export IGNORE_UUID
;;
+ integrity-check)
+ INTEGRITY_CHECK="Yes"
+ export INTEGRITY_CHECK
+ ;;
+
ip=*)
STATICIP="${ARGUMENT#ip=}"
export PERSISTENT
;;
+ persistent-path=*)
+ PERSISTENT_PATH="${ARGUMENT#persistent-path=}"
+ export PERSISTENT_PATH
+ ;;
+
nopersistent)
NOPERSISTENT="Yes"
export NOPERSISTENT
export PLAIN_ROOT
;;
+ skipunion)
+ SKIP_UNION_MOUNTS="Yes"
+ export SKIP_UNION_MOUNTS
+ ;;
+
root=*)
ROOT="${ARGUMENT#root=}"
export ROOT
cp -a ${copyfrom}/* ${copyto} # "cp -a" from busybox also copies hidden files
fi
- livefs_root
umount ${copyfrom}
mount -r -o move ${copyto} ${copyfrom}
fi
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
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}
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
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"
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