Make sure the passwd command succeeds
[grml-debootstrap.git] / chroot-script
old mode 100644 (file)
new mode 100755 (executable)
index caafeaf..cea2f7d
@@ -4,7 +4,7 @@
 # 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: Sam Apr 28 20:19:58 CEST 2007 [mika]
+# Latest change: Son Dez 16 16:30:31 CET 2007 [mika]
 ################################################################################
 
 set -e # exit on any error
@@ -45,8 +45,13 @@ stage() {
 
 # define chroot mirror {{{
 chrootmirror() {
-  if [ -n "$CHROOTMIRROR" ] ; then
-     echo "deb $CHROOTMIRROR $RELEASE main contrib non-free" > /etc/apt/sources.list
+  if [ -n "$ISO" ] ; then
+     echo "deb $ISO $RELEASE main contrib" > /etc/apt/sources.list
+     [ -n "$CHROOTMIRROR" ] && echo "deb $CHROOTMIRROR $RELEASE main contrib non-free" >> /etc/apt/sources.list
+  else
+    if [ -n "$CHROOTMIRROR" ] ; then
+       echo "deb $CHROOTMIRROR $RELEASE main contrib non-free" > /etc/apt/sources.list
+    fi
   fi
 }
 # }}}
@@ -253,6 +258,7 @@ passwords() {
      echo "Setting password for user root:"
      set +e # do not exit if passwd returns error due to missmatching passwords
      passwd
+     until passwd; do echo "Please try again to set the password:" ; done
      echo ""
      set -e # restore default behaviour again
   fi