From b8c8cdcf6c996a5255b768cf2033b4ee8dcf3701 Mon Sep 17 00:00:00 2001 From: Javier Martinez Canillas Date: Oct 23 2018 13:06:40 +0000 Subject: Make grubby-bls execute grub2-mkconfig on ppc64 When booting an ppc64 machine on bare-metal (PowerNV) the OPAL firmware interface is used. The firmware contains the Petitboot boot-loader that can be used to parse the BootLoaderSpec (BLS) snippets in a BLS setup. But machines could have an older version of Petitboot that doesn't have BLS support, so on ppc64 machines can't be assumed that just modifying the BLS files is enough for those changes to be reflected in the boot menu. Instead, grub2-mkconfig is executed so the BLS can be parsed and produce a grub config file that can be used by any Petitboot version. Resolves: rhbz#1636039 Signed-off-by: Javier Martinez Canillas --- diff --git a/grubby-bls b/grubby-bls index d94415f..4a83cd6 100755 --- a/grubby-bls +++ b/grubby-bls @@ -234,6 +234,8 @@ remove_bls_fragment() { done get_bls_values + + update_grubcfg } add_bls_fragment() { @@ -308,6 +310,8 @@ add_bls_fragment() { set_default_bls "TITLE=${title}" fi + update_grubcfg + exit 0 } @@ -357,6 +361,8 @@ update_bls_fragment() { set_bls_value "${bls_file[$i]}" "initrd" "${initrd}" fi done + + update_grubcfg } set_default_bls() { @@ -397,6 +403,13 @@ remove_var_prefix() { fi } +update_grubcfg() +{ + if [[ $arch = 'ppc64' || $arch = 'ppc64le' ]]; then + grub2-mkconfig -o /boot/grub2/grub.cfg >& /dev/null + fi +} + print_usage() { cat <