5 # initramfs-tools header
24 # FIXME: stop hardcoding overloading of initramfs-tools functions
26 . /lib/live/boot/initramfs-tools.sh
28 if [ -n "${NOFSTAB}" ]
33 log_begin_msg "Configuring fstab"
37 if ! grep -qs "^${UNIONTYPE}" "${FSTAB}"
39 echo "${UNIONTYPE} / ${UNIONTYPE} rw 0 0" >> "${FSTAB}"
42 if ! grep -qs "^tmpfs /tmp" "${FSTAB}"
44 echo "tmpfs /tmp tmpfs nosuid,nodev 0 0" >> "${FSTAB}"
51 for device in /dev/[hs]d[a-z][0-9]*
53 if ! [ -b "${device}" ]
58 /sbin/blkid -o udev -p ${device%%[0-9]*} | grep -q "^ID_FS_USAGE=raid" && continue
60 magic=$(/bin/dd if="${device}" bs=4086 skip=1 count=1 2>/dev/null | /bin/dd bs=10 count=1 2>/dev/null) || continue
62 if [ "${magic}" = "SWAPSPACE2" -o "${magic}" = "SWAP-SPACE" ]
64 #log "Found ${device}"
65 devices="${devices} ${device}"
69 # Remove all auto swap entries
70 if grep -qs "swap swap" "${FSTAB}"
72 grep -v "swap swap" "${FSTAB}" > "${FSTAB}".tmp
73 mv "${FSTAB}".tmp "${FSTAB}"
76 # Add new swap entries
77 for device in ${devices}
79 echo "${device} swap swap defaults 0 0" >> "${FSTAB}"
84 #rm -f /root/etc/rcS.d/S*checkroot.sh
86 if [ "${NOFASTBOOT}" != "Yes" ]