[Fai-commit] r5883 - in trunk: conf debian lib

Thomas Lange lange at alioth.debian.org
Tue Jul 27 21:58:55 UTC 2010


Author: lange
Date: 2010-07-27 21:58:54 +0000 (Tue, 27 Jul 2010)
New Revision: 5883

Added:
   trunk/lib/get-config-dir-http
Modified:
   trunk/conf/fai.conf
   trunk/debian/NEWS
   trunk/debian/changelog
Log:
get-config-dir-http: new script to get a tarball of the config space
(thanks to Waldemar Brodkorb for the initial patch)

Modified: trunk/conf/fai.conf
===================================================================
--- trunk/conf/fai.conf	2010-07-27 06:56:04 UTC (rev 5882)
+++ trunk/conf/fai.conf	2010-07-27 21:58:54 UTC (rev 5883)
@@ -6,7 +6,7 @@
 # If undefined here, make-fai-nfsroot/fai-setup will use default value
 # nfs://<install server>/$FAI_CONFIGDIR
 # supported URL-types: nfs, file, cvs, cvs+ssh, svn+file, svn+http,
-# git, git+http, hg+http
+# git, git+http, hg+http, tarball via http
 #FAI_CONFIG_SRC=nfs://yourservername/path/to/config/space
 
 # LOGUSER: an account on the install server which saves all log-files

Modified: trunk/debian/NEWS
===================================================================
--- trunk/debian/NEWS	2010-07-27 06:56:04 UTC (rev 5882)
+++ trunk/debian/NEWS	2010-07-27 21:58:54 UTC (rev 5883)
@@ -1,6 +1,7 @@
 fai (4.0) unstable; urgency=low
 
   - old tool setup_harddisks removed. Use setup-storage instead
+  - a tarball of the config space can be received via http
 
  -- Thomas Lange <lange at debian.org>  Fri, 09 Jul 2010 16:21:32 +0200
 

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2010-07-27 06:56:04 UTC (rev 5882)
+++ trunk/debian/changelog	2010-07-27 21:58:54 UTC (rev 5883)
@@ -1,6 +1,8 @@
 fai (3.4~beta6) unstable; urgency=low
 
   [ Thomas Lange ]
+  * get-config-dir-http: new script to get a tarball of the config space
+    (thanks to Waldemar Brodkorb for the initial patch)
   * dhcp-edit: new command that adds or removes entries to/from dhcpd.conf
     add $modified, add more messages, fix code for adding a host
   * make-fai-nfsroot.conf: set NFSROOT_HOOKS by default

Added: trunk/lib/get-config-dir-http
===================================================================
--- trunk/lib/get-config-dir-http	                        (rev 0)
+++ trunk/lib/get-config-dir-http	2010-07-27 21:58:54 UTC (rev 5883)
@@ -0,0 +1,54 @@
+#!/bin/bash
+
+# $Id$
+#*********************************************************************
+#
+# get-config-dir-http -- get a tarball of the config dir
+#
+# This script is part of FAI (Fully Automatic Installation)
+# Copyright (C) 2000-2010 Thomas Lange, lange at informatik.uni-koeln.de
+# Universitaet zu Koeln
+#
+#*********************************************************************
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#*********************************************************************
+
+### BEGIN SUBROUTINE INFO
+# Provides-Var:
+# Requires-Var:  $FAI_CONFIG_SRC $FAI
+# Suggests-Var:
+# Short-Description: get config space via http
+### END SUBROUTINE INFO
+
+fdir=/var/lib/fai
+
+cd $fdir
+
+# determine basename of tar file to download (later used as class name)
+file=${FAI_CONFIG_SRC##*/}
+base=${file%%.*}
+
+# get md5sum first
+if wget -q -t5 -O $fdir/$file.md5 ${FAI_CONFIG_SRC}.md5; then
+   echo "Checksum file $file.md5 successfully downloaded."
+else
+   echo "Checksum file ${FAI_CONFIG_SRC}.md5 failed to download. Aborting."
+   task_error 701
+fi
+
+# now download tarball of config space
+echo -n "Getting configuration space tarball from $FAI_CONFIG_SRC ..."
+wget -q -t 3 $FAI_CONFIG_SRC && echo "done"
+task_error 702 $?
+
+# check the md5 sum
+md5sum -c $file.md5 || echo "Checksum mismatch "
+task_error 703 $?
+
+# extraxt the downloaded file using ftar. Therefore define a class
+# basename of the file
+echo "extracting config space from $file"
+ftar -c $base -t $FAI -s $fdir .




More information about the Fai-commit mailing list