grubby-bls: unset default entry if is the one being removed
If the default entry is removed, this can't be set as the default anymore for zipl. Otherwise the zipl tool will fail since it won't exist an IPL section for the one set as the default. For grub2, if the saved_entry doesn't exist it will fallback to the first entry. But still the correct thing to do is to unset the default there. Resolves: rhbz#1668329 Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
This commit is contained in:
parent
f742fa15b3
commit
a77221432e
12
grubby-bls
12
grubby-bls
@ -305,6 +305,15 @@ grub_class kernel${flavor}
|
||||
EOF
|
||||
}
|
||||
|
||||
unset_default_bls()
|
||||
{
|
||||
if [[ $bootloader = grub2 ]]; then
|
||||
grub2-editenv "${env}" unset saved_entry
|
||||
else
|
||||
sed -i -e "/^default=.*/d" "${zipl_config}"
|
||||
fi
|
||||
}
|
||||
|
||||
remove_bls_fragment() {
|
||||
local indexes=($(param_to_indexes "$1"))
|
||||
|
||||
@ -313,6 +322,9 @@ remove_bls_fragment() {
|
||||
fi
|
||||
|
||||
for i in "${indexes[@]}"; do
|
||||
if [[ $default_index = $i ]]; then
|
||||
unset_default_bls
|
||||
fi
|
||||
rm -f "${bls_file[$i]}"
|
||||
done
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user