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 magic=$(/bin/dd if="${device}" bs=4086 skip=1 count=1 2>/dev/null | /bin/dd bs=10 count=1 2>/dev/null) || continue
46 if [ "${magic}" = "SWAPSPACE2" -o "${magic}" = "SWAP-SPACE" ]
48 #log "Found ${device}"
49 devices="${devices} ${device}"
53 for device in ${devices}
56 cat >> ${FSTAB} << EOF
57 ${device} swap swap defaults 0 0