X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=scripts%2Fcasper;h=17e19ae245b794e1c7b0271d454db0bfbf601048;hb=3939ae5680826a0ae16a7942adeb8c514801a1f1;hp=f932c65e508fcad2be3c775cab7071cfb348ccac;hpb=0a8e85ff66e30694a0583614f0ae90c36e8d44f6;p=live-boot-grml.git diff --git a/scripts/casper b/scripts/casper index f932c65..17e19ae 100644 --- a/scripts/casper +++ b/scripts/casper @@ -29,6 +29,7 @@ fi parse_cmdline () { + PRESEEDS= # looking for casper specifics options as kernel parameters for x in $(cat /proc/cmdline); do case $x in @@ -46,14 +47,20 @@ parse_cmdline () ;; netboot*) export NETBOOT=${x#netboot=} ;; + access=*) + export ACCESS=${x#access=} ;; + xdebconf) + export XDEBCONF="Yes" ;; toram) - export TORAM=1 ;; + export TORAM="Yes" ;; todisk=*) export TODISK=${x#todisk=} ;; showmounts) - export SHOWMOUNTS=1 ;; + export SHOWMOUNTS="Yes" ;; persistent) - export PERSISTENT=1 ;; + export PERSISTENT="Yes" ;; + nopersistent) + export PERSISTENT="" ;; ip*) STATICIP=${x#ip=} if [ "${STATICIP}" == "" ]; then @@ -62,28 +69,33 @@ parse_cmdline () export STATICIP ;; casper-getty) export CASPERGETTY=1 ;; - console=*) - export DEFCONSOLE=$(sed -e 's%.*console=%console=%' /proc/cmdline) ;; - bootfrom=*) - export LIVEMEDIA=${x#bootfrom=} ;; - live-media=*) - export LIVEMEDIA=${x#live-media=} ;; + bootfrom=*|live-media=*) + export LIVEMEDIA=${x#*=} ;; live-media-timeout=*) export LIVEMEDIA_TIMEOUT=${x#live-media-timeout=} ;; - debian-installer/locale=*) - export LOCALE=${x#debian-installer/locale=} ;; - locale=*) - export LOCALE=${x#locale=} ;; - kbd-chooser/method=*) - export KBD=${x#kbd-chooser/method=} ;; - keyb=*) - export KBD=${x#keyb=} ;; - console-setup/layoutcode=*) - export CSLAYOUT=${x#console-setup/layoutcode=} ;; - console-setup/variantcode=*) - export CSVARIANT=${x#console-setup/variantcode=} ;; - console-setup/modelcode=*) - export CSMODEL=${x#console-setup/modelcode=} ;; + 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=$(sed -e 's%.*console=%console=%' /proc/cmdline) ;; esac done @@ -214,7 +226,7 @@ do_netmount() { modprobe "${MP_QUIET}" af_packet # For DHCP - ipconfig ${DEVICE} /tmp/net-${DEVICE}.conf + ipconfig ${DEVICE} /tmp/net-${DEVICE}.conf | tee /netboot.config if [ "${NFSROOT}" = "auto" ]; then NFSROOT=${ROOTSERVER}:${ROOTPATH} @@ -414,6 +426,7 @@ setup_unionfs() { rofsstring=${rofsstring%:} mkdir -p /cow + cowdevice="tmpfs" cow_fstype="tmpfs" @@ -472,6 +485,12 @@ check_dev () if [ -z "${devname}" ]; then devname=$(sys2dev "${sysdev}") fi + + if [ -n "${LIVEMEDIA_OFFSET}" ]; then + loopdevname=$(setup_loop "${devname}" "loop" "/sys/block/loop*" "${LIVEMEDIA_OFFSET}") + devname="${loopdevname}" + fi + fstype=$(get_fstype "${devname}") if is_supported_fs ${fstype}; then mount -t ${fstype} -o ro "${devname}" $mountpoint || continue @@ -482,6 +501,10 @@ check_dev () umount $mountpoint fi fi + + if [ -n "${LIVEMEDIA_OFFSET}" ]; then + losetup -d "${loopdevname}" + fi return 1 } @@ -566,7 +589,7 @@ mountroot() { 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 [ -n "${livefs_root}" ]; then break @@ -601,12 +624,6 @@ mountroot() { run_scripts /scripts/casper-bottom [ "$quiet" != "y" ] && log_end_msg - if [ -f /casper.vars ]; then - echo "Casper vars:" - cat /casper.vars - fi - - echo "Casper Log:" exec 1>&6 6>&- exec 2>&7 7>&- cp casper.log "${rootmnt}/var/log/"