Failed to remove old efi boot entry. This is most likely a kernel or firmware bug

Hi folks I already try and read a lot of similar posts but do not help. so I currently debugging this error on a live os.

the problem is that the anaconda fail to remove the old efi using the efibootmgr tool. Loking the logs I found this:

then the command that is trying to execute is efibootmgr -b 0005 -B but the tool respond with a error “invalid argument.”

the I go for the python code that run that command, is this:

It loop looking for the get_product_name (I think is fedora something) the string to match.
there was a Fedora entry, the efibootmgr remove the entry but still return a errror . this looks like a bad interpretation of the output of the tool.

I manually run the efibootmgr and list this:

so I try to remove the Manjaro entry on the top with code 0000 and get the same error could not delete variable: Invalid argument but the entry was deleted.

so currently I playing with the efibootmgr (I hope I don’t brick my laptop xD) I trying to install and fix the error.

I post this to have a record.

I some has encounter this error feel free to help me.

I thinks this is a bad error handling error for the efibootmgr and the anaconda tool. Where I need to report this ?

the invalid argument error is comming from efivarfs.c and lib.c

Each time that I remove an efibootmgr entry, I use the form
# efibootmgr -b DIGIT -B

such as
# efibootmgr -b 0 -B
or
# efibootmgr -b 5 -B

Perhaps the leading zeroes are causing an issue. If they are, a bug report should be filed.

is not for the leading zeroes, it fail with both formats 0001 or 1.

but in the case of removing the entries it’s not failing. It remove the entry but return the “invalid argument:” error.

I try to set the boot order to remove the previous one, and get the same error, but in this case it fail to set the new value.

I try to manually remove the Fedora entry to pass the point of the previous log. (the remove_efi_boot_target) And it pass. but fail again with the same errors running the command:

INFO:program:Running in chroot '/mnt/sysroot'... efibootmgr -c -w -L Fedora -d /dev/nvme1n1 -p 1 -l \EFI\fedora\shimx64.efi

So it continue to return a non zero result and break my installl process xD. I going to sleep now :melting_face:

questions:

How I fix the efibootmgr ?
Why it’s returning the error ?
Does the lib.c and efivarfs.c come within the fedora iso ?
or instead
Are the libs got from the firmware ?

well I will try to respond that tomorrow :hand_with_fingers_splayed:

A few years ago, there was an error in efibootmagr which causes it to fail if there is no entry for boot0001. I don’t know if that got fixed after it was reported to bugzilla.

You could try to create a new entry that would be installed as boot0001 and see if that makes a difference when removeing the other entries you want to remove.

Use Linux efibootmgr Command to Manage UEFI Boot Menu

this don’t help. the efibootmgr is trowing a unexpected error on the operations. please read the post thk.

Please post text as preformatted text and not as screen shots.
Screen shots are hard for many to read and we cannot quote from images.

And image content is generally not found with web searches. The OP should be raising this issue upstream at https://github.com/rhboot/efibootmgr/issues/.

yeah sorry I was on a hurry. to resume:

the anaconda process is failing to install the bootloader and boot entries. Any command to the efibootmgr.

the first command that is traying to run is the efibootmgr -b 0005 -B to delete the entry added by the live stick. this command fail with:

Could not delete variable: invalid argument

After that I manually remove the entry called Fedora and the entry was deleted but the efibootmgr return a non 0 value, with the same ..invalid argument message.

Because aI manually delete de entry anaconde is able to pass the point and try to run another efibootmgr command.

INFO:program:Running in chroot '/mnt/sysroot'... efibootmgr -c -w -L Fedora -d /dev/nvme1n1 -p 1 -l \EFI\fedora\shimx64.efi

but it also fail with another similar error:

Could not prepare Boot  variable: invalid argument

After that, in both cases the install process fail with the thread title.

Its looks like the main repo is unmaintained, I don’t know if fedora use this exact repo. but the last accepted commit is from one year ago.

Dell has been reducing staff. There are outstanding pull requests – one of them may address your issue, or another distro may be using a patched version. There have been many forks – some forks may track upstream issues/changes.

https://bbs.archlinux.org/viewtopic.php?id=301046 might be relevant.

Posting details of your issue may get attention. You can try searching for mentions your issue on other distros. Is your UEFI/BIOS fully updated?

yeah last asus version. I understand. so what I need to do.
make a fork (or download) and compile myself. ? replacing the version of efibootmgr that dnf install ?
does anaconda need to be update ?

You could try bcfg from an Arch Linux live ISO.

thk I will try that

the I added the boot entry but the grub entry for fedora is missing. so I currently trying to update the grub.