Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

efibootmgr --bootnum XXXX --label ... --loader ... --disk ... does NOT update the entry? #161

Open
colemickens opened this issue Mar 20, 2022 · 12 comments

Comments

@colemickens
Copy link

+ sudo efibootmgr -v
BootCurrent: 0004
Timeout: 0 seconds
BootOrder: 0004,0003,0001,0000
Boot0000* EFI Network   AcpiEx(VMBus,,)/VenHw(9b17e5a2-0891-42dd-b653-80b5c22809ba,635161f83edfc546913ff2d2f965ed0e1e3e0d54a0f4d049a000bbc770e777e9)/MAC(000000000000,0)/IPv4(0.0.0.00.0.0.0,0,0)
Boot0001* EFI SCSI Device       AcpiEx(VMBus,,)/VenHw(9b17e5a2-0891-42dd-b653-80b5c22809ba,d96361baa104294db60572e2ffb1dc7f771a751da1da2d438fe843db0ce3321a)/SCSI(0,0)
Boot0002* FrontPage     MemoryMapped(11,0x100000,0x5dffff)/FvFile(4042708a-0f2d-4823-ac60-0d77b3111889)
Boot0003* EFI SCSI Device       AcpiEx(VMBus,,)/VenHw(9b17e5a2-0891-42dd-b653-80b5c22809ba,d96361baa104294db60572e2ffb1dc7f771a751da1da2d438fe843db0ce3321a)/SCSI(0,1)
Boot0004* nixos-grub    HD(1,GPT,8318b10a-489c-4df1-accf-68ce81ecf54a,0x800,0x100000)/File(\EFI\nixos-grub\grubx64.efi)


+ part=1
+ sudo efibootmgr -v --bootnum 0004 --label nixos-grub --loader '\EFI\nixos-grub\shimx64.efi' --disk /dev/sda --part 1
BootCurrent: 0004
Timeout: 0 seconds
BootOrder: 0004,0003,0001,0000
Boot0000* EFI Network   AcpiEx(VMBus,,)/VenHw(9b17e5a2-0891-42dd-b653-80b5c22809ba,635161f83edfc546913ff2d2f965ed0e1e3e0d54a0f4d049a000bbc770e777e9)/MAC(000000000000,0)/IPv4(0.0.0.00.0.0.0,0,0)
Boot0001* EFI SCSI Device       AcpiEx(VMBus,,)/VenHw(9b17e5a2-0891-42dd-b653-80b5c22809ba,d96361baa104294db60572e2ffb1dc7f771a751da1da2d438fe843db0ce3321a)/SCSI(0,0)
Boot0002* FrontPage     MemoryMapped(11,0x100000,0x5dffff)/FvFile(4042708a-0f2d-4823-ac60-0d77b3111889)
Boot0003* EFI SCSI Device       AcpiEx(VMBus,,)/VenHw(9b17e5a2-0891-42dd-b653-80b5c22809ba,d96361baa104294db60572e2ffb1dc7f771a751da1da2d438fe843db0ce3321a)/SCSI(0,1)
Boot0004* nixos-grub    HD(1,GPT,8318b10a-489c-4df1-accf-68ce81ecf54a,0x800,0x100000)/File(\EFI\nixos-grub\grubx64.efi)

No error, no nothing, entry isn't updated.

User error?

@colemickens
Copy link
Author

❯ efibootmgr --version
version 17

@colemickens
Copy link
Author

and skimming the code, again it's clear that efibootmgr wasn't really built with distros in mind. Cool, looks like it's back to manually managing deleting and recreating the boot entry then.

@colemickens
Copy link
Author

and of course this messes with the boot order. 🙃 😠

@frozencemetery
Copy link
Member

Your settings already matched what you asked for. I'm not sure what you're trying to do here - can you phrase your question to clearly provide: what you expected to happen, what you did, and what happened instead?

@colemickens
Copy link
Author

No, they don't.

Command:

  • sudo efibootmgr -v --bootnum 0004 --label nixos-grub --loader '\EFI\nixos-grub\shimx64.efi' --disk /dev/sda --part 1

Note, shimx64.efi

Boot0004* nixos-grub HD(1,GPT,8318b10a-489c-4df1-accf-68ce81ecf54a,0x800,0x100000)/File(\EFI\nixos-grub\grubx64.efi)

Note, grubx64.efi

As I said from skimming the code, it seems obviously not written to support this.

@frozencemetery
Copy link
Member

and skimming the code, again it's clear that efibootmgr wasn't really built with distros in mind. Cool, looks like it's back to manually managing deleting and recreating the boot entry then.

We're using it in distros just fine, so I'm not really sure what you mean, but feel free to post patches to fix what's missing.

@colemickens
Copy link
Author

So you have an example of using efibootmgr to edit a boot entry without having to manually backup bootorder, delete and recreate entry, and then restore boot order? Because that's what this issue is about, and I'd be more than happy be wrong, replace this code, and close this issue.

@LoganDark
Copy link

I'm also running into this issue. I want to switch kernels without changing the boot args or boot order, but efibootmgr currently only allows me to create and delete boot entries, not modify them. I think this issue could be turned into a much more constructive feature request for modifying boot entries in-place.

@fice-t
Copy link

fice-t commented Jul 27, 2023

Ran into this issue as well. A BIOS update messed with the boot manager list and I had to restore it from my Windows install, which somehow resulted in both the Windows and the systemd boot loaders having the same name.

I figured a simple efibootmgr -b N -L 'Linux Boot Manager' would work, but sadly I had to create an entire new entry to replace the old one.

@TxLogicGuy
Copy link

TxLogicGuy commented Oct 12, 2023

IMHO, the ability to modify the contents of an existing boot entry is something that is badly needed in this tool. I don't know how many times I just wanted to edit the label, or change the kernel version or one of the boot parameters and leave everything else the same. The only way I have found to do this is to delete the existing entry and then recreate it with the new information. But now the boot order as it appears on the selection menu when I reboot is messed up. What I have resorted to doing, and I've gone through this tedious process many times, is to delete all the entries up to and including the one I want to change, recreate it with my modified information, and then recreate all the other entries below it that I deleted.

@TxLogicGuy
Copy link

Looking through the various issues posted over the years I see that the ability to edit an existing entry has been brought up in one form or another several times. It was entered as a feature request #49 back on Jul 10, 2016.

@colemickens
Copy link
Author

I could have asked more politely as well. I don't want to encourage what might be perceived as spamming, but if someone takes @LoganDark's suggestion and make a politer, proper feature request, I'd be happy to close this issue in favor of it. Apologies for my frustrated, un-kind tone last year; not nice to re-read.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants