* REMOVE_DOCS: get rid of documentation directories (like /usr/share/doc,
/usr/share/man/, /usr/share/info,...)
+* SOURCES: retrieve Debian source packages after installation. Files will be
+placed in the output directory under grml_sources.
+
* XORG: providing important packages for use with a base grml-featured X.org
setup
# official debian repository (mirror selected via geo-ip):
deb http://cdn.debian.net/debian/ etch main contrib non-free
-# deb-src http://cdn.debian.net/debian/ etch main contrib non-free
+ deb-src http://cdn.debian.net/debian/ etch main contrib non-free
# official debian repository:
# deb http://ftp.debian.org/debian/ etch main contrib non-free
# official debian repository (mirror selected via geo-ip):
deb http://cdn.debian.net/debian/ lenny main contrib non-free
-# deb-src http://cdn.debian.net/debian/ lenny main contrib non-free
+ deb-src http://cdn.debian.net/debian/ lenny main contrib non-free
# security updates:
deb http://security.debian.org/ lenny/updates main contrib
-# deb-src http://security.debian.org/ lenny/updates main contrib
+ deb-src http://security.debian.org/ lenny/updates main contrib
# official debian repository:
# deb http://ftp.debian.org/debian/ lenny main contrib non-free
# official debian repository (mirror selected via geo-ip):
deb http://cdn.debian.net/debian/ sid main contrib non-free
-# deb-src http://cdn.debian.net/debian/ sid main contrib non-free
+ deb-src http://cdn.debian.net/debian/ sid main contrib non-free
# official debian repository:
# deb http://ftp.debian.org/debian/ sid main contrib non-free
# official debian repository (mirror selected via geo-ip):
deb http://cdn.debian.net/debian/ squeeze main contrib non-free
-# deb-src http://cdn.debian.net/debian/ squeeze main contrib non-free
+ deb-src http://cdn.debian.net/debian/ squeeze main contrib non-free
# security updates:
deb http://security.debian.org/ squeeze/updates main contrib
-# deb-src http://security.debian.org/ squeeze/updates main contrib
+ deb-src http://security.debian.org/ squeeze/updates main contrib
# official debian repository:
# deb http://ftp.debian.org/debian/ squeeze main contrib non-free
# official debian repository (mirror selected via geo-ip):
deb http://cdn.debian.net/debian/ stable main contrib non-free
-# deb-src http://cdn.debian.net/debian/ stable main contrib non-free
+ deb-src http://cdn.debian.net/debian/ stable main contrib non-free
# security updates:
deb http://security.debian.org/ stable/updates main contrib
-# deb-src http://security.debian.org/ stable/updates main contrib
+ deb-src http://security.debian.org/ stable/updates main contrib
# official debian repository:
# deb http://ftp.debian.org/debian/ stable main contrib non-free
# official debian repository (mirror selected via geo-ip):
deb http://cdn.debian.net/debian/ testing main contrib non-free
-# deb-src http://cdn.debian.net/debian/ testing main contrib non-free
+ deb-src http://cdn.debian.net/debian/ testing main contrib non-free
# security updates:
deb http://security.debian.org/ testing/updates main contrib
-# deb-src http://security.debian.org/ testing/updates main contrib
+ deb-src http://security.debian.org/ testing/updates main contrib
# official debian repository:
# deb http://ftp.debian.org/debian/ testing main contrib non-free
# official debian repository (mirror selected via geo-ip):
deb http://cdn.debian.net/debian/ wheezy main contrib non-free
-# deb-src http://cdn.debian.net/debian/ wheezy main contrib non-free
+ deb-src http://cdn.debian.net/debian/ wheezy main contrib non-free
# security updates:
deb http://security.debian.org/ wheezy/updates main contrib
-# deb-src http://security.debian.org/ wheezy/updates main contrib
+ deb-src http://security.debian.org/ wheezy/updates main contrib
# official debian repository:
# deb http://ftp.debian.org/debian/ wheezy main contrib non-free
# stable Grml repository:
deb http://deb.grml.org/ grml-stable main
-# deb-src http://deb.grml.org/ grml-stable main
+ deb-src http://deb.grml.org/ grml-stable main
# testing/developer Grml repository:
deb http://deb.grml.org/ grml-testing main
-# deb-src http://deb.grml.org/ grml-testing main
+ deb-src http://deb.grml.org/ grml-testing main
--- /dev/null
+#!/bin/bash
+# Filename: ${GRML_FAI_CONFIG}/config/scripts/GRMLBASE/03-get-sources
+# Purpose: download sources of Debian packages
+# 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 or any later version.
+################################################################################
+
+[ -r /etc/grml/grml-live.conf ] && . /etc/grml/grml-live.conf
+[ -r /etc/grml/grml-live.local ] && . /etc/grml/grml-live.local
+
+if ifclass SOURCES ; then
+ echo "Class SOURCES set, retrieving source packages."
+else
+ echo "Class SOURCES not set, nothing to do."
+ exit 0
+fi
+
+set -u
+
+PACKAGE_LIST=$(mktemp)
+
+bailout() {
+ rm -f "${target}/grml-live/sources/errors.log"
+ rm -f "$PACKAGE_LIST"
+}
+
+$ROOTCMD dpkg-query -W -f='${Package}\n' > "${PACKAGE_LIST}"
+
+if ! [ -r "${PACKAGE_LIST}" ] ; then
+ echo "Can not read ${PACKAGE_LIST}, can not download source packages as requested." >&2
+ bailout
+ exit 1
+else
+ mkdir -p "${target}"/grml-live/sources
+
+ # needs to be done for each package to get:
+ # | Picking 'acpi-support' as source package instead of 'acpi-fakekey'
+ # instead of:
+ # | E: Unable to find a source package for acpi-fakekey
+ for package in $(grep -v '^#' ${PACKAGE_LIST}) ; do
+ cat << EOT | chroot "$target" /bin/bash
+cd /grml-live/sources
+apt-get --download-only source "$package" 2>>/grml-live/sources/errors.log
+EOT
+ done
+
+ if grep -q . "${target}/grml-live/sources/errors.log" ; then
+ echo "Errors noticed while retrieving sources:" >&2
+ cat "${target}/grml-live/sources/errors.log" >&2
+ bailout
+ exit 1
+ fi
+
+fi
+
+bailout
+
+## END OF FILE #################################################################
+# vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=2
umount $CHROOT_OUTPUT/sys 2>/dev/null || /bin/true
umount $CHROOT_OUTPUT/dev/pts 2>/dev/null || /bin/true
umount $CHROOT_OUTPUT/dev 2>/dev/null || /bin/true
+ umount "${CHROOT_OUTPUT}/grml-live/sources/" 2>/dev/null || /bin/true
[ -n "$MIRROR_DIRECTORY" ] && umount "${CHROOT_OUTPUT}/${MIRROR_DIRECTORY}"
}
# }}}
else
cat >> "$SOURCES_LIST_OUTPUT" << EOF
# generated by grml-live
-deb http://deb.grml.org/ grml-stable main
-deb http://deb.grml.org/ grml-testing main
-deb http://cdn.debian.net/debian $SUITE main contrib non-free
+deb http://deb.grml.org/ grml-stable main
+deb-src http://deb.grml.org/ grml-stable main
+
+deb http://deb.grml.org/ grml-testing main
+deb-src http://deb.grml.org/ grml-testing main
+
+deb http://cdn.debian.net/debian $SUITE main contrib non-free
+deb-src http://cdn.debian.net/debian $SUITE main contrib non-free
EOF
fi
mount --bind "${MIRROR_DIRECTORY}" "${CHROOT_OUTPUT}/${MIRROR_DIRECTORY}"
fi
+ mkdir -p "${OUTPUT}/grml_sources/" "${CHROOT_OUTPUT}/grml-live/sources/"
+ mount --bind "${OUTPUT}/grml_sources/" "${CHROOT_OUTPUT}/grml-live/sources/"
+
# tell dpkg to use "unsafe io" during the build
[ -d "$CHROOT_OUTPUT/etc/dpkg/dpkg.cfg.d" ] || mkdir -p "$CHROOT_OUTPUT/etc/dpkg/dpkg.cfg.d"
echo force-unsafe-io > "$CHROOT_OUTPUT/etc/dpkg/dpkg.cfg.d/unsafe-io"