]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
bcache: newer util-linux supports bcache with blkid
authorHarald Hoyer <harald@redhat.com>
Mon, 9 Sep 2013 14:51:44 +0000 (16:51 +0200)
committerHarald Hoyer <harald@redhat.com>
Mon, 9 Sep 2013 14:51:44 +0000 (16:51 +0200)
and probe-bcache should not be needed in that case

modules.d/90bcache/module-setup.sh

index 3bb03f4e84d9993c245f42938a0986c9235f23d6..b02b8b4e2cf0f4abc3bcb3bb08e1a11322279de6 100755 (executable)
@@ -3,7 +3,10 @@
 # ex: ts=8 sw=4 sts=4 et filetype=sh
 
 check() {
-    type -P probe-bcache >/dev/null || return 1
+    if ! blkid -k | { while read line; do [[ $line == bcache ]] && exit 0; done; exit 1; } \
+        && ! type -P probe-bcache >/dev/null; then
+        return 1
+    fi
 
     [[ $hostonly ]] || [[ $mount_needs ]] && {
         for fs in "${host_fs_types[@]}"; do
@@ -24,7 +27,7 @@ installkernel() {
 }
 
 install() {
-    inst_multiple probe-bcache ${udevdir}/bcache-register
+    blkid -k | { while read line; do [[ $line == bcache ]] && exit 0; done; exit 1; } || inst_multiple probe-bcache
+    inst_multiple ${udevdir}/bcache-register
     inst_rules 61-bcache.rules
 }
-