From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1aOpin-0000F9-OK for mharc-grub-devel@gnu.org; Thu, 28 Jan 2016 11:47:01 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38510) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOpil-0000Eo-Ni for grub-devel@gnu.org; Thu, 28 Jan 2016 11:47:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aOpig-0006oe-NS for grub-devel@gnu.org; Thu, 28 Jan 2016 11:46:59 -0500 Received: from mail-lb0-x242.google.com ([2a00:1450:4010:c04::242]:34912) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOpig-0006oa-DB for grub-devel@gnu.org; Thu, 28 Jan 2016 11:46:54 -0500 Received: by mail-lb0-x242.google.com with SMTP id dx9so2091632lbc.2 for ; Thu, 28 Jan 2016 08:46:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=bEj5C9327tsr895sDBRONOfhk7068OiUIltMReltHzs=; b=tsAot0sctM4eBSmNat4yjyHjSjBfi/qaR2z+Tia/cakL7ebCeJ8Qk5fGP6+WCKKXXW c3hAEAC2pFQo8CM7G8D53GppO502bVg9nz0S79iOt4+4GQsnnmKRFwTL21OlTl/QaYm6 3YR9GXnbdjy0NkcawqkpHY4HRBjous17mWYix26Gb273FBfxUwXWdV9Rcj9CDr/vUgaS TojXJCUZ8MGJxx3fQacUhq7izMufiUN5cH/vmgQCMc30uAexD1ojaXq4PSJoIQD97N1B dFnd9nWU48GfIGFD9KbkguvYhuvcsRYp73rzAJI1y2GnvstcNgzWN5q60Vv0iw0U8PLs /a9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=bEj5C9327tsr895sDBRONOfhk7068OiUIltMReltHzs=; b=WcJu/RWAFFzRQgEvsOmLVR4//hd6TGr7tj4VhmFKfYWe+sd+oQBUuSfPtBSRopOehE 3UKz0lO+c202ds43JDOR2696t+eIi5CIj0NStOFpjvZIBLG+qfNS6zLwPJBOkL/oF+hf NHzyWcUxNUYckf43DR4As8k/sEEfAVWVSCOTIAzA8LKT7sdWLBV6XtnSevVEBD9FC5SR 1Y5sW9HG5YgFBDKXRrZYVrtRFR96xeKeZ4feZMCG654S7SYb0VTPf/u4q/ARrg5V3t7D I1xMa6aJmUoHQatUm+iTsQ+GnSiwAq9F/ObIZKm1tSOy7pmfAmxV2qu6vz6WZ94Azi1i mSgA== X-Gm-Message-State: AG10YOSppzf8IhOBzNokzqYZt1j8wuoSdxS31Jq8p2nBL5yAf3AjuO/b/CNHYx0NVcVNzQ== X-Received: by 10.112.137.41 with SMTP id qf9mr1553771lbb.140.1453999613487; Thu, 28 Jan 2016 08:46:53 -0800 (PST) Received: from localhost.localdomain (ppp109-252-76-159.pppoe.spdop.ru. [109.252.76.159]) by smtp.gmail.com with ESMTPSA id v189sm1592572lfd.4.2016.01.28.08.46.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 28 Jan 2016 08:46:52 -0800 (PST) From: Andrei Borzenkov To: grub-devel@gnu.org Subject: [PATCH] 10_linux: avoid multi-device root= kernel argument Date: Thu, 28 Jan 2016 19:46:41 +0300 Message-Id: <1453999601-7706-1-git-send-email-arvidjaar@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c04::242 Cc: j.orti.alcaine@gmail.com, jamespharvey20@gmail.com 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: Thu, 28 Jan 2016 16:47:00 -0000 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)