From: Nicholas Vinson <nvinson234@gmail.com>
To: grub-devel@gnu.org
Cc: Nicholas Vinson <nvinson234@gmail.com>
Subject: [GRUB PARTUUID PATCH V2 2/2] Update grub script template files
Date: Sat, 6 Aug 2016 18:56:32 -0700 [thread overview]
Message-ID: <20160807015632.32562-3-nvinson234@gmail.com> (raw)
In-Reply-To: <20160807015632.32562-1-nvinson234@gmail.com>
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 <nvinson234@gmail.com>
---
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 82f6fa4..1f312c6 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 f8496d2..30ead59 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 de9044c..71675fa 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.9.2
prev parent reply other threads:[~2016-08-07 1:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-07 1:56 [GRUB PARTUUID PATCH V2 0/2] Add PARTUUID detection support Nicholas Vinson
2016-08-07 1:56 ` [GRUB PARTUUID PATCH V2 1/2] Add PARTUUID detection support to grub-probe Nicholas Vinson
2016-08-07 1:56 ` Nicholas Vinson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160807015632.32562-3-nvinson234@gmail.com \
--to=nvinson234@gmail.com \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).