btrfs: add hostonly check
parent
6baa63110e
commit
dcdca91d91
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue