efibootdude 0.3__tar.gz → 0.5.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.

@@ -1,8 +1,8 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: efibootdude
3
- Version: 0.3
3
+ Version: 0.5.1
4
4
  Summary: A visual wrapper for efibootmgr
5
- Author-email: Joe Defen <joedef@google.com>
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,23 +41,27 @@ After running `efibootdude` and making some changes, you'll see a screen compara
41
41
  ![efibootdude-screenshot](https://github.com/joedefen/efibootdude/blob/main/images/efibootdude-screenshot.png?raw=true).
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 the action.
47
- * Enter `?` for a more complete explanation of the keys, navigation keys, etc.
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
- * Use `u` or `d` to move it up or down in the boot order.
52
- * Use `t` to relabel the boot entry.
53
- * Use `r` to remove it.
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 pressing `*`.
57
- * Use the `ESC` key to abandon any changes and reload the boot information.
56
+ active by typing `*` for the corresponding entries.
57
+ * Press `ESC` key to abandon any changes and reload the boot information.
58
58
  * When ready to write the changes to the BIOS, enter `w`.
59
59
  * When writing the changes, `efibootdude` drops out of menu mode so you can
60
60
  verify the underlying commands, error codes, and error messages.
61
+ * After you write changes, type `b` to reboot, if you wish and the boot menu looks OK.
62
+ * BTW, the top-line keys vary per context; e.g.:
63
+ * `w` is only shown with pending changes, and
64
+ * `b` is only shown w/o pending changes.
61
65
 
62
66
  ## Caveats
63
67
  * Some operations may not work permanently even though there is no indication from `efibootmgr`
@@ -23,23 +23,27 @@ After running `efibootdude` and making some changes, you'll see a screen compara
23
23
  ![efibootdude-screenshot](https://github.com/joedefen/efibootdude/blob/main/images/efibootdude-screenshot.png?raw=true).
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 the action.
29
- * Enter `?` for a more complete explanation of the keys, navigation keys, etc.
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
- * Use `u` or `d` to move it up or down in the boot order.
34
- * Use `t` to relabel the boot entry.
35
- * Use `r` to remove it.
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 pressing `*`.
39
- * Use the `ESC` key to abandon any changes and reload the boot information.
38
+ active by typing `*` for the corresponding entries.
39
+ * Press `ESC` key to abandon any changes and reload the boot information.
40
40
  * When ready to write the changes to the BIOS, enter `w`.
41
41
  * When writing the changes, `efibootdude` drops out of menu mode so you can
42
42
  verify the underlying commands, error codes, and error messages.
43
+ * After you write changes, type `b` to reboot, if you wish and the boot menu looks OK.
44
+ * BTW, the top-line keys vary per context; e.g.:
45
+ * `w` is only shown with pending changes, and
46
+ * `b` is only shown w/o pending changes.
43
47
 
44
48
  ## Caveats
45
49
  * Some operations may not work permanently even though there is no indication from `efibootmgr`
@@ -55,10 +55,10 @@ build-backend = "setuptools.build_meta"
55
55
 
56
56
  [project]
57
57
  name = "efibootdude"
58
- version = "0.3"
58
+ version = "0.5.1"
59
59
  description = "A visual wrapper for efibootmgr"
60
60
  authors = [
61
- { name = "Joe Defen", email = "joedef@google.com" }
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 = 'tudrnmw*zqx'
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
@@ -221,6 +222,17 @@ class EfiBootDude:
221
222
  words = line.split(maxsplit=1)
222
223
  return words[0]
223
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
+
224
236
  def write(self):
225
237
  """ Commit the changes. """
226
238
  if not self.mods.dirty:
@@ -262,8 +274,6 @@ class EfiBootDude:
262
274
  Window._start_curses()
263
275
  self.win.pick_pos = self.boot_idx
264
276
 
265
-
266
-
267
277
  def main_loop(self):
268
278
  """ TBD """
269
279
 
@@ -287,6 +297,7 @@ class EfiBootDude:
287
297
  ' m - modify - modify the value'
288
298
  ' w - write - write the changes',
289
299
  ' ESC - abandon changes and re-read boot state',
300
+ ' b - reboot the machine',
290
301
  ]
291
302
  for line in lines:
292
303
  self.win.put_body(line)
@@ -347,6 +358,8 @@ class EfiBootDude:
347
358
  actions['m'] = 'modify'
348
359
  if self.mods.dirty:
349
360
  actions['w'] = 'write'
361
+ else:
362
+ actions['b'] = 'boot'
350
363
 
351
364
  return actions
352
365
 
@@ -386,7 +399,7 @@ class EfiBootDude:
386
399
  return value
387
400
 
388
401
  if key in (ord('q'), ord('x')):
389
-
402
+
390
403
  answer = 'y'
391
404
  if self.mods.dirty:
392
405
  answer = self.win.answer(
@@ -462,7 +475,7 @@ class EfiBootDude:
462
475
  if key == ord('t') and ns.is_boot:
463
476
  seed = ns.label
464
477
  while True:
465
- answer = self.win.answer(prompt='Enter new label or clear to abort',
478
+ answer = self.win.answer(prompt='Type new label or clear to abort',
466
479
  seed=seed, width=80)
467
480
  seed = answer = answer.strip()
468
481
  if not answer:
@@ -476,7 +489,7 @@ class EfiBootDude:
476
489
  if key == 27: # ESC
477
490
  if self.mods.dirty:
478
491
  answer = self.win.answer(
479
- prompt='Enter "y" to clear edits and refresh')
492
+ prompt='Type "y" to clear edits and refresh')
480
493
  if answer.strip().lower().startswith('y'):
481
494
  self.reinit()
482
495
  else:
@@ -487,13 +500,22 @@ class EfiBootDude:
487
500
  self.write()
488
501
  return None
489
502
 
490
- # FIXME: handle more keys
503
+ if key == ord('b'):
504
+ if self.mods.dirty:
505
+ self.win.alert('Pending changes (on return, use "w" to commit or "ESC" to discard)')
506
+ return
507
+
508
+ answer = self.win.answer(prompt='Type "reboot" to reboot',
509
+ seed='reboot', width=80)
510
+ if answer.strip().lower().startswith('reboot'):
511
+ self.reboot()
512
+
513
+ # FIXME: handle more keys
491
514
  return None
492
515
 
493
516
 
494
517
  def main():
495
518
  """ The program """
496
- import argparse
497
519
  parser = argparse.ArgumentParser()
498
520
  parser.add_argument('testfile', nargs='?', default=None)
499
521
  opts = parser.parse_args()
@@ -1,8 +1,8 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: efibootdude
3
- Version: 0.3
3
+ Version: 0.5.1
4
4
  Summary: A visual wrapper for efibootmgr
5
- Author-email: Joe Defen <joedef@google.com>
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,23 +41,27 @@ After running `efibootdude` and making some changes, you'll see a screen compara
41
41
  ![efibootdude-screenshot](https://github.com/joedefen/efibootdude/blob/main/images/efibootdude-screenshot.png?raw=true).
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 the action.
47
- * Enter `?` for a more complete explanation of the keys, navigation keys, etc.
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
- * Use `u` or `d` to move it up or down in the boot order.
52
- * Use `t` to relabel the boot entry.
53
- * Use `r` to remove it.
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 pressing `*`.
57
- * Use the `ESC` key to abandon any changes and reload the boot information.
56
+ active by typing `*` for the corresponding entries.
57
+ * Press `ESC` key to abandon any changes and reload the boot information.
58
58
  * When ready to write the changes to the BIOS, enter `w`.
59
59
  * When writing the changes, `efibootdude` drops out of menu mode so you can
60
60
  verify the underlying commands, error codes, and error messages.
61
+ * After you write changes, type `b` to reboot, if you wish and the boot menu looks OK.
62
+ * BTW, the top-line keys vary per context; e.g.:
63
+ * `w` is only shown with pending changes, and
64
+ * `b` is only shown w/o pending changes.
61
65
 
62
66
  ## Caveats
63
67
  * Some operations may not work permanently even though there is no indication from `efibootmgr`
File without changes
File without changes