X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=scripts%2Flive-bottom%2F13swap;h=8b47a0099d65b27b7742f4b3b00b5028430d9067;hb=526a7c2e15a71dbaef918007637973c3b61986fa;hp=fcef76c08f652b9adf341092291255bde891a825;hpb=d70b77f919f85511936645abb95d710b80c10c74;p=live-boot-grml.git diff --git a/scripts/live-bottom/13swap b/scripts/live-bottom/13swap index fcef76c..8b47a00 100755 --- a/scripts/live-bottom/13swap +++ b/scripts/live-bottom/13swap @@ -1,25 +1,37 @@ #!/bin/sh -PREREQ="" -DESCRIPTION="Setting up swap..." -FSTAB=/root/etc/fstab +#set -e -. /scripts/live-functions +# initramfs-tools header + +PREREQ="" prereqs() { - echo "$PREREQ" + echo "${PREREQ}" } -case $1 in -# get pre-requisites -prereqs) - prereqs - exit 0 - ;; +case "${1}" in + prereqs) + prereqs + exit 0 + ;; esac -log_begin_msg "$DESCRIPTION" +# live-initramfs header + +if [ -n "${NOSWAP}" ] +then + exit 0 +fi + +. /scripts/live-functions + +log_begin_msg "Setting up swap..." + +# live-initramfs script + +FSTAB=/root/etc/fstab devices="" for device in /dev/[hs]d[a-z][0-9]*; do @@ -28,7 +40,7 @@ for device in /dev/[hs]d[a-z][0-9]*; do fi magic=$(/bin/dd if="$device" bs=4086 skip=1 count=1 2>/dev/null | /bin/dd bs=10 count=1 2>/dev/null) || continue - + if [ "$magic" = "SWAPSPACE2" -o "$magic" = "SWAP-SPACE" ]; then # log "Found $device" devices="$devices $device"