Allow use of comments in file /etc/debootstrap/packages; install postfix
authorMichael Prokop <devnull@localhost>
Thu, 28 Aug 2008 14:46:17 +0000 (16:46 +0200)
committerMichael Prokop <devnull@localhost>
Thu, 28 Aug 2008 14:46:17 +0000 (16:46 +0200)
chroot-script
debian/changelog
grml-debootstrap
packages

index 8fdf894..f9e3b0e 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.
 # 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
 ################################################################################
 
 set -e # exit on any error
@@ -138,7 +137,7 @@ packages() {
        exit 1
      else
        $APTUPDATE
        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
 }
      fi
   fi
 }
@@ -209,12 +208,23 @@ passwords() {
      echo root:"$ROOTPASSWD" | chpasswd -m
      export ROOTPASSWD=''
   else
      echo root:"$ROOTPASSWD" | chpasswd -m
      export ROOTPASSWD=''
   else
+    a='1'
+    b='2'
      echo "Setting password for user root:"
      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
+       echo root:"$a" | chpasswd -m
+       if [ "$a" != "$b" ] ; then
+         echo "Sorry, passwords do not match. Retry."
+       fi
+       unset a
+       unset b
+     done
   fi
 }
 # }}}
   fi
 }
 # }}}
index ebc7343..07c26e8 100644 (file)
@@ -22,8 +22,11 @@ grml-debootstrap (0.18) unstable; urgency=low
     gebi).
   * Install devices using our own device tarball instead of running
     MAKEDEV (which is just an ungly fork bomb).
     gebi).
   * Install devices using our own device tarball instead of running
     MAKEDEV (which is just an ungly fork bomb).
+  * Install MTA postfix by default to avoid installation of unwanted
+    packages like citadel in lenny.
+  * Allow use of comments in file /etc/debootstrap/packages.
 
 
- -- Michael Prokop <mika@grml.org>  Thu, 28 Aug 2008 15:22:57 +0200
+ -- Michael Prokop <mika@grml.org>  Thu, 28 Aug 2008 16:45:43 +0200
 
 grml-debootstrap (0.17) unstable; urgency=low
 
 
 grml-debootstrap (0.17) unstable; urgency=low
 
index 8488ad8..0182ee9 100755 (executable)
@@ -381,7 +381,7 @@ elif [ -n "$INTERACTIVE" ] ; then
    INFOTEXT="Please recheck configuration before execution:
    "
    [ -n "$TARGET" ]  && INFOTEXT="$INFOTEXT
    INFOTEXT="Please recheck configuration before execution:
    "
    [ -n "$TARGET" ]  && INFOTEXT="$INFOTEXT
-   Target:                 $TARGET"
+   Target:          $TARGET"
    [ -n "$GRUB" ]    && INFOTEXT="$INFOTEXT
    Install grub:    $GRUB"
    [ -n "$RELEASE" ] && INFOTEXT="$INFOTEXT
    [ -n "$GRUB" ]    && INFOTEXT="$INFOTEXT
    Install grub:    $GRUB"
    [ -n "$RELEASE" ] && INFOTEXT="$INFOTEXT
@@ -393,7 +393,7 @@ elif [ -n "$INTERACTIVE" ] ; then
 
 Is this ok for you? Notice: canceling will exit ${PN}."
 
 
 Is this ok for you? Notice: canceling will exit ${PN}."
 
-   dialog --title "$PN" \
+   dialog --title "$PN" --no-collapse \
           --yesno "$INFOTEXT" 0 0
 
 else # if not running automatic installation display configuration and prompt for execution:
           --yesno "$INFOTEXT" 0 0
 
 else # if not running automatic installation display configuration and prompt for execution:
@@ -523,7 +523,7 @@ ISODIR=${ISODIR%%/}
 # }}}
 
 # provide variables to chroot system {{{
 # }}}
 
 # provide variables to chroot system {{{
-CHROOT_VARIABLES="/etc/debootstrap/variables_${SHORT_TARGET}"
+CHROOT_VARIABLES="/var/cache/grml-debootstrap/variables_${SHORT_TARGET}"
 touch $CHROOT_VARIABLES
 chmod 600 $CHROOT_VARIABLES # make sure nobody except root can read it
 [ -n "$ARCH" ]   && echo "ARCH=$ARCH"     >  $CHROOT_VARIABLES
 touch $CHROOT_VARIABLES
 chmod 600 $CHROOT_VARIABLES # make sure nobody except root can read it
 [ -n "$ARCH" ]   && echo "ARCH=$ARCH"     >  $CHROOT_VARIABLES
@@ -671,13 +671,15 @@ preparechroot() {
   # make sure we have our files for later use via chroot-script
   cp /etc/debootstrap/config    $MNTPOINT/etc/debootstrap/
   # make sure we adjust the configuration variables accordingly:
   # make sure we have our files for later use via chroot-script
   cp /etc/debootstrap/config    $MNTPOINT/etc/debootstrap/
   # make sure we adjust the configuration variables accordingly:
-  sed -i "s/RELEASE=.*/RELEASE=\"${RELEASE}\"/" $MNTPOINT/etc/debootstrap/config
-  sed -i "s/TARGET=.*/TARGET=\"${TARGET}\"/"    $MNTPOINT/etc/debootstrap/config
-  sed -i "s/GRUB=.*/GRUB=\"${GRUB}\"/"          $MNTPOINT/etc/debootstrap/config
-  sed -i "s/GROOT=.*/GROOT=\"${GROOT}\"/"       $MNTPOINT/etc/debootstrap/config
+  sed -i "s/RELEASE=.*/RELEASE=\"$RELEASE\"/" $MNTPOINT/etc/debootstrap/config
+  sed -i "s/TARGET=.*/TARGET=\"$TARGET\"/"    $MNTPOINT/etc/debootstrap/config
+  sed -i "s/GRUB=.*/GRUB=\"$GRUB\"/"          $MNTPOINT/etc/debootstrap/config
+  sed -i "s/GROOT=.*/GROOT=\"$GROOT\"/"       $MNTPOINT/etc/debootstrap/config
 
   cp /etc/debootstrap/packages  $MNTPOINT/etc/debootstrap/packages
 
   cp /etc/debootstrap/packages  $MNTPOINT/etc/debootstrap/packages
-  cp $CHROOT_VARIABLES          $MNTPOINT/etc/debootstrap/variables # do NOT use $CHROOT_VARIABLES inside chroot!
+
+  # notice: do NOT use $CHROOT_VARIABLES inside chroot but statically file instead!
+  cp $CHROOT_VARIABLES          $MNTPOINT/etc/debootstrap/variables
 
   cp -a /etc/debootstrap/extrapackages/ $MNTPOINT/etc/debootstrap/
 
 
   cp -a /etc/debootstrap/extrapackages/ $MNTPOINT/etc/debootstrap/
 
@@ -694,7 +696,7 @@ preparechroot() {
   [ -n "$LOCALES" ] && cp /etc/debootstrap/locale.gen  $MNTPOINT/etc/locale.gen
 
   # MAKEDEV is just a forking bomb crap, let's do it on our own instead :)
   [ -n "$LOCALES" ] && cp /etc/debootstrap/locale.gen  $MNTPOINT/etc/locale.gen
 
   # MAKEDEV is just a forking bomb crap, let's do it on our own instead :)
-  ( cd $MNTPOINT/dev && tar jxf /etc/debootstrap/devices.tar.gz )
+  ( cd $MNTPOINT/dev && tar zxf /etc/debootstrap/devices.tar.gz )
 
   # copy any existing existing files to chroot
   [ -d /etc/debootstrap/boot  ] && cp -a /etc/debootstrap/boot/*  $MNTPOINT/boot/
 
   # copy any existing existing files to chroot
   [ -d /etc/debootstrap/boot  ] && cp -a /etc/debootstrap/boot/*  $MNTPOINT/boot/
@@ -789,8 +791,12 @@ for i in mkfs tunefs mount_target debootstrap_system preparechroot \
 done
 # }}}
 
 done
 # }}}
 
-# stages {{{
-  echo done > $STAGES/grml-debootstrap
+# finalize {{{
+# Remove temporary mountpoint again
+if echo "$MNTPOINT" | grep -q '/mnt/debootstrap\.' ; then
+   einfo "Removing directory ${MNTPOINT}" ; rmdir "$MNTPOINT" ; eend $?
+   einfo "Removing ${CHROOT_VARIABLES}" ; rm "$CHROOT_VARIABLES" ; eend $?
+fi
 # }}}
 
 # end dialog of autoinstallation {{{
 # }}}
 
 # end dialog of autoinstallation {{{
index dfd12da..66869ac 100644 (file)
--- a/packages
+++ b/packages
@@ -1,3 +1,4 @@
 locales console-data console-common
 locales console-data console-common
-initrd-tools grub mdadm lvm2
+initramfs-tools grub mdadm lvm2
 bzip2 dhcp3-client file less lsof most pciutils resolvconf screen ssh strace sysfsutils usbutils vim w3m zsh
 bzip2 dhcp3-client file less lsof most pciutils resolvconf screen ssh strace sysfsutils usbutils vim w3m zsh
+postfix