]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
grub-mkconfig: If $hints is not set reduce the output into grub.cfg to just 1 line
authorFlorian La Roche <Florian.LaRoche@gmail.com>
Tue, 1 Sep 2020 05:13:20 +0000 (07:13 +0200)
committerDaniel Kiper <daniel.kiper@oracle.com>
Fri, 18 Sep 2020 20:31:30 +0000 (22:31 +0200)
Signed-off-by: Florian La Roche <Florian.LaRoche@gmail.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
util/grub-mkconfig_lib.in

index 2d80f14bfcdab2f121e564615c04058006fbe8d2..301d1ac229aebcdcdc2a3fa2ffde02fbb9261fd7 100644 (file)
@@ -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"
 }