From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1eiQGo-0007jt-AA for mharc-grub-devel@gnu.org; Sun, 04 Feb 2018 14:48:10 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46995) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eiQGk-0007gt-Rz for grub-devel@gnu.org; Sun, 04 Feb 2018 14:48:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eiQGj-0001Cx-Qv for grub-devel@gnu.org; Sun, 04 Feb 2018 14:48:06 -0500 Received: from mail-pl0-x241.google.com ([2607:f8b0:400e:c01::241]:42533) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eiQGj-0001Bv-Ko for grub-devel@gnu.org; Sun, 04 Feb 2018 14:48:05 -0500 Received: by mail-pl0-x241.google.com with SMTP id 11so10337792plc.9 for ; Sun, 04 Feb 2018 11:48:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=7NIgOk2ikENUcV7PL2yC/J2Y0F1+qH4gDbnqDwhx5ug=; b=nli7wfMu17X9B6N9EQ2CI/4UfE17ly/ZaOUUa/t10X76NwP4wZnBZCxbtkl+1uLDyc hVD959JqxpegKNgNl8LH3VpGneyyrIUYqIN4xEQMcTRbltVzRX9bNUXAUhoulZFJiKgl Q7k6tFI/I/Byowv/WZ/ve9FFY+Gml0TYRV40AvskzGUMByhcavs+hLJroyXwDOJ12/ur 2aY7lLZpdwHFx4K9DiDy5D+rSwv7k6GAWj4p/E92fOrRMZCiVPlkafMbl6UWlbpv2/SP dHpy7b4u2+tVrolqW86E+o0j1NtaUlKBSdf12P1o9i78LmcExh4G5R3aaJ+c8vDksdHZ iiww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=7NIgOk2ikENUcV7PL2yC/J2Y0F1+qH4gDbnqDwhx5ug=; b=g8jmyM4hvgJxczRRjmEldiGRBkgOzqOPZuvnelfLHLO3mzQo5IGGw48O60uxJ/iNTL h56VvmIG0HVaJ0tXu62I4JgJW8RaNA4nJ5o5DVIIrQmwOo6Pl4jcbUgWcX8fCaFDjpSl CHehWZORmMYrBjuL+KW4nqIfQmG6BlbyJkzzUwoVRLp0UTZMOiyOLaWwAd3OGlDvIjg+ h1SOWIiRtsn8wcoBDTncisKuzJdgPdNGARhDenLkW/6+x3NbKZLvEg5qjz8005GvVpQ2 yvl2IuNIbxrOuLdZjnSLlVAErP/h3e/ncDarPHRhOEVxWK3LV+ew8VzRUaWff1mjQl+b 3L9g== X-Gm-Message-State: AKwxytfE2KsJMh17N6ydIWs6SUEtBKG0UzxzG5wECd35tcdWL04P3nnT RP3ubZijzSr+6mXRWgOJQzSyDw== X-Google-Smtp-Source: AH8x226a9HnW7hLdownk7MpG3ZwGo88HxwJttQR9hdd/LEwqT2AnpHgYO++bwyChcRAf3Qn9ZaG0RA== X-Received: by 2002:a17:902:128c:: with SMTP id g12-v6mr12465959pla.417.1517773684311; Sun, 04 Feb 2018 11:48:04 -0800 (PST) Received: from localhost.localdomain ([2601:602:9c01:e86a:2ec2:3a19:cd81:76ab]) by smtp.googlemail.com with ESMTPSA id v20sm13565736pfe.176.2018.02.04.11.48.02 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 04 Feb 2018 11:48:03 -0800 (PST) From: Nicholas Vinson To: grub-devel@gnu.org Subject: [GRUB PARTUUID PATCH V5 3/3] Update grub script template files Date: Sun, 4 Feb 2018 11:47:37 -0800 Message-Id: <20180204194737.22662-4-nvinson234@gmail.com> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180204194737.22662-1-nvinson234@gmail.com> References: <20180204194737.22662-1-nvinson234@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c01::241 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Feb 2018 19:48:08 -0000 Update grub-mkconfig.in and 10_linux.in to support grub-probe's new partuuid target. Update grub.texi documenation. --- docs/grub.texi | 9 +++++++++ util/grub-mkconfig.in | 3 +++ util/grub.d/10_linux.in | 12 +++++++++--- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/docs/grub.texi b/docs/grub.texi index 137b894fa..cb6e62a93 100644 --- a/docs/grub.texi +++ b/docs/grub.texi @@ -1405,6 +1405,15 @@ the Linux kernel, using a @samp{root=UUID=...} kernel parameter. This is usually more reliable, but in some cases it may not be appropriate. To disable the use of UUIDs, set this option to @samp{true}. +@item GRUB_ENABLE_LINUX_PARTUUID +Setting this option to @samp{true} changes the behavior of +@command{grub-mkconfig} so that it identifies the device containing the root +filesystem by the partition UUID via the @samp{root=PARTUUID=...} kernel +parameter. This is desirable for Linux systems where identifying the root +filesystem by its filesystem UUID or device name is imappropriate. However, +this option is only supported in Linux kernel versions least 2.6.37 (3.10 for +systems using the MSDOS partition scheme) or newer. + @item GRUB_DISABLE_RECOVERY If this option is set to @samp{true}, disable the generation of recovery mode menu entries. diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in index f8496d28b..30ead59e1 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in @@ -134,6 +134,7 @@ fi # 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 +GRUB_DEVICE_PARTUUID="`${grub_probe} --device ${GRUB_DEVICE} --target=partuuid 2> /dev/null`" || true # Device containing our /boot partition. Usually the same as GRUB_DEVICE. GRUB_DEVICE_BOOT="`${grub_probe} --target=device /boot`" @@ -182,6 +183,7 @@ if [ "x${GRUB_ACTUAL_DEFAULT}" = "xsaved" ] ; then GRUB_ACTUAL_DEFAULT="`"${grub # override them. export GRUB_DEVICE \ GRUB_DEVICE_UUID \ + GRUB_DEVICE_PARTUUID \ GRUB_DEVICE_BOOT \ GRUB_DEVICE_BOOT_UUID \ GRUB_FS \ @@ -215,6 +217,7 @@ export GRUB_DEFAULT \ GRUB_TERMINAL_OUTPUT \ GRUB_SERIAL_COMMAND \ GRUB_DISABLE_LINUX_UUID \ + GRUB_ENABLE_LINUX_PARTUUID \ GRUB_DISABLE_RECOVERY \ GRUB_VIDEO_BACKEND \ GRUB_GFXMODE \ diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in index de9044c7f..d4ee4ac69 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -45,12 +45,18 @@ esac # btrfs may reside on multiple devices. We cannot pass them as value of root= parameter # and mounting btrfs requires user space scanning, so force UUID in this case. -if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \ - || ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \ +if [ "x${GRUB_DEVICE_UUID}" = "x" ] && [ "x${GRUB_DEVICE_PARTUUID}" = "x" ] \ + || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \ + || ( ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \ + && ! test -e "/dev/disk/by-partuuid/${GRUB_DEVICE_PARTUUID}" ) \ || ( test -e "${GRUB_DEVICE}" && uses_abstraction "${GRUB_DEVICE}" lvm ); then LINUX_ROOT_DEVICE=${GRUB_DEVICE} -else +elif [ "x${GRUB_ENABLE_LINUX_PARTUUID}" != "xtrue" ] \ + || [ "x${GRUB_DEVICE_PARTUUID}" = "x" ] \ + || ! test -e "/dev/disk/by-partuuid/${GRUB_DEVICE_PARTUUID}"; then LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID} +else + LINUX_ROOT_DEVICE=PARTUUID=${GRUB_DEVICE_PARTUUID} fi case x"$GRUB_FS" in -- 2.15.1