[Pkg-sysvinit-commits] r1084 - in sysvinit/trunk/debian: . initscripts/etc/init.d initscripts/lib/init
pere at alioth.debian.org
pere at alioth.debian.org
Sun Dec 23 09:35:19 UTC 2007
Author: pere
Date: 2007-12-23 09:35:18 +0000 (Sun, 23 Dec 2007)
New Revision: 1084
Modified:
sysvinit/trunk/debian/changelog
sysvinit/trunk/debian/initscripts/etc/init.d/checkroot.sh
sysvinit/trunk/debian/initscripts/etc/init.d/mountall.sh
sysvinit/trunk/debian/initscripts/lib/init/vars.sh
Log:
* Implement noswap kernel boot option to stop automatic
swap activation at boot time (Closes: #388525). Based on patch
from Michael Prokop.
Modified: sysvinit/trunk/debian/changelog
===================================================================
--- sysvinit/trunk/debian/changelog 2007-12-23 09:21:10 UTC (rev 1083)
+++ sysvinit/trunk/debian/changelog 2007-12-23 09:35:18 UTC (rev 1084)
@@ -8,6 +8,9 @@
the HDDOWN default/halt variable.
* Improve usage information in update-rc.d by using the same
notation as the one used in the manual page (Closes: #268713)
+ * Implement noswap kernel boot option to stop automatic
+ swap activation at boot time (Closes: #388525). Based on patch
+ from Michael Prokop.
-- Petter Reinholdtsen <pere at debian.org> Sun, 23 Dec 2007 10:03:48 +0100
Modified: sysvinit/trunk/debian/initscripts/etc/init.d/checkroot.sh
===================================================================
--- sysvinit/trunk/debian/initscripts/etc/init.d/checkroot.sh 2007-12-23 09:21:10 UTC (rev 1083)
+++ sysvinit/trunk/debian/initscripts/etc/init.d/checkroot.sh 2007-12-23 09:35:18 UTC (rev 1084)
@@ -105,14 +105,20 @@
ENABLE_SWAP=no
case "$KERNEL" in
Linux)
- if [ "$swap_on_lv" = yes ]
+ if [ "$NOSWAP" = yes ]
then
- [ "$VERBOSE" = no ] || log_warning_msg "Not activating swap on logical volume."
- elif [ "$swap_on_file" = yes ]
- then
- [ "$VERBOSE" = no ] || log_warning_msg "Not activating swap on swapfile."
+ [ "$VERBOSE" = no ] || log_warning_msg "Not activating swap as requested via bootoption noswap."
+ ENABLE_SWAP=no
else
- ENABLE_SWAP=yes
+ if [ "$swap_on_lv" = yes ]
+ then
+ [ "$VERBOSE" = no ] || log_warning_msg "Not activating swap on logical volume."
+ elif [ "$swap_on_file" = yes ]
+ then
+ [ "$VERBOSE" = no ] || log_warning_msg "Not activating swap on swapfile."
+ else
+ ENABLE_SWAP=yes
+ fi
fi
;;
*)
Modified: sysvinit/trunk/debian/initscripts/etc/init.d/mountall.sh
===================================================================
--- sysvinit/trunk/debian/initscripts/etc/init.d/mountall.sh 2007-12-23 09:21:10 UTC (rev 1083)
+++ sysvinit/trunk/debian/initscripts/etc/init.d/mountall.sh 2007-12-23 09:35:18 UTC (rev 1084)
@@ -64,15 +64,20 @@
#
# Ignore 255 status due to swap already being enabled
#
- if [ "$VERBOSE" = no ]
+ if [ "$NOSWAP" = yes ]
then
- log_action_begin_msg "Activating swapfile swap"
- swapon -a -e 2>/dev/null || : # Stifle "Device or resource busy"
- log_action_end_msg 0
+ [ "$VERBOSE" = no ] || log_warning_msg "Not activating swap as requested via bootoption noswap."
else
- log_daemon_msg "Will now activate swapfile swap"
- swapon -a -e -v
- log_action_end_msg $?
+ if [ "$VERBOSE" = no ]
+ then
+ log_action_begin_msg "Activating swapfile swap"
+ swapon -a -e 2>/dev/null || : # Stifle "Device or resource busy"
+ log_action_end_msg 0
+ else
+ log_daemon_msg "Will now activate swapfile swap"
+ swapon -a -e -v
+ log_action_end_msg $?
+ fi
fi
}
Modified: sysvinit/trunk/debian/initscripts/lib/init/vars.sh
===================================================================
--- sysvinit/trunk/debian/initscripts/lib/init/vars.sh 2007-12-23 09:21:10 UTC (rev 1083)
+++ sysvinit/trunk/debian/initscripts/lib/init/vars.sh 2007-12-23 09:35:18 UTC (rev 1084)
@@ -4,6 +4,14 @@
[ -f /etc/default/rcS ] && . /etc/default/rcS || true
+# check for bootoption 'noswap' and do not activate swap
+# partitions/files when it is set.
+if [ -r /proc/cmdline ] && grep -q ' noswap' /proc/cmdline ; then
+ NOSWAP=yes
+else
+ NOSWAP=no
+fi
+
# Accept the same 'quiet' option as the kernel
if [ ! -e /proc/cmdline ] || egrep -qw 'quiet' /proc/cmdline ; then
VERBOSE="no"
More information about the Pkg-sysvinit-commits
mailing list