X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=scripts%2Flive;h=f204a1ee7970ee75da509709bad9e16d4f34110a;hb=9431b744fbb49b0b3d52d205126b2cbe6a7980ae;hp=b1157c57d030b1722b83fa10c7e52df6e7a3a77b;hpb=6a4d65ec300345fa19ecddafcabec9b83372a33c;p=live-boot-grml.git diff --git a/scripts/live b/scripts/live index b1157c5..f204a1e 100755 --- a/scripts/live +++ b/scripts/live @@ -79,6 +79,11 @@ Arguments () export USERFULLNAME LIVECONF ;; + ignore_uuid) + IGNORE_UUID="Yes" + export IGNORE_UUID + ;; + ip=*) STATICIP="${ARGUMENT#ip=}" @@ -434,6 +439,31 @@ is_live_path () 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 @@ -732,7 +762,7 @@ do_snap_copy () if [ -n "${fstype}" ] then # Copying stuff... - mount -t "${fstype}" -o ro,noatime "${fromdev}" "${tomount}" + mount -t "${fstype}" -o ro,noatime,nodiratime "${fromdev}" "${tomount}" cp -a "${tomount}"/* ${todir} umount "${tomount}" else @@ -908,7 +938,7 @@ setup_unionfs () mkdir -p "${croot}/${imagename}" echo "debug: Can not mount backdev ${backdev} (image = ${image}) on croot/imagename ${croot}/${imagename}" - mount -t "${fstype}" -o ro,noatime "${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 @@ -932,9 +962,9 @@ setup_unionfs () fi fi - mount ${cowdevice} -t ${cow_fstype} -o rw,noatime /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 noatime,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}" ] @@ -945,7 +975,7 @@ setup_unionfs () if [ -b "${homecow}" ] then - mount -t $(get_fstype "${homecow}") -o rw,noatime "${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" @@ -983,6 +1013,7 @@ check_dev () { sysdev="${1}" devname="${2}" + skip_uuid_check="${3}" if [ -z "${devname}" ] then @@ -999,9 +1030,11 @@ check_dev () if is_supported_fs ${fstype} then - mount -t ${fstype} -o ro,noatime "${devname}" ${mountpoint} || continue + mount -t ${fstype} -o ro,noatime,nodiratime "${devname}" ${mountpoint} || continue if is_live_path ${mountpoint} + if is_live_path $mountpoint && \ + ([ "${skip_uuid_check}" ] || matches_uuid ${mountpoint}) then echo ${mountpoint} return 0 @@ -1025,7 +1058,7 @@ find_livefs () # 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