Received: from list by lists.gnu.org with archive (Exim 4.71) id 1aOzZV-0000qp-Px for mharc-grub-devel@gnu.org; Thu, 28 Jan 2016 22:18:05 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48236) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOzZS-0000h9-Vw for grub-devel@gnu.org; Thu, 28 Jan 2016 22:18:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aOzZP-0007ka-PL for grub-devel@gnu.org; Thu, 28 Jan 2016 22:18:02 -0500 Received: from victor.provo.novell.com ([137.65.250.26]:34488 helo=prv3-mh.provo.novell.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOzZP-0007jr-GK for grub-devel@gnu.org; Thu, 28 Jan 2016 22:17:59 -0500 Received: from leap-t5810.suse (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) by prv3-mh.provo.novell.com with ESMTP (TLS encrypted); Thu, 28 Jan 2016 20:17:47 -0700 Date: Fri, 29 Jan 2016 11:17:42 +0800 From: Michael Chang To: grub-devel@gnu.org Subject: Re: [PATCH] 10_linux: avoid multi-device root= kernel argument Message-ID: <20160129031742.GA24181@leap-t5810.suse> Mail-Followup-To: grub-devel@gnu.org References: <1453999601-7706-1-git-send-email-arvidjaar@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1453999601-7706-1-git-send-email-arvidjaar@gmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 137.65.250.26 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jan 2016 03:18:04 -0000 On Thu, Jan 28, 2016 at 07:46:41PM +0300, Andrei Borzenkov wrote: > 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 JFYI, this patch also has verified to solve a reported installation problem in Btrfs RAID 0 configuration in SUSE Linux. It would be great to have this patch included in upstream. Thanks, Michael > > --- > 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) > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel