efibootdude 0.0__tar.gz → 0.1__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.0/src/efibootdude.egg-info → efibootdude-0.1}/PKG-INFO +5 -2
- {efibootdude-0.0 → efibootdude-0.1}/README.md +4 -1
- {efibootdude-0.0 → efibootdude-0.1}/pyproject.toml +1 -1
- {efibootdude-0.0 → efibootdude-0.1}/src/efibootdude/main.py +22 -13
- {efibootdude-0.0 → efibootdude-0.1/src/efibootdude.egg-info}/PKG-INFO +5 -2
- {efibootdude-0.0 → efibootdude-0.1}/LICENSE +0 -0
- {efibootdude-0.0 → efibootdude-0.1}/setup.cfg +0 -0
- {efibootdude-0.0 → efibootdude-0.1}/src/efibootdude/PowerWindow.py +0 -0
- {efibootdude-0.0 → efibootdude-0.1}/src/efibootdude/__init__.py +0 -0
- {efibootdude-0.0 → efibootdude-0.1}/src/efibootdude.egg-info/SOURCES.txt +0 -0
- {efibootdude-0.0 → efibootdude-0.1}/src/efibootdude.egg-info/dependency_links.txt +0 -0
- {efibootdude-0.0 → efibootdude-0.1}/src/efibootdude.egg-info/entry_points.txt +0 -0
- {efibootdude-0.0 → efibootdude-0.1}/src/efibootdude.egg-info/requires.txt +0 -0
- {efibootdude-0.0 → efibootdude-0.1}/src/efibootdude.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: efibootdude
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.1
|
|
4
4
|
Summary: A visual wrapper for efibootmgr
|
|
5
5
|
Author-email: Joe Defen <joedef@google.com>
|
|
6
6
|
License: MIT
|
|
@@ -32,11 +32,14 @@ boot menu and parameters while running Linux.
|
|
|
32
32
|
* setting boot entries active or inactive, and
|
|
33
33
|
* setting the boot menu timeout value (until it boots the default entry).
|
|
34
34
|
|
|
35
|
-
To be sure, there are many other esoteric uses of `efibootmanager
|
|
35
|
+
To be sure, there are many other esoteric uses of `efibootmanager` including adding
|
|
36
|
+
a new boot entry; for such needs, just use `efibootmgr` directly.
|
|
36
37
|
|
|
37
38
|
## Usage
|
|
38
39
|
After running `efibootdude`, you'll see a screen like this:
|
|
40
|
+
|
|
39
41
|
.
|
|
42
|
+
|
|
40
43
|
At this point
|
|
41
44
|
* The current line starts with `>` and is highlighted.
|
|
42
45
|
* The top line shows actions for the current line.
|
|
@@ -14,11 +14,14 @@ boot menu and parameters while running Linux.
|
|
|
14
14
|
* setting boot entries active or inactive, and
|
|
15
15
|
* setting the boot menu timeout value (until it boots the default entry).
|
|
16
16
|
|
|
17
|
-
To be sure, there are many other esoteric uses of `efibootmanager
|
|
17
|
+
To be sure, there are many other esoteric uses of `efibootmanager` including adding
|
|
18
|
+
a new boot entry; for such needs, just use `efibootmgr` directly.
|
|
18
19
|
|
|
19
20
|
## Usage
|
|
20
21
|
After running `efibootdude`, you'll see a screen like this:
|
|
22
|
+
|
|
21
23
|
.
|
|
24
|
+
|
|
22
25
|
At this point
|
|
23
26
|
* The current line starts with `>` and is highlighted.
|
|
24
27
|
* The top line shows actions for the current line.
|
|
@@ -26,10 +26,11 @@ class EfiBootDude:
|
|
|
26
26
|
""" Main class for curses atop efibootmgr"""
|
|
27
27
|
singleton = None
|
|
28
28
|
|
|
29
|
-
def __init__(self):
|
|
29
|
+
def __init__(self, testfile=None):
|
|
30
30
|
# self.cmd_loop = CmdLoop(db=False) # just running as command
|
|
31
31
|
assert not EfiBootDude.singleton
|
|
32
32
|
EfiBootDude.singleton = self
|
|
33
|
+
self.testfile = testfile
|
|
33
34
|
|
|
34
35
|
spin = self.spin = OptionSpinner()
|
|
35
36
|
spin.add_key('help_mode', '? - toggle help screen', vals=[False, True])
|
|
@@ -113,10 +114,14 @@ class EfiBootDude:
|
|
|
113
114
|
def digest_boots(self):
|
|
114
115
|
""" Digest the output of 'efibootmgr'."""
|
|
115
116
|
# Define the command to run
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
117
|
+
lines = []
|
|
118
|
+
if self.testfile:
|
|
119
|
+
with open(self.testfile, 'r', encoding='utf-8') as fh:
|
|
120
|
+
lines = fh.readlines()
|
|
121
|
+
else:
|
|
122
|
+
command = 'efibootmgr'.split()
|
|
123
|
+
result = subprocess.run(command, stdout=subprocess.PIPE, text=True, check=True)
|
|
124
|
+
lines = result.stdout.splitlines()
|
|
120
125
|
rv = []
|
|
121
126
|
width1 = 0 # width of info1
|
|
122
127
|
label_wid = 0
|
|
@@ -141,8 +146,8 @@ class EfiBootDude:
|
|
|
141
146
|
)
|
|
142
147
|
|
|
143
148
|
mat = re.match(r'\bBoot([0-9a-f]+)\b(\*?)' # Boot0024*
|
|
144
|
-
+ r'\s+(\
|
|
145
|
-
+ r'\
|
|
149
|
+
+ r'\s+(\S.*\S|\S)\s*\t' # Linux Boot Manager
|
|
150
|
+
+ r'\s*(\S.*\S|\S)\s*$', # HD(4,GPT,cd15e3b1-...
|
|
146
151
|
line, re.IGNORECASE)
|
|
147
152
|
if not mat:
|
|
148
153
|
ns.ident = key
|
|
@@ -243,7 +248,7 @@ class EfiBootDude:
|
|
|
243
248
|
os.system('/bin/echo; /bin/echo')
|
|
244
249
|
|
|
245
250
|
for cmd in cmds:
|
|
246
|
-
os.system(f'set -x; {cmd}; /bin/echo " <<<ExitCode=$?>>>"')
|
|
251
|
+
os.system(f'(set -x; {cmd}); /bin/echo " <<<ExitCode=$?>>>"')
|
|
247
252
|
|
|
248
253
|
os.system(r'/bin/echo -e "\n\n===== Press ENTER for menu ====> \c"; read FOO')
|
|
249
254
|
self.reinit()
|
|
@@ -380,7 +385,7 @@ class EfiBootDude:
|
|
|
380
385
|
answer = 'y'
|
|
381
386
|
if self.mods.dirty:
|
|
382
387
|
answer = self.win.answer(
|
|
383
|
-
prompt='Enter "y" to abandon edits and exit
|
|
388
|
+
prompt='Enter "y" to abandon edits and exit')
|
|
384
389
|
if answer.strip().lower().startswith('y'):
|
|
385
390
|
self.win.stop_curses()
|
|
386
391
|
os.system('clear; stty sane')
|
|
@@ -394,7 +399,7 @@ class EfiBootDude:
|
|
|
394
399
|
seed = ns.label.split()[0]
|
|
395
400
|
while True:
|
|
396
401
|
answer = self.win.answer(
|
|
397
|
-
prompt='Enter timeout seconds or clear to abort
|
|
402
|
+
prompt='Enter timeout seconds or clear to abort',
|
|
398
403
|
seed=seed, width=80)
|
|
399
404
|
seed = answer = answer.strip()
|
|
400
405
|
if not answer:
|
|
@@ -452,7 +457,7 @@ class EfiBootDude:
|
|
|
452
457
|
if key == ord('t') and ns.is_boot:
|
|
453
458
|
seed = ns.label
|
|
454
459
|
while True:
|
|
455
|
-
answer = self.win.answer(prompt='Enter new label or clear to abort
|
|
460
|
+
answer = self.win.answer(prompt='Enter new label or clear to abort',
|
|
456
461
|
seed=seed, width=80)
|
|
457
462
|
seed = answer = answer.strip()
|
|
458
463
|
if not answer:
|
|
@@ -465,7 +470,7 @@ class EfiBootDude:
|
|
|
465
470
|
|
|
466
471
|
if key == ord('f') and self.mods.dirty:
|
|
467
472
|
answer = self.win.answer(
|
|
468
|
-
prompt='Enter "y" to clear edits and refresh
|
|
473
|
+
prompt='Enter "y" to clear edits and refresh')
|
|
469
474
|
if answer.strip().lower().startswith('y'):
|
|
470
475
|
self.reinit()
|
|
471
476
|
return None
|
|
@@ -480,8 +485,12 @@ class EfiBootDude:
|
|
|
480
485
|
|
|
481
486
|
def main():
|
|
482
487
|
""" The program """
|
|
488
|
+
import argparse
|
|
489
|
+
parser = argparse.ArgumentParser()
|
|
490
|
+
parser.add_argument('testfile', nargs='?', default=None)
|
|
491
|
+
opts = parser.parse_args()
|
|
483
492
|
|
|
484
|
-
dude = EfiBootDude()
|
|
493
|
+
dude = EfiBootDude(testfile=opts.testfile)
|
|
485
494
|
dude.main_loop()
|
|
486
495
|
|
|
487
496
|
if __name__ == '__main__':
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: efibootdude
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.1
|
|
4
4
|
Summary: A visual wrapper for efibootmgr
|
|
5
5
|
Author-email: Joe Defen <joedef@google.com>
|
|
6
6
|
License: MIT
|
|
@@ -32,11 +32,14 @@ boot menu and parameters while running Linux.
|
|
|
32
32
|
* setting boot entries active or inactive, and
|
|
33
33
|
* setting the boot menu timeout value (until it boots the default entry).
|
|
34
34
|
|
|
35
|
-
To be sure, there are many other esoteric uses of `efibootmanager
|
|
35
|
+
To be sure, there are many other esoteric uses of `efibootmanager` including adding
|
|
36
|
+
a new boot entry; for such needs, just use `efibootmgr` directly.
|
|
36
37
|
|
|
37
38
|
## Usage
|
|
38
39
|
After running `efibootdude`, you'll see a screen like this:
|
|
40
|
+
|
|
39
41
|
.
|
|
42
|
+
|
|
40
43
|
At this point
|
|
41
44
|
* The current line starts with `>` and is highlighted.
|
|
42
45
|
* The top line shows actions for the current line.
|
|
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
|