From: Andrei Borzenkov <arvidjaar@gmail.com>
To: grub-devel@gnu.org
Cc: j.orti.alcaine@gmail.com, jamespharvey20@gmail.com
Subject: [PATCH] 10_linux: avoid multi-device root= kernel argument
Date: Thu, 28 Jan 2016 19:46:41 +0300 [thread overview]
Message-ID: <1453999601-7706-1-git-send-email-arvidjaar@gmail.com> (raw)
In-Reply-To: <CAC+fKQW3LZDiuuEiGqWzK8Zkk=eRvJNs02LmEC9Y8v_M8OGrbQ@mail.gmail.com>
If root filesystem is multidev btrfs, do not attempt to pass all devices as
kernel root= argument. This results in splitting command line in GRUB due to
embedded newline and even if we managed to quote it, kernel does not know how
to interpret it anyway. Multidev btrfs requires user space device scanning,
so passing single device would not work too.
This still respects user settings GRUB_DISABLE_LINUX_UUID. Not sure what we
should do in this case.
Closes: 45709
---
util/grub.d/10_linux.in | 4 +++-
util/grub.d/20_linux_xen.in | 4 +++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
index 859b608..5a78513 100644
--- a/util/grub.d/10_linux.in
+++ b/util/grub.d/10_linux.in
@@ -43,9 +43,11 @@ case ${GRUB_DEVICE} in
;;
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}" \
- || uses_abstraction "${GRUB_DEVICE}" lvm; then
+ || test -e "${GRUB_DEVICE}" && uses_abstraction "${GRUB_DEVICE}" lvm; then
LINUX_ROOT_DEVICE=${GRUB_DEVICE}
else
LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}
diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in
index f532fb9..46045db 100644
--- a/util/grub.d/20_linux_xen.in
+++ b/util/grub.d/20_linux_xen.in
@@ -43,9 +43,11 @@ case ${GRUB_DEVICE} in
;;
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}" \
- || uses_abstraction "${GRUB_DEVICE}" lvm; then
+ || test -e "${GRUB_DEVICE}" && uses_abstraction "${GRUB_DEVICE}" lvm; then
LINUX_ROOT_DEVICE=${GRUB_DEVICE}
else
LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}
--
tg: (ff84a9b..) u/btrfs-multidev (depends on: master)
next parent reply other threads:[~2016-01-28 16:47 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAC+fKQW3LZDiuuEiGqWzK8Zkk=eRvJNs02LmEC9Y8v_M8OGrbQ@mail.gmail.com>
2016-01-28 16:46 ` Andrei Borzenkov [this message]
2016-01-29 3:17 ` [PATCH] 10_linux: avoid multi-device root= kernel argument Michael Chang
2016-01-29 8:54 ` Olaf Hering
2016-01-29 8:57 ` Andrei Borzenkov
2016-01-29 16:23 ` Olaf Hering
2016-01-29 17:36 ` Andrei Borzenkov
2016-01-31 21:17 ` Juan Orti Alcaine
2016-02-01 17:16 ` Andrei Borzenkov
2016-01-02 12:30 Andrei Borzenkov
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=1453999601-7706-1-git-send-email-arvidjaar@gmail.com \
--to=arvidjaar@gmail.com \
--cc=grub-devel@gnu.org \
--cc=j.orti.alcaine@gmail.com \
--cc=jamespharvey20@gmail.com \
/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).