From: Harald Hoyer Date: Wed, 20 Mar 2013 09:22:41 +0000 (+0100) Subject: dracut.sh: turn off host-only mode, if essential system filesystems not mounted X-Git-Tag: 027~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5bfa3b363a35fb5586f015701832eab5544385bf;p=thirdparty%2Fdracut.git dracut.sh: turn off host-only mode, if essential system filesystems not mounted --- diff --git a/dracut.sh b/dracut.sh index 772871277..9afa69416 100755 --- a/dracut.sh +++ b/dracut.sh @@ -781,6 +781,15 @@ fi # Need to be able to have non-root users read stuff (rpcbind etc) chmod 755 "$initdir" +if [[ $hostonly ]]; then + for i in /sys /proc /run /dev; do + if ! findmnt "$i" &>/dev/null; then + dwarning "Turning off host-only mode: '$i' is not mounted!" + unset hostonly + fi + done +fi + declare -A host_fs_types for line in "${fstab_lines[@]}"; do