Skip to content

Commit

Permalink
Make grubby-bls execute grub2-mkconfig on ppc64
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
martinezjavier committed Oct 8, 2018
1 parent 20c98af commit e192151
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions grubby-bls
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,8 @@ remove_bls_fragment() {
done

get_bls_values

update_grubcfg
}

add_bls_fragment() {
Expand Down Expand Up @@ -308,6 +310,8 @@ add_bls_fragment() {
set_default_bls "TITLE=${title}"
fi

update_grubcfg

exit 0
}

Expand Down Expand Up @@ -357,6 +361,8 @@ update_bls_fragment() {
set_bls_value "${bls_file[$i]}" "initrd" "${initrd}"
fi
done

update_grubcfg
}

set_default_bls() {
Expand Down Expand Up @@ -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 <<EOF
Expand Down

0 comments on commit e192151

Please sign in to comment.