summaryrefslogtreecommitdiffstats
path: root/modules.d/dnbd3-rootfs/hooks/s3-mount-root.sh
diff options
context:
space:
mode:
Diffstat (limited to 'modules.d/dnbd3-rootfs/hooks/s3-mount-root.sh')
-rwxr-xr-xmodules.d/dnbd3-rootfs/hooks/s3-mount-root.sh14
1 files changed, 6 insertions, 8 deletions
diff --git a/modules.d/dnbd3-rootfs/hooks/s3-mount-root.sh b/modules.d/dnbd3-rootfs/hooks/s3-mount-root.sh
index 2f5fc15f..78410fce 100755
--- a/modules.d/dnbd3-rootfs/hooks/s3-mount-root.sh
+++ b/modules.d/dnbd3-rootfs/hooks/s3-mount-root.sh
@@ -1,5 +1,6 @@
#!/bin/bash
+type emergency_shell >/dev/null 2>&1 || source /lib/dracut-lib.sh # $NEWROOT
source "/etc/openslx"
cnt=0
@@ -14,23 +15,20 @@ done
ret=99
if [ -n "$SLX_MOUNT_ROOT_OPTIONS" ]; then
# Always prefer mount options mandated by server
+ echo "Mounting with provided options: $SLX_MOUNT_ROOT_OPTIONS"
mount "$SLX_DNBD3_DEVICE_COW" "$NEWROOT" $SLX_MOUNT_ROOT_OPTIONS
ret=$?
else
# Let's guess it's ext4, tune for maximum performance as we don't care about recoverability
- mount "$SLX_DNBD3_DEVICE_COW" "$NEWROOT" -o data=writeback,barrier=0,commit=60,noinit_itable,discard,noatime
+ echo "Trying optimized ext4 mount options..."
+ mount -t ext4 "$SLX_DNBD3_DEVICE_COW" "$NEWROOT" -o data=writeback,barrier=0,commit=60,noinit_itable,discard,noatime
ret=$?
if (( ret != 0 )); then
# Just try with no options and hope for the best...
+ echo "Trying default mount with no options..."
mount "$SLX_DNBD3_DEVICE_COW" "$NEWROOT"
ret=$?
fi
fi
-(( ret != 0 )) && exit $ret
-
-if ! [ -e "$NEWROOT/etc/fstab.keep" ] && ! grep -qF 'NODELETE' "$NEWROOT/etc/fstab"; then
- echo "" > "$NEWROOT/etc/fstab"
-fi
-
-exit 0
+exit $ret