summaryrefslogtreecommitdiff
path: root/dracut.sh
diff options
context:
space:
mode:
authorHarald Hoyer <harald@redhat.com>2013-03-20 10:22:41 +0100
committerHarald Hoyer <harald@redhat.com>2013-03-20 10:22:41 +0100
commit5bfa3b363a35fb5586f015701832eab5544385bf (patch)
treed490d6fb212a616ffe1b9fc64f4897c731500800 /dracut.sh
parent1d4b3375431d2d19d511aa5784f2c1ed1e6bbb9e (diff)
downloaddracut-5bfa3b363a35fb5586f015701832eab5544385bf.tar.gz
dracut-5bfa3b363a35fb5586f015701832eab5544385bf.tar.bz2
dracut-5bfa3b363a35fb5586f015701832eab5544385bf.zip
dracut.sh: turn off host-only mode, if essential system filesystems not mounted
Diffstat (limited to 'dracut.sh')
-rwxr-xr-xdracut.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/dracut.sh b/dracut.sh
index 77287127..9afa6941 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