diff --git a/grubby-bls b/grubby-bls index 5f5ca6a..708f830 100755 --- a/grubby-bls +++ b/grubby-bls @@ -125,25 +125,13 @@ get_default_index() { index="$default" fi - # GRUB2 and zipl use different fields to set the default entry - if [[ $bootloader = "grub2" ]]; then - id="$default" - else - title="$default" - fi - for i in ${!bls_file[@]}; do if [[ $i -eq $index ]]; then echo $i return fi - if [[ $bootloader = "grub2" && $id = ${bls_id[$i]} ]]; then - echo $i - return - fi - - if [[ $bootloader = "zipl" && $title = ${bls_title[$i]} ]]; then + if [[ $default = ${bls_id[$i]} || $default = ${bls_title[$i]} ]]; then echo $i return fi diff --git a/grubby.spec b/grubby.spec index 470d9f5..a9d4b74 100644 --- a/grubby.spec +++ b/grubby.spec @@ -1,6 +1,6 @@ Name: grubby Version: 8.40 -Release: 22%{?dist} +Release: 23%{?dist} Summary: Command line tool for updating bootloader configs License: GPLv2+ URL: https://github.com/rhinstaller/grubby @@ -130,6 +130,10 @@ current boot environment. %{_mandir}/man8/*.8* %changelog +* Tue Dec 11 2018 Javier Martinez Canillas - 8.40-23 +- grubby-bls: lookup default entry by either id or title on grub2 + Related: rhbz#1654936 + * Fri Nov 30 2018 Javier Martinez Canillas - 8.40-22 - grubby-bls: also print the absolute path in the --default-kernel option Resolves: rhbz#1649778