Adding upstream version 1.110.4.
[live-boot-grml.git] / scripts / live-bottom / 12fstab
index fa9c642..ca83626 100755 (executable)
@@ -1,31 +1,57 @@
 #!/bin/sh
 
+#set -e
+
+# initramfs-tools header
+
 PREREQ=""
-DESCRIPTION="Configuring fstab..."
 FSTAB=/root/etc/fstab
 
-. /scripts/live-functions
-
 prereqs()
 {
-       echo "$PREREQ"
+       echo "${PREREQ}"
 }
 
-case $1 in
-# get pre-requisites
-prereqs)
-       prereqs
-       exit 0
-       ;;
+case "${1}" in
+       prereqs)
+               prereqs
+               exit 0
+               ;;
 esac
 
-log_begin_msg "$DESCRIPTION"
+# live-initramfs header
+
+. /scripts/live-functions
+
+if [ -n "${NOFSTAB}" ]
+then
+       exit 0
+fi
+
+if [ -s ${FSTAB} ]
+then
+       log_begin_msg "Not touching preexisting fstab..."
+else
+       log_begin_msg "Configuring fstab..."
+
+       cat >> ${FSTAB} <<-EOF
+       # /etc/fstab: static file system information.
+       #
+       # <file system> <mount point>   <type>  <options>       <dump>  <pass>
+       ${UNIONTYPE} / ${UNIONTYPE} rw 0 0
+       tmpfs /tmp tmpfs nosuid,nodev 0 0
+       EOF
+fi
+
+# live-initramfs script
+
 
-cat > $FSTAB <<EOF
-unionfs / unionfs rw 0 0
-tmpfs /tmp tmpfs nosuid,nodev 0 0
-EOF
+# disabled for now
+#rm -f /root/etc/rcS.d/S*checkroot.sh
 
-rm -f /root/etc/rcS.d/S*checkroot.sh
+if [ "${NOFASTBOOT}" != "Yes" ]
+then
+       touch root/fastboot
+fi
 
 log_end_msg