2018-07-10 19:08:14 +00:00
|
|
|
From e944dc0c0a5b414873c3149e008130f14bdb9af4 Mon Sep 17 00:00:00 2001
|
2014-09-29 15:48:01 +00:00
|
|
|
From: Peter Jones <pjones@redhat.com>
|
|
|
|
Date: Thu, 4 Sep 2014 16:49:25 -0400
|
2018-07-10 18:39:10 +00:00
|
|
|
Subject: [PATCH] Add GRUB_DISABLE_UUID.
|
2014-09-29 15:48:01 +00:00
|
|
|
|
|
|
|
This will cause "search --fs-uuid --set=root ..." not to be generated by
|
|
|
|
grub2-mkconfig, and instead simply attempt to use the grub device name
|
|
|
|
as it understands it.
|
|
|
|
|
|
|
|
Signed-off-by: Peter Jones <pjones@redhat.com>
|
|
|
|
---
|
|
|
|
docs/grub.texi | 7 +++++++
|
2018-07-10 19:08:14 +00:00
|
|
|
util/grub-mkconfig.in | 22 +++++++++++++++++++---
|
2014-09-29 15:48:01 +00:00
|
|
|
util/grub-mkconfig_lib.in | 4 ++--
|
2018-07-10 19:08:14 +00:00
|
|
|
3 files changed, 28 insertions(+), 5 deletions(-)
|
2014-09-29 15:48:01 +00:00
|
|
|
|
|
|
|
diff --git a/docs/grub.texi b/docs/grub.texi
|
2018-07-10 19:08:14 +00:00
|
|
|
index 2adfa97bee8..2fd32608c01 100644
|
2014-09-29 15:48:01 +00:00
|
|
|
--- a/docs/grub.texi
|
|
|
|
+++ b/docs/grub.texi
|
2018-07-10 19:08:14 +00:00
|
|
|
@@ -1441,6 +1441,13 @@ enable the use of partition UUIDs, set this option to @samp{false}.
|
2014-09-29 15:48:01 +00:00
|
|
|
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}.
|
|
|
|
+
|
|
|
|
@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
|
2018-07-10 19:08:14 +00:00
|
|
|
index bc5a3f17541..b0a8626dd1c 100644
|
2014-09-29 15:48:01 +00:00
|
|
|
--- a/util/grub-mkconfig.in
|
|
|
|
+++ b/util/grub-mkconfig.in
|
2018-07-10 19:08:14 +00:00
|
|
|
@@ -133,12 +133,12 @@ fi
|
2014-09-29 15:48:01 +00:00
|
|
|
|
|
|
|
# Device containing our userland. Typically used for root= parameter.
|
|
|
|
GRUB_DEVICE="`${grub_probe} --target=device /`"
|
|
|
|
-GRUB_DEVICE_UUID="`${grub_probe} --device ${GRUB_DEVICE} --target=fs_uuid 2> /dev/null`" || true
|
2018-07-10 19:08:14 +00:00
|
|
|
-GRUB_DEVICE_PARTUUID="`${grub_probe} --device ${GRUB_DEVICE} --target=partuuid 2> /dev/null`" || true
|
2014-09-29 15:48:01 +00:00
|
|
|
+GRUB_DEVICE_UUID_GENERATED="`${grub_probe} --device ${GRUB_DEVICE} --target=fs_uuid 2> /dev/null`" || true
|
2018-07-10 19:08:14 +00:00
|
|
|
+GRUB_DEVICE_PARTUUID_GENERATED="`${grub_probe} --device ${GRUB_DEVICE} --target=partuuid 2> /dev/null`" || true
|
2014-09-29 15:48:01 +00:00
|
|
|
|
|
|
|
# Device containing our /boot partition. Usually the same as GRUB_DEVICE.
|
|
|
|
GRUB_DEVICE_BOOT="`${grub_probe} --target=device /boot`"
|
|
|
|
-GRUB_DEVICE_BOOT_UUID="`${grub_probe} --device ${GRUB_DEVICE_BOOT} --target=fs_uuid 2> /dev/null`" || true
|
|
|
|
+GRUB_DEVICE_BOOT_UUID_GENERATED="`${grub_probe} --device ${GRUB_DEVICE_BOOT} --target=fs_uuid 2> /dev/null`" || true
|
|
|
|
|
|
|
|
# Filesystem for the device containing our userland. Used for stuff like
|
|
|
|
# choosing Hurd filesystem module.
|
2018-07-10 19:08:14 +00:00
|
|
|
@@ -158,6 +158,21 @@ if test -f ${sysconfdir}/default/grub ; then
|
2014-09-29 15:48:01 +00:00
|
|
|
. ${sysconfdir}/default/grub
|
|
|
|
fi
|
|
|
|
|
2018-07-10 19:08:14 +00:00
|
|
|
+if [ "x$GRUB_DISABLE_UUID" != "xtrue" ]; then
|
|
|
|
+ if [ -z "$GRUB_DEVICE_UUID" ]; then
|
|
|
|
+ GRUB_DEVICE_UUID="$GRUB_DEVICE_UUID_GENERATED"
|
|
|
|
+ fi
|
|
|
|
+ if [ -z "$GRUB_DEVICE_BOOT_UUID" ]; then
|
|
|
|
+ GRUB_DEVICE_BOOT_UUID="$GRUB_DEVICE_BOOT_UUID_GENERATED"
|
|
|
|
+ fi
|
|
|
|
+ if [ -z "$GRUB_DEVICE_UUID" ]; then
|
|
|
|
+ GRUB_DEVICE_UUID="$GRUB_DEVICE_UUID_GENERATED"
|
|
|
|
+ fi
|
|
|
|
+ if [ -z "$GRUB_DEVICE_PART_UUID" ]; then
|
|
|
|
+ GRUB_DEVICE_PART_UUID="$GRUB_DEVICE_PART_UUID_GENERATED"
|
|
|
|
+ fi
|
2014-09-29 15:48:01 +00:00
|
|
|
+fi
|
|
|
|
+
|
|
|
|
# XXX: should this be deprecated at some point?
|
|
|
|
if [ "x${GRUB_TERMINAL}" != "x" ] ; then
|
|
|
|
GRUB_TERMINAL_INPUT="${GRUB_TERMINAL}"
|
2018-07-10 19:08:14 +00:00
|
|
|
@@ -227,6 +242,7 @@ export GRUB_DEFAULT \
|
2014-09-29 15:48:01 +00:00
|
|
|
GRUB_DISABLE_LINUX_UUID \
|
2018-07-10 19:08:14 +00:00
|
|
|
GRUB_DISABLE_LINUX_PARTUUID \
|
2014-09-29 15:48:01 +00:00
|
|
|
GRUB_DISABLE_RECOVERY \
|
|
|
|
+ GRUB_DISABLE_UUID \
|
|
|
|
GRUB_VIDEO_BACKEND \
|
|
|
|
GRUB_GFXMODE \
|
|
|
|
GRUB_BACKGROUND \
|
|
|
|
diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in
|
2018-07-10 19:08:14 +00:00
|
|
|
index 0f801cab3e4..1001a12232b 100644
|
2014-09-29 15:48:01 +00:00
|
|
|
--- 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'
|