Received: from list by lists.gnu.org with archive (Exim 4.71) id 1aFLKT-0004Ph-1z for mharc-grub-devel@gnu.org; Sat, 02 Jan 2016 07:30:41 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50831) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aFLKO-0004NZ-ME for grub-devel@gnu.org; Sat, 02 Jan 2016 07:30:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aFLKK-0001Ul-IS for grub-devel@gnu.org; Sat, 02 Jan 2016 07:30:36 -0500 Received: from mail-lf0-x22c.google.com ([2a00:1450:4010:c07::22c]:33744) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aFLKK-0001U8-BL for grub-devel@gnu.org; Sat, 02 Jan 2016 07:30:32 -0500 Received: by mail-lf0-x22c.google.com with SMTP id p203so257829280lfa.0 for ; Sat, 02 Jan 2016 04:30:32 -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; bh=PNghSjfrMpvACOrP505HXgIBiuNYyRSNVR83PnERkyA=; b=r7UqJy7ALZjFoiHk2e8q9HNOk2n/bsovyr9O34w4ntc/nwGZCEBjExotU+J5m1MjA6 43WJtWaxwuoe534Pfl0G6G68hUTUnv9b6ZpB6YTX/f4uWCywdxKG/RY9HtYXM/GSMfKG K46MJIQ/SccL+Nit3O0m15885ZYhQVmbXBkAtibKl5j/F5zZWpge/QxgaMhEJmraV42x U/JUOrldIVYAyfQqdublMlZm4SRiHVbV5yt3JTWRocLmFuMMF40KQJ39CaBYf4Rx/4NE ut/XctJ7nQKYOB0/qRXx7OM4h1PToG6/d9qDsdCv3v11ykgS4+G1e5XaXcH3VWzphU0u lX1g== X-Received: by 10.25.23.86 with SMTP id n83mr6220042lfi.66.1451737831270; Sat, 02 Jan 2016 04:30:31 -0800 (PST) Received: from localhost.localdomain (ppp91-76-25-247.pppoe.mtu-net.ru. [91.76.25.247]) by smtp.gmail.com with ESMTPSA id eb3sm8369923lbc.31.2016.01.02.04.30.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 02 Jan 2016 04:30:30 -0800 (PST) From: Andrei Borzenkov To: grub-devel@gnu.org Subject: [PATCH] 10_linux: avoid multi-device root= kernel argument Date: Sat, 2 Jan 2016 15:30:18 +0300 Message-Id: <1451737818-17806-1-git-send-email-arvidjaar@gmail.com> X-Mailer: git-send-email 1.9.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c07::22c Cc: 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: Sat, 02 Jan 2016 12:30:39 -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. 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)