set ISO to file:$ISO, not to file:$1 which is just wrong
[grml-debootstrap.git] / grml-debootstrap
index 89b5adc..bac2cd5 100755 (executable)
@@ -689,11 +689,13 @@ elif [ -n "$INTERACTIVE" ] ; then
    [ -n "$RELEASE" ] && INFOTEXT="$INFOTEXT
    Using release:   $RELEASE"
    [ -n "$HOSTNAME" ] && INFOTEXT="$INFOTEXT
-   Using hostname   $HOSTNAME"
+   Using hostname:  $HOSTNAME"
    [ -n "$MIRROR" ]  && INFOTEXT="$INFOTEXT
    Using mirror:    $MIRROR"
    [ -n "$ISO" ]  && INFOTEXT="$INFOTEXT
    Using ISO:       $ISO"
+   [ -n "$ARCH" ]  && INFOTEXT="$INFOTEXT
+   Using arch:      $ARCH"
 
    INFOTEXT="$INFOTEXT
 
@@ -718,9 +720,10 @@ else # if not running automatic installation display configuration and prompt fo
    fi
 
    [ -n "$RELEASE" ]  && echo "   Using release:   $RELEASE"
-   [ -n "$MIRROR" ]   && echo "   Using mirror:    $MIRROR"
    [ -n "$HOSTNAME" ] && echo "   Using hostname:  $HOSTNAME"
+   [ -n "$MIRROR" ]   && echo "   Using mirror:    $MIRROR"
    [ -n "$ISO" ]      && echo "   Using ISO:       $ISO"
+   [ -n "$ARCH" ]     && echo "   Using arch:      $ARCH"
    if [ -n "$VIRTUAL" ] ; then
       echo "   Deploying as Virtual Machine."
       [ -n "$VMSIZE" ] && echo "   Using Virtual Disk file with size of ${VMSIZE}."
@@ -842,7 +845,7 @@ if [ -n "$ISO" ] ; then
       file*) # do nothing
       ;;
       *)
-      ISO=file:$1
+      ISO=file:$ISO
       ;;
    esac
 fi
@@ -942,7 +945,7 @@ prepare_vm() {
 
   # if dm-mod isn't available then kpartx will fail with
   # "Is device-mapper driver missing from kernel? [...]"
-  if ! kpartx -av $TARGET >/dev/null 2>&1 ; then
+  if ! kpartx -av $TARGET >/dev/null 2>&1 || ! grep -q device-mapper /proc/misc >/dev/null 2>&1 ; then
     einfo "Device-mapper not ready yet, trying to load dm-mod module."
     modprobe dm-mod ; eend $?
   fi