Activity log for bug #1195504

Date Who What changed Old value New value Message
2013-06-27 23:28:06 Lucas Magasweran bug added bug
2013-06-27 23:29:03 Lucas Magasweran attachment added noswap kernel parameter patch https://bugs.launchpad.net/ubuntu/+source/casper/+bug/1195504/+attachment/3716470/+files/noswap.patch
2013-06-27 23:29:13 Lucas Magasweran attachment added noswap kernel parameter patch https://bugs.launchpad.net/ubuntu/+source/casper/+bug/1195504/+attachment/3716471/+files/noswap.patch
2013-06-27 23:30:05 Lucas Magasweran description I would like to propose the following patch that adds a "noswap" Kernel parameter that disables casper's automatic discovery and activation of any present swap partitions. The purpose is to not have the drives and drivers in use so that they can be accessed or unloaded without issue. === modified file 'debian/manpage/casper.7' --- old/debian/manpage/casper.7 2010-11-29 12:49:36 +0000 +++ new/debian/manpage/casper.7 2013-06-27 22:21:58 +0000 @@ -88,6 +88,11 @@ .TP .BI noprompt Do not prompt to eject the CD on reboot. +.TP +.BI noswap +Adding this parameter, casper will not attempt to find and activate swap partitions requiring manual use of +.B swapon +as needed. This is useful to avoid accessing drives that may be present in the system. .SH FILES .B /etc/casper.conf === modified file 'scripts/casper' --- old/scripts/casper 2013-05-28 10:19:04 +0000 +++ new/scripts/casper 2013-06-27 22:23:14 +0000 @@ -71,6 +71,8 @@ export CMD_USERFULLNAME="${x#userfullname=}" ;; username=*) export CMD_USERNAME="${x#username=}" ;; + noswap) + export DISABLE_SWAP="Yes" ;; esac done if [ "${UNIONFS}" = "" ]; then === modified file 'scripts/casper-bottom/13swap' --- old/scripts/casper-bottom/13swap 2013-03-13 14:24:28 +0000 +++ new/scripts/casper-bottom/13swap 2013-06-27 22:23:36 +0000 @@ -22,25 +22,29 @@ log_begin_msg "$DESCRIPTION" devices="" -for device in /dev/[hsv]d[a-z][0-9]*; do - if ! [ -b "$device" ]; then - continue - fi - - /sbin/blkid -o udev -p ${device%%[0-9]*} | grep -q "^ID_FS_USAGE=raid" && continue - - 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" +if [[ -n "$DISABLE_SWAP" ]]; then + echo -n "disabled via kernel cmdline: noswap." +else + for device in /dev/[hsv]d[a-z][0-9]*; do + if ! [ -b "$device" ]; then + continue fi -done - -for device in $devices; do - cat >> $FSTAB <<EOF + + /sbin/blkid -o udev -p ${device%%[0-9]*} | grep -q "^ID_FS_USAGE=raid" && continue + + 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 + done + + for device in $devices; do + cat >> $FSTAB <<EOF $device swap swap defaults 0 0 EOF -done + done +fi log_end_msg I would like to propose the attached patch that adds a "noswap" Kernel parameter that disables casper's automatic discovery and activation of any present swap partitions. The purpose is to not have the drives and drivers in use so that they can be accessed or unloaded without issue.
2013-06-28 00:16:48 Ubuntu Foundations Team Bug Bot tags patch
2013-06-28 00:16:59 Ubuntu Foundations Team Bug Bot bug added subscriber Ubuntu Review Team
2013-06-28 04:14:12 Lucas Magasweran bug added subscriber DanMD
2013-07-01 15:21:23 Launchpad Janitor casper (Ubuntu): status New Confirmed