Add APT_PROXY configuration variable
authorChristian Hofstaedtler <ch@grml.org>
Fri, 25 Nov 2011 16:18:51 +0000 (17:18 +0100)
committerChristian Hofstaedtler <ch@grml.org>
Fri, 25 Nov 2011 16:18:51 +0000 (17:18 +0100)
docs/grml-live.txt
etc/grml/fai/config/hooks/updatebase.GRMLBASE
etc/grml/fai/config/scripts/GRMLBASE/98-clean-chroot
etc/grml/grml-live.conf

index 1aac189..7952172 100644 (file)
@@ -928,6 +928,9 @@ taken as first entry in the generated sources.list so it's preferred over
 non-local mirrors. Using a fallback mirror (via providing several mirrors in
 GRML_LIVE_SOURCES as used by default) is a recommended setting.
 
+If you want to use a HTTP Proxy (like apt-cacher-ng), set APT_PROXY. Example:
+APT_PROXY="http://localhost:3142/"
+
 [[add-additional-debian-packages]]
 How do I add additional Debian package(s) to my CD/ISO?
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -1008,25 +1011,20 @@ or if using /etc/grml/fai/config/basefiles/$CLASSNAME.tar.gz for:
 Existing base.tgz can be found at http://daily.grml.org/
 
 [[apt-cacher]]
-Set up apt-cacher / apt-cacher-ng for use with grml-live
+Set up apt-cacher-ng for use with grml-live
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-Make sure /etc/grml/grml-live.conf provides according GRML_LIVE_SOURCES and
+Make sure /etc/grml/grml-live.local provides according APT_PROXY and
 FAI_DEBOOTSTRAP:
 
-  # cat /etc/grml/grml-live.conf
+  # cat /etc/grml/grml-live.local
   [...]
-  GRML_LIVE_SOURCES="
-  deb http://localhost:3142/deb.grml.org grml-stable  main
-  deb http://localhost:3142/deb.grml.org grml-testing main
-  deb http://localhost:3142/cdn.debian.net/debian squeeze main contrib non-free
-  "
+  APT_PROXY="http://localhost:3142/"
   [...]
   FAI_DEBOOTSTRAP="squeeze http://localhost:3142/cdn.debian.net/debian squeeze main contrib non-free"
 
-Make sure apt-cacher / apt-cacher-ng is running ('/etc/init.d/apt-cacher
-restart' or '/etc/init.d/apt-cacher-ng restart'). That's it.  All downloaded
-files will be cached in /var/cache/apt-cacher/ or /var/cache/apt-cacher-ng then.
+Make sure apt-cacher-ng is running ('/etc/init.d/apt-cacher-ng restart').
+That's it.  All downloaded files will be cached in /var/cache/apt-cacher-ng then.
 
 [[approx]]
 Set up approx for use with grml-live
index f88f0fb..82a2fb9 100755 (executable)
@@ -18,6 +18,12 @@ HOSTNAME=''
 [ -n "$HOSTNAME" ] || HOSTNAME=grml
 echo "$HOSTNAME" > $target/etc/hostname
 
+if [ -n "$APT_PROXY" ] ; then
+  cat > $target/etc/apt/apt.conf.d/90grml-apt-proxy.conf <<EOF
+Acquire::http { Proxy "$APT_PROXY"; };
+EOF
+fi
+
 if [ "$FAI_ACTION" = "softupdate" ] ; then
    echo "Action $FAI_ACTION of FAI (hooks/updatebase.GRMLBASE) via grml-live running"
 
index 9df6204..c053a9e 100755 (executable)
@@ -17,6 +17,8 @@ fi
 echo "Creating ~/.zshrc"
 touch $target/root/.zshrc
 
+$ROOTCMD rm -f /etc/apt/apt.conf.d/90grml-apt-proxy.conf
+
 if [ -x $target/usr/sbin/localepurge ] ; then
   echo "Running localepurge"
   $ROOTCMD localepurge
index 8cb21b4..63acc99 100644 (file)
@@ -76,6 +76,9 @@
 #deb http://cdn.debian.net/debian etch         main contrib non-free
 #"
 
+# HTTP Proxy to use for APT
+# APT_PROXY="http://localhost:3142/"
+
 # Which Debian suite and which mirror do you want to use for debootstrapping?
 # Unless specified the default from /etc/grml/fai/make-fai-nfsroot.conf will be
 # taken. If you specify a value then the file /etc/grml/fai/make-fai-nfsroot.conf