+# sarge specific stuff: mkinitrd {{{
+mkinitrd() {
+ if [ "$RELEASE" = 'sarge' ] ; then
+ sed -i "s#ROOT=probe#ROOT=$TARGET#" /etc/mkinitrd/mkinitrd.conf
+ fi
+}
+# }}}
+
+# install kernel packages {{{
+kernel() {
+ # do not override $KERNEL if set via config file
+ if [ -z "$KERNEL" ] ; then
+ if [ "$ARCH" = 'i386' ] ; then
+ KERNEL='2.6-686'
+ elif [ "$ARCH" = 'amd64' ] ; then
+ KERNEL='2.6-amd64'
+ fi
+ fi
+
+ if [ -n "$KERNEL" ] ; then
+ $APTUPDATE
+ if [ "$RELEASE" = 'sarge' ] ; then
+ KERNELPACKAGES="kernel-image-$KERNEL kernel-headers-$KERNEL"
+ else
+ KERNELPACKAGES="linux-image-$KERNEL linux-headers-$KERNEL"
+ fi
+ DEBIAN_FRONTEND=$DEBIAN_FRONTEND $APTINSTALL $KERNELPACKAGES
+ fi
+}
+# }}}
+
+# reconfigure packages {{{
+reconfigure() {
+ if [ -n "$RECONFIGURE" ] ; then
+ for package in $RECONFIGURE ; do
+ dpkg --list $package 1>/dev/null 2>/dev/null && \
+ DEBIAN_FRONTEND=$DEBIAN_FRONTEND dpkg-reconfigure $package || \
+ echo "Warning: $package does not exist, can not reconfigure it."
+ done
+ fi
+}
+# }}}
+
+# set password of user root {{{
+passwords()
+{
+ echo "Activating shadow passwords."
+ shadowconfig on
+
+ if [ -n "$ROOTPASSWORD" ] ; then
+ echo root:"$ROOTPASSWORD" | chpasswd -m
+ export ROOTPASSWORD=''
+ else
+ a='1'
+ b='2'
+ echo "Setting password for user root:"
+ 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
+}
+# }}}
+
+# set up /etc/hosts {{{
+hosts() {
+ if ! [ -f /etc/hosts ] ; then
+ echo "Setting up /etc/hosts"
+ echo "127.0.0.1 localhost $HOSTNAME" > /etc/hosts
+ fi
+}
+# }}}
+
+# set up /etc/network/interfaces {{{
+interfaces() {
+ if ! [ -r /etc/network/interfaces ] ; then
+ echo "Setting up /etc/network/interfaces"
+ cat >> /etc/network/interfaces << EOF
+
+# loopback device: