From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1f1D4c-0003DJ-3h for mharc-grub-devel@gnu.org; Wed, 28 Mar 2018 11:33:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56605) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f1D4Z-0003Af-I8 for grub-devel@gnu.org; Wed, 28 Mar 2018 11:33:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f1D4Y-0007eS-Cr for grub-devel@gnu.org; Wed, 28 Mar 2018 11:33:11 -0400 Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]:36539) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f1D4Y-0007du-6i for grub-devel@gnu.org; Wed, 28 Mar 2018 11:33:10 -0400 Received: by mail-pf0-x244.google.com with SMTP id g14so1113272pfh.3 for ; Wed, 28 Mar 2018 08:33:10 -0700 (PDT) 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:in-reply-to :references; bh=+jzqlHocfv41Oc3DtElYf9hOoUaTldEgAQu+jXpTqIo=; b=rZVV+2VBN4EXbAy+Ic5mYjn7YeMSAXT8LxvGmOJuDzD09NBWBL1G2fhDgew2hzLK09 RLARwu350wWVnuDNxOYrRe2ersxoChYG4+974/Qt/Spp0nl5dc71+DoaDUgoQr+AMq1h BwKTx+iQzujhi4LLmaMqeBwgX7K0drv8feCfkWR5kcdOpP9X7R3+oWeYr+Fls3nKy1GW kFfNZBtTvc9piRURi48+q3XlhGwSG44CCZrIxAmdaaAVOzTqyIexrPgJVYAcrrzYUMmv 5qkTKjxYqkoOMQOWLJl+T/HlO68d3D090BhxvLDeRxpBj8ZYhwyKNmZdei65YQoehqa5 JINA== 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:in-reply-to:references; bh=+jzqlHocfv41Oc3DtElYf9hOoUaTldEgAQu+jXpTqIo=; b=CfkZ/X0r+yr0D+De4ovBMK/WlrbC0CFHrA7aFbhlyNiZONmfkP18pGluxDhQH46D/O XlFjShTjhh8YWj57Xg1udONvBbST2xhi2Ld2g0Yj4wQLUpqEvcqAjeKtnDIPNnjmRZeD cl3GRGV5nptsUV6raO6WGmf1HJqFgIi+mpVe5xaMp7iXKoQMFoUEMP/CDh+QiQjSro6K +BhbbCJ1w7/URbvpbrOsCkNjQ0SfU4CbooE3AyYkmW9gqB1MVQOFI3Se4OIQMvY7PZnt Ftw0XUWEGtOmW0ADvABHJMSPfZ9vjuz6uMNGDjuv2NXff0Y0hDPcL0KoOtZctWJlaMvr a7yQ== X-Gm-Message-State: AElRT7GsQ98Y7600NrzGXKHcq9Db8F5dm5O4QDEN2B2PGFL2XlnUxUj6 PFQ7QqOrSYV9q3c4xcv/yGbWrg== X-Google-Smtp-Source: AIpwx49YGCtBVmxt69DsCU1UDnwg6A3bne+9tokO12qMzLCZjZQF0oKDR/ORtwjZyTFCC9pZ1xa8/A== X-Received: by 10.99.147.82 with SMTP id w18mr2840405pgm.181.1522251188757; Wed, 28 Mar 2018 08:33:08 -0700 (PDT) Received: from localhost.localdomain ([2601:602:9c01:e86a:2ec2:3a19:cd81:76ab]) by smtp.googlemail.com with ESMTPSA id m185sm3887624pfc.88.2018.03.28.08.33.07 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Mar 2018 08:33:07 -0700 (PDT) From: Nicholas Vinson To: grub-devel@gnu.org Subject: [GRUB PARTUUID PATCH V8 4/4] Update grub script template files Date: Wed, 28 Mar 2018 08:32:54 -0700 Message-Id: X-Mailer: git-send-email 2.16.3 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::244 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: Wed, 28 Mar 2018 15:33:12 -0000 Update grub-mkconfig.in and 10_linux.in to support grub-probe's new partuuid target. Update grub.texi documenation. Signed-off-by: Nicholas Vinson --- 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 65b4bbeda..019ce5d03 100644 --- a/docs/grub.texi +++ b/docs/grub.texi @@ -1424,6 +1424,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 inappropriate. However, +this option is only supported in Linux kernel versions 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 35ef583b0..9a1f92bdf 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`" @@ -188,6 +189,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 \ @@ -223,6 +225,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 faedf74e1..53de33bea 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.16.3