[Fai-commit] r5253 - in people/lazyboy/fai-distributions: debian etc sbin

lazyboy-guest at alioth.debian.org lazyboy-guest at alioth.debian.org
Mon Feb 9 12:22:33 UTC 2009


Author: lazyboy-guest
Date: 2009-02-09 12:22:33 +0000 (Mon, 09 Feb 2009)
New Revision: 5253

Added:
   people/lazyboy/fai-distributions/debian/files
   people/lazyboy/fai-distributions/etc/DIST-UBUNTU_HARDY.conf
   people/lazyboy/fai-distributions/etc/DIST-UBUNTU_INTREPID.conf
   people/lazyboy/fai-distributions/sbin/fai-make-base-tgz-rhel
   people/lazyboy/fai-distributions/sbin/fai-make-initial-ramdisk-rhel
Modified:
   people/lazyboy/fai-distributions/sbin/fai-make-base-tgz
Log:
add some more stuff - rhel things, intrepid config

Added: people/lazyboy/fai-distributions/debian/files
===================================================================
--- people/lazyboy/fai-distributions/debian/files	                        (rev 0)
+++ people/lazyboy/fai-distributions/debian/files	2009-02-09 12:22:33 UTC (rev 5253)
@@ -0,0 +1 @@
+fai-distributions_0.1-10_i386.deb unknown optional

Added: people/lazyboy/fai-distributions/etc/DIST-UBUNTU_HARDY.conf
===================================================================
--- people/lazyboy/fai-distributions/etc/DIST-UBUNTU_HARDY.conf	                        (rev 0)
+++ people/lazyboy/fai-distributions/etc/DIST-UBUNTU_HARDY.conf	2009-02-09 12:22:33 UTC (rev 5253)
@@ -0,0 +1,13 @@
+# MIRROR_LOCATION: the location of the mirror argument given to debootstrap
+MIRROR_LOCATION="http://de.archive.ubuntu.com/ubuntu"
+
+# where to find the deboostrap package
+BOOTSTRAP_ARCHIVE=http://ftp.de.debian.org/debian/pool/main/d/debootstrap/
+
+# name of the package
+BOOTSTRAP_PACKAGE=debootstrap_1.0.9_all.deb
+
+DEBOOTSTRAP_DIST_NAME="hardy"
+DEBOOTSTRAP_ARCH="i386"
+DEBOOTSTRAP_EXCLUDE="pcmcia-cs,pppoe,dhcp-client,exim4,exim4-base,exim4-config,exim4-daemon-light,modconf,libident,exim"
+DEBOOTSTRAP_INCLUDE=""


Property changes on: people/lazyboy/fai-distributions/etc/DIST-UBUNTU_HARDY.conf
___________________________________________________________________
Name: svn:executable
   + *

Added: people/lazyboy/fai-distributions/etc/DIST-UBUNTU_INTREPID.conf
===================================================================
--- people/lazyboy/fai-distributions/etc/DIST-UBUNTU_INTREPID.conf	                        (rev 0)
+++ people/lazyboy/fai-distributions/etc/DIST-UBUNTU_INTREPID.conf	2009-02-09 12:22:33 UTC (rev 5253)
@@ -0,0 +1,13 @@
+# MIRROR_LOCATION: the location of the mirror argument given to debootstrap
+MIRROR_LOCATION="http://de.archive.ubuntu.com/ubuntu"
+
+# where to find the deboostrap package
+BOOTSTRAP_ARCHIVE=http://ftp.de.debian.org/debian/pool/main/d/debootstrap/
+
+# name of the package
+BOOTSTRAP_PACKAGE=debootstrap_1.0.9_all.deb
+
+DEBOOTSTRAP_DIST_NAME="intrepid"
+DEBOOTSTRAP_ARCH="i386"
+DEBOOTSTRAP_EXCLUDE="pcmcia-cs,pppoe,dhcp-client,exim4,exim4-base,exim4-config,exim4-daemon-light,modconf,libident,exim"
+DEBOOTSTRAP_INCLUDE=""


