Mention hostname in configuration check dialog
[grml-debootstrap.git] / grml-debootstrap
index 02015ce..9bda8e3 100755 (executable)
@@ -40,8 +40,10 @@ Bootstrap options:
   -i, --iso <mnt>        Mountpoint where a Debian ISO is mounted to, for use
                            instead of fetching packages from a mirror.
   -r, --release <name>   Release of new Debian system (default: lenny).
-  -t, --target <target>  Target partition (/dev/...) or directory.
-  -p, --mntpoint <mnt>   Mountpoint used for mounting the target system.
+  -t, --target <target>  Target partition (/dev/...) or directory where the
+                         system should be installed to.
+  -p, --mntpoint <mnt>   Mountpoint used for mounting the target system,
+                         has no effect if -t is given and represents a directory.
       --debopt <params>  Extra parameters passed to the debootstrap command.
       --interactive      Use interactive mode (frontend).
       --nodebootstrap    Skip debootstrap, only do configuration to the target.
@@ -491,10 +493,11 @@ else # if not running automatic installation display configuration and prompt fo
    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 "$ISO" ]     && echo "   Using ISO:       $ISO"
+      [ -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
    einfon "Is this ok for you? [y/N] "
@@ -734,14 +737,14 @@ mount_target() {
 
 # install main chroot {{{
 debootstrap_system() {
-  if ! grep -q $MNTPOINT /proc/mounts ; then
+  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
+  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
@@ -777,7 +780,7 @@ preparechroot() {
 
   cp $VERBOSE $CONFFILES/chroot-script $MNTPOINT/bin/chroot-script
   chmod 755 $MNTPOINT/bin/chroot-script
-  mkdir $MNTPOINT/etc/debootstrap/
+  [ -d "$MNTPOINT"/etc/debootstrap/ ] || mkdir "$MNTPOINT"/etc/debootstrap/
 
   # make sure we have our files for later use via chroot-script
   cp $VERBOSE $CONFFILES/config    $MNTPOINT/etc/debootstrap/