2 # Filename: /etc/grml/fai/config/scripts/GRMLBASE/33-aptsetup
3 # Purpose: configure Debian package management of live-system
4 # Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
5 # Bug-Reports: see http://grml.org/bugs/
6 # License: This file is licensed under the GPL v2 or any later version.
7 ################################################################################
11 if [ -L "$target"/etc/apt/sources.list ] ; then
12 echo "Note: $target/etc/apt/sources.list seems to be the old sources.list setup."
13 echo "|-> Not modifying anything. If you want to switch to the new setup just"
14 echo "\`-> remove symlink $target/etc/apt/sources.list"
18 # remove leftover from /etc/grml/fai/config/hooks/instsoft.GRMLBASE:
19 rm -f $target/etc/apt/sources.list.d/grml-live.list
21 # restore original grml sources.list file:
22 if [ -r $target/etc/apt/sources.list.d/grml.unused ] ; then
23 mv $target/etc/apt/sources.list.d/grml.unused $target/etc/apt/sources.list.d/grml.list
26 GRML_SOURCES_LIST="$target/etc/apt/sources.list.d/grml.list"
27 DEBIAN_SOURCES_LIST="$target/etc/apt/sources.list.d/debian.list"
29 [ -d $target/etc/apt/sources.list.d ] || mkdir $target/etc/apt/sources.list.d
31 # remove any existing sources.list and inform user about the new
32 # /etc/apt/sources.list.d/ setup:
33 cat > $target/etc/apt/sources.list << EOF
34 ##### IMPORTANT NOTE ##############################################
35 # The configuration file /etc/apt/sources.list has been split
36 # into structured files in /etc/apt/sources.list.d/ - check out:
38 # /etc/apt/sources.list.d/grml.list for the grml related repositories
39 # /etc/apt/sources.list.d/debian.list for official Debian repositories
41 # If you're looking for the "old" /etc/apt/sources.list file or
42 # need some further repositories please take a look at the file
43 # /etc/apt/sources.list.grml
44 ##### IMPORTANT NOTE ##############################################
47 # retrieve build information ($SUITE):
48 if [ -r $target/etc/grml_live_version ] ; then
49 . $target/etc/grml_live_version
52 # if we stil do not know which Debian suite we are building assume "stable"
53 [ -n "$SUITE" ] || SUITE="stable"
55 # configure official Debian repositories:
56 cat > "$DEBIAN_SOURCES_LIST" << EOF
57 # official debian repository (mirror selected via geo-ip):
58 deb http://cdn.debian.net/debian/ $SUITE main contrib non-free
59 # deb-src http://cdn.debian.net/debian/ $SUITE main contrib non-free
61 # official debian repository:
62 # deb http://ftp.debian.org/debian/ sid main contrib non-free
63 # deb-src http://ftp.debian.org/debian/ sid main contrib non-free
65 # official debian DE repository:
66 # deb http://ftp.de.debian.org/debian/ sid main contrib non-free
67 # deb-src http://ftp.de.debian.org/debian/ sid main contrib non-free
69 # official debian AT repository:
70 # deb http://ftp.at.debian.org/debian/ sid main contrib non-free
71 # deb-src http://ftp.at.debian.org/debian/ sid main contrib non-free
74 # configure grml-stable repository:
75 cat > "$GRML_SOURCES_LIST" << EOF
76 # stable grml repository:
77 deb http://deb.grml.org/ grml-stable main
78 # deb-src http://deb.grml.org/ grml-stable main
81 ENABLE_GRML_TESTING=false
82 # if we have a devel-version or a daily snapshot enable grml-testing by default:
83 if [ -n "$GRML_NAME" -o -n "$RELEASENAME" ] ; then
84 if echo "$GRML_NAME" "$RELEASENAME" | grep -e devel -e autobuild 1>/dev/null ; then
85 ENABLE_GRML_TESTING=true
89 if $ENABLE_GRML_TESTING ; then
90 cat >> "$GRML_SOURCES_LIST" << EOF
91 # testing/developer grml repository:
92 deb http://deb.grml.org/ grml-testing main
93 # deb-src http://deb.grml.org/ grml-testing main
95 else # no devel/daily build:
96 cat >> "$GRML_SOURCES_LIST" << EOF
97 # testing/developer grml repository:
98 # deb http://deb.grml.org/ grml-testing main
99 # deb-src http://deb.grml.org/ grml-testing main
103 ## END OF FILE #################################################################
104 # vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=3