Fix -t option when not using a device
[grml-debootstrap.git] / chroot-script
index 8f545cf..5ca8295 100755 (executable)
@@ -196,7 +196,8 @@ kernel() {
      if [ "$RELEASE" = 'sarge' ] ; then
         KERNELPACKAGES="kernel-image-$KERNEL kernel-headers-$KERNEL"
      else
-        KERNELPACKAGES="linux-image-$KERNEL linux-headers-$KERNEL"
+        # note: install busybox to be able to debug initramfs
+        KERNELPACKAGES="linux-image-$KERNEL linux-headers-$KERNEL busybox"
      fi
       DEBIAN_FRONTEND=$DEBIAN_FRONTEND $APTINSTALL $KERNELPACKAGES
   fi
@@ -221,8 +222,14 @@ passwords()
   echo "Activating shadow passwords."
   shadowconfig on
 
+  CHPASSWD_OPTION=
+  if chpasswd --help 2>&1 | grep -q -- '-m,' ; then
+     CHPASSWD_OPTION='-m'
+  fi
+
+
   if [ -n "$ROOTPASSWORD" ] ; then
-     echo root:"$ROOTPASSWORD" | chpasswd -m
+     echo root:"$ROOTPASSWORD" | chpasswd $CHPASSWD_OPTION
      export ROOTPASSWORD=''
   else
     a='1'
@@ -240,7 +247,7 @@ passwords()
          a='1'
          b='2'
        else
-         echo root:"$a" | chpasswd -m
+         echo root:"$a" | chpasswd $CHPASSWD_OPTION
          unset a
          unset b
        fi