grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] 10_linux: avoid multi-device root= kernel argument


From: Andrei Borzenkov
Subject: [PATCH] 10_linux: avoid multi-device root= kernel argument
Date: Sat, 2 Jan 2016 15:30:18 +0300

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. Multidev btrfs requires user space device scanning,
so passing single device makes no sense as well.

It means we may end up without any root= argument if either UUIDs are
not available or user explicitly disabled them.

Closes: 45709

---
 util/grub.d/10_linux.in     | 7 ++++++-
 util/grub.d/20_linux_xen.in | 7 ++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
index 859b608..a3a4624 100644
--- a/util/grub.d/10_linux.in
+++ b/util/grub.d/10_linux.in
@@ -43,10 +43,15 @@ 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 leave root= empty in 
this case.
+# We hope that whatever initramfs is used knows how to mount root.
 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
-  LINUX_ROOT_DEVICE=${GRUB_DEVICE}
+  if test -e "${GRUB_DEVICE}" ; then
+    LINUX_ROOT_DEVICE=${GRUB_DEVICE}
+  fi
 else
   LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}
 fi
diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in
index f532fb9..761d289 100644
--- a/util/grub.d/20_linux_xen.in
+++ b/util/grub.d/20_linux_xen.in
@@ -43,10 +43,15 @@ 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 leave root= empty in 
this case.
+# We hope that whatever initramfs is used knows how to mount root.
 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
-  LINUX_ROOT_DEVICE=${GRUB_DEVICE}
+  if test -e "${GRUB_DEVICE}" ; then
+    LINUX_ROOT_DEVICE=${GRUB_DEVICE}
+  fi
 else
   LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}
 fi
-- 
tg: (ba83ed1..) u/btrfs-multidev (depends on: master)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]