USERNAME="user"
USERFULLNAME="Live user"
HOSTNAME="host"
-BUILD_SYSTEM="Custom"
mkdir -p "${mountpoint}"
[ -f /etc/live.conf ] && . /etc/live.conf
-export USERNAME USERFULLNAME HOSTNAME BUILD_SYSTEM
+export USERNAME USERFULLNAME HOSTNAME
. /scripts/live-helpers
console=*)
DEFCONSOLE="${ARGUMENT#*=}"
- export DEFCONFSOLE
+ export DEFCONSOLE
;;
debug)
export USERFULLNAME LIVECONF
;;
+ ignore_uuid)
+ IGNORE_UUID="Yes"
+ export IGNORE_UUID
+ ;;
+
ip=*)
STATICIP="${ARGUMENT#ip=}"
export TORAM MODULETORAM
;;
+ exposedroot)
+ EXPOSED_ROOT="Yes"
+ export EXPOSED_ROOT
+ ;;
+
union=*)
UNIONTYPE="${ARGUMENT#union=}"
export UNIONTYPE
return 1
}
+matches_uuid ()
+{
+ if [ "${IGNORE_UUID}" ] || [ ! -e /conf/uuid.conf ]
+ then
+ return 0
+ fi
+
+ path="${1}"
+ uuid="$(cat /conf/uuid.conf)"
+
+ for try_uuid_file in "${mountpoint}/.disk/casper-uuid"*
+ do
+ [ -e "${try_uuid_file}" ] || continue
+
+ try_uuid="$(cat "${try_uuid_file}")"
+
+ if [ "${uuid}" = "${try_uuid}" ]
+ then
+ return 0
+ fi
+ done
+
+ return 1
+}
+
get_backing_device ()
{
case "${1}" in
{
rc=1
- modprobe "${MP_QUIET}" af_packet # For DHCP
+ modprobe -q af_packet # For DHCP
udevtrigger
udevsettle
{
rc=1
- modprobe "${MP_QUIET}" nfs
+ modprobe -q nfs
if [ -z "${NFSOPTS}" ]
then
fi
[ "${quiet}" != "y" ] && log_begin_msg "Trying mount.cifs ${NFSROOT} ${mountpoint} ${CIFSOPTS}"
- modprobe "${MP_QUIET}" cifs
+ modprobe -q cifs
if mount.cifs "${NFSROOT}" "${mountpoint}" "${CIFSOPTS}"
then
image_directory="${1}"
rootmnt="${2}"
- modprobe "${MP_QUIET}" -b ${UNIONTYPE}
+ modprobe -q -b ${UNIONTYPE}
# run-init can't deal with images in a subdir, but we're going to
# move all of these away before it runs anyway. No, we're not,
fi
fi
- mount ${cowdevice} -t ${cow_fstype} -o rw,noatime /cow || panic "Can not mount ${cowdevice} on /cow"
+ rofscount=$(echo ${rofslist} |wc -w)
- mount -t ${UNIONTYPE} -o noatime,dirs=/cow=rw:${rofsstring} ${UNIONTYPE} "${rootmnt}" || panic "${UNIONTYPE} mount failed"
+ if [ -n "${EXPOSED_ROOT}" ]
+ then
+ if [ ${rofscount} -ne 1 ]
+ then
+ panic "only one RO file system supported with exposedroot: ${rofslist}"
+ fi
+ exposedrootfs=${rofslist%% }
+
+ mount --bind ${exposedrootfs} ${rootmnt} || \
+ panic "bind mount of ${exposedrootfs} failed"
+
+ mount ${cowdevice} -t ${cow_fstype} -o rw,noatime /cow || \
+ panic "Can not mount ${cowdevice} on /cow"
+
+ cow_dirs='/tmp /var/tmp /var/lock /var/run /var/log /var/spool
+ /home /live /var/lib/live'
+
+ for dir in ${cow_dirs}; do
+ mkdir -p /cow${dir}
+ mount -t ${UNIONTYPE} \
+ -o rw,noatime,dirs=/cow${dir}=rw:${exposedrootfs}${dir}=ro \
+ ${UNIONTYPE} "${rootmnt}${dir}" || \
+ panic "mount ${UNIONTYPE} on ${rootmnt}${dir} failed with option \
+ rw,noatime,dirs=/cow${dir}=rw:${exposedrootfs}${dir}=ro"
+ done
+ else
+ mount ${cowdevice} -t ${cow_fstype} -o rw,noatime /cow || \
+ panic "Can not mount ${cowdevice} on /cow"
+ mount -t ${UNIONTYPE} -o noatime,dirs=/cow=rw:${rofsstring} \
+ ${UNIONTYPE} "${rootmnt}" || panic "mount ${UNIONTYPE} on \
+ ${rootmnt} failed with option noatime,dirs=/cow=rw:${rofsstring}"
+ fi
# Adding other custom mounts
if [ -n "${PERSISTENT}" ]
{
sysdev="${1}"
devname="${2}"
+ skip_uuid_check="${3}"
if [ -z "${devname}" ]
then
then
mount -t ${fstype} -o ro,noatime "${devname}" ${mountpoint} || continue
- if is_live_path ${mountpoint}
+ if is_live_path ${mountpoint} && \
+ ([ "${skip_uuid_check}" ] || matches_uuid ${mountpoint})
then
echo ${mountpoint}
return 0
# first look at the one specified in the command line
if [ ! -z "${LIVE_MEDIA}" ]
then
- if check_dev "null" "${LIVE_MEDIA}"
+ if check_dev "null" "${LIVE_MEDIA}" "skip_uuid_check"
then
return 0
fi