elinvention / efiboots Goto Github PK
View Code? Open in Web Editor NEWManage EFI boot loader entries with this simple GUI
License: GNU General Public License v3.0
Manage EFI boot loader entries with this simple GUI
License: GNU General Public License v3.0
I would be very nice if you could implement a button that enables editing the loader path so people can use this instead of bcdedit.
$ python3 '/home/m/Downloads/efibootmgr-gui-directreboot/efibootmgr_gui.py'
File "/home/m/Downloads/efibootmgr-gui-directreboot/efibootmgr_gui.py", line 242
str += f'efibootmgr {esp} --delete-bootnum --bootnum {entry}\n'
^
SyntaxError: invalid syntax
OS: Ubuntu 16.04
when running on NVME drive where the partitions are named /dev/nvme0n1p1
it fails with
findmnt --noheadings --output SOURCE --target /boot/efi
/dev/nvme0n1p1
Could not parse device path: Invalid argument
Command '['efibootmgr', '-v']' returned non-zero exit status 18.
Here the argument for efibootmgr should be --disk /dev/nvme0n1p1
Noob question.
Why not just upload a deb file or give us a build that doesn't require this Nix thing.
demicv@ASUSLaptopX509FA:~$ sudo apt install efibootmgr python3
[sudo] password for demicv:
Reading package lists... Done
Building dependency tree
Reading state information... Done
efibootmgr is already the newest version (17-1).
python3 is already the newest version (3.8.2-0ubuntu2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
demicv@ASUSLaptopX509FA:~$ sudo python3 efiboots
python3: can't open file 'efiboots': [Errno 2] No such file or directory
demicv@ASUSLaptopX509FA:~$
When the script is run this happens:
Traceback (most recent call last):
File "/home/george/efiboots/efiboots", line 6, in <module>
import efiboots
File "/home/george/efiboots/efiboots.py", line 9, in <module>
gi.require_version('Gtk', '4.0')
File "/usr/lib/python3/dist-packages/gi/__init__.py", line 129, in require_version
raise ValueError('Namespace %s not available for version %s' %
ValueError: Namespace Gtk not available for version 4.0
I did some research and it's because the Gtk 4.0 libraries are unavailable on Ubuntu. Any suggestions?
Since the switch to GTK4, the application is not scaling properly on a high DPI monitor. I have my system configured for 2x scaling so that everything isn't absolutely tiny (my device has a resolution of 3000X2000 in about 13in, so fairly close to about 3k). The following is a screenshot of the application when I launch it:
Attempting to override the scaling for this app by running GDK_SCALE=1
, the window size is usable, but then all controls are so tiny that they are nearly impossible to use:
Before the switch from GTK3 to GTK4, everything was scaling fine without issue.
System Configuration:
Arch Linux
Kernel v5.15.5
Desktop Environment: KDE Plasma 5.23.4-1, X11
efiboots version: 1.0.r7.ga2514cd-1, installed from AUR package
Instead of doing all the changes live the tool could do them in RAM and add save and revert buttons as well as an edit dialog in case of unsaved changes.
In one recent commit I changed the regex without realizing it didn't work properly. Then I rewrote the tests using the same regex, so all tests are wrong.
I have to figure out a better way to test this.
Ok, something a bit weird. When I run python3 efibootmgr-gui.py
it crashes with a segfault in gtk_list_store_reorder(). But when I then tried just efibootmgr-gui.py
it started once. Now after trying it again that crashes too. I have the whole crash report with trace etc available if you want to take a look at it.
Hi!
Are there screenshots of this tool in action somewhere?
Thanks!
I was attempting to add a boot parameter to my kernel and I could not run the gui. It would fail with
DEBUG:root:Running: findmnt --noheadings --output SOURCE,FSTYPE --mountpoint /efi
Traceback (most recent call last):
File "/usr/bin/efiboots", line 18, in <module>
efiboots.run(parsed_args.disk, parsed_args.part)
File "/usr/lib/python3.9/site-packages/efiboots.py", line 571, in run
disk, part = auto_detect_esp()
File "/usr/lib/python3.9/site-packages/efiboots.py", line 125, in auto_detect_esp
result = find_esp_method()
File "/usr/lib/python3.9/site-packages/efiboots.py", line 82, in auto_detect_esp_with_findmnt
source, fstype = subprocess.run(cmd, check=True, capture_output=True, text=True).stdout.strip().split()
So I added an additional debug and I found it the problem is that since I have my EFI partition set to automount in my fstab, findmnt sees two mount points and crashes the app.
If I add [-2:] to the end of the line it would only grab the last entry, which fixed my setup, but I do not know if the autofs entry is always first or not.
FYI: the output of the findmnt command on my system:
findmnt --noheadings --output SOURCE,FSTYPE --mountpoint /efi
systemd-1 autofs
/dev/nvme0n1p1 vfat
This error is receiving:
$ sudo python efibootmgr-gui.py
Traceback (most recent call last):
File "efibootmgr-gui.py", line 9, in
import efibootmgr
File "/home/m/Downloads/efibootmgr-gui-master/efibootmgr.py", line 7
print(*cmd)
^
SyntaxError: invalid syntax
This little patch fixes it for me:
diff --git a/efiboots.py b/efiboots.py
index 25e8bb9..96c1a0f 100644
--- a/efiboots.py
+++ b/efiboots.py
@@ -152,7 +152,7 @@ def auto_detect_esp():
sys.exit(-1)
-efibootmgr_regex = re.compile(r'^Boot([0-9A-F]+)(\*)? (.+)\t(?:.+File\((.+)\))?.*\)(.*)$')
+efibootmgr_regex = re.compile(r'^Boot([0-9A-F]+)(\*)? (.+)\t.*File\((.+)\)?.*\)(.*)$')
def try_decode_efibootmgr(code):
Hi!
I used the script to set the nextboot option to my USB DVD drive. After restart DVD wasn't booted. I restarted again, and tried to enter system BIOS, to look for the boot options. Since then I am unable to enter the BIOS any more, it simply freezes with a black screen, and a non-blinking cursor in the left top corner. I think this is a BIOS problem, though.
Since there is no package I just copied the old sources to machine by machine. Now I downloaded the newer sources on a newer machine and realised that it is broken. Then I checked the readme again and noticed that the minimum requirement now is Ubuntu 22.10.
I have a few machines with 20.04 and 22.04 but as most long term Ubuntu users I don't have any with 22.10 for tons good reasons. Nobody use non-LTS systems. Makes no sense. So is it possible to add compatibility or are there any workaround for 20.04/22.04 systems to make it run?
The naming is a bit weird.Why not name them like that instead?
| Default | ID | Name | Path | Parameters | Visible | Boot once |
nevermind
entries are deleted only in the program window and nothing happens when you click "save"
Ubuntu 19.10 MATE 1.22.2
UPD: Thanks!
info:
os: Arch Linux
Python 3.7.3
findmnt --noheadings --output SOURCE --target /boot/efi
/dev/sda2
Traceback (most recent call last):
File "efibootmgr-gui.py", line 328, in <module>
win = EFIWindow()
File "efibootmgr-gui.py", line 218, in __init__
self.store = EFIStore(self)
File "efibootmgr-gui.py", line 93, in __init__
self.refresh()
File "efibootmgr-gui.py", line 135, in refresh
self.reorder()
File "efibootmgr-gui.py", line 102, in reorder
super().reorder(items)
TypeError: Item 4: Must be number, not NoneType
Hi,
i have used your program under Fedora 31 i lost a UEFI boot entry the program is very useful, the part that show the command is very important, it solves my problem.
I have only one issue
the loader part need double quota
sudo efibootmgr --disk /dev/sda --part 1 --create --label fedora --loader "\EFI\fedora\grubx64.efi"
Filing for reference, it's looking like it's an issue on Ubuntu 22.04 Gtk python library... checking it out on gtk-ubuntu branch
Ubuntu 22.04
Python3
by default, pacman will reinstall already installed packages. if you add the --needed
flag it will only install packages that are not already installed.
The command should be sudo pacman -S --needed efibootmgr python3 python-gobject
I'm getting an error running this program. reading from internet they say it's a problem with my locale or language. i already try installing a language pack, update-locale etc.. I'm stuck how can i fix this?
putraadr@ptrsoft:~/files/efibootmgr-gui$ sudo python3 efibootmgr_gui.py
DEBUG:root:Running: findmnt --noheadings --output SOURCE,FSTYPE --mountpoint /efi
DEBUG:root:Running: findmnt --noheadings --output SOURCE,FSTYPE --mountpoint /boot/efi
DEBUG:root:Device path /dev/sda1 split into /dev/sda and 1
INFO:root:Detected ESP on disk /dev/sda part 1
Traceback (most recent call last):
File "efibootmgr_gui.py", line 503, in <module>
main()
File "efibootmgr_gui.py", line 496, in main
win = EFIWindow(f"--disk {disk} --part {part}")
File "efibootmgr_gui.py", line 429, in __init__
self.store.refresh()
File "efibootmgr_gui.py", line 259, in refresh
boot = run_efibootmgr()
File "efibootmgr_gui.py", line 17, in run_efibootmgr
output = subprocess.run(["efibootmgr", "-v"], check=True, capture_output=True, text=True).stdout.strip().split('\n')
File "/usr/lib/python3.8/subprocess.py", line 491, in run
stdout, stderr = process.communicate(input, timeout=timeout)
File "/usr/lib/python3.8/subprocess.py", line 1024, in communicate
stdout, stderr = self._communicate(input, endtime, timeout)
File "/usr/lib/python3.8/subprocess.py", line 1904, in _communicate
stdout = self._translate_newlines(stdout,
File "/usr/lib/python3.8/subprocess.py", line 901, in _translate_newlines
data = data.decode(encoding, errors)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x9e in position 127: invalid start byte
==> Starting package()...
install: cannot stat '/var/tmp/pamac-build-yes/efibootmgr-gui-git/src/efibootmgr-gui/efibootmgr.desktop': No such file or directory
==> ERROR: A failure occurred in package().
Aborting...
The PKGBUILD on AUR is broken due to recent commits. Please update it.
When i add a new Entry, i get this Error and it does not Write the new entry.
Command '['pkexec', 'sh', '-c', "efibootmgr --disk /dev/nvme0n1p --part 1 --create --label 'KUbuntu' --loader '\EFI\ubuntu\shimx64.efi'\n"]' returned non-zero exit status 5.
sincelery Uwe
I say "locks up" - it holds my SSD in a busy state. Processes run for a bit, but then everything grinds to a halt. I had tty2 open to run iotop to see if I could figure out what was going on. I couldn't, but it told me this:
Killed process xxxxx (python3) total-vm:62715315kB, anon-rss:31522500kB, file-rss:2304kB, shmem-rs:16kB
Run 1:
pkexec efibootmgr --disk /dev/sda --part 1 --bootnum 0008 --inactive
pkexec efibootmgr --disk /dev/sda --part 1 --bootnum 0009 --inactive
pkexec efibootmgr --disk /dev/sda --part 1 --bootnum 0002 --inactive
pkexec efibootmgr --disk /dev/sda --part 1 --bootnum 0001 --inactive
pkexec efibootmgr --disk /dev/sda --part 1 --bootnum 0000 --inactive
Killed
Run 2:
pkexec efibootmgr --disk /dev/sda --part 1 --delete-bootnum --bootnum 0000
pkexec efibootmgr --disk /dev/sda --part 1 --delete-bootnum --bootnum 0008
pkexec efibootmgr --disk /dev/sda --part 1 --delete-bootnum --bootnum 0001
pkexec efibootmgr --disk /dev/sda --part 1 --delete-bootnum --bootnum 0002
pkexec efibootmgr --disk /dev/sda --part 1 --bootnext 0009
Killed
Hi,
nice UI. I would vote for this to be integrated in the system settings of ubuntu etc (I use arch btw ;))
However, since I have a long list of parameters I am afraid to break, it would be great if I could edit existing entries with the UI. If that is not so easy to implement, at least a duplicate button, which just prefills the "new entry" UI with the values of the currently selected entry would be nice.
The gtk3/gtk4 package is not listed as a dependency in the AUR PKGBUIlD. Came across this when installing/updating efiboots in a QT-based desktop environment such as KDE on Arch on a few different occasions, so GTK had not been installed on my system. (This was also the first application on my system to use gtk4 even though I had gtk3 installed by this point.)
I noticed that you also appear to maintain the AUR package for this application, so I figured that this is one place where I could point this out.
benutzername@Thinkpad-E15:~/Downloads$ git clone https://github.com/Elinvention/efiboots.git
Klone nach 'efiboots'...
remote: Enumerating objects: 260, done.
remote: Counting objects: 100% (135/135), done.
remote: Compressing objects: 100% (88/88), done.
remote: Total 260 (delta 78), reused 88 (delta 47), pack-reused 125
Empfange Objekte: 100% (260/260), 111.96 KiB | 3.11 MiB/s, fertig.
Löse Unterschiede auf: 100% (144/144), fertig.
benutzername@Thinkpad-E15:~/Downloads$ cd efiboots/
benutzername@Thinkpad-E15:~/Downloads/efiboots$ python3 efiboots
Traceback (most recent call last):
File "/home/benutzername/Downloads/efiboots/efiboots", line 6, in
import efiboots
File "/home/benutzername/Downloads/efiboots/efiboots.py", line 9, in
gi.require_version('Gtk', '4.0')
File "/usr/lib/python3/dist-packages/gi/init.py", line 129, in require_version
raise ValueError('Namespace %s not available for version %s' %
ValueError: Namespace Gtk not available for version 4.0
benutzername@Thinkpad-E15:~/Downloads/efiboots$ sudo uname -a
Linux Thinkpad-E15 5.19.0-2-amd64 #1 SMP PREEMPT_DYNAMIC Debian 5.19.11-1 (2022-09-24) x86_64 GNU/Linux
I did not know what the error is. :-(
I'm using your fine tool for many years now and I also translated the script for myself but it would be cool if we can "spread the word". Any chances?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.