Closed ghost closed 9 years ago
It would probably help to state what versions of efibootmgr and libefivar you're using.
Hi,
sure, i'm sorry: efibootmgr 0.12 and efivar 0.20
regards
The bug is around the first call to efi_loadopt_create which doesn't allow dp = NULL
Edit: The "bug" is not in efibootmgr but inside the efivar project. The check (!dp) should be after the check (size == 0)
This condition should be spitted
if (!dp && dp_size == 0) {
errno = EINVAL;
return -1;
}
Before if (size == 0) return sz;
if (dp_size == 0) {
errno = EINVAL;
return -1;
}
And after if (size == 0) return sz;
if (!dp) {
errno = EINVAL;
return -1;
}
Same thing with optional_data...
The bug was already referenced here : https://github.com/rhinstaller/efivar/issues/22
This is fixed in efivar-0.21 with https://github.com/rhinstaller/efivar/commit/d07807c80cffa32460c10ddb0f76ac49d9c00387 . Thanks for the report!
Hello,
tryed
efibootmgr -d /dev/sda -p 1 -c -L "Arch Linux" -l /vmlinuz-linux -u "root=/dev/sda2 rw initrd=/initramfs-linux.img"
fails with
efibootmgr: Could not set variable: Invalid argument efibootmgr: Could not prepare boot variable: Invalid argument
. Same arguments working with 0.11.0.
regards