Property changes on: people/lazyboy/fai-distributions/etc/DIST-UBUNTU_INTREPID.conf
___________________________________________________________________
Name: svn:executable
   + *

Modified: people/lazyboy/fai-distributions/sbin/fai-make-base-tgz
===================================================================
--- people/lazyboy/fai-distributions/sbin/fai-make-base-tgz	2009-02-08 22:38:38 UTC (rev 5252)
+++ people/lazyboy/fai-distributions/sbin/fai-make-base-tgz	2009-02-09 12:22:33 UTC (rev 5253)
@@ -1,8 +1,12 @@
 #!/bin/sh
 
+# this script is avilable under the terms of the GNU GPL.
+# author: Henning Sprang - henning at sprang.de
+
+# TODO: put this info in a --help / -h function!
 # this script should help to create base system images for use in FAI
 # installations.
-# even if debsoostrap seems to have scripts for multiple different
+# even if debboostrap seems to have scripts for multiple different
 # debian-based distributions, it most often does not succeed, for example to
 # create etch base system from sarge, create debian base system from ubuntu,
 # etc.
@@ -21,6 +25,8 @@
 #   - a debootstrap downloaded from a given location
 #
 # TODO: add the possibility to just download a readily created base image?
+# TODO: add a script for centOS/redhat and other systems minimal image
+# creation!
 
 
 PATH=/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin
@@ -31,7 +37,6 @@
     exit 9
 fi
 
-# option e currently does nothing
 while getopts vc:f:d: opt ; do
     case "$opt" in
         d) DISTRIBUTION=$OPTARG ;;
@@ -51,11 +56,8 @@
     exit 6
 fi
 
-if [ ! -d $NFSROOT ]; then
-	echo "need a working nfsroot - run fai-setup or make-fai-nfsroot"
-	exit 1
-fi
 
+
 [ "$verbose" ] && echo "Using configuration files from directory $cfdir"
 if [ -n "$cfg" ]; then
     . $cfdir/$cfg
@@ -70,12 +72,17 @@
 
 . /etc/fai-distributions/${DISTRIBUTION}.conf
 
-if [ -z "$NFSROOT" ]; then
-    echo "\$NFSROOT is not set. Please check your settings in $cfdir/fai.conf."
+if [ -z "$FAI_CONFIGDIR" ]; then
+    echo "\$FAI_CONFIGDIR is not set. Please check your settings in $cfdir/fai.conf."
     exit 4
 fi
 
+if [ ! -d $FAI_CONFIGDIR ]; then
+	echo "need a working nfsroot - run fai-setup or make-fai-nfsroot"
+	exit 1
+fi
 
+
 # TODO: base bootstrapper dir should be defined in (not yet existing)
 # generic config file)
 BOOTSTRAP_DIR=/var/lib/fai-distributions/bootstrappers/$DISTRIBUTION
@@ -111,30 +118,48 @@
 
 echo "TMPDIR is $TMP_CHROOT_DIR"
 
+
+# from here, it's debian/dpkg specific! - for additional distributions, we
+# need a decision here and call something else!
+
 # call debootstrap as neccessary
 # TODO: put into config file (for each distribution)!
-DEBOOTSTRAP_OPTIONS="--arch $DEBOOTSTRAP_ARCH \
-    --exclude=$DEBOOTSTRAP_EXCLUDE \
-    --include=$DEBOOTSTRAP_INCLUDE \
+
+[ -z $DEBOOTSTRAP_EXCLUDE ] || {
+    DEBOOTSTRAP_OPTIONS="--exclude=$DEBOOTSTRAP_EXCLUDE"
+}
+
+[ -z $DEBOOTSTRAP_INCLUDE ] || {
+    DEBOOTSTRAP_OPTIONS="$DEBOOTSTRAP_OPTIONS --include=$DEBOOTSTRAP_INCLUDE"
+}
+
+DEBOOTSTRAP_OPTIONS="$DEBOOTSTRAP_OPTIONS --arch $DEBOOTSTRAP_ARCH \
     $DEBOOTSTRAP_DIST_NAME \
     $TMP_CHROOT_DIR \
     $MIRROR_LOCATION"
 
 cd `dirname $0`
 
