-v|--verbose) set -x;;
-c|--conf) conffile="$2"; shift;;
-l|--local) allowlocal="yes" ;;
+ -h|--hostonly) hostonly="-h" ;;
--skip-missing) skipmissing="yes" ;;
*) break ;;
esac
[[ $allowlocal && -f dracut-functions ]] && dsrc="." || dsrc=/usr/lib/dracut
. $dsrc/dracut-functions
+dracutfunctions=$dsrc/dracut-functions
+export dracutfunctions
[[ $dracutmodules ]] || dracutmodules="auto"
[[ $dracutmodules = "auto" ]] && {
skipmissing="yes"
}
+[[ $dracutmodules = "hostonly" ]] && {
+ dracutmodules="all"
+ skipmissing="yes"
+ hostonly="-h"
+}
[[ $2 ]] && kernel=$2 || kernel=$(uname -r)
[[ $1 ]] && outfile=$(readlink -f $1) || outfile="/boot/initrd-$kernel.img"
esac
[[ $skipmissing ]] && [[ -x $1/check ]] && {
- return $("$1/check" >/dev/null 2>&1);
+ return $("$1/check" $hostonly >/dev/null 2>&1;)
}
[[ $skipmissing ]] || return 1
#!/bin/sh
-grep -q '^dm_crypt' /proc/modules || exit 1
-awk '/^dm_crypt/ {if ($3 > 0) exit 0; else exit 1;}' /proc/modules
\ No newline at end of file
+
+[[ $dracutfunctions ]] && . $dracutfunctions
+
+find_binary cryptsetup || exit 1
+
+if [ "$1" = "-h" ]; then
+ blkid | grep -q crypt_LUKS || exit 1
+fi
+
+exit 0
#!/bin/sh
-grep -q '^dm_mod' /proc/modules || exit 1
-awk '/^dm_mod/ {if ($3 > 0) exit 0; else exit 1;}' /proc/modules
\ No newline at end of file
+
+[[ $dracutfunctions ]] && . $dracutfunctions
+
+dmraid=$(find_binary dmraid) || exit 1
+
+if [ "$1" = "-h" ]; then
+ $dmraid -r | grep -q ok || exit 1
+fi
+
+exit 0
\ No newline at end of file
#!/bin/sh
-exit 1
+[ "$1" != "-h" ] && exit 1
--- /dev/null
+#!/bin/sh
+
+[[ $dracutfunctions ]] && . $dracutfunctions
+
+find_binary lvm || exit 1
+
+if [ "$1" = "-h" ]; then
+ blkid | grep -q lvm2pv || exit 1
+fi
+
+exit 0
--- /dev/null
+#!/bin/sh
+
+[[ $dracutfunctions ]] && . $dracutfunctions
+
+find_binary mdadm || exit 1
+
+if [ "$1" = "-h" ]; then
+ blkid | grep -q linux_raid || exit 1
+fi
+
+exit 0
#!/bin/sh
-exit 1
+[ -f /etc/lsb-release ] && \
+grep -q 'DISTRIB_DESCRIPTION="Ubuntu 8.10"' /etc/lsb-release
\ No newline at end of file