Received: from list by lists.gnu.org with archive (Exim 4.71) id 1ci93u-0005tr-Lt for mharc-grub-devel@gnu.org; Sun, 26 Feb 2017 19:21:10 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48501) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ci93q-0005sT-OM for grub-devel@gnu.org; Sun, 26 Feb 2017 19:21:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ci93p-0007uV-Li for grub-devel@gnu.org; Sun, 26 Feb 2017 19:21:06 -0500 Received: from mail-pf0-x241.google.com ([2607:f8b0:400e:c00::241]:33068) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ci93p-0007sy-Do for grub-devel@gnu.org; Sun, 26 Feb 2017 19:21:05 -0500 Received: by mail-pf0-x241.google.com with SMTP id p185so3205779pfb.0 for ; Sun, 26 Feb 2017 16:21: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=PKSlQ12nUdX2dNXwljq9+vtk7gvn2TzF8BbSld5e2bQ=; b=S3f8KcGJOlbXorFhfqYuo1mNLR9BmP17UFhN56q88LxSE/XETVPboIrES8QIumGbez gV478ArXW0z8MPPT/rJ16b/JyuehbgHDb4E572EhMMiprqXoI4NQMWQo4lyHUN9/KuZZ dg8ipO2wKGXUqQUvGamr77fdHvlgPt54k3WMXefzwEQwURyuiGazH4vYyVUKfn6YVgtF wCvc00SIETtrvHvrOuYPhhGwp7WcbcWvZXkGgS6cREaGvOpB19359Gqbv0KKtxdeNI83 Z/+bTXSpX75BJzenuYm6CNtZZhDy26MJiaTxbOXVei16ELL4lSDu1XEtr/uPPeTiPORt S8Qg== 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=PKSlQ12nUdX2dNXwljq9+vtk7gvn2TzF8BbSld5e2bQ=; b=Jk/VV9eZ7wiqGrLFP1pHlor9OPVfs7S1Z2KqV8DbjwjM4JnSsts2OBGauotlT8jSvB Ag0CKKDEvMFJ+dowmCBkPwmAUrZZFBod7aKsl1rGpXwNJm9oLhvRENc1fjC1yZ/+OQgD anK4o97OYvog+E1CmWgITXAzxw2xsjrImSxKcY3lbYnhS1/XKbmnBlIz3O9IVIoxPwGm 5+hx7Og3RbmZPdsyjHrRiPtBoYR30vDD+wc4vGws5Wy3ZnqKH8W2LNFugp36/bGW+Cqw wcQ3gFyDUu/Z+b3rqf07afPoIJJ1tTtDQFiDxzE/VvHLHX9QGCNTdVEZiQBns6rvQ2dP KfVA== X-Gm-Message-State: AMke39nnej7oDWeJcnXZjtlNDFQb4mb/rQJvmjA58D46PJFZ5aEFieOCA148zX2hy3LD6g== X-Received: by 10.98.51.70 with SMTP id z67mr17358235pfz.68.1488154864432; Sun, 26 Feb 2017 16:21:04 -0800 (PST) Received: from localhost.localdomain ([2601:602:9c01:e86a:1fb0:47b:8245:c067]) by smtp.googlemail.com with ESMTPSA id u82sm26523453pfd.7.2017.02.26.16.21.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 26 Feb 2017 16:21:03 -0800 (PST) From: Nicholas Vinson To: skenton@ou.edu, grub-devel@gnu.org Subject: [GRUB PARTUUID PATCH V3 3/5] Update grub script template files Date: Sun, 26 Feb 2017 16:20:53 -0800 Message-Id: <20170227002055.5829-4-nvinson234@gmail.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170227002055.5829-1-nvinson234@gmail.com> References: <20170227002055.5829-1-nvinson234@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c00::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: Mon, 27 Feb 2017 00:21:10 -0000 Update grub-mkconfig.in and 10_linux.in to support grub-probe's new partuuid target. Update grub.texi documenation. --- docs/grub.texi | 13 +++++++++++++ util/grub-mkconfig.in | 3 +++ util/grub.d/10_linux.in | 13 +++++++++++-- 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/docs/grub.texi b/docs/grub.texi index e935af33e..289b202df 100644 --- a/docs/grub.texi +++ b/docs/grub.texi @@ -1405,6 +1405,19 @@ 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 +Normally, when @command{grub-mkconfig} sets the @samp{root=UUID=...} kernel +parameter, it selects a filesystem UUID. This works well for Linux systems that +boot using an initramfs as most implementations support mounting the root +filesystem this way. However for Linux systems that do not boot using an +initramfs, @command{grub-mkconfig} defaults to setting the @samp{root=...} +kernel parameter to the device name containing the root filesystem. 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. In order to use the @samp{root=PARTUUID=...} kernel parameter, the Linux +kernel version must be at least 2.6.37 (3.10 for systems using the MSDOS +partition scheme). + @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..71675fac6 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -220,8 +220,17 @@ while [ "x$list" != "x" ] ; do gettext_printf "Found initrd image: %s\n" "${dirname}/${initrd}" >&2 elif test -z "${initramfs}" ; then # "UUID=" and "ZFS=" magic is parsed by initrd or initramfs. Since there's - # no initrd or builtin initramfs, it can't work here. - linux_root_device_thisversion=${GRUB_DEVICE} + # no initrd or builtin initramfs, it can't work here. However, if + # GRUB_DEVICE_PARTUUID is not empty we can use that here if + # GRUD_DISABLE_LINUX_UUID is not set to true and GRUB_ENABLE_LINUX_PARTUUID + # is set to true. + if [ "x${GRUB_DISABLE_LINUX_UUID}" != "xtrue" ] \ + && [ "x${GRUB_DEVICE_PARTUUID}" != "x" ] \ + && [ "x${GRUB_ENABLE_LINUX_PARTUUID}" = "xtrue" ] ; then + linux_root_device_thisversion="PARTUUID=${GRUB_DEVICE_PARTUUID}" + else + linux_root_device_thisversion=${GRUB_DEVICE} + fi fi if [ "x$is_top_level" = xtrue ] && [ "x${GRUB_DISABLE_SUBMENU}" != xy ]; then -- 2.12.0