Casper patches
From FlimzyWiki
I have created several patches against casper. As of version 1.81+debian-2, all but one my patches have been included in the official Debian version (and several in the upstream Ubuntu version). The one still-unofficial patch is here:
My modified version can be downloaded in complete form from here: http://aslan.flimzy.com/casper/
Contents |
patch.livemount
This patch was created against casper-1.79+debian-2. The Debian mantainer says he will likely impliment this feature in a future version of casper, using some different methodology, possibly including reworking the entire capser directory structure. In the meantime, I continue to use this patch, as I need it for my Debian on USB project.
This patch allows the user to specify "livemount=" on the kernel commandline, to specify an alternative location for the live media to be mounted on the booted system. For example, livemount=/boot will put the live media on /boot instead of /live_mount when the boot process is complete.
NOTE: I successfully applied this patch against casper-1.81+debian-2 as well, although it complained that one hunk failed, the failing hunk is insignificant and can be ignored.
patch.livemount
diff -ru c1/debian/manpage/casper.7 c3/debian/manpage/casper.7
--- c1/debian/manpage/casper.7 2007-02-07 10:34:12.000000000 -0600
+++ c3/debian/manpage/casper.7 2007-02-07 10:36:17.000000000 -0600
@@ -36,6 +36,9 @@
.BI "live-media-offset=" BYTES
This way you could tell casper that your image starts at offset BYTES in the above specified or autodiscovered device, this could be useful to hide the debian-live iso or image inside another iso or image, to create "clean" images.
.TP
+.BI "livemount=" MOUNTPOINT
+This specifies where the live media should be mounted after the boot process. The default is /live_media.
+.TP
.BI "locale=" LOCALE " | debian-installer/locale=" LOCALE
Configure the running locale as specified, if not present the live-media rootfs configured locale will be used and if also this one misses casper behave as "locale=en_US.UTF-8" was specified. If only 2 lowercase letter are specified (like "it"), the "maybe wanted" locale is generated (like it:IT.UTF-8), in this case if also "keyb=" is unspecified is set with those 2 lowercase letters (keyb=it).
.TP
diff -ru c1/scripts/casper c3/scripts/casper
--- c1/scripts/casper 2007-02-07 10:34:12.000000000 -0600
+++ c3/scripts/casper 2007-02-07 10:34:41.000000000 -0600
@@ -16,10 +16,12 @@
HOSTNAME="live"
BUILD_SYSTEM="Debian"
+LIVEMOUNT=/live_media
+
mkdir -p $mountpoint
[ -f /etc/casper.conf ] && . /etc/casper.conf
-export USERNAME USERFULLNAME HOSTNAME BUILD_SYSTEM
+export USERNAME USERFULLNAME HOSTNAME BUILD_SYSTEM LIVEMOUNT
. /scripts/casper-helpers
@@ -33,6 +35,9 @@
# looking for casper specifics options as kernel parameters
for x in $(cat /proc/cmdline); do
case $x in
+ livemount=*)
+ export LIVEMOUNT=${x#livemount=}
+ ;;
userfullname=*)
export USERFULLNAME=${x#userfullname=}
export CASPERCONF="changed"
@@ -403,7 +408,7 @@
else
roopt="ro"
fi
-
+
# Read image names from order.lst if it exists
if [ -e "${image_directory}/order.lst" ]; then
for image in $(cat "${image_directory}/order.lst"); do
diff -ru c1/scripts/casper-bottom/05mountpoints c3/scripts/casper-bottom/05mountpoints
--- c1/scripts/casper-bottom/05mountpoints 2007-02-06 14:45:32.000000000 -0600
+++ c3/scripts/casper-bottom/05mountpoints 2007-02-07 10:34:45.000000000 -0600
@@ -20,10 +20,12 @@
log_begin_msg "$DESCRIPTION"
+LIVEMOUNT=$(echo ${LIVEMOUNT} | sed -e 's%^/%%')
# Move to the new root filesystem so that programs there can get at it.
-if [ ! -d /root/live_media ]; then
- mkdir -p /root/live_media
- mount -n -o move /live_media /root/live_media
+if [ ! -e /root/${LIVEMOUNT}/* ]; then
+ mkdir -p /root/${LIVEMOUNT}
+ mount -n -o move /live_media /root/${LIVEMOUNT}
fi
+
log_end_msg

