efibootdude 0.3__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.

@@ -1,8 +1,8 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: efibootdude
3
- Version: 0.3
3
+ Version: 0.5
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,21 +41,22 @@ 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
+ * When the changes look good, type `b` to reboot, if you wish.
59
60
  * When writing the changes, `efibootdude` drops out of menu mode so you can
60
61
  verify the underlying commands, error codes, and error messages.
61
62
 
@@ -23,21 +23,22 @@ 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
+ * When the changes look good, type `b` to reboot, if you wish.
41
42
  * When writing the changes, `efibootdude` drops out of menu mode so you can
42
43
  verify the underlying commands, error codes, and error messages.
43
44
 
@@ -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"
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,7 @@ class EfiBootDude:
347
358
  actions['m'] = 'modify'
348
359
  if self.mods.dirty:
349
360
  actions['w'] = 'write'
361
+ actions['b'] = 'boot'
350
362
 
351
363
  return actions
352
364
 
@@ -386,7 +398,7 @@ class EfiBootDude:
386
398
  return value
387
399
 
388
400
  if key in (ord('q'), ord('x')):
389
-
401
+
390
402
  answer = 'y'
391
403
  if self.mods.dirty:
392
404
  answer = self.win.answer(
@@ -462,7 +474,7 @@ class EfiBootDude:
462
474
  if key == ord('t') and ns.is_boot:
463
475
  seed = ns.label
464
476
  while True:
465
- answer = self.win.answer(prompt='Enter new label or clear to abort',
477
+ answer = self.win.answer(prompt='Type new label or clear to abort',
466
478
  seed=seed, width=80)
467
479
  seed = answer = answer.strip()
468
480
  if not answer:
@@ -476,7 +488,7 @@ class EfiBootDude:
476
488
  if key == 27: # ESC
477
489
  if self.mods.dirty:
478
490
  answer = self.win.answer(
479
- prompt='Enter "y" to clear edits and refresh')
491
+ prompt='Type "y" to clear edits and refresh')
480
492
  if answer.strip().lower().startswith('y'):
481
493
  self.reinit()
482
494
  else:
@@ -487,13 +499,18 @@ class EfiBootDude:
487
499
  self.write()
488
500
  return None
489
501
 
490
- # FIXME: handle more keys
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
491
509
  return None
492
510
 
493
511
 
494
512
  def main():
495
513
  """ The program """
496
- import argparse
497
514
  parser = argparse.ArgumentParser()
498
515
  parser.add_argument('testfile', nargs='?', default=None)
499
516
  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
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,21 +41,22 @@ 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
+ * When the changes look good, type `b` to reboot, if you wish.
59
60
  * When writing the changes, `efibootdude` drops out of menu mode so you can
60
61
  verify the underlying commands, error codes, and error messages.
61
62
 
File without changes
File without changes