Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1iAFir-0007qu-0m for mharc-grub-devel@gnu.org; Tue, 17 Sep 2019 11:48:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37511) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iAFio-0007oV-K0 for grub-devel@gnu.org; Tue, 17 Sep 2019 11:48:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iAFin-0006rG-7M for grub-devel@gnu.org; Tue, 17 Sep 2019 11:48:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49194) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iAFim-0006qs-SW for grub-devel@gnu.org; Tue, 17 Sep 2019 11:48:53 -0400 Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CC4735945E for ; Tue, 17 Sep 2019 15:48:51 +0000 (UTC) Received: by mail-wr1-f72.google.com with SMTP id v18so1463394wro.16 for ; Tue, 17 Sep 2019 08:48:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=e+6v86DkihiTpHtH3swhX7uz5IfJopMGPQma5ngziOg=; b=Y3jwgn1r+etsYaXhwLIia4RJaGtoOBFNLGij8KmhV1JV2GQuDDTw8XC364iAL30jGd /bEPKI+VK6xVZ+UKytIeZEfMPoy2+5x9l/Sl5CGaOwxKx7nHtFE04ODdo0UQc90QoTz1 1DnhbUZW90BGSfztIHONvNkurhmNT3gzPlCcF4Z72N3RhdLMyxk7UrG7YfpQGmd91XlZ 7ulIMGEFDHbFnZ0zQwQykAyrkEbijeUHqbMWUHaU6GJWJHBpRK3aKOh6OpHjl3fBdal3 +kwe5WAHJFjeriWcQZRHzFeJ6sWw+HgioE3zDvhwlj4uk1Dz/IWZxdKQHH24VwwooCsu ovAA== X-Gm-Message-State: APjAAAUy7QTC20baEYpdF3j3yvjerfDUzK+pmMzho4BUrdY3biYGQb4B /t0cPhERI/0+uTRCg9RG5OgDf62q+mVdejg5iRf1FKYpNz7/sGaPrr50sbup+67CVi4NoUnSRX+ +S2CguOyWkB4= X-Received: by 2002:adf:f7c3:: with SMTP id a3mr3588966wrq.141.1568735330130; Tue, 17 Sep 2019 08:48:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqxFPErxoTxXR+qAomigV0iGldT6ojTo6BWFqG1tgwujtiUQJ9Q7iLhojZsoQnyeK4HAhzWstA== X-Received: by 2002:adf:f7c3:: with SMTP id a3mr3588957wrq.141.1568735329921; Tue, 17 Sep 2019 08:48:49 -0700 (PDT) Received: from minerva.redhat.com ([90.168.169.92]) by smtp.gmail.com with ESMTPSA id s19sm3601601wrb.14.2019.09.17.08.48.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Sep 2019 08:48:49 -0700 (PDT) From: Javier Martinez Canillas To: grub-devel@gnu.org Cc: Peter Jones , Javier Martinez Canillas , Vladimir Serbinenko , Daniel Kiper Subject: [PATCH] Add GRUB_DISABLE_UUID. Date: Tue, 17 Sep 2019 17:48:45 +0200 Message-Id: <20190917154845.1937-1-javierm@redhat.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Sep 2019 15:48:56 -0000 From: Peter Jones This will cause "search --fs-uuid --set=3Droot ..." not to be generated b= y grub2-mkconfig, and instead simply attempt to use the grub device name as it understands it. Signed-off-by: Peter Jones Signed-off-by: Javier Martinez Canillas --- docs/grub.texi | 7 +++++++ util/grub-mkconfig.in | 22 +++++++++++++++++++--- util/grub-mkconfig_lib.in | 4 ++-- 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/docs/grub.texi b/docs/grub.texi index 3d50b16ba4c..132e56a7b44 100644 --- a/docs/grub.texi +++ b/docs/grub.texi @@ -1441,6 +1441,13 @@ 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. =20 +@item GRUB_DISABLE_UUID +Normally, @command{grub-mkconfig} will generate menu entries that use +universally-unique identifiers (UUIDs) to identify various filesystems t= o +search for files. This is usually more reliable, but in some cases it m= ay +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 index 523d4e029bb..9ecbcfb5b43 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in @@ -133,12 +133,12 @@ fi =20 # Device containing our userland. Typically used for root=3D parameter. GRUB_DEVICE=3D"`${grub_probe} --target=3Ddevice /`" -GRUB_DEVICE_UUID=3D"`${grub_probe} --device ${GRUB_DEVICE} --target=3Dfs= _uuid 2> /dev/null`" || true -GRUB_DEVICE_PARTUUID=3D"`${grub_probe} --device ${GRUB_DEVICE} --target=3D= partuuid 2> /dev/null`" || true +GRUB_DEVICE_UUID_GENERATED=3D"`${grub_probe} --device ${GRUB_DEVICE} --t= arget=3Dfs_uuid 2> /dev/null`" || true +GRUB_DEVICE_PARTUUID_GENERATED=3D"`${grub_probe} --device ${GRUB_DEVICE}= --target=3Dpartuuid 2> /dev/null`" || true =20 # Device containing our /boot partition. Usually the same as GRUB_DEVIC= E. GRUB_DEVICE_BOOT=3D"`${grub_probe} --target=3Ddevice /boot`" -GRUB_DEVICE_BOOT_UUID=3D"`${grub_probe} --device ${GRUB_DEVICE_BOOT} --t= arget=3Dfs_uuid 2> /dev/null`" || true +GRUB_DEVICE_BOOT_UUID_GENERATED=3D"`${grub_probe} --device ${GRUB_DEVICE= _BOOT} --target=3Dfs_uuid 2> /dev/null`" || true =20 # Filesystem for the device containing our userland. Used for stuff lik= e # choosing Hurd filesystem module. @@ -158,6 +158,21 @@ if test -f ${sysconfdir}/default/grub ; then . ${sysconfdir}/default/grub fi =20 +if [ "x$GRUB_DISABLE_UUID" !=3D "xtrue" ]; then + if [ -z "$GRUB_DEVICE_UUID" ]; then + GRUB_DEVICE_UUID=3D"$GRUB_DEVICE_UUID_GENERATED" + fi + if [ -z "$GRUB_DEVICE_BOOT_UUID" ]; then + GRUB_DEVICE_BOOT_UUID=3D"$GRUB_DEVICE_BOOT_UUID_GENERATED" + fi + if [ -z "$GRUB_DEVICE_UUID" ]; then + GRUB_DEVICE_UUID=3D"$GRUB_DEVICE_UUID_GENERATED" + fi + if [ -z "$GRUB_DEVICE_PART_UUID" ]; then + GRUB_DEVICE_PART_UUID=3D"$GRUB_DEVICE_PART_UUID_GENERATED" + fi +fi + # XXX: should this be deprecated at some point? if [ "x${GRUB_TERMINAL}" !=3D "x" ] ; then GRUB_TERMINAL_INPUT=3D"${GRUB_TERMINAL}" @@ -227,6 +242,7 @@ export GRUB_DEFAULT \ GRUB_DISABLE_LINUX_UUID \ GRUB_DISABLE_LINUX_PARTUUID \ 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 index 0f801cab3e4..1001a12232b 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" !=3D x ]; then echo "set root=3D'$fs_hint'" fi - if fs_uuid=3D"`"${grub_probe}" --device $@ --target=3Dfs_uuid 2> /dev/= null`" ; then + if [ "x$GRUB_DISABLE_UUID" !=3D "xtrue" ] && fs_uuid=3D"`"${grub_probe= }" --device $@ --target=3Dfs_uuid 2> /dev/null`" ; then hints=3D"`"${grub_probe}" --device $@ --target=3Dhints_string 2> /de= v/null`" || hints=3D echo "if [ x\$feature_platform_search_hint =3D xy ]; then" echo " search --no-floppy --fs-uuid --set=3Droot ${hints} ${fs_uuid= }" @@ -173,7 +173,7 @@ grub_get_device_id () IFS=3D' ' device=3D"$1" - if fs_uuid=3D"`"${grub_probe}" --device ${device} --target=3Dfs_uuid 2= > /dev/null`" ; then + if [ "x$GRUB_DISABLE_UUID" !=3D "xtrue" ] && fs_uuid=3D"`"${grub_probe= }" --device ${device} --target=3Dfs_uuid 2> /dev/null`" ; then echo "$fs_uuid"; else echo $device |sed 's, ,_,g' --=20 2.21.0