mirror of
https://github.com/linuxboot/heads.git
synced 2025-01-29 15:44:07 +00:00
oem-factory-reset: Fix index used for default boot option
Since we sort the boot options prior to selecting the new default entry, we need to use the index of the entry in the list prior to being sorted, vs always setting it as 1. This fixes setting/booting of the default OS target where the list entries are changed when calling sort. Test: perform OEM factory reset with Fedora 32 installed, verify default boot succeeds followng reset. Signed-off-by: Matt DeVillier <matt.devillier@puri.sm>
This commit is contained in:
parent
009c10465a
commit
4c64ca631a
@ -221,8 +221,11 @@ set_default_boot_option()
|
||||
# clear existing default configs
|
||||
rm "/boot/kexec_default.*.txt" 2>/dev/null
|
||||
|
||||
# get correct index for entry
|
||||
index=$(grep -n "$entry" $option_file | cut -f1 -d ':')
|
||||
|
||||
# write new config
|
||||
echo "$entry" > /boot/kexec_default.1.txt
|
||||
echo "$entry" > /boot/kexec_default.$index.txt
|
||||
|
||||
# validate boot option
|
||||
cd /boot && /bin/kexec-boot -b "/boot" -e "$entry" -f \
|
||||
|
Loading…
x
Reference in New Issue
Block a user