X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=scripts%2Flive;h=89fcd50d5360b8da53588575d4290a0f6cb2f054;hb=2c2184b6deff74fd2ea091edeee34efa08b74b09;hp=d125eae1e9d1b876ac7cdadcf002b92cb215154b;hpb=b786a1129a4d5014389a603e00cd8ecabf63a10e;p=live-boot-grml.git diff --git a/scripts/live b/scripts/live index d125eae..89fcd50 100755 --- a/scripts/live +++ b/scripts/live @@ -773,9 +773,11 @@ do_httpmount () then case "$url" in tftp*) - ip="$(dirname $url | sed -e 's|tftp://||g')" - log_begin_msg "Trying tftp -g -b 10240 -r $(basename ${url}) -l ${dest}/$(basename ${url}) $ip" - tftp -g -b 10240 -r $(basename ${url}) -l ${dest}/$(basename ${url}) $ip + ip="$(dirname $url | sed -e 's|tftp://||g' -e 's|/.*$||g')" + rfile="$(echo $url | sed -e "s|tftp://$ip||g")" + lfile="$(basename $url)" + log_begin_msg "Trying tftp -g -b 10240 -r $rfile -l ${dest}/$lfile $ip" + tftp -g -b 10240 -r $rfile -l ${dest}/$lfile $ip ;; *) @@ -925,7 +927,7 @@ find_snap () if [ "${PERSISTENT}" != "nofiles" ] then # search for image files - snapdata=$(find_files "${snap_label}.squashfs ${snap_label}.cpio.gz ${snap_label}.ext2 ${snap_label}.ext3 ${snal_label}.ext4 ${snap_label}.jffs2") + snapdata=$(find_files "${snap_label}.squashfs ${snap_label}.cpio.gz ${snap_label}.ext2 ${snap_label}.ext3 ${snap_label}.ext4 ${snap_label}.jffs2") fi if [ -z "${snapdata}" ] @@ -944,7 +946,7 @@ try_snap () snap_mount="${2}" snap_type="${3}" - if [ ! -z "${snapdata}" ] + if [ -n "${snapdata}" ] && [ ! -b "${snapdata}" ] then log_success_msg "found snapshot: ${snapdata}" snapdev="$(echo ${snapdata} | cut -f1 -d ' ')" @@ -983,12 +985,11 @@ try_snap () log_warning_msg "Impossible to include the ${snapfile} Snapshot file" fi - elif [ -b "${snapdata}" ] then # Try to find if it could be a snapshot partition dev="${snapdata}" - log_success_msg "found snapshot device on ${dev}" + log_success_msg "found snapshot ${snap_type} device on ${dev}" if echo "${dev}" | grep -qs loop then # strange things happens, user confused? @@ -1285,6 +1286,9 @@ setup_unionfs () ${rootmnt} failed with option noatime,dirs=/cow=rw:${rofsstring}" fi + # Correct the permissions of /: + chmod 0755 "${rootmnt}" + # tmpfs file systems touch /etc/fstab mkdir -p "${rootmnt}/live" @@ -1402,26 +1406,29 @@ find_livefs () # first look at the one specified in the command line case "${LIVE_MEDIA}" in - removable) + removable-usb) for sysblock in $(echo /sys/block/* | tr ' ' '\n' | grep -vE "/(loop|ram|dm-|fd)") do if [ "$(cat ${sysblock}/removable)" = "1" ] then - for dev in $(subdevices "${sysblock}") - do - if check_dev "${dev}" - then - return 0 - fi - done + if readlink ${sysblock}/device | grep -q usb + then + for dev in $(subdevices "${sysblock}") + do + if check_dev "${dev}" + then + return 0 + fi + done + fi fi done ;; - removable-usb) + removable) for sysblock in $(echo /sys/block/* | tr ' ' '\n' | grep -vE "/(loop|ram|dm-|fd)") do - if [ "$(cat ${sysblock}/removable)" = "1" ] && readlink ${sysblock}/device | grep -q usb + if [ "$(cat ${sysblock}/removable)" = "1" ] then for dev in $(subdevices "${sysblock}") do