Update documentation for --arch option
[grml-debootstrap.git] / grml-debootstrap
index 8cafe54..7d6d6a3 100755 (executable)
@@ -51,6 +51,7 @@ Bootstrap options:
                            \$TARGET in grub syntax, like hd0,0 for /dev/sda1.
       --grub <device>    Target for grub installation. Use grub syntax for
                            specifying, like hd0 for /dev/sda.
+      --arch <arch>      Architecture to use. Currently only i386 is supported.
 
 Configuration options:
 
@@ -149,6 +150,7 @@ fi
 [ "$_opt_bootappend" ]          && BOOT_APPEND=$_opt_bootappend
 [ "$_opt_groot" ]               && GROOT=$_opt_groot
 [ "$_opt_grub" ]                && GRUB=$_opt_grub
+[ "$_opt_arch" ]                && ARCH=$_opt_arch
 [ "$_opt_verbose" ]             && VERBOSE="-v"
 
 [ "$_opt_help" ] && {
@@ -759,17 +761,18 @@ mount_target() {
 
 # install main chroot {{{
 debootstrap_system() {
-  if ! grep -q "$MNTPOINT" /proc/mounts ; then
-     mount_target
-  fi
   if [ "$_opt_nodebootstrap" ]; then
      einfo "Skipping debootstrap as requested."
      return
   fi
+
   if grep -q "$MNTPOINT" /proc/mounts || [ -n "$DIRECTORY" ] ; then
      einfo "Running $DEBOOTSTRAP $DEBOOTSTRAP_OPT for release ${RELEASE}${ARCHINFO} using ${MIRROR}${ISO}"
-     [ -n "$MIRROR" ] && $DEBOOTSTRAP $ARCHCMD $DEBOOTSTRAP_OPT $RELEASE $MNTPOINT $MIRROR || \
-     $DEBOOTSTRAP $ARCHCMD $DEBOOTSTRAP_OPT $RELEASE $MNTPOINT $ISO
+     if [ -n "$MIRROR" ] ; then
+        $DEBOOTSTRAP $ARCHCMD $DEBOOTSTRAP_OPT $RELEASE $MNTPOINT $MIRROR
+     else
+        $DEBOOTSTRAP $ARCHCMD $DEBOOTSTRAP_OPT $RELEASE $MNTPOINT $ISO
+     fi
      eend $?
   else
      eerror "Error: $MNTPOINT not mounted, can not continue."