5 # initramfs-tools header
22 # live-initramfs header
24 .
/scripts
/live-functions
26 if [ -n "${NOFSTAB}" ]
31 log_begin_msg
"Configuring fstab"
33 # live-initramfs script
35 # Create a fake fstab only if it doesn't exist or if its the debootstrap template
36 if [ ! -f "${FSTAB}" ] ||
grep -qs 'UNCONFIGURED FSTAB FOR BASE SYSTEM' "${FSTAB}"
40 # /etc/fstab: static file system information.
42 # <file system> <mount point> <type> <options> <dump> <pass>
48 if ! grep -qs "^${UNIONTYPE}" "${FSTAB}"
50 echo "${UNIONTYPE} / ${UNIONTYPE} rw 0 0" >> "${FSTAB}"
53 if ! grep -qs "^tmpfs /tmp" "${FSTAB}"
55 echo "tmpfs /tmp tmpfs nosuid,nodev 0 0" >> "${FSTAB}"
62 for device
in /dev
/[hs
]d
[a-z
][0-9]*
64 if ! [ -b "${device}" ]
69 if [ -x /lib
/udev
/vol_id
]
71 /lib
/udev
/vol_id
${device%%[0-9]*} 2>/dev
/null |
grep -q "^ID_FS_USAGE=raid" && continue
74 magic
=$
(/bin
/dd if="${device}" bs
=4086 skip
=1 count
=1 2>/dev
/null |
/bin
/dd bs
=10 count
=1 2>/dev
/null
) ||
continue
76 if [ "${magic}" = "SWAPSPACE2" -o "${magic}" = "SWAP-SPACE" ]
78 #log "Found ${device}"
79 devices
="${devices} ${device}"
83 # Remove all auto swap entries
84 if grep -qs "swap swap" "${FSTAB}"
86 grep -v "swap swap" "${FSTAB}" > "${FSTAB}".tmp
87 mv "${FSTAB}".tmp
"${FSTAB}"
90 # Add new swap entries
91 for device
in ${devices}
93 echo "${device} swap swap defaults 0 0" >> "${FSTAB}"
98 #rm -f /root/etc/rcS.d/S*checkroot.sh
100 if [ "${NOFASTBOOT}" != "Yes" ]