Update documentation for --arch option
[grml-debootstrap.git] / grml-debootstrap
index 3c55932..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" ] && {
@@ -509,14 +511,19 @@ else # if not running automatic installation display configuration and prompt fo
    einfo "$PN - Please recheck configuration before execution:"
    echo
    echo "   Target:          $TARGET"
-      case "$MNTPOINT" in "$TARGET") ;; *) echo "   Mount point:     $MNTPOINT" ;; esac
-      [ -n "$GRUB" ]     && echo "   Install grub:    $GRUB" || echo "   Install grub:    no"
-      [ -n "$RELEASE" ]  && echo "   Using release:   $RELEASE"
-      [ -n "$MIRROR" ]   && echo "   Using mirror:    $MIRROR"
-      [ -n "$HOSTNAME" ] && echo "   Using hostname:  $HOSTNAME"
-      [ -n "$ISO" ]      && echo "   Using ISO:       $ISO"
-      case "$MNTPOINT" in "$TARGET") ;; *) echo "   Important! Continuing will delete all data from ${TARGET}!" ;; esac
-      echo
+
+   # do not display if MNTPOINT is the default one
+   case "$MNTPOINT" in /mnt/debootstrap*) ;; *) echo "   Mount point:     $MNTPOINT" ;; esac
+
+   [ -n "$GRUB" ]     && echo "   Install grub:    $GRUB" || echo "   Install grub:    no"
+   [ -n "$RELEASE" ]  && echo "   Using release:   $RELEASE"
+   [ -n "$MIRROR" ]   && echo "   Using mirror:    $MIRROR"
+   [ -n "$HOSTNAME" ] && echo "   Using hostname:  $HOSTNAME"
+   [ -n "$ISO" ]      && echo "   Using ISO:       $ISO"
+
+   echo "   Important! Continuing will delete all data from ${TARGET}!"
+
+   echo
    einfon "Is this ok for you? [y/N] "
    read a
    if ! [ "$a" = 'y' -o "$a" = 'Y' ] ; then
@@ -754,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."