5 # initramfs-tools header
21 # live-initramfs header
23 if [ -n "${NOSWAP}" ] || [ -n "${NOFSTAB}" ]
28 . /scripts/live-functions
30 log_begin_msg "Setting up swap"
32 # live-initramfs script
37 for device in /dev/[hs]d[a-z][0-9]*
39 if ! [ -b "${device}" ]
44 /lib/udev/vol_id ${device%%[0-9]*} | grep -q "^ID_FS_USAGE=raid" && continue
46 magic=$(/bin/dd if="${device}" bs=4086 skip=1 count=1 2>/dev/null | /bin/dd bs=10 count=1 2>/dev/null) || continue
48 if [ "${magic}" = "SWAPSPACE2" -o "${magic}" = "SWAP-SPACE" ]
50 #log "Found ${device}"
51 devices="${devices} ${device}"
55 for device in ${devices}
58 cat >> ${FSTAB} << EOF
59 ${device} swap swap defaults 0 0