[Debian-live-changes] r1465 - in dists/trunk/live-initramfs: docs
manpages scripts scripts/live-bottom
Daniel Baumann
daniel at alioth.debian.org
Fri May 11 16:58:58 UTC 2007
Author: daniel
Date: 2007-05-11 16:58:58 +0000 (Fri, 11 May 2007)
New Revision: 1465
Modified:
dists/trunk/live-initramfs/docs/ChangeLog
dists/trunk/live-initramfs/manpages/live-initramfs.en.7
dists/trunk/live-initramfs/scripts/live
dists/trunk/live-initramfs/scripts/live-bottom/13swap
Log:
Modified: dists/trunk/live-initramfs/docs/ChangeLog
===================================================================
--- dists/trunk/live-initramfs/docs/ChangeLog 2007-05-11 16:24:28 UTC (rev 1464)
+++ dists/trunk/live-initramfs/docs/ChangeLog 2007-05-11 16:58:58 UTC (rev 1465)
@@ -5,6 +5,9 @@
* scripts/live-bottom/10adduser:
- Moved screensaver hack to 22screensaver.
- Moved sudo stuff to 11sudo.
+ * scripts/live-bottom/13swap:
+ - Added check for swapoff bootparameter to disable usage of local
+ swap partitions.
2007-05-09 Daniel Baumann <daniel at debian.org>
Modified: dists/trunk/live-initramfs/manpages/live-initramfs.en.7
===================================================================
--- dists/trunk/live-initramfs/manpages/live-initramfs.en.7 2007-05-11 16:24:28 UTC (rev 1464)
+++ dists/trunk/live-initramfs/manpages/live-initramfs.en.7 2007-05-11 16:58:58 UTC (rev 1465)
@@ -54,6 +54,8 @@
This option causes live\-initramfs to reboot without attempting to eject the media and without asking the user to remove the boot media.
.IP "\fBshowmounts\fR" 4
This parameter will make live\-initramfs to show on "/" the ro filesystems (mostly compressed) on "/live". This is not enabled by default because could lead to problems by applications like "mono" which store binary paths on installation.
+.IP "\fBswapoff\fR" 4
+This parameter disables usage of local swap partitions.
.IP "\fBtodisk=\fR\fIDEVICE" 4
Adding this parameter, live\-initramfs will try to copy the entire read\-only media to the specified device before mounting the root filesystem. It probably needs a lot of free space. Subsequent boots should then skip this step and just specify the "live\-media=DEVICE" boot parameter with the same DEVICE used this time.
.IP "\fBtoram\fR" 4
Modified: dists/trunk/live-initramfs/scripts/live
===================================================================
--- dists/trunk/live-initramfs/scripts/live 2007-05-11 16:24:28 UTC (rev 1464)
+++ dists/trunk/live-initramfs/scripts/live 2007-05-11 16:58:58 UTC (rev 1465)
@@ -100,6 +100,8 @@
export MODULE=${x#module=} ;;
preseed/file=*|file=*)
export LOCATION="${x#*=}" ;;
+ swapoff)
+ export SWAPOFF="Yes" ;;
*/*=*)
question="${x%%=*}"
value="${x#*=}"
Modified: dists/trunk/live-initramfs/scripts/live-bottom/13swap
===================================================================
--- dists/trunk/live-initramfs/scripts/live-bottom/13swap 2007-05-11 16:24:28 UTC (rev 1464)
+++ dists/trunk/live-initramfs/scripts/live-bottom/13swap 2007-05-11 16:58:58 UTC (rev 1465)
@@ -2,6 +2,11 @@
set -e
+if [ -z "${SWAPOFF}" ]
+then
+ exit 0
+fi
+
# initramfs-tools header
PREREQ=""
@@ -18,38 +23,35 @@
;;
esac
-# swap
+# live-initramfs header
-DESCRIPTION="Setting up swap..."
FSTAB=/root/etc/fstab
. /scripts/live-functions
-log_begin_msg "$DESCRIPTION"
+log_begin_msg "Setting up swap..."
-devices=""
-
-for device in /dev/[hs]d[a-z][0-9]*
+for DEVICE in /dev/[hs]d[a-z][0-9]*
do
- if ! [ -b "$device" ]
+ 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
+ SWAP_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" ]
+ if [ "${SWAP_MAGIC}" = "SWAPSPACE2" ] || [ "${SWAP_MAGIC}" = "SWAP-SPACE" ]
then
#log "Found $device"
- devices="$devices $device"
+ SWAP_DEVICES="${SWAP_DEVICE} ${DEVICE}"
fi
done
-for device in $devices
+for DEVICE in ${SWAP_DEVICES}
do
-cat >> $FSTAB << EOF
-$device swap swap defaults 0 0
+cat >> "${FSTAB}" << EOF
+${DEVICE} swap swap defaults 0 0
EOF
done
More information about the Debian-live-changes
mailing list