X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=scripts%2Flive;h=d06dd209eca8855338bfcd5e73d7009f660f931e;hb=a8034024765e91f0b0e6edb9a5b6e75aa5aeac92;hp=c0e59a8a4f0ad91a821ac7dc6f16284c11947d95;hpb=4f974a9e68707dac0517f30a6b3c249380495cca;p=live-boot-grml.git diff --git a/scripts/live b/scripts/live index c0e59a8..d06dd20 100755 --- a/scripts/live +++ b/scripts/live @@ -109,6 +109,11 @@ Arguments () export IGNORE_UUID ;; + integrity-check) + INTEGRITY_CHECK="Yes" + export INTEGRITY_CHECK + ;; + ip=*) STATICIP="${ARGUMENT#ip=}" @@ -422,6 +427,11 @@ Arguments () export PLAIN_ROOT ;; + skipunion) + SKIP_UNION_MOUNTS="Yes" + export SKIP_UNION_MOUNTS + ;; + root=*) ROOT="${ARGUMENT#root=}" export ROOT @@ -658,7 +668,6 @@ copy_live_to () cp -a ${copyfrom}/* ${copyto} # "cp -a" from busybox also copies hidden files fi - livefs_root umount ${copyfrom} mount -r -o move ${copyto} ${copyfrom} fi @@ -695,7 +704,8 @@ do_netmount () # Check if we have a network device at all if ! ls /sys/class/net/eth0 > /dev/null 2>&1 && \ ! ls /sys/class/net/wlan0 > /dev/null 2>&1 && \ - ! ls /sys/class/net/ath0 > /dev/null 2>&1 + ! ls /sys/class/net/ath0 > /dev/null 2>&1 && \ + ! ls /sys/class/net/ra0 > /dev/null 2>&1 then panic "No supported network device found, maybe a non-mainline driver is required." fi @@ -1080,6 +1090,12 @@ setup_unionfs () do imagename=$(basename "${image}") + export image devname + maybe_break live-realpremount + log_begin_msg "Running /scripts/live-realpremount" + run_scripts /scripts/live-realpremount + log_end_msg + if [ -d "${image}" ] then # it is a plain directory: do nothing @@ -1237,8 +1253,12 @@ setup_unionfs () mount --bind ${exposedrootfs} ${rootmnt} || \ panic "bind mount of ${exposedrootfs} failed" - cow_dirs='/var/tmp /var/lock /var/run /var/log /var/spool - /home /var/lib/live' + if [ -z "${SKIP_UNION_MOUNTS}" ] + then + cow_dirs='/var/tmp /var/lock /var/run /var/log /var/spool /home /var/lib/live' + else + cow_dirs='' + fi for dir in ${cow_dirs}; do mkdir -p /cow${dir} @@ -1426,6 +1446,32 @@ set_usplash_timeout () fi ; fi } +integrity_check () +{ + media_mountpoint="${1}" + + log_begin_msg "Checking media integrity" + + cd ${media_mountpoint} + /bin/md5sum -c md5sum.txt < /dev/tty8 > /dev/tty8 + RC="${?}" + + log_end_msg + + if [ "${RC}" -eq 0 ] + then + log_success_msg "Everything ok, will reboot in 10 seconds." + sleep 10 + cd / + umount ${media_mountpoint} + sync + echo u > /proc/sysrq-trigger + echo b > /proc/sysrq-trigger + else + panic "Not ok, a media defect is likely, switch to VT8 for details." + fi +} + mountroot () { if [ -x /scripts/local-top/cryptroot ]; then @@ -1492,6 +1538,11 @@ mountroot () panic "Unable to find a medium containing a live file system" fi + if [ "${INTEGRITY_CHECK}" ] + then + integrity_check "${livefs_root}" + fi + if [ "${TORAM}" ] then live_dest="ram" @@ -1519,7 +1570,7 @@ mountroot () log_end_msg maybe_break live-bottom - log_begin_msg "Running /scripts/live-bottom" + log_begin_msg "Running /scripts/live-bottom\n" run_scripts /scripts/live-bottom log_end_msg