diff options
| author | Daniel Baumann <daniel@debian.org> | 2012-07-25 16:44:46 +0200 |
|---|---|---|
| committer | Daniel Baumann <daniel@debian.org> | 2012-07-25 17:25:03 +0200 |
| commit | d0fe6311af9fbeaa1f6dbc185fa97e1ce4f5347d (patch) | |
| tree | 364c7e698b5d538dcabf152c88e18a28b2a165d5 /scripts/boot/3020-swapon | |
| parent | ee04164312a51ba075ff169140a8969b7ee66512 (diff) | |
| download | live-boot-d0fe6311af9fbeaa1f6dbc185fa97e1ce4f5347d.tar.gz live-boot-d0fe6311af9fbeaa1f6dbc185fa97e1ce4f5347d.zip | |
Making swap function self contained.
Diffstat (limited to 'scripts/boot/3020-swapon')
| -rwxr-xr-x | scripts/boot/3020-swapon | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/scripts/boot/3020-swapon b/scripts/boot/3020-swapon index 281fd04..82e998a 100755 --- a/scripts/boot/3020-swapon +++ b/scripts/boot/3020-swapon @@ -2,14 +2,28 @@ #set -e -Swapon () +Swap () { - if [ "${LIVE_SWAPON}" != "true" ] + for _PARAMETER in ${_CMDLINE} + do + case "${_PARAMETER}" in + live-boot.swap=*|swap=*) + LIVE_SWAP="true" + LIVE_SWAP_DEVICES="${_PARAMETER#*swap=}" + ;; + + live-boot.swap|swap) + LIVE_SWAP="true" + ;; + esac + done + + if [ "${LIVE_SWAP}" != "true" ] then return 0 fi - LIVE_SWAPON_DEVICES="${LIVE_SWAPON_DEVICES:-/dev/sd* /dev/vd*}" + LIVE_SWAP_DEVICES="${LIVE_SWAP_DEVICES:-/dev/sd* /dev/vd*}" if [ -e /run ] then @@ -20,7 +34,7 @@ Swapon () _FSTAB="/root/etc/fstab" fi - for _DEVICE in $(echo ${LIVE_SWAPON_DEVICES} | sed -e 's|,| |g') + for _DEVICE in $(echo ${LIVE_SWAP_DEVICES} | sed -e 's|,| |g') do if [ ! -b "${_DEVICE}" ] then |
