From: Harald Hoyer Date: Wed, 21 Jul 2010 12:25:42 +0000 (+0200) Subject: btrfs: add hostonly check X-Git-Tag: 007~66 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=dcdca91d9169b00d3a55af0c20bccc9747969d1f;p=thirdparty%2Fdracut.git btrfs: add hostonly check --- diff --git a/modules.d/90btrfs/check b/modules.d/90btrfs/check index 532e2ef4d..99aa71254 100755 --- a/modules.d/90btrfs/check +++ b/modules.d/90btrfs/check @@ -1,10 +1,22 @@ #!/bin/bash # We depend on udev-rules being loaded -[ "$1" = "-d" ] && exit 0 +[[ "$1" = "-d" ]] && exit 0 # if we don't have btrfs (btrfsctl) installed on the host system, # no point in trying to support it in the initramfs. which btrfsctl >/dev/null 2>&1 || exit 1 +. $dracutfunctions +[[ $debug ]] && set -x + +is_btrfs() { get_fs_type /dev/block/$1 |grep -q btrfs; } + +if [[ "$1" = "-h" ]]; then + rootdev=$(find_root_block_device) + if [[ $rootdev ]]; then + is_btrfs "$rootdev" || exit 1 + fi +fi + exit 0