From: Florian La Roche Date: Tue, 1 Sep 2020 05:13:20 +0000 (+0200) Subject: grub-mkconfig: If $hints is not set reduce the output into grub.cfg to just 1 line X-Git-Tag: grub-2.06-rc1~201 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3ec59f14f43e9edf594581b6b3f054ec39dd131d;p=thirdparty%2Fgrub.git grub-mkconfig: If $hints is not set reduce the output into grub.cfg to just 1 line Signed-off-by: Florian La Roche Reviewed-by: Daniel Kiper --- diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in index 2d80f14bf..301d1ac22 100644 --- a/util/grub-mkconfig_lib.in +++ b/util/grub-mkconfig_lib.in @@ -158,11 +158,15 @@ prepare_grub_to_access_device () fi if [ "x${GRUB_DISABLE_UUID}" != "xtrue" ] && fs_uuid="`"${grub_probe}" --device $@ --target=fs_uuid 2> /dev/null`" ; then hints="`"${grub_probe}" --device $@ --target=hints_string 2> /dev/null`" || hints= - echo "if [ x\$feature_platform_search_hint = xy ]; then" - echo " search --no-floppy --fs-uuid --set=root ${hints} ${fs_uuid}" - echo "else" - echo " search --no-floppy --fs-uuid --set=root ${fs_uuid}" - echo "fi" + if [ "x$hints" != x ]; then + echo "if [ x\$feature_platform_search_hint = xy ]; then" + echo " search --no-floppy --fs-uuid --set=root ${hints} ${fs_uuid}" + echo "else" + echo " search --no-floppy --fs-uuid --set=root ${fs_uuid}" + echo "fi" + else + echo "search --no-floppy --fs-uuid --set=root ${fs_uuid}" + fi fi IFS="$old_ifs" }