KeyError in uefi_find_duplicate_entries
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
curtin |
New
|
Undecided
|
Unassigned | ||
grub2 (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
I attempted to install Ubuntu 20.04.03 and 22.04 (beta) over the weekend and ran into an issue where part of the Grub install step was causing a KeyError. The specific line that was throwing the error is: https:/
After investigations it looks like the "BootCurrent" line returned by efibootmgr was showing '0000' as the current boot. However, that line had not been processed as it was a USB device that doesn't seem to match the expected format in the parse function. That would then lead to the '0000' key not being added to the data structure and throwing a KeyError.
I'm not sure if the solution should be to alter the previous line (https:/
I wasn't able to figure out how I could test either of these solutions. My workaround was to replace the 'efibootmgr' executable temporarily and change the 'BootCurrent' parameter to '0001' which was in the dictionary and therefore would get past the KeyError. It seems to have worked for the install. Here is a rough script I did to replace it after the package was installed:
sudo -i
mv /target/
echo <<EOF >/target/
#!/bin/sh
/target/
EOF
chmod o+x /target/
Sounds like Curtin could stand some defensive checks.
Is this also something that should be addressed in grub?