+++ /dev/null
-# NOTE: This file is used as input file for generating
-# ${GRML_FAI_CONFIG}/config/files/etc/apt/sources.list/GRMLBASE
-# which is copied to /etc/apt/sources.list to the chroot.
-# Do *NOT* modify this file directly but instead consider using
-# GRML_LIVE_SOURCES in /etc/grml/grml-live.conf* or FAI's
-# fcopy command with ${GRML_FAI_CONFIG}/config/files instead!
-deb http://deb.grml.org/ grml-stable main
-deb http://deb.grml.org/ grml-testing main
-deb http://cdn.debian.net/debian squeeze main contrib non-free
--- /dev/null
+# 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
+
+# official debian repository:
+# deb http://ftp.debian.org/debian/ etch main contrib non-free
+# deb-src http://ftp.debian.org/debian/ etch main contrib non-free
+
+# official debian DE repository:
+# deb http://ftp.de.debian.org/debian/ etch main contrib non-free
+# deb-src http://ftp.de.debian.org/debian/ etch main contrib non-free
+
+# official debian AT repository:
+# deb http://ftp.at.debian.org/debian/ etch main contrib non-free
+# deb-src http://ftp.at.debian.org/debian/ etch main contrib non-free
--- /dev/null
+# 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
+
+# official debian repository:
+# deb http://ftp.debian.org/debian/ lenny main contrib non-free
+# deb-src http://ftp.debian.org/debian/ lenny main contrib non-free
+
+# official debian DE repository:
+# deb http://ftp.de.debian.org/debian/ lenny main contrib non-free
+# deb-src http://ftp.de.debian.org/debian/ lenny main contrib non-free
+
+# official debian AT repository:
+# deb http://ftp.at.debian.org/debian/ lenny main contrib non-free
+# deb-src http://ftp.at.debian.org/debian/ lenny main contrib non-free
--- /dev/null
+# 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
+
+# official debian repository:
+# deb http://ftp.debian.org/debian/ sid main contrib non-free
+# deb-src http://ftp.debian.org/debian/ sid main contrib non-free
+
+# official debian DE repository:
+# deb http://ftp.de.debian.org/debian/ sid main contrib non-free
+# deb-src http://ftp.de.debian.org/debian/ sid main contrib non-free
+
+# official debian AT repository:
+# deb http://ftp.at.debian.org/debian/ sid main contrib non-free
+# deb-src http://ftp.at.debian.org/debian/ sid main contrib non-free
--- /dev/null
+# 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
+
+# official debian repository:
+# deb http://ftp.debian.org/debian/ squeeze main contrib non-free
+# deb-src http://ftp.debian.org/debian/ squeeze main contrib non-free
+
+# official debian DE repository:
+# deb http://ftp.de.debian.org/debian/ squeeze main contrib non-free
+# deb-src http://ftp.de.debian.org/debian/ squeeze main contrib non-free
+
+# official debian AT repository:
+# deb http://ftp.at.debian.org/debian/ squeeze main contrib non-free
+# deb-src http://ftp.at.debian.org/debian/ squeeze main contrib non-free
--- /dev/null
+# 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
+
+# official debian repository:
+# deb http://ftp.debian.org/debian/ stable main contrib non-free
+# deb-src http://ftp.debian.org/debian/ stable main contrib non-free
+
+# official debian DE repository:
+# deb http://ftp.de.debian.org/debian/ stable main contrib non-free
+# deb-src http://ftp.de.debian.org/debian/ stable main contrib non-free
+
+# official debian AT repository:
+# deb http://ftp.at.debian.org/debian/ stable main contrib non-free
+# deb-src http://ftp.at.debian.org/debian/ stable main contrib non-free
--- /dev/null
+# 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
+
+# official debian repository:
+# deb http://ftp.debian.org/debian/ testing main contrib non-free
+# deb-src http://ftp.debian.org/debian/ testing main contrib non-free
+
+# official debian DE repository:
+# deb http://ftp.de.debian.org/debian/ testing main contrib non-free
+# deb-src http://ftp.de.debian.org/debian/ testing main contrib non-free
+
+# official debian AT repository:
+# deb http://ftp.at.debian.org/debian/ testing main contrib non-free
+# deb-src http://ftp.at.debian.org/debian/ testing main contrib non-free
--- /dev/null
+# 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
+
+# official debian repository:
+# deb http://ftp.debian.org/debian/ wheezy main contrib non-free
+# deb-src http://ftp.debian.org/debian/ wheezy main contrib non-free
+
+# official debian DE repository:
+# deb http://ftp.de.debian.org/debian/ wheezy main contrib non-free
+# deb-src http://ftp.de.debian.org/debian/ wheezy main contrib non-free
+
+# official debian AT repository:
+# deb http://ftp.at.debian.org/debian/ wheezy main contrib non-free
+# deb-src http://ftp.at.debian.org/debian/ wheezy main contrib non-free
--- /dev/null
+# stable Grml repository:
+ deb http://deb.grml.org/ grml-stable main
+# deb-src http://deb.grml.org/ grml-stable main
--- /dev/null
+# testing/developer Grml repository:
+ deb http://deb.grml.org/ grml-testing main
+# deb-src http://deb.grml.org/ grml-testing main
--- /dev/null
+###################################################################
+# Installed via grml-live's
+# ${GRML_FAI_CONFIG}/config/files/etc/apt/sources.list/GRMLBASE
+###################################################################
+
+##### IMPORTANT NOTE ##############################################
+# The configuration file /etc/apt/sources.list has been split
+# into structured files in directory /etc/apt/sources.list.d
+##### IMPORTANT NOTE ##############################################
set -u
set -e
-GRML_SOURCES_LIST="$target/etc/apt/sources.list.d/grml.list"
-DEBIAN_SOURCES_LIST="$target/etc/apt/sources.list.d/debian.list"
-
# if hooks/updatebase.GRMLBASE fails for whatever reason
# and can't skip instsoft.GRMLBASE we have to make sure
# we exit here as well
//DPkg::Tools::Options::/usr/sbin/apt-listbugs::Version "2";
EOF
- # FAI softupdate executes upgrade only with the sources.list being
- # present in the chroot - so let's do it on our own:
- fcopy /etc/apt/sources.list
-
- # when re-running grml-live with the -u option we do not want to use the
- # sources.list config of the live system but grml-live's config instead,
- # therefore temporarly move known files and restore them again later on
- # through /etc/grml/fai/config/scripts/GRMLBASE/33-aptsetup:
- if [ -r "$GRML_SOURCES_LIST" ] ; then
- mv "$GRML_SOURCES_LIST" "${GRML_SOURCES_LIST}.unused"
- fi
-
- if [ -r "$DEBIAN_SOURCES_LIST" ] ; then
- mv "$DEBIAN_SOURCES_LIST" "${DEBIAN_SOURCES_LIST}.unused"
- fi
-
# run it on our own, as updatebase is used at the wrong stage for our needs,
# see ${GRML_FAI_CONFIG}/hooks/updatebase.GRMLBASE
# the apt-get update might return an error if there's for example
fi
# install all apt related files
-fcopy -r /etc/apt
+fcopy -v /etc/apt/grml.key
+fcopy -v /etc/apt/preferences
+fcopy -v /etc/apt/apt.conf.d/20pdiffs
+fcopy -v /etc/apt/apt.conf.d/15grml-live
+
+# this is the auto-generated sources.list file by grml-live,
+# will be overriden by $GRML_FAI_CONFIG/scripts/GRMLBASE/33-aptsetup
+fcopy -v -c GRML_LIVE_SOURCES_LIST /etc/apt/sources.list
# install Grml gpg key:
$ROOTCMD apt-key add /etc/apt/grml.key
set -u
set -e
-GRML_SOURCES_LIST="$target/etc/apt/sources.list.d/grml.list"
-DEBIAN_SOURCES_LIST="$target/etc/apt/sources.list.d/debian.list"
-
-# restore original grml sources.list file (temporarly moved via
-# /etc/grml/fai/config/hooks/instsoft.GRMLBASE):
-if [ -r "${GRML_SOURCES_LIST}.unused" ] ; then
- mv "${GRML_SOURCES_LIST}.unused" "${GRML_SOURCES_LIST}"
-fi
-if [ -r "${DEBIAN_SOURCES_LIST}.unused" ] ; then
- mv "${DEBIAN_SOURCES_LIST}.unused" "${DEBIAN_SOURCES_LIST}"
+fcopy -v /etc/apt/sources.list
+fcopy -v /etc/apt/sources.list.d/grml-stable.list
+
+case "${SUITE:-}" in
+ etch) suite_class=DEBIAN_ETCH ;;
+ lenny) suite_class=DEBIAN_LENNY ;;
+ squeeze) suite_class=DEBIAN_SQUEEZE ;;
+ stable) suite_class=DEBIAN_STABLE ;;
+ testing) suite_class=DEBIAN_TESTING ;;
+ unstable|sid) suite_class=DEBIAN_SID ;;
+ wheezy) suite_class=DEBIAN_WHEEZY ;;
+ *) suite_class=DEBIAN_SID ;; # default to sid otherwise
+esac
+
+if ! [ -r $FAI/files/etc/apt/sources.list.d/debian.list/$suite_class ] ; then
+ echo "Error: could not find $FAI/files/etc/apt/sources.list.d/debian.list/$suite_class" >&2
+ echo "Please provide an according sources.list template." >&2
+ exit 1
fi
-[ -d $target/etc/apt/sources.list.d ] || mkdir $target/etc/apt/sources.list.d
-
-# remove any existing sources.list and inform user about the new
-# /etc/apt/sources.list.d/ setup:
-cat > $target/etc/apt/sources.list << EOF
-##### IMPORTANT NOTE ##############################################
-# The configuration file /etc/apt/sources.list has been split
-# into structured files in /etc/apt/sources.list.d/ - check out:
-#
-# /etc/apt/sources.list.d/grml.list for the grml related repositories
-# /etc/apt/sources.list.d/debian.list for official Debian repositories
-#
-# If you're looking for the "old" /etc/apt/sources.list file or
-# need some further repositories please take a look at the file
-# /etc/apt/sources.list.grml
-##### IMPORTANT NOTE ##############################################
-EOF
-
-# retrieve build information ($SUITE):
-if [ -r $target/etc/grml_live_version ] ; then
- . $target/etc/grml_live_version
-fi
-
-# if we stil do not know which Debian suite we are building assume "stable"
-[ -n "$SUITE" ] || SUITE="stable"
-
-# configure official Debian repositories:
-cat > "$DEBIAN_SOURCES_LIST" << EOF
-# official debian repository (mirror selected via geo-ip):
- deb http://cdn.debian.net/debian/ $SUITE main contrib non-free
-# deb-src http://cdn.debian.net/debian/ $SUITE main contrib non-free
+# install according sources.list, depending on deployed Debian suite
+fcopy -v -c $suite_class /etc/apt/sources.list.d/debian.list
-# official debian repository:
-# deb http://ftp.debian.org/debian/ sid main contrib non-free
-# deb-src http://ftp.debian.org/debian/ sid main contrib non-free
-
-# official debian DE repository:
-# deb http://ftp.de.debian.org/debian/ sid main contrib non-free
-# deb-src http://ftp.de.debian.org/debian/ sid main contrib non-free
-
-# official debian AT repository:
-# deb http://ftp.at.debian.org/debian/ sid main contrib non-free
-# deb-src http://ftp.at.debian.org/debian/ sid main contrib non-free
-EOF
-
-# configure grml-stable repository:
-cat > "$GRML_SOURCES_LIST" << EOF
-# stable grml repository:
- deb http://deb.grml.org/ grml-stable main
-# deb-src http://deb.grml.org/ grml-stable main
-EOF
-
-ENABLE_GRML_TESTING=false
-# if we have a devel-version or a daily snapshot enable grml-testing by default:
+# if we have a devel-version or a daily snapshot enable grml-testing repos:
if [ -n "$GRML_NAME" -o -n "$RELEASENAME" ] ; then
- if echo "$GRML_NAME" "$RELEASENAME" | grep -e devel -e autobuild 1>/dev/null ; then
- ENABLE_GRML_TESTING=true
- fi
-fi
-
-if $ENABLE_GRML_TESTING ; then
- cat >> "$GRML_SOURCES_LIST" << EOF
-# testing/developer grml repository:
- deb http://deb.grml.org/ grml-testing main
-# deb-src http://deb.grml.org/ grml-testing main
-EOF
-else # no devel/daily build:
- cat >> "$GRML_SOURCES_LIST" << EOF
-# testing/developer grml repository:
-# deb http://deb.grml.org/ grml-testing main
-# deb-src http://deb.grml.org/ grml-testing main
-EOF
+ if echo "$GRML_NAME" "$RELEASENAME" | grep -e devel -e autobuild >/dev/null ; then
+ fcopy -v /etc/apt/sources.list.d/grml-testing.list
+ fi
fi
## END OF FILE #################################################################
[ -n "$HYBRID_METHOD" ] || HYBRID_METHOD='manifold'
[ -n "$NFSROOT_CONF" ] || NFSROOT_CONF="${GRML_FAI_CONFIG}/make-fai-nfsroot.conf"
[ -n "$RELEASENAME" ] || RELEASENAME='grml-live rocks'
-[ -n "$SOURCES_LIST_INPUT" ] || SOURCES_LIST_INPUT="${GRML_FAI_CONFIG}/apt/sources.list"
-[ -n "$SOURCES_LIST_OUTPUT" ] || SOURCES_LIST_OUTPUT="${GRML_FAI_CONFIG}/config/files/etc/apt/sources.list/GRMLBASE"
+[ -n "$SOURCES_LIST_OUTPUT" ] || SOURCES_LIST_OUTPUT="${GRML_FAI_CONFIG}/config/files/etc/apt/sources.list/GRML_LIVE_SOURCES_LIST"
[ -n "$SQUASHFS_EXCLUDES_FILE" ] || SQUASHFS_EXCLUDES_FILE="${GRML_FAI_CONFIG}/config/grml/squashfs-excludes"
[ -n "$SUITE" ] || SUITE='squeeze'
[ -n "$TEMPLATE_DIRECTORY" ] || TEMPLATE_DIRECTORY='/usr/share/grml-live/templates'
cat > "$SOURCES_LIST_OUTPUT" << EOF
# NOTE: This file is *NOT* meant for manual customisation! This file is
-# modified by grml-live and any changes will be overridden.
-# You might consider using GRML_LIVE_SOURCES in /etc/grml/grml-live.conf*
-# or FAI's fcopy command with ${GRML_FAI_CONFIG}/config/files instead!
+# installed temporarily only by grml-live and will be overriden in the
+# installation and configuration process then.
EOF
if [ -n "$MIRROR_DIRECTORY" ] ; then
echo "$MIRROR_SOURCES" >> "$SOURCES_LIST_OUTPUT"
fi
-if [ -n "$GRML_LIVE_SOURCES" ] ; then
- echo "$GRML_LIVE_SOURCES" >> "$SOURCES_LIST_OUTPUT"
-fi
-
if [ -n "$FAI_DEBOOTSTRAP" ] ; then
sed "s#^FAI_DEBOOTSTRAP=.*#FAI_DEBOOTSTRAP=\"$FAI_DEBOOTSTRAP\"#" "$NFSROOT_CONF" | sponge "$NFSROOT_CONF"
fi
sid) ;;
*) echo "Sorry, $SUITE is not a valid Debian suite, exiting.">&2; bailout 1 ;;
esac
-
-DIST=" etch\| stable\| lenny\| squeeze\| wheezy\| testing\| sid\| unstable"
-sed "s/\(^deb .\+\)\([ \t]*\)\($DIST\)\([ \t]*\)\(main \)/\1 \2$SUITE\4\5/" "$SOURCES_LIST_INPUT" | sponge "$SOURCES_LIST_OUTPUT"
-for file in "$LIVE_CONF" "$CONFIG" "$LOCAL_CONFIG" ; do
- if [ -n "$file" ] ; then
- sed "s/^SUITE=.*/SUITE=\"$SUITE\"/" $file | sponge $file
- sed "s/\(^deb .\+\)\([ \t]*\)\($DIST\)\([ \t]*\)\(main \)/\1 \2$SUITE\4\5/" "$file" | sponge "$file"
- fi
-done
+export SUITE # make sure it's available in FAI scripts
+
+if [ -n "${GRML_LIVE_SOURCES:-}" ] ; then
+ DIST=" etch\| stable\| lenny\| squeeze\| wheezy\| testing\| sid\| unstable"
+ echo "# generated based on \$GRML_LIVE_SOURCES by grml-live
+$GRML_LIVE_SOURCES" | \
+ sed -e "s/\(^deb .\+\)\([ \t]*\)\($DIST\)\([ \t]*\)\(main \)/\1 \2$SUITE\4\5/;
+ s/\(^deb-src .\+\)\([ \t]*\)\($DIST\)\([ \t]*\)\(main \)/\1 \2$SUITE\4\5/" >> "$SOURCES_LIST_OUTPUT"
+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
+EOF
+fi
# notice: activate grml-live pool only if we are building against unstable:
-if grep -qwe unstable -qwe sid "$SOURCES_LIST_INPUT" ; then
+if grep -qwe unstable -qwe sid "$SOURCES_LIST_OUTPUT" ; then
grep -q 'grml-live.*main' "$SOURCES_LIST_OUTPUT" || \
grep grml-stable "$SOURCES_LIST_OUTPUT" | \
sed 's/grml-stable/grml-live/' >> "$SOURCES_LIST_OUTPUT"
else
- grep -q 'grml-live.*main' "$SOURCES_LIST_INPUT" && \
- sed 's/.*grml-live.*/# removed grml-live repository/' "$SOURCES_LIST_INPUT" | sponge "$SOURCES_LIST_OUTPUT"
+ grep -q 'grml-live.*main' "$SOURCES_LIST_OUTPUT" && \
+ sed -i 's/.*grml-live.*main/# removed grml-live repository/' "$SOURCES_LIST_OUTPUT"
fi
for file in "$LIVE_CONF" "$CONFIG" "$LOCAL_CONFIG" "$NFSROOT_CONF" ; do