5 # initramfs-tools header
24 . /scripts/live-functions
26 if [ -n "${NOFSTAB}" ]
31 log_begin_msg "Configuring fstab"
35 if ! grep -qs "^${UNIONTYPE}" "${FSTAB}"
37 echo "${UNIONTYPE} / ${UNIONTYPE} rw 0 0" >> "${FSTAB}"
40 if ! grep -qs "^tmpfs /tmp" "${FSTAB}"
42 echo "tmpfs /tmp tmpfs nosuid,nodev 0 0" >> "${FSTAB}"
49 for device in /dev/[hs]d[a-z][0-9]*
51 if ! [ -b "${device}" ]
56 /sbin/blkid -o udev -p ${device%%[0-9]*} | grep -q "^ID_FS_USAGE=raid" && continue
58 magic=$(/bin/dd if="${device}" bs=4086 skip=1 count=1 2>/dev/null | /bin/dd bs=10 count=1 2>/dev/null) || continue
60 if [ "${magic}" = "SWAPSPACE2" -o "${magic}" = "SWAP-SPACE" ]
62 #log "Found ${device}"
63 devices="${devices} ${device}"
67 # Remove all auto swap entries
68 if grep -qs "swap swap" "${FSTAB}"
70 grep -v "swap swap" "${FSTAB}" > "${FSTAB}".tmp
71 mv "${FSTAB}".tmp "${FSTAB}"
74 # Add new swap entries
75 for device in ${devices}
77 echo "${device} swap swap defaults 0 0" >> "${FSTAB}"
82 #rm -f /root/etc/rcS.d/S*checkroot.sh
84 if [ "${NOFASTBOOT}" != "Yes" ]