X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=scripts%2Flive;h=2b8ff0109a37e9022c763df2e1f733eb368d711e;hb=d645cf3735a13845ef25042a1974dd72e96a64a7;hp=8543cf13243fa99033734738b608d77e964b9199;hpb=7038288c3b6045568169a6912edccab72f3561a1;p=live-boot-grml.git diff --git a/scripts/live b/scripts/live index 8543cf1..2b8ff01 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=}" @@ -658,7 +663,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 @@ -1427,6 +1431,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 @@ -1493,6 +1523,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" @@ -1520,7 +1555,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