diff --git a/grubby-bls b/grubby-bls index def45dd..aa1f3a2 100755 --- a/grubby-bls +++ b/grubby-bls @@ -581,8 +581,33 @@ remove_var_prefix() { update_grubcfg() { - if [[ $arch = 'ppc64' || $arch = 'ppc64le' ]]; then - grub2-mkconfig --no-grubenv-update -o "${grub_config}" >& /dev/null + # Older ppc64le OPAL firmware (petitboot version < 1.8.0) don't have BLS support + # so grub2-mkconfig has to be run to generate a config with menuentry commands. + if [ "${arch}" = "ppc64le" ] && [ -d /sys/firmware/opal ]; then + RUN_MKCONFIG="true" + petitboot_path="/sys/firmware/devicetree/base/ibm,firmware-versions/petitboot" + + if test -e ${petitboot_path}; then + read -r -d '' petitboot_version < ${petitboot_path} + petitboot_version="$(echo ${petitboot_version//v})" + + if test -n ${petitboot_version}; then + major_version="$(echo ${petitboot_version} | cut -d . -f1)" + minor_version="$(echo ${petitboot_version} | cut -d . -f2)" + + re='^[0-9]+$' + if [[ $major_version =~ $re ]] && [[ $minor_version =~ $re ]] && + ([[ ${major_version} -gt 1 ]] || + [[ ${major_version} -eq 1 && + ${minor_version} -ge 8 ]]); then + RUN_MKCONFIG="false" + fi + fi + fi + fi + + if [[ $RUN_MKCONFIG = "true" ]]; then + grub2-mkconfig --no-grubenv-update -o "${grub_config}" >& /dev/null fi } diff --git a/grubby.spec b/grubby.spec index 1a7f321..512415e 100644 --- a/grubby.spec +++ b/grubby.spec @@ -1,6 +1,6 @@ Name: grubby Version: 8.40 -Release: 52%{?dist} +Release: 53%{?dist} Summary: Command line tool for updating bootloader configs License: GPLv2+ URL: https://github.com/rhinstaller/grubby @@ -131,6 +131,10 @@ current boot environment. %{_mandir}/man8/*.8* %changelog +* Tue Apr 27 2021 Javier Martinez Canillas - 8.40-53 +- grubby-bs: Fix changing kernel cmdline params not working on ppc64le + Resolves: rhbz#1896222 + * Fri Apr 16 2021 Mohan Boddu - 8.40-52 - Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937