-export DEBOOTSTRAP_DIR=$BOOTSTRAP_DIR/usr/lib/debootstrap/
+#export DEBOOTSTRAP_DIR=$BOOTSTRAP_DIR/usr/lib/debootstrap/
+export DEBOOTSTRAP_DIR=$BOOTSTRAP_DIR/usr/share/debootstrap/
 
 echo run $BOOTSTRAP_DIR/usr/sbin/debootstrap $DEBOOTSTRAP_OPTIONS
 $BOOTSTRAP_DIR/usr/sbin/debootstrap $DEBOOTSTRAP_OPTIONS
 
 chroot $TMP_CHROOT_DIR apt-get clean
        
-echo "Creating base-$DISTRIBUTION.tgz"
 
+# Debian specific stuff ends here
+
+echo "Creating $DISTRIBUTION.tar.gz"
+
 cd $TMP_CHROOT_DIR
 
+[ -d $FAI_CONFIGDIR/basefiles ] || {
+    mkdir $FAI_CONFIGDIR/basefiles
+}
 
-tar cfz $NFSROOT/var/tmp/base-$DISTRIBUTION.tgz *
+tar cfz $FAI_CONFIGDIR/basefiles/$DISTRIBUTION.tar.gz
 
 chroot $TMP_CHROOT_DIR umount /dev
 chroot $TMP_CHROOT_DIR umount /.dev
@@ -142,5 +167,3 @@
 # cleanup
 echo "cleaning up TMP_CHROOT_DIR $TMP_CHROOT_DIR"
 rm -rf $TMP_CHROOT_DIR
-
-

Added: people/lazyboy/fai-distributions/sbin/fai-make-base-tgz-rhel
===================================================================
--- people/lazyboy/fai-distributions/sbin/fai-make-base-tgz-rhel	                        (rev 0)
+++ people/lazyboy/fai-distributions/sbin/fai-make-base-tgz-rhel	2009-02-09 12:22:33 UTC (rev 5253)
@@ -0,0 +1,23 @@
+#! /bin/sh
+tmp=`mktemp -d`
+
+#yum -c yum.conf --installroot=$tmp -y groupinstall Core
+yum -c yum.conf --installroot=$tmp -y install yum dhclient
+cp rhel5.repo  $tmp/etc/yum.repos.d/
+mount -o bind /proc $tmp/proc
+chroot $tmp yum groupinstall -y Core
+chroot $tmp yum clean packages
+
+#rm $tmp/var/cache/yum/base/packages/*.rpm
+
+echo "chroot created in tmp=$tmp"
+oldpwd=$PWD
+cd $tmp
+umount ./proc
+
+tar cvfz $oldpwd/DIST-RHEL_5.tar.gz . 
+
+cd -
+
+
+echo "chroot created in tmp=$tmp"


Property changes on: people/lazyboy/fai-distributions/sbin/fai-make-base-tgz-rhel
___________________________________________________________________
Name: svn:executable
   + *

Added: people/lazyboy/fai-distributions/sbin/fai-make-initial-ramdisk-rhel
===================================================================
--- people/lazyboy/fai-distributions/sbin/fai-make-initial-ramdisk-rhel	                        (rev 0)
+++ people/lazyboy/fai-distributions/sbin/fai-make-initial-ramdisk-rhel	2009-02-09 12:22:33 UTC (rev 5253)
@@ -0,0 +1 @@
+ mkinitrd --with=xennet --preload=xenblk -v -f /boot/initrd-2.6.18-8.el5xen-custom.img 2.6.18-8.el5xen


Property changes on: people/lazyboy/fai-distributions/sbin/fai-make-initial-ramdisk-rhel
___________________________________________________________________
Name: svn:executable
   + *




More information about the Fai-commit mailing list