[Debian-live-changes] r1329 - in dists/trunk/live-initramfs: doc
scripts
Daniel Baumann
daniel at alioth.debian.org
Sun May 6 16:35:48 UTC 2007
Author: daniel
Date: 2007-05-06 16:35:48 +0000 (Sun, 06 May 2007)
New Revision: 1329
Modified:
dists/trunk/live-initramfs/doc/ChangeLog
dists/trunk/live-initramfs/scripts/live
Log:
Modified: dists/trunk/live-initramfs/doc/ChangeLog
===================================================================
--- dists/trunk/live-initramfs/doc/ChangeLog 2007-05-06 16:17:31 UTC (rev 1328)
+++ dists/trunk/live-initramfs/doc/ChangeLog 2007-05-06 16:35:48 UTC (rev 1329)
@@ -13,6 +13,9 @@
- Added patch to allow custom keymap when using encryption.
- Added patch to make ubuntu specific calls conditional.
- Added patch to read configuration earlier.
+ * scripts/live:
+ - Added patch to support encrypted filesystem images.
+ - Added patch to support multiple filesystem images.
2007-05-06 Daniel Baumann <daniel at debian.org>
Modified: dists/trunk/live-initramfs/scripts/live
===================================================================
--- dists/trunk/live-initramfs/scripts/live 2007-05-06 16:17:31 UTC (rev 1328)
+++ dists/trunk/live-initramfs/scripts/live 2007-05-06 16:35:48 UTC (rev 1329)
@@ -7,8 +7,13 @@
echo "/root/lib" >> /etc/ld.so.conf
echo "/root/usr/lib" >> /etc/ld.so.conf
-mountpoint=/cdrom
+mountpoint=/live_media
+root_persistence="liver-rw"
+home_persistence="home-rw"
+root_snapshot_label="live-sn"
+home_snapshot_label="home-sn"
+
USERNAME=user
USERFULLNAME="Live session user"
HOSTNAME=live
@@ -25,6 +30,99 @@
touch /live.vars
fi
+parse_cmdline ()
+{
+ PRESEEDS=
+ # looking for casper specifics options as kernel parameters
+ for x in $(cat /proc/cmdline); do
+ case $x in
+ userfullname=*)
+ export USERFULLNAME=${x#userfullname=}
+ export CASPERCONF="changed"
+ ;;
+ hostname=*)
+ export HOSTNAME=${x#hostname=}
+ export CASPERCONF="changed"
+ ;;
+ username=*)
+ export USERNAME=${x#username=}
+ export CASPERCONF="changed"
+ ;;
+ netboot*)
+ export NETBOOT=${x#netboot=} ;;
+ access=*)
+ export ACCESS=${x#access=} ;;
+ xdebconf)
+ export XDEBCONF="Yes" ;;
+ toram)
+ export TORAM="Yes" ;;
+ todisk=*)
+ export TODISK=${x#todisk=} ;;
+ showmounts)
+ export SHOWMOUNTS="Yes" ;;
+ persistent)
+ export PERSISTENT="Yes" ;;
+ nopersistent)
+ export PERSISTENT="" ;;
+ ip*)
+ STATICIP=${x#ip=}
+ if [ "${STATICIP}" = "" ]; then
+ STATICIP="frommedia"
+ fi
+ export STATICIP
+ ;;
+ live-getty)
+ export CASPERGETTY=1 ;;
+ bootfrom=*|live-media=*)
+ export LIVEMEDIA=${x#*=} ;;
+ live-media-encryption=*|encryption=*)
+ export LIVEMEDIA_ENCRYPTION=${x#*=} ;;
+ live-media-timeout=*)
+ export LIVEMEDIA_TIMEOUT=${x#live-media-timeout=} ;;
+ live-media-offset=*)
+ export LIVEMEDIA_OFFSET=${x#live-media-offset=} ;;
+ locale=*|debian-installer/locale=*)
+ export LOCALE=${x#*=} ;;
+ keyb=*|kbd-chooser/method=*)
+ export KBD=${x#*=} ;;
+ klayout=*|console-setup/layoutcode=*)
+ export KLAYOUT=${x#*=} ;;
+ koptions=*)
+ export KOPTIONS=${x#koptions=} ;;
+ kvariant=*|console-setup/variantcode=*)
+ export KVARIANT=${x#*=} ;;
+ kmodel=*|console-setup/modelcode=*)
+ export KMODEL=${x#*=} ;;
+ module=*)
+ export MODULE=${x#module=} ;;
+ preseed/file=*|file=*)
+ export LOCATION="${x#*=}" ;;
+ */*=*)
+ question="${x%%=*}"
+ value="${x#*=}"
+ PRESEEDS="${PRESEEDS}\"${question}=${value}\" "
+ ;;
+ console=*)
+ export DEFCONSOLE="${x#*=}" ;;
+ esac
+ done
+
+ # sort of compatibility with netboot.h from linux docs
+ if [ -z "${NETBOOT}" ]; then
+ if [ "${ROOT}" == "/dev/nfs" ]; then
+ NETBOOT="nfs"
+ export NETBOOT
+ elif [ "${ROOT}" == "/dev/cifs" ]; then
+ NETBOOT="cifs"
+ export NETBOOT
+ fi
+ fi
+
+ if [ -z "${MODULE}" ]; then
+ MODULE=order
+ fi
+}
+
is_casper_path() {
path=$1
if [ -d "$path/live" ]; then
@@ -40,7 +138,7 @@
get_backing_device() {
case "$1" in
*.squashfs|*.ext2)
- echo $(setup_loop "$1" "loop" "/sys/block/loop*")
+ echo $(setup_loop "$1" "loop" "/sys/block/loop*" '0' "${LIVEMEDIA_ENCRYPTION}")
;;
*.dir)
echo "directory"
@@ -320,24 +418,40 @@
roopt="ro"
fi
+ # Read image names from ${MODULE}.lst if it exists
+ if [ -e "${image_directory}/${MODULE}.lst" ]; then
+ for image in $(cat "${image_directory}/${MODULE}.lst"); do
+ image_string="${image_string} ${image_directory}/${image}";
+ done
+ else
+ # If ${MODULE}.lst does not exist, create a list of images
+ for image_type in "ext2" "squashfs" "dir"; do
+ for image in "${image_directory}"/*."${image_type}"; do
+ if [ -e "${image}" ]; then
+ image_string="${image_string} ${image}";
+ fi
+ done
+ done
+ # Now sort the list
+ image_string=$(echo ${image_string} | sed -e 's/ /\n/g' | sort )
+ fi
+
mkdir -p "${croot}"
- for image_type in "ext2" "squashfs" "dir" ; do
- for image in "${image_directory}"/*."${image_type}"; do
- imagename=$(basename "${image}")
- if [ -d "${image}" ]; then
- # it is a plain directory: do nothing
- rofsstring="${image}=${roopt}:${rofsstring}"
- rofslist="${image} ${rofslist}"
- elif [ -f "${image}" ]; then
- backdev=$(get_backing_device "$image")
- fstype=$(get_fstype "${backdev}")
- if [ "${fstype}" = "unknown" ]; then
- panic "Unknown file system type on ${backdev} (${image})"
- fi
- mkdir -p "${croot}/${imagename}"
- mount -t "${fstype}" -o ro "${backdev}" "${croot}/${imagename}" || panic "Can not mount $backdev ($image) on ${croot}/${imagename}" && rofsstring="${croot}/${imagename}=${roopt}:${rofsstring}" && rofslist="${croot}/${imagename} ${rofslist}"
+ for image in ${image_string}; do
+ imagename=$(basename "${image}")
+ if [ -d "${image}" ]; then
+ # it is a plain directory: do nothing
+ rofsstring="${image}=${roopt}:${rofsstring}"
+ rofslist="${image} ${rofslist}"
+ elif [ -f "${image}" ]; then
+ backdev=$(get_backing_device "$image")
+ fstype=$(get_fstype "${backdev}")
+ if [ "${fstype}" = "unknown" ]; then
+ panic "Unknown file system type on ${backdev} (${image})"
fi
- done
+ mkdir -p "${croot}/${imagename}"
+ mount -t "${fstype}" -o ro "${backdev}" "${croot}/${imagename}" || panic "Can not mount $backdev ($image) on ${croot}/${imagename}" && rofsstring="${croot}/${imagename}=${roopt}:${rofsstring}" && rofslist="${croot}/${imagename} ${rofslist}"
+ fi
done
rofsstring=${rofsstring%:}
@@ -386,17 +500,11 @@
;;
esac
done
- # shows cow fs on /cow for use by live-snapshot
- mkdir -p "${rootmnt}/cow"
- mount -o bind /cow "${rootmnt}/cow"
fi
- # move the first mount; no head in busybox-initramfs
- for d in $(mount -t squashfs | cut -d\ -f 3); do
- mkdir -p "${rootmnt}/rofs"
- mount -o move "${d}" "${rootmnt}/rofs"
- break
- done
+ # shows cow fs on /cow for use by casper-snapshot
+ mkdir -p "${rootmnt}/cow"
+ mount -o bind /cow "${rootmnt}/cow"
}
check_dev ()
@@ -408,7 +516,7 @@
fi
if [ -n "${LIVEMEDIA_OFFSET}" ]; then
- loopdevname=$(setup_loop "${devname}" "loop" "/sys/block/loop*" "${LIVEMEDIA_OFFSET}")
+ loopdevname=$(setup_loop "${devname}" "loop" "/sys/block/loop*" "${LIVEMEDIA_OFFSET}" '')
devname="${loopdevname}"
fi
@@ -489,6 +597,8 @@
exec > live.log
exec 2>&1
+ parse_cmdline
+
set_usplash_timeout
[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/live-premount"
pulsate
@@ -508,9 +618,9 @@
fi
else
# Scan local devices for the image
- for i in 0 1 2 3 4 5 6 7 8 9 a b c d e f 10 11 12 13; do
+ for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19; do
livefs_root=$(find_livefs $i)
- if [ "${livefs_root}" ]; then
+ if [ -n "${livefs_root}" ]; then
break
fi
sleep 1
More information about the Debian-live-changes
mailing list