[Debconf-video-commits] r267 - in fai-config: doc/src files/etc/apt/sources.list

holger at alioth.debian.org holger at alioth.debian.org
Sat Aug 23 16:23:19 UTC 2008


Author: holger
Date: 2008-08-23 16:23:18 +0000 (Sat, 23 Aug 2008)
New Revision: 267

Added:
   fai-config/files/etc/apt/sources.list/postinst
Modified:
   fai-config/doc/src/final_setup.sh
   fai-config/files/etc/apt/sources.list/AMD64
   fai-config/files/etc/apt/sources.list/I386
Log:
document final_setup.sh better, detect automatically if a local mirror is accessable and use it, if it is

Modified: fai-config/doc/src/final_setup.sh
===================================================================
--- fai-config/doc/src/final_setup.sh	2008-08-23 15:21:00 UTC (rev 266)
+++ fai-config/doc/src/final_setup.sh	2008-08-23 16:23:18 UTC (rev 267)
@@ -1,20 +1,55 @@
 #! /bin/bash
 
+#
 # Copyright 2006-2008 Holger Levsen 
 # released under the GPLv=2
 #
-# this is a stripped down version :)
 
+# country=UNIX
+LANG=C
+
+# distribution we are using
+DISTRO=etch
+
+# either use local mirror or ftp.de.debian.org
+apt-get install file
+TMPFILE=`mktemp -p /tmp`
+if $( wget -q http://mirror/debian/dists/$DISTRO/Release.gpg -O $TMPFILE && file $TMPFILE | grep PGP > /dev/null ) ; then MIRROR=mirror 
+elif $(wget -q http://ftp.de.debian.org/debian/dists/$DISTRO/Release.gpg -O $TMPFILE && file $TMPFILE | grep PGP > /dev/null ) ; then MIRROR=ftp.de.debian.org 
+else echo cannot reach a mirror, aborting && exit 1 ; fi
+rm $TMPFILE 
+
+# which arch are we running on? (needed for sources.list)
+ARCH=`dpkg --print-installation-architecture`
+
+# overwrite existing sources.lists, provide sensible defaults
+echo "deb http://$MIRROR/debian/ $DISTRO main contrib non-free
+deb http://security.debian.org/ $DISTRO/updates main contrib non-free
+
+deb http://db.debconf.org/dc-admin/archive/ $DISTRO/$ARCH/
+deb http://db.debconf.org/dc-admin/archive/ $DISTRO/all/
+" > /etc/apt/sources.list
+
+# /me hates this - we should definitly fix this before DebConf9
+echo 'APT::Get::AllowUnauthenticated "true";
+Aptitude::CmdLine::Ignore-Trust-Violations "true";
+' > /etc/apt/apt.conf.d/7debconf7
+
+# install fai clients and recommended stuff
 apt-get update
-DEBCONF_FRONTEND=noninteractive  DEBIAN_FRONTEND=noninteractive apt-get install vim fai-client subversion 
+DEBCONF_FRONTEND=noninteractive  DEBIAN_FRONTEND=noninteractive apt-get install fai-client subversion 
 
+# configure fai
 echo 'FAI_CONFIG_SRC="svn://svn.debian.org/svn/debconf-video/fai-config"' >> /etc/fai/fai.conf  # crude hack - last entry has precedence :)
 
+# run first softupdate, after that you can use /usr/local/sbin/softupdate 
 fai -N softupdate
 
+# display errors
 echo "cat /var/log/fai/current/error.log:"
 cat /var/log/fai/current/error.log
 
+# done
 echo
 echo "'fai -N softupdate' done."
 echo

Modified: fai-config/files/etc/apt/sources.list/AMD64
===================================================================
--- fai-config/files/etc/apt/sources.list/AMD64	2008-08-23 15:21:00 UTC (rev 266)
+++ fai-config/files/etc/apt/sources.list/AMD64	2008-08-23 16:23:18 UTC (rev 267)
@@ -1,4 +1,4 @@
-deb http://mirror/debian/ etch main contrib non-free
+deb http://#MIRROR#/debian/ etch main contrib non-free
 deb http://security.debian.org/ etch/updates main contrib non-free
 
 deb http://db.debconf.org/dc-admin/archive/ etch/amd64/

Modified: fai-config/files/etc/apt/sources.list/I386
===================================================================
--- fai-config/files/etc/apt/sources.list/I386	2008-08-23 15:21:00 UTC (rev 266)
+++ fai-config/files/etc/apt/sources.list/I386	2008-08-23 16:23:18 UTC (rev 267)
@@ -1,4 +1,4 @@
-deb http://mirror/debian/ etch main contrib non-free
+deb http://#MIRROR#/debian/ etch main contrib non-free
 deb http://security.debian.org/ etch/updates main contrib non-free
 
 deb http://db.debconf.org/dc-admin/archive/ etch/i386/

Added: fai-config/files/etc/apt/sources.list/postinst
===================================================================
--- fai-config/files/etc/apt/sources.list/postinst	                        (rev 0)
+++ fai-config/files/etc/apt/sources.list/postinst	2008-08-23 16:23:18 UTC (rev 267)
@@ -0,0 +1,22 @@
+#! /bin/bash
+
+#
+# Copyright 2006-2008 Holger Levsen 
+# released under the GPLv=2
+#
+
+# country=UNIX
+LANG=C
+
+# distribution we are using
+DISTRO=etch
+
+# either use local mirror or ftp.de.debian.org
+TMPFILE=`mktemp -p /tmp`
+if $( wget -q http://mirror/debian/dists/$DISTRO/Release.gpg -O $TMPFILE && file $TMPFILE | grep PGP > /dev/null ) ; then MIRROR=mirror 
+elif MIRROR=ftp.de.debian.org ; fi
+rm $TMPFILE 
+
+# modify copied file
+sed -i "s/#MIRROR#/$MIRROR/" $2
+


Property changes on: fai-config/files/etc/apt/sources.list/postinst
___________________________________________________________________
Name: svn:executable
   + *




More information about the Debconf-video-commits mailing list