Support setting hostname in interface and on cmdline; SW-RAID fixes
[grml-debootstrap.git] / chroot-script
index 8fdf894..0c7c3c8 100755 (executable)
@@ -4,7 +4,6 @@
 # Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
 # Bug-Reports:   see http://grml.org/bugs/
 # License:       This file is licensed under the GPL v2.
-# Latest change: Tue Aug 26 20:59:31 CEST 2008 [mika]
 ################################################################################
 
 set -e # exit on any error
@@ -18,7 +17,7 @@ set -e # exit on any error
 
 # use aptitude only if it's available
 if [ -x /usr/bin/aptitude ] ; then
-   APTINSTALL='aptitude -y install '
+   APTINSTALL='aptitude -y --without-recommends install '
    APTUPDATE='aptitude update'
 else
    APTINSTALL='apt-get --force-yes -y install'
@@ -138,7 +137,7 @@ packages() {
        exit 1
      else
        $APTUPDATE
-       DEBIAN_FRONTEND=$DEBIAN_FRONTEND $APTINSTALL $(cat /etc/debootstrap/packages) $GRMLPACKAGES
+       DEBIAN_FRONTEND=$DEBIAN_FRONTEND $APTINSTALL $(grep -v '^#' /etc/debootstrap/packages) $GRMLPACKAGES
      fi
   fi
 }
@@ -201,7 +200,8 @@ reconfigure() {
 # }}}
 
 # set password of user root {{{
-passwords() {
+passwords()
+{
   echo "Activating shadow passwords."
   shadowconfig on
 
@@ -209,12 +209,26 @@ passwords() {
      echo root:"$ROOTPASSWD" | chpasswd -m
      export ROOTPASSWD=''
   else
+    a='1'
+    b='2'
      echo "Setting password for user root:"
-     echo -n "Enter new UNIX password for user root: "
-     read -s a
-     echo root:"$a" | chpasswd -m
-     unset a
-     echo
+     while [ "$a" != "$b" ] ; do
+       echo -n "Enter new UNIX password for user root: "
+       read -s a
+       echo
+       echo -n "Retype new UNIX password for user root: "
+       read -s b
+       echo
+       if [ "$a" != "$b" ] ; then
+         echo "Sorry, passwords do not match. Retry."
+         a='1'
+         b='2'
+       else
+         echo root:"$a" | chpasswd -m
+         unset a
+         unset b
+       fi
+     done
   fi
 }
 # }}}