mika, this should be the last time that I combine everything together. :-)
# define chroot mirror {{{
chrootmirror() {
# define chroot mirror {{{
chrootmirror() {
+ [ -n "$KEEP_SRC_LIST" ] && return
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
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
# set up grml repository {{{
grmlrepos() {
if [ -n "$GRMLREPOS" ] ; then
# set up grml repository {{{
grmlrepos() {
if [ -n "$GRMLREPOS" ] ; then
- cat >> /etc/apt/sources.list << EOF
+ # user might have provided their own apt sources.list
+ if ! grep -q grml /etc/apt/sources.list 2>/dev/null ; then
+ cat >> /etc/apt/sources.list << EOF
# grml: stable repository:
deb http://deb.grml.org/ grml-stable main
# grml: stable repository:
deb http://deb.grml.org/ grml-stable main
deb-src http://deb.grml.org/ grml-testing main
EOF
deb-src http://deb.grml.org/ grml-testing main
EOF
# make sure we have the keys available for aptitude
gpg --keyserver subkeys.pgp.net --recv-keys F61E2E7CECDEA787
gpg --export F61E2E7CECDEA787 | apt-key add - || /bin/true # not yet sure
# make sure we have the keys available for aptitude
gpg --keyserver subkeys.pgp.net --recv-keys F61E2E7CECDEA787
gpg --export F61E2E7CECDEA787 | apt-key add - || /bin/true # not yet sure
packages() {
# Pre-seed the debconf database with answers. Each question will be marked
# as seen to prevent debconf from asking the question interactively.
packages() {
# Pre-seed the debconf database with answers. Each question will be marked
# as seen to prevent debconf from asking the question interactively.
- [ -f /etc/debootstrap/debconf-selections ] && \
+ [ -f /etc/debootstrap/debconf-selections ] && {
+ echo "Preseeding the debconf database, some lines might be skipped..."
cat /etc/debootstrap/debconf-selections | debconf-set-selections
cat /etc/debootstrap/debconf-selections | debconf-set-selections
if [ "$PACKAGES" = 'yes' ] ; then
if ! [ -r /etc/debootstrap/packages ] ; then
if [ "$PACKAGES" = 'yes' ] ; then
if ! [ -r /etc/debootstrap/packages ] ; then
[ -n "$ISO" ] && echo "ISO=$ISO" >> $CHROOT_VARIABLES
[ -n "$MIRROR" ] && echo "CHROOTMIRROR=$MIRROR" >> $CHROOT_VARIABLES
[ -n "$MIRROR" ] && echo "MIRROR=$MIRROR" >> $CHROOT_VARIABLES
[ -n "$ISO" ] && echo "ISO=$ISO" >> $CHROOT_VARIABLES
[ -n "$MIRROR" ] && echo "CHROOTMIRROR=$MIRROR" >> $CHROOT_VARIABLES
[ -n "$MIRROR" ] && echo "MIRROR=$MIRROR" >> $CHROOT_VARIABLES
+ [ -n "$KEEP_SRC_LIST" ] && echo "KEEP_SRC_LIST=$KEEP_SRC_LIST" >> $CHROOT_VARIABLES
[ -n "$ROOTPASSWORD" ] && echo "ROOTPASSWORD=$ROOTPASSWORD" >> $CHROOT_VARIABLES
[ -n "$TARGET" ] && echo "TARGET=$TARGET" >> $CHROOT_VARIABLES
[ -n "$TARGET_UUID" ] && echo "TARGET_UUID=$TARGET_UUID" >> $CHROOT_VARIABLES
[ -n "$ROOTPASSWORD" ] && echo "ROOTPASSWORD=$ROOTPASSWORD" >> $CHROOT_VARIABLES
[ -n "$TARGET" ] && echo "TARGET=$TARGET" >> $CHROOT_VARIABLES
[ -n "$TARGET_UUID" ] && echo "TARGET_UUID=$TARGET_UUID" >> $CHROOT_VARIABLES
/etc/debootstrap/. Every existing directory will be copied to the new Debian
system then. If you want to install additional packages that are not available
via the grml or debian mirror drop them into /etc/debootstrap/extrapackages and
/etc/debootstrap/. Every existing directory will be copied to the new Debian
system then. If you want to install additional packages that are not available
via the grml or debian mirror drop them into /etc/debootstrap/extrapackages and
-take sure that EXTRAPACKAGES is set to "yes".
+make sure that EXTRAPACKAGES is set to "yes".
Automatic installation
----------------------
Automatic installation
----------------------