[Fai-commit] r3229 - people/lazyboy/fai-2.9-multidistribution/lib

fai-repository at svn.debian.org fai-repository at svn.debian.org
Mon Jan 9 22:55:33 UTC 2006


Author: lazyboy-guest
Date: 2006-01-09 22:55:32 +0000 (Mon, 09 Jan 2006)
New Revision: 3229

Modified:
   people/lazyboy/fai-2.9-multidistribution/lib/subroutines-linux
Log:
changing base extraction method for multiple distribution, plus backward compatibility with standard base.tgz

Modified: people/lazyboy/fai-2.9-multidistribution/lib/subroutines-linux
===================================================================
--- people/lazyboy/fai-2.9-multidistribution/lib/subroutines-linux	2006-01-09 22:53:14 UTC (rev 3228)
+++ people/lazyboy/fai-2.9-multidistribution/lib/subroutines-linux	2006-01-09 22:55:32 UTC (rev 3229)
@@ -92,11 +92,17 @@
 }
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 task_extrbase() {
-
     local fs=$FAI_ROOT/etc/$fstab
     # extract the tar file which was the result of debootstrap
-    echo "Unpacking Debian base archive"
-    gzip -dc /var/tmp/base.tgz | tar -C $FAI_ROOT -xpf -
+
+    # calculate base_filename depending from distribution 
+    BASE_FILENAME="base.tgz"
+    if ! [ -z $DISTRIBUTION ]; then
+        BASE_FILENAME="base-$DISTRIBUTION.tgz"
+    fi
+    echo "Unpacking base archive $BASE_FILENAME"
+    gzip -dc /var/tmp/$BASE_FILENAME | tar -C $FAI_ROOT -xpf -
+
     # now we can copy fstab
     [ -f $fs ] && mv $fs $fs.old
     cp -p $LOGDIR/$fstab $fs
@@ -125,7 +131,13 @@
     fai-debconf $FAI/debconf
 }
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# FIXME: will break as soon somebody start using DISTRIBUTION=debian_sarge!!!
 task_prepareapt () {
+    # run this only for default distribution
+    if ! [ -z $DISTRIBUTION ]; then
+        echo "not running prepareapt because we are installing DISTRIBUTION=$DISTRIBUTION"
+        return 0
+    fi
 
     # ftp and http needs resolv.conf in chroot environment, /etc/hosts is useful
     # think about using fcopy for these two files
@@ -136,10 +148,17 @@
       echo -e "$IPADDR\t$HOSTNAME.$DOMAIN $HOSTNAME" >>$FAI_ROOT/etc/hosts
       echo $HOSTNAME >$FAI_ROOT/etc/hostname
     fi
+
     cp -r /etc/apt/* $FAI_ROOT/etc/apt/
 }
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# FIXME: will break as soon somebody start using DISTRIBUTION=debian_sarge!!!
 task_updatebase() {
+    # run this only for default distribution
+    if ! [ -z $DISTRIBUTION ]; then
+        echo "not running updatebase because we are installing DISTRIBUTION=$DISTRIBUTION"
+        return 0
+    fi
 
     # maybe the base system is not up to date
     echo "Updating base"
@@ -206,7 +225,7 @@
 	$frsh true >/dev/null 2>&1
 	if [ $? -ne 0 ]; then
 	    terror=3
-	    echo "WARNING: $frsh failed. Can't call fai-chboot on the install server."
+	    echo "Error: $frsh failed."
 	else
 	    # remove pxe config, so host will use default and boot from local disk
 	    $frsh /usr/sbin/fai-chboot -r $hostname
@@ -218,7 +237,11 @@
 
     # send message to monitor daemon
     [ "$faimond" -eq 0 ] && return 0
-    echo "$sndhostname $*" | nc $monserver 4711 2>/dev/null
+    if [ "$debug" ];then
+	echo "$sndhostname $*" | nc $monserver 4711
+    else
+	echo "$sndhostname $*" | nc $monserver 4711 2>/dev/null
+    fi
     return $?
 }
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -




More information about the Fai-commit mailing list