X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=scripts%2Flive;h=2b8ff0109a37e9022c763df2e1f733eb368d711e;hb=d645cf3735a13845ef25042a1974dd72e96a64a7;hp=4ba4257952cb131a955d39df35f7d3efa4dbb2d0;hpb=dbad7350e28a6fff0aea7dd683315e79b37d2f14;p=live-boot-grml.git diff --git a/scripts/live b/scripts/live index 4ba4257..2b8ff01 100755 --- a/scripts/live +++ b/scripts/live @@ -21,6 +21,17 @@ HOSTNAME="host" mkdir -p "${mountpoint}" +# Create /etc/mtab for debug purpose and future syncs +if [ ! -d /etc ] +then + mkdir /etc/ +fi + +if [ ! -f /etc/mtab ] +then + touch /etc/mtab +fi + [ -f /etc/live.conf ] && . /etc/live.conf export USERNAME USERFULLNAME HOSTNAME @@ -98,6 +109,11 @@ Arguments () export IGNORE_UUID ;; + integrity-check) + INTEGRITY_CHECK="Yes" + export INTEGRITY_CHECK + ;; + ip=*) STATICIP="${ARGUMENT#ip=}" @@ -275,9 +291,9 @@ Arguments () export NOPROGRAMCRASHES ;; - norestrictedmanager) - NORESTRICTEDMANAGER="Yes" - export NORESTRICTEDMANAGER + nojockey) + NOJOCKEY="Yes" + export NOJOCKEY ;; nosudo) @@ -285,9 +301,9 @@ Arguments () export NOSUDO ;; - noswap) - NOSWAP="Yes" - export NOSWAP + swapon) + SWAPON="Yes" + export SWAPON ;; noupdatenotifier) @@ -315,6 +331,15 @@ Arguments () export PERSISTENT ;; + persistent=*) + PERSISTENT="${ARGUMENT#persistent=}" + if [ -z "${PERSISTENT}" ] + then + PERSISTENT="Yes" + fi + export PERSISTENT + ;; + nopersistent) NOPERSISTENT="Yes" export NOPERSISTENT @@ -333,9 +358,9 @@ Arguments () url=*) location="${ARGUMENT#url=}" - mount -n -o bind /sys /root/sys - mount -n -o bind /proc /root/proc - mount -n -o bind /dev /root/dev + mount -o bind /sys /root/sys + mount -o bind /proc /root/proc + mount -o bind /dev /root/dev mkdir -p /root/var/run/network chroot /root dhclient eth0 @@ -489,7 +514,7 @@ matches_uuid () path="${1}" uuid="$(cat /conf/uuid.conf)" - for try_uuid_file in "${mountpoint}/.disk/live-uuid"* + for try_uuid_file in "${path}/.disk/live-uuid"* do [ -e "${try_uuid_file}" ] || continue @@ -538,7 +563,7 @@ mount_images_in_directory () { directory="${1}" rootmnt="${2}" - mac="${3}" + mac="${3}" if match_files_in_dir "${directory}/${LIVE_MEDIA_PATH}/*.squashfs" || @@ -550,7 +575,7 @@ mount_images_in_directory () [ -n "${mac}" ] && adddirectory="${directory}/${LIVE_MEDIA_PATH}/${mac}" setup_unionfs "${directory}/${LIVE_MEDIA_PATH}" "${rootmnt}" "${adddirectory}" else - : + panic "No supported filesystem images found at /${LIVE_MEDIA_PATH}." fi } @@ -558,7 +583,7 @@ is_nice_device () { sysfs_path="${1#/sys}" - if /lib/udev/path_id "${sysfs_path}" | grep -E -q "ID_PATH=(usb|pci-[^-]*-[ide|scsi|usb])" + if /lib/udev/path_id "${sysfs_path}" | grep -E -q "ID_PATH=(usb|pci-[^-]*-(ide|scsi|usb))" then return 0 elif echo "${sysfs_path}" | grep -q '^/block/vd[a-z]$' @@ -593,7 +618,7 @@ copy_live_to () if [ "${copytodev}" = "ram" ] then # copying to ram: - freespace=$( expr $(awk '/MemFree/{print $2}' /proc/meminfo) + $( cat /proc/meminfo | grep Cached | head -n 1 | awk '/Cached/{print $2}' - ) ) + freespace=$( expr $(awk '/MemFree/{print $2}' /proc/meminfo) + $( awk '/\