diff --git a/docs/grub.texi b/docs/grub.texi index d788efe44..c25ab7a5f 100644 --- a/docs/grub.texi +++ b/docs/grub.texi @@ -1441,6 +1441,15 @@ enable the use of partition UUIDs, set this option to @samp{false}. If this option is set to @samp{true}, disable the generation of recovery mode menu entries. +@item GRUB_DISABLE_UUID +Normally, @command{grub-mkconfig} will generate menu entries that use +universally-unique identifiers (UUIDs) to identify various filesystems to +search for files. This is usually more reliable, but in some cases it may +not be appropriate. To disable this use of UUIDs, set this option to +@samp{true}. Setting this option to @samp{true}, will also set the options +@samp{GRUB_DISABLE_LINUX_UUID} and @samp{GRUB_DISABLE_LINUX_PARTUUID} to +@samp{true}, unless they have been explicilty set to @samp{false}. + @item GRUB_VIDEO_BACKEND If graphical video support is required, either because the @samp{gfxterm} graphical terminal is in use or because @samp{GRUB_GFXPAYLOAD_LINUX} is set, diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in index a6ce375ed..d3e879b8e 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in @@ -158,6 +158,15 @@ if test -f ${sysconfdir}/default/grub ; then . ${sysconfdir}/default/grub fi +if [ "x${GRUB_DISABLE_UUID}" = "xtrue" ]; then + if [ -z "${GRUB_DISABLE_LINUX_UUID}" ]; then + GRUB_DISABLE_LINUX_UUID="true" + fi + if [ -z "${GRUB_DISABLE_LINUX_PARTUUID}" ]; then + GRUB_DISABLE_LINUX_PARTUUID="true" + fi +fi + # XXX: should this be deprecated at some point? if [ "x${GRUB_TERMINAL}" != "x" ] ; then GRUB_TERMINAL_INPUT="${GRUB_TERMINAL}" @@ -224,6 +233,7 @@ export GRUB_DEFAULT \ GRUB_TERMINAL_INPUT \ GRUB_TERMINAL_OUTPUT \ GRUB_SERIAL_COMMAND \ + GRUB_DISABLE_UUID \ GRUB_DISABLE_LINUX_UUID \ GRUB_DISABLE_LINUX_PARTUUID \ GRUB_DISABLE_RECOVERY \ diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in index 0f801cab3..3e12b2c0e 100644 --- a/util/grub-mkconfig_lib.in +++ b/util/grub-mkconfig_lib.in @@ -156,7 +156,7 @@ prepare_grub_to_access_device () if [ "x$fs_hint" != x ]; then echo "set root='$fs_hint'" fi - if fs_uuid="`"${grub_probe}" --device $@ --target=fs_uuid 2> /dev/null`" ; then + 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}" @@ -173,7 +173,7 @@ grub_get_device_id () IFS=' ' device="$1" - if fs_uuid="`"${grub_probe}" --device ${device} --target=fs_uuid 2> /dev/null`" ; then + if [ "x${GRUB_DISABLE_UUID}" != "xtrue" ] && fs_uuid="`"${grub_probe}" --device ${device} --target=fs_uuid 2> /dev/null`" ; then echo "$fs_uuid"; else echo $device |sed 's, ,_,g'