export USERFULLNAME LIVECONF
;;
+ ignore_uuid)
+ IGNORE_UUID="Yes" ;;
+
ip=*)
STATICIP="${ARGUMENT#ip=}"
export SHOWMOUNTS
;;
+ textonly)
+ TEXTONLY="Yes"
+ export TEXTONLY
+ ;;
+
timezone=*)
TIMEZONE="${ARGUMENT#timezone=}"
export TIMEZONE
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
if [ -n "${fstype}" ]
then
# Copying stuff...
- mount -t "${fstype}" -o ro "${fromdev}" "${tomount}"
+ mount -t "${fstype}" -o ro,noatime,nodiratime "${fromdev}" "${tomount}"
cp -a "${tomount}"/* ${todir}
umount "${tomount}"
else
then
for IMAGE in $(cat ${image_directory}/filesystem.${MODULE}.module)
do
- image_string="${image_string} ${image_directory}/${image}"
+ image_string="${image_string} ${image_directory}/${IMAGE}"
done
elif [ -e "${image_directory}/${MODULE}.module" ]
then
for IMAGE in $(cat ${image_directory}/${MODULE}.module)
do
- image_string="${image_string} ${image_directory}/${image}"
+ image_string="${image_string} ${image_directory}/${IMAGE}"
done
else
# ${MODULE}.module does not exist, create a list of images
mkdir -p "${croot}/${imagename}"
echo "debug: Can not mount backdev ${backdev} (image = ${image}) on croot/imagename ${croot}/${imagename}"
- mount -t "${fstype}" -o ro "${backdev}" "${croot}/${imagename}" || panic "Can not mount ${backdev} (${image}) on ${croot}/${imagename}" && rofsstring="${croot}/${imagename}=${roopt}:${rofsstring}" && rofslist="${croot}/${imagename} ${rofslist}"
+ mount -t "${fstype}" -o ro,noatime,nodiratime "${backdev}" "${croot}/${imagename}" || panic "Can not mount ${backdev} (${image}) on ${croot}/${imagename}" && rofsstring="${croot}/${imagename}=${roopt}:${rofsstring}" && rofslist="${croot}/${imagename} ${rofslist}"
fi
done
fi
fi
- mount ${cowdevice} -t ${cow_fstype} -o rw /cow || panic "Can not mount ${cowdevice} on /cow"
+ mount ${cowdevice} -t ${cow_fstype} -o rw,noatime,nodiratime /cow || panic "Can not mount ${cowdevice} on /cow"
- mount -t ${UNIONTYPE} -o dirs=/cow=rw:${rofsstring} ${UNIONTYPE} "${rootmnt}" || panic "${UNIONTYPE} mount failed"
+ mount -t ${UNIONTYPE} -o noatime,nodiratime,dirs=/cow=rw:${rofsstring} ${UNIONTYPE} "${rootmnt}" || panic "${UNIONTYPE} mount failed"
# Adding other custom mounts
if [ -n "${PERSISTENT}" ]
if [ -b "${homecow}" ]
then
- mount -t $(get_fstype "${homecow}") -o rw "${homecow}" "${rootmnt}/home"
+ mount -t $(get_fstype "${homecow}") -o rw,noatime,nodiratime "${homecow}" "${rootmnt}/home"
export HOMEMOUNTED=1 # used to proper calculate free space in do_snap_copy()
else
[ "${quiet}" != "y" ] && log_warning_msg "Unable to find the persistent home medium"
# shows cow fs on /cow for use by live-snapshot
mkdir -p "${rootmnt}/live/cow"
- mount -o bind /cow "${rootmnt}/live/cow"
+ mount -o move /cow "${rootmnt}/live/cow"
}
check_dev ()
{
sysdev="${1}"
devname="${2}"
+ skip_uuid_check="${3}"
if [ -z "${devname}" ]
then
if is_supported_fs ${fstype}
then
- mount -t ${fstype} -o ro "${devname}" ${mountpoint} || continue
+ mount -t ${fstype} -o ro,noatime,nodiratime "${devname}" ${mountpoint} || continue
if is_live_path ${mountpoint}
- then
+ if is_live_path $mountpoint && \
+ ([ "$skip_uuid_check" ] || matches_uuid $mountpoint); then
echo ${mountpoint}
return 0
else
# 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