Removing ubuntu support.
[live-boot-grml.git] / scripts / live
index 16a54c2..b4254e1 100755 (executable)
@@ -18,12 +18,11 @@ home_snapshot_label="home-sn"
 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
 
@@ -80,7 +79,9 @@ Arguments ()
                                ;;
 
                        ignore_uuid)
-                               IGNORE_UUID="Yes" ;;
+                               IGNORE_UUID="Yes"
+                               export IGNORE_UUID
+                               ;;
 
                        ip=*)
                                STATICIP="${ARGUMENT#ip=}"
@@ -437,20 +438,29 @@ 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
+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 ()
@@ -607,7 +617,7 @@ do_netmount ()
 {
        rc=1
 
-       modprobe "${MP_QUIET}" af_packet # For DHCP
+       modprobe -q af_packet # For DHCP
 
        udevtrigger
        udevsettle
@@ -677,7 +687,7 @@ do_nfsmount ()
 {
        rc=1
 
-       modprobe "${MP_QUIET}" nfs
+       modprobe -q nfs
 
        if [ -z "${NFSOPTS}" ]
        then
@@ -710,7 +720,7 @@ do_cifsmount ()
                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
@@ -751,7 +761,7 @@ do_snap_copy ()
                if [ -n "${fstype}" ]
                then
                        # Copying stuff...
-                       mount -t "${fstype}" -o ro,noatime,nodiratime "${fromdev}" "${tomount}"
+                       mount -t "${fstype}" -o ro,noatime "${fromdev}" "${tomount}"
                        cp -a "${tomount}"/* ${todir}
                        umount "${tomount}"
                else
@@ -850,7 +860,7 @@ setup_unionfs ()
        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,
@@ -927,7 +937,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,nodiratime "${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 "${backdev}" "${croot}/${imagename}" || panic "Can not mount ${backdev} (${image}) on ${croot}/${imagename}" && rofsstring="${croot}/${imagename}=${roopt}:${rofsstring}" && rofslist="${croot}/${imagename} ${rofslist}"
                fi
        done
 
@@ -951,9 +961,9 @@ setup_unionfs ()
                fi
        fi
 
-       mount ${cowdevice} -t ${cow_fstype} -o rw,noatime,nodiratime /cow || panic "Can not mount ${cowdevice} on /cow"
+       mount ${cowdevice} -t ${cow_fstype} -o rw,noatime /cow || panic "Can not mount ${cowdevice} on /cow"
 
-       mount -t ${UNIONTYPE} -o noatime,nodiratime,dirs=/cow=rw:${rofsstring} ${UNIONTYPE} "${rootmnt}" || panic "${UNIONTYPE} mount failed"
+       mount -t ${UNIONTYPE} -o noatime,dirs=/cow=rw:${rofsstring} ${UNIONTYPE} "${rootmnt}" || panic "${UNIONTYPE} mount failed"
 
        # Adding other custom mounts
        if [ -n "${PERSISTENT}" ]
@@ -964,7 +974,7 @@ setup_unionfs ()
 
                if [ -b "${homecow}" ]
                then
-                       mount -t $(get_fstype "${homecow}") -o rw,noatime,nodiratime "${homecow}" "${rootmnt}/home"
+                       mount -t $(get_fstype "${homecow}") -o rw,noatime "${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"
@@ -1019,11 +1029,11 @@ check_dev ()
 
        if is_supported_fs ${fstype}
        then
-               mount -t ${fstype} -o ro,noatime,nodiratime "${devname}" ${mountpoint} || continue
+               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
+               if is_live_path ${mountpoint} && \
+                       ([ "${skip_uuid_check}" ] || matches_uuid ${mountpoint})
+               then
                        echo ${mountpoint}
                        return 0
                else