Sophie

Sophie

distrib > Fedora > 13 > i386 > media > updates-src > by-pkgid > 2565d442133d17866d7a0458852920c6 > files > 93

dracut-005-5.fc13.src.rpm

From 2fa1c599e40a6044055f08031b09a30295643125 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 21 Jul 2010 14:25:42 +0200
Subject: [PATCH 093/133] btrfs: add hostonly check

---
 modules.d/90btrfs/check |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/modules.d/90btrfs/check b/modules.d/90btrfs/check
index 532e2ef..99aa712 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
-- 
1.7.3