From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 96E1B1388C0 for ; Mon, 29 Feb 2016 21:48:47 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9DD58E0839; Mon, 29 Feb 2016 21:48:45 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 243F3E0839 for ; Mon, 29 Feb 2016 21:48:45 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id F3A1E340A38 for ; Mon, 29 Feb 2016 21:48:43 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 0FFCC2C9 for ; Mon, 29 Feb 2016 21:48:40 +0000 (UTC) From: "Robin H. Johnson" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Robin H. Johnson" Message-ID: <1456778056.c37d0daba2f264c72a945dcebd08e9a42d8649f7.robbat2@gentoo> Subject: [gentoo-commits] proj/genkernel:master commit in: / X-VCS-Repository: proj/genkernel X-VCS-Files: gen_cmdline.sh gen_funcs.sh X-VCS-Directories: / X-VCS-Committer: robbat2 X-VCS-Committer-Name: Robin H. Johnson X-VCS-Revision: c37d0daba2f264c72a945dcebd08e9a42d8649f7 X-VCS-Branch: master Date: Mon, 29 Feb 2016 21:48:40 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 4bdca7e4-d11e-4124-9736-15e07a46c902 X-Archives-Hash: c38360940979a4e379e3b40f86b31868 commit: c37d0daba2f264c72a945dcebd08e9a42d8649f7 Author: Robin H. Johnson gentoo org> AuthorDate: Mon Feb 29 20:34:09 2016 +0000 Commit: Robin H. Johnson gentoo org> CommitDate: Mon Feb 29 20:34:16 2016 +0000 URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=c37d0dab fix rootfs detection per bug #552052 ZFS and btrfs tools if not explictly configured (either way), default to detecting the fstype of the rootfs. The old rootfs detection method was NOT reliable in all cases; so replace it with a different way. Future improvements should check for rootfs AND the local existence of the required binaries (and bail out early if the the rootrfs was detected but the binaries are not present). Signed-off-by: Robin H. Johnson gentoo.org> gen_cmdline.sh | 4 ++-- gen_funcs.sh | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/gen_cmdline.sh b/gen_cmdline.sh index 01adfdd..e9e7401 100755 --- a/gen_cmdline.sh +++ b/gen_cmdline.sh @@ -100,9 +100,9 @@ longusage() { echo " --no-dmraid Exclude DMRAID support" echo " --e2fsprogs Include e2fsprogs" echo " --no-e2fsprogs Exclude e2fsprogs" - echo " --zfs Include ZFS support" + echo " --zfs Include ZFS support (enabled by default if rootfs is zfs)" echo " --no-zfs Exclude ZFS support" - echo " --btrfs Include Btrfs support" + echo " --btrfs Include Btrfs support (enabled by default if rootfs is btrfs)" echo " --no-btrfs Exclude Btrfs support" echo " --multipath Include Multipath support" echo " --no-multipath Exclude Multipath support" diff --git a/gen_funcs.sh b/gen_funcs.sh index 37942ad..eb807ad 100755 --- a/gen_funcs.sh +++ b/gen_funcs.sh @@ -498,7 +498,9 @@ set_config_with_override() { rootfs_type_is() { local fstype=$1 - if $(df -t ${fstype} / 2>/dev/null 1>/dev/null) + # It is possible that the awk will return MULTIPLE lines, depending on your + # initramfs setup (one of the entries will be 'rootfs'). + if awk '($2=="/"){print $3}' /proc/mounts | grep -sq --line-regexp "$fstype" ; then echo yes else