summaryrefslogtreecommitdiff
path: root/beagle/debian-rfs/lib/init/swap-functions.sh
diff options
context:
space:
mode:
authorManuel Traut <manut@mecka.net>2011-04-29 09:09:27 +0200
committerManuel Traut <manut@mecka.net>2011-04-29 09:09:27 +0200
commit5238ad5a0c4a9e1c8cd036f5de4055e39bd71297 (patch)
tree4407c087b9fb5432b1dc11e70b52dacfa0b99feb /beagle/debian-rfs/lib/init/swap-functions.sh
parent60ead65c41afba7e6aa4bbcf507a1d52f7a8fe9f (diff)
added debootstrap stuff
Signed-off-by: Manuel Traut <manut@mecka.net>
Diffstat (limited to 'beagle/debian-rfs/lib/init/swap-functions.sh')
-rw-r--r--beagle/debian-rfs/lib/init/swap-functions.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/beagle/debian-rfs/lib/init/swap-functions.sh b/beagle/debian-rfs/lib/init/swap-functions.sh
new file mode 100644
index 0000000..48a2326
--- /dev/null
+++ b/beagle/debian-rfs/lib/init/swap-functions.sh
@@ -0,0 +1,28 @@
+#
+# Functions that assist in turning on swap.
+#
+
+# $1 is a string used to log the type of swap expected to be activated
+swaponagain() {
+ #
+ # Execute swapon command again to pick up any swap partitions
+ # that have shown up since the last swapon.
+ #
+ # Ignore 255 status due to swap already being enabled
+ #
+ if [ "$NOSWAP" = yes ]
+ then
+ [ "$VERBOSE" = no ] || log_warning_msg "Not activating swap as requested via bootoption noswap."
+ else
+ if [ "$VERBOSE" = no ]
+ then
+ log_action_begin_msg "Activating $1 swap"
+ swapon -a -e 2>/dev/null || : # Stifle "Device or resource busy"
+ log_action_end_msg 0
+ else
+ log_daemon_msg "Will now activate $1 swap"
+ swapon -a -e -v
+ log_action_end_msg $?
+ fi
+ fi
+}