diff options
| author | Daniel Baumann <daniel@debian.org> | 2007-09-23 14:46:42 +0200 |
|---|---|---|
| committer | Daniel Baumann <daniel@debian.org> | 2011-03-09 17:31:05 +0100 |
| commit | fdd8036ba32ad88e83a61191cc4597ae060355d2 (patch) | |
| tree | fe1bfc2da930128100db011d642be562ed82867e /scripts/live-bottom/13swap | |
| parent | 140b179f0ff73f3cc1c081f6e6641417a5a0788d (diff) | |
| download | live-boot-fdd8036ba32ad88e83a61191cc4597ae060355d2.tar.gz live-boot-fdd8036ba32ad88e83a61191cc4597ae060355d2.zip | |
Adding live-initramfs 1.99.2-1.
Diffstat (limited to 'scripts/live-bottom/13swap')
| -rwxr-xr-x | scripts/live-bottom/13swap | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/scripts/live-bottom/13swap b/scripts/live-bottom/13swap index 8b47a00..4980433 100755 --- a/scripts/live-bottom/13swap +++ b/scripts/live-bottom/13swap @@ -20,7 +20,7 @@ esac # live-initramfs header -if [ -n "${NOSWAP}" ] +if [ -n "${NOSWAP}" ] || [ -n "${NOFSTAB}" ] then exit 0 fi @@ -32,25 +32,31 @@ 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 - if ! [ -b "$device" ]; then - continue - 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 +for device in /dev/[hs]d[a-z][0-9]* +do + if ! [ -b "$device" ] + then + continue + 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" - fi + if [ "$magic" = "SWAPSPACE2" -o "$magic" = "SWAP-SPACE" ] + then + #log "Found $device" + devices="$devices $device" + fi done -for device in $devices; do - cat >> $FSTAB <<EOF +for device in $devices +do + +cat >> $FSTAB << EOF $device swap swap defaults 0 0 EOF + done log_end_msg |
