From 791d55400ba8919b84a3e9b43a01c40e240169ba Mon Sep 17 00:00:00 2001 From: Javier Martinez Canillas Date: Nov 21 2018 09:44:33 +0000 Subject: grubby-bls: use title field instead of version for zipl default entry Most bootloaders use the BootLoaderSpec "title" field to name the entries in their boot menu. The zipl bootloader used the "version" field instead, since it was wrongly assumed that the zipl boot menu didn't support names that contained spaces, which are usually present in a BLS "title" field. But this is not the case, names with space characters are supported by the IPL and is just a constraint of the section heading in the zipl.conf file. To be consistent with all the other bootloaders, zipl now uses the "title" field to populate the boot menu entries from BLS files. So change grubby to use the "title" field to set the default entry of the "version" field. Related: rhbz#1645200 Signed-off-by: Javier Martinez Canillas --- diff --git a/grubby-bls b/grubby-bls index ee28802..71dcb31 100755 --- a/grubby-bls +++ b/grubby-bls @@ -129,7 +129,7 @@ get_default_index() { if [[ $bootloader = "grub2" ]]; then id="$default" else - version="$default" + title="$default" fi for i in ${!bls_file[@]}; do @@ -143,7 +143,7 @@ get_default_index() { return fi - if [[ $bootloader = "zipl" && $version = ${bls_version[$i]} ]]; then + if [[ $bootloader = "zipl" && $title = ${bls_title[$i]} ]]; then echo $i return fi @@ -459,7 +459,7 @@ set_default_bls() { if [[ $bootloader = grub2 ]]; then grub2-editenv "${env}" set saved_entry="${bls_id[$index]}" else - local default="${bls_version[$index]}" + local default="${bls_title[$index]}" local current="$(grep '^default=' ${zipl_config} | sed -e 's/^default=//')" if [[ -n $current ]]; then sed -i -e "s,^default=.*,default=${default}," "${zipl_config}"