X-Git-Url: https://git.grml.org/?p=grml2usb.git;a=blobdiff_plain;f=grml2usb;h=9c5f1d92317ee564832e214653091c3b9319e2b4;hp=64d95eb38c6aa625484ee634d6d2f917ea66d2fb;hb=0adc8aa48b1edc748056a3f54d0f73cd849fd77e;hpb=cd37abd0e9a40ce86f1351ff93f574c89e778318 diff --git a/grml2usb b/grml2usb index 64d95eb..9c5f1d9 100755 --- a/grml2usb +++ b/grml2usb @@ -4,7 +4,7 @@ # Authors: grml-team (grml.org), (c) Michael Prokop # Bug-Reports: see http://grml.org/bugs/ # License: This file is licensed under the GPL v2. -# Latest change: Fre Mär 16 14:43:44 CET 2007 [mika] +# Latest change: Mit Apr 04 00:02:50 CEST 2007 [mika] ################################################################################ # colors {{{ @@ -49,7 +49,7 @@ LANGUAGE='C' LC_ALL='C' PROGRAMNAME=${0##*/} - VERSION='0.7' + VERSION='0.7.5' ISO="$1" DEVICE="$2" [ -n "$TMPMNT" ] || TMPMNT='/mnt/test' @@ -82,6 +82,9 @@ Usage: Usage example - install grml-small to usb-device on /mnt/external1: $PROGRAMNAME grml_small_0.2.iso /mnt/external1 +Usage example - install currently running grml to usb-device on /mnt/external1: + $PROGRAMNAME /cdrom /mnt/external1 + Usage example - delete grml-installation from /mnt/external1: $PROGRAMNAME uninstall /mnt/external1 @@ -134,8 +137,14 @@ mount_device(){ mount_iso(){ echo -n "Mounting ${ISO} to ${TMPMNT}: " - debugit "debug: mount -o loop ${ISO} ${TMPMNT}" - if mount -o loop "${ISO}" ${TMPMNT} ; then + local mount_opts_="-o loop" + if [ -d $ISO ]; then + mount_opts_="--bind" + elif [ -b $ISO ]; then + mount_opts_="" + fi + debugit "debug: mount $mount_opts_ ${ISO} ${TMPMNT}" + if mount $mount_opts_ "${ISO}" ${TMPMNT} ; then echo "${WHITE}done${NORMAL}" else echo 1>&2 "${RED}Problem? You got an error saying 'mount: could not find any free loop device'?