export PATH=/root/usr/bin:/root/usr/sbin:/root/bin:/root/sbin:/usr/bin:/usr/sbin:/bin:/sbin
-mountpoint=/live_media
+echo "/root/lib" >> /etc/ld.so.conf
+echo "/root/usr/lib" >> /etc/ld.so.conf
-root_persistence="casper-rw"
-home_persistence="home-rw"
-root_snapshot_label="casper-sn"
-home_snapshot_label="home-sn"
+mountpoint=/cdrom
-USERNAME="casper"
+USERNAME=casper
USERFULLNAME="Live session user"
-HOSTNAME="live"
-BUILD_SYSTEM="Debian"
+HOST=live
+BUILD_SYSTEM=Custom
mkdir -p $mountpoint
[ -f /etc/casper.conf ] && . /etc/casper.conf
-export USERNAME USERFULLNAME HOSTNAME BUILD_SYSTEM
+export USERNAME USERFULLNAME HOST BUILD_SYSTEM
. /scripts/casper-helpers
touch /casper.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 ;;
- casper-getty)
- export CASPERGETTY=1 ;;
- bootfrom=*|live-media=*)
- export LIVEMEDIA=${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#*=} ;;
- 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
-}
-
is_casper_path() {
path=$1
if [ -d "$path/casper" ]; then
return 1
}
-is_supported_fs ()
-{
+is_supported_fs () {
# FIXME: do something better like the scan of supported filesystems
fstype="${1}"
case ${fstype} in
modprobe "${MP_QUIET}" af_packet # For DHCP
+ udevtrigger
+ udevsettle
+
ipconfig ${DEVICE} /tmp/net-${DEVICE}.conf | tee /netboot.config
if [ "${NFSROOT}" = "auto" ]; then
# Let's just mount the read-only file systems first
rofsstring=""
rofslist=""
- if [ "${NETBOOT}" == "nfs" ] ; then
+ if [ "${NETBOOT}" = "nfs" ] ; then
roopt="nfsro" # go aroung a bug in nfs-unionfs locking
else
roopt="ro"
;;
esac
done
+ # shows cow fs on /cow for use by casper-snapshot
+ mkdir -p "${rootmnt}/cow"
+ mount -o bind /cow "${rootmnt}/cow"
fi
- # shows cow fs on /cow for use by casper-snapshot
- mkdir -p "${rootmnt}/cow"
- mount -o bind /cow "${rootmnt}/cow"
+ # 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
}
check_dev ()
exec > casper.log
exec 2>&1
- parse_cmdline
-
set_usplash_timeout
[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/casper-premount"
pulsate
if do_netmount ; then
livefs_root="${mountpoint}"
else
- panic "Unable to find a the network rootfs live file system"
+ panic "Unable to find a live file system on the network"
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
livefs_root=$(find_livefs $i)
- if [ -n "${livefs_root}" ]; then
+ if [ "${livefs_root}" ]; then
break
fi
sleep 1
panic "Unable to find a medium containing a live file system"
fi
- if [ -n "${TORAM}" ]; then
+ if [ "${TORAM}" ]; then
live_dest="ram"
- elif [ -n "${TODISK}" ]; then
+ elif [ "${TODISK}" ]; then
live_dest="${TODISK}"
fi
- if [ -n "${live_dest}" ]; then
- [ "$quiet" != "y" ] && log_begin_msg "Copying live_media to ${live_dest}"
+ if [ "${live_dest}" ]; then
+ log_begin_msg "Copying live_media to ${live_dest}"
copy_live_to "${livefs_root}" "${live_dest}"
- [ "$quiet" != "y" ] && log_end_msg
+ log_end_msg
fi
mount_images_in_directory "${livefs_root}" "${rootmnt}"