efibootdude 0.2__tar.gz → 0.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of efibootdude might be problematic. Click here for more details.
- {efibootdude-0.2/src/efibootdude.egg-info → efibootdude-0.5}/PKG-INFO +12 -9
- {efibootdude-0.2 → efibootdude-0.5}/README.md +10 -7
- {efibootdude-0.2 → efibootdude-0.5}/pyproject.toml +2 -2
- {efibootdude-0.2 → efibootdude-0.5}/src/efibootdude/main.py +30 -22
- {efibootdude-0.2 → efibootdude-0.5/src/efibootdude.egg-info}/PKG-INFO +12 -9
- {efibootdude-0.2 → efibootdude-0.5}/LICENSE +0 -0
- {efibootdude-0.2 → efibootdude-0.5}/setup.cfg +0 -0
- {efibootdude-0.2 → efibootdude-0.5}/src/efibootdude/PowerWindow.py +0 -0
- {efibootdude-0.2 → efibootdude-0.5}/src/efibootdude/__init__.py +0 -0
- {efibootdude-0.2 → efibootdude-0.5}/src/efibootdude.egg-info/SOURCES.txt +0 -0
- {efibootdude-0.2 → efibootdude-0.5}/src/efibootdude.egg-info/dependency_links.txt +0 -0
- {efibootdude-0.2 → efibootdude-0.5}/src/efibootdude.egg-info/entry_points.txt +0 -0
- {efibootdude-0.2 → efibootdude-0.5}/src/efibootdude.egg-info/requires.txt +0 -0
- {efibootdude-0.2 → efibootdude-0.5}/src/efibootdude.egg-info/top_level.txt +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: efibootdude
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.5
|
|
4
4
|
Summary: A visual wrapper for efibootmgr
|
|
5
|
-
Author-email: Joe Defen <joedef@
|
|
5
|
+
Author-email: Joe Defen <joedef@duck.com>
|
|
6
6
|
License: MIT
|
|
7
7
|
Project-URL: Homepage, https://github.com/joedefen/efibootdude
|
|
8
8
|
Project-URL: Bug Tracker, https://github.com/joedefen/efibootdude/issues
|
|
@@ -41,19 +41,22 @@ After running `efibootdude` and making some changes, you'll see a screen compara
|
|
|
41
41
|
.
|
|
42
42
|
|
|
43
43
|
At this point
|
|
44
|
-
* The current line starts with `>` and is highlighted.
|
|
44
|
+
* The "current" line starts with `>` and is highlighted.
|
|
45
45
|
* The top line shows actions for the current line; type the underscored letter
|
|
46
|
-
to effect
|
|
47
|
-
*
|
|
46
|
+
to effect its action.
|
|
47
|
+
* Type `?` for a more complete explanation of the keys, navigation keys, etc.
|
|
48
48
|
* **ALWAYS** view the help at least once if unfamiliar with this tool,
|
|
49
49
|
it navigation, and/or uncertain of keys not shown on top line.
|
|
50
50
|
* With this current line, we can:
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
51
|
+
* Type `u` or `d` to move it up or down in the boot order.
|
|
52
|
+
* Type `t` to relabel the boot entry.
|
|
53
|
+
* Type `r` to remove the boot entry.
|
|
54
54
|
* And so forth.
|
|
55
|
-
*
|
|
55
|
+
* The entries with `*` on the left are active boot entries; toggle whether
|
|
56
|
+
active by typing `*` for the corresponding entries.
|
|
57
|
+
* Press `ESC` key to abandon any changes and reload the boot information.
|
|
56
58
|
* When ready to write the changes to the BIOS, enter `w`.
|
|
59
|
+
* When the changes look good, type `b` to reboot, if you wish.
|
|
57
60
|
* When writing the changes, `efibootdude` drops out of menu mode so you can
|
|
58
61
|
verify the underlying commands, error codes, and error messages.
|
|
59
62
|
|
|
@@ -23,19 +23,22 @@ After running `efibootdude` and making some changes, you'll see a screen compara
|
|
|
23
23
|
.
|
|
24
24
|
|
|
25
25
|
At this point
|
|
26
|
-
* The current line starts with `>` and is highlighted.
|
|
26
|
+
* The "current" line starts with `>` and is highlighted.
|
|
27
27
|
* The top line shows actions for the current line; type the underscored letter
|
|
28
|
-
to effect
|
|
29
|
-
*
|
|
28
|
+
to effect its action.
|
|
29
|
+
* Type `?` for a more complete explanation of the keys, navigation keys, etc.
|
|
30
30
|
* **ALWAYS** view the help at least once if unfamiliar with this tool,
|
|
31
31
|
it navigation, and/or uncertain of keys not shown on top line.
|
|
32
32
|
* With this current line, we can:
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
33
|
+
* Type `u` or `d` to move it up or down in the boot order.
|
|
34
|
+
* Type `t` to relabel the boot entry.
|
|
35
|
+
* Type `r` to remove the boot entry.
|
|
36
36
|
* And so forth.
|
|
37
|
-
*
|
|
37
|
+
* The entries with `*` on the left are active boot entries; toggle whether
|
|
38
|
+
active by typing `*` for the corresponding entries.
|
|
39
|
+
* Press `ESC` key to abandon any changes and reload the boot information.
|
|
38
40
|
* When ready to write the changes to the BIOS, enter `w`.
|
|
41
|
+
* When the changes look good, type `b` to reboot, if you wish.
|
|
39
42
|
* When writing the changes, `efibootdude` drops out of menu mode so you can
|
|
40
43
|
verify the underlying commands, error codes, and error messages.
|
|
41
44
|
|
|
@@ -55,10 +55,10 @@ build-backend = "setuptools.build_meta"
|
|
|
55
55
|
|
|
56
56
|
[project]
|
|
57
57
|
name = "efibootdude"
|
|
58
|
-
version = "0.
|
|
58
|
+
version = "0.5"
|
|
59
59
|
description = "A visual wrapper for efibootmgr"
|
|
60
60
|
authors = [
|
|
61
|
-
{ name = "Joe Defen", email = "joedef@
|
|
61
|
+
{ name = "Joe Defen", email = "joedef@duck.com" }
|
|
62
62
|
]
|
|
63
63
|
readme = "README.md"
|
|
64
64
|
license = { text = "MIT" }
|
|
@@ -18,6 +18,7 @@ from types import SimpleNamespace
|
|
|
18
18
|
import subprocess
|
|
19
19
|
import traceback
|
|
20
20
|
import curses as cs
|
|
21
|
+
import argparse
|
|
21
22
|
# import xml.etree.ElementTree as ET
|
|
22
23
|
from efibootdude.PowerWindow import Window, OptionSpinner
|
|
23
24
|
|
|
@@ -37,7 +38,7 @@ class EfiBootDude:
|
|
|
37
38
|
spin.add_key('verbose', 'v - toggle verbose', vals=[False, True])
|
|
38
39
|
|
|
39
40
|
# FIXME: keys
|
|
40
|
-
other = '
|
|
41
|
+
other = 'btudrnmw*zqx'
|
|
41
42
|
other_keys = set(ord(x) for x in other)
|
|
42
43
|
other_keys.add(cs.KEY_ENTER)
|
|
43
44
|
other_keys.add(27) # ESCAPE
|
|
@@ -89,18 +90,6 @@ class EfiBootDude:
|
|
|
89
90
|
|
|
90
91
|
def get_part_uuids(self):
|
|
91
92
|
""" Get all the Partition UUIDS"""
|
|
92
|
-
# uuids = {}
|
|
93
|
-
# with open('/run/blkid/blkid.tab', encoding='utf8') as fh:
|
|
94
|
-
# # sample: <device ... TYPE="vfat"
|
|
95
|
-
# # PARTUUID="25d2dea1-9f68-1644-91dd-4836c0b3a30a">/dev/nvme0n1p1</device>
|
|
96
|
-
# for xml_line in fh:
|
|
97
|
-
# element = ET.fromstring(xml_line)
|
|
98
|
-
# if 'PARTUUID' in element.attrib:
|
|
99
|
-
# device=element.text.strip()
|
|
100
|
-
# name = self.mounts.get(device, device)
|
|
101
|
-
# uuids[element.attrib['PARTUUID'].lower()] = name
|
|
102
|
-
# return uuids
|
|
103
|
-
|
|
104
93
|
uuids = {}
|
|
105
94
|
partuuid_path = '/dev/disk/by-partuuid/'
|
|
106
95
|
|
|
@@ -111,6 +100,8 @@ class EfiBootDude:
|
|
|
111
100
|
if os.path.islink(full_path):
|
|
112
101
|
device_path = os.path.realpath(full_path)
|
|
113
102
|
uuids[entry] = device_path
|
|
103
|
+
if device_path in self.mounts:
|
|
104
|
+
uuids[entry] = self.mounts[device_path]
|
|
114
105
|
return uuids
|
|
115
106
|
|
|
116
107
|
@staticmethod
|
|
@@ -118,7 +109,6 @@ class EfiBootDude:
|
|
|
118
109
|
""" Find uuid string in a line """
|
|
119
110
|
# Define the regex pattern for UUID (e.g., 25d2dea1-9f68-1644-91dd-4836c0b3a30a)
|
|
120
111
|
pattern = r'\b[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}\b'
|
|
121
|
-
# Search for the pattern in the line
|
|
122
112
|
mats = re.findall(pattern, line, re.IGNORECASE)
|
|
123
113
|
return mats
|
|
124
114
|
|
|
@@ -127,9 +117,11 @@ class EfiBootDude:
|
|
|
127
117
|
# Define the command to run
|
|
128
118
|
lines = []
|
|
129
119
|
if self.testfile:
|
|
120
|
+
# if given a "testfile" (which should be just the
|
|
121
|
+
# raw output of 'efibootmgr'), then parse it
|
|
130
122
|
with open(self.testfile, 'r', encoding='utf-8') as fh:
|
|
131
123
|
lines = fh.readlines()
|
|
132
|
-
else:
|
|
124
|
+
else: # run efibootmgr
|
|
133
125
|
command = 'efibootmgr'.split()
|
|
134
126
|
result = subprocess.run(command, stdout=subprocess.PIPE, text=True, check=True)
|
|
135
127
|
lines = result.stdout.splitlines()
|
|
@@ -230,6 +222,17 @@ class EfiBootDude:
|
|
|
230
222
|
words = line.split(maxsplit=1)
|
|
231
223
|
return words[0]
|
|
232
224
|
|
|
225
|
+
def reboot(self):
|
|
226
|
+
""" Reboot the machine """
|
|
227
|
+
Window.stop_curses()
|
|
228
|
+
os.system('clear; stty sane; (set -x; sudo reboot now)')
|
|
229
|
+
|
|
230
|
+
# NOTE: probably will not get here...
|
|
231
|
+
os.system(r'/bin/echo -e "\n\n===== Press ENTER for menu ====> \c"; read FOO')
|
|
232
|
+
self.reinit()
|
|
233
|
+
Window._start_curses()
|
|
234
|
+
self.win.pick_pos = self.boot_idx
|
|
235
|
+
|
|
233
236
|
def write(self):
|
|
234
237
|
""" Commit the changes. """
|
|
235
238
|
if not self.mods.dirty:
|
|
@@ -271,8 +274,6 @@ class EfiBootDude:
|
|
|
271
274
|
Window._start_curses()
|
|
272
275
|
self.win.pick_pos = self.boot_idx
|
|
273
276
|
|
|
274
|
-
|
|
275
|
-
|
|
276
277
|
def main_loop(self):
|
|
277
278
|
""" TBD """
|
|
278
279
|
|
|
@@ -296,6 +297,7 @@ class EfiBootDude:
|
|
|
296
297
|
' m - modify - modify the value'
|
|
297
298
|
' w - write - write the changes',
|
|
298
299
|
' ESC - abandon changes and re-read boot state',
|
|
300
|
+
' b - reboot the machine',
|
|
299
301
|
]
|
|
300
302
|
for line in lines:
|
|
301
303
|
self.win.put_body(line)
|
|
@@ -356,6 +358,7 @@ class EfiBootDude:
|
|
|
356
358
|
actions['m'] = 'modify'
|
|
357
359
|
if self.mods.dirty:
|
|
358
360
|
actions['w'] = 'write'
|
|
361
|
+
actions['b'] = 'boot'
|
|
359
362
|
|
|
360
363
|
return actions
|
|
361
364
|
|
|
@@ -395,7 +398,7 @@ class EfiBootDude:
|
|
|
395
398
|
return value
|
|
396
399
|
|
|
397
400
|
if key in (ord('q'), ord('x')):
|
|
398
|
-
|
|
401
|
+
|
|
399
402
|
answer = 'y'
|
|
400
403
|
if self.mods.dirty:
|
|
401
404
|
answer = self.win.answer(
|
|
@@ -471,7 +474,7 @@ class EfiBootDude:
|
|
|
471
474
|
if key == ord('t') and ns.is_boot:
|
|
472
475
|
seed = ns.label
|
|
473
476
|
while True:
|
|
474
|
-
answer = self.win.answer(prompt='
|
|
477
|
+
answer = self.win.answer(prompt='Type new label or clear to abort',
|
|
475
478
|
seed=seed, width=80)
|
|
476
479
|
seed = answer = answer.strip()
|
|
477
480
|
if not answer:
|
|
@@ -485,7 +488,7 @@ class EfiBootDude:
|
|
|
485
488
|
if key == 27: # ESC
|
|
486
489
|
if self.mods.dirty:
|
|
487
490
|
answer = self.win.answer(
|
|
488
|
-
prompt='
|
|
491
|
+
prompt='Type "y" to clear edits and refresh')
|
|
489
492
|
if answer.strip().lower().startswith('y'):
|
|
490
493
|
self.reinit()
|
|
491
494
|
else:
|
|
@@ -496,13 +499,18 @@ class EfiBootDude:
|
|
|
496
499
|
self.write()
|
|
497
500
|
return None
|
|
498
501
|
|
|
499
|
-
|
|
502
|
+
if key == ord('b'):
|
|
503
|
+
answer = self.win.answer(prompt='Type "reboot" to reboot',
|
|
504
|
+
seed='reboot', width=80)
|
|
505
|
+
if answer.strip().lower().startswith('reboot'):
|
|
506
|
+
self.reboot()
|
|
507
|
+
|
|
508
|
+
# FIXME: handle more keys
|
|
500
509
|
return None
|
|
501
510
|
|
|
502
511
|
|
|
503
512
|
def main():
|
|
504
513
|
""" The program """
|
|
505
|
-
import argparse
|
|
506
514
|
parser = argparse.ArgumentParser()
|
|
507
515
|
parser.add_argument('testfile', nargs='?', default=None)
|
|
508
516
|
opts = parser.parse_args()
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: efibootdude
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.5
|
|
4
4
|
Summary: A visual wrapper for efibootmgr
|
|
5
|
-
Author-email: Joe Defen <joedef@
|
|
5
|
+
Author-email: Joe Defen <joedef@duck.com>
|
|
6
6
|
License: MIT
|
|
7
7
|
Project-URL: Homepage, https://github.com/joedefen/efibootdude
|
|
8
8
|
Project-URL: Bug Tracker, https://github.com/joedefen/efibootdude/issues
|
|
@@ -41,19 +41,22 @@ After running `efibootdude` and making some changes, you'll see a screen compara
|
|
|
41
41
|
.
|
|
42
42
|
|
|
43
43
|
At this point
|
|
44
|
-
* The current line starts with `>` and is highlighted.
|
|
44
|
+
* The "current" line starts with `>` and is highlighted.
|
|
45
45
|
* The top line shows actions for the current line; type the underscored letter
|
|
46
|
-
to effect
|
|
47
|
-
*
|
|
46
|
+
to effect its action.
|
|
47
|
+
* Type `?` for a more complete explanation of the keys, navigation keys, etc.
|
|
48
48
|
* **ALWAYS** view the help at least once if unfamiliar with this tool,
|
|
49
49
|
it navigation, and/or uncertain of keys not shown on top line.
|
|
50
50
|
* With this current line, we can:
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
51
|
+
* Type `u` or `d` to move it up or down in the boot order.
|
|
52
|
+
* Type `t` to relabel the boot entry.
|
|
53
|
+
* Type `r` to remove the boot entry.
|
|
54
54
|
* And so forth.
|
|
55
|
-
*
|
|
55
|
+
* The entries with `*` on the left are active boot entries; toggle whether
|
|
56
|
+
active by typing `*` for the corresponding entries.
|
|
57
|
+
* Press `ESC` key to abandon any changes and reload the boot information.
|
|
56
58
|
* When ready to write the changes to the BIOS, enter `w`.
|
|
59
|
+
* When the changes look good, type `b` to reboot, if you wish.
|
|
57
60
|
* When writing the changes, `efibootdude` drops out of menu mode so you can
|
|
58
61
|
verify the underlying commands, error codes, and error messages.
|
|
59
62
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|