[Fai-commit] r3258 - in people/lazyboy/fai-distributions:
classes/MANDRIVA/files classes/MANDRIVA/files/boot
classes/MANDRIVA/files/boot/grub
classes/MANDRIVA/files/boot/grub/menu.lst
classes/MANDRIVA/hooks debian dists dists/centos3
dists/mandriva dists/ubuntu_breezy dists/ubuntu_hoary etc
fai-repository at svn.debian.org
fai-repository at svn.debian.org
Sat Jan 21 22:09:09 UTC 2006
Author: lazyboy-guest
Date: 2006-01-21 22:09:08 +0000 (Sat, 21 Jan 2006)
New Revision: 3258
Added:
people/lazyboy/fai-distributions/classes/MANDRIVA/files/boot/
people/lazyboy/fai-distributions/classes/MANDRIVA/files/boot/grub/
people/lazyboy/fai-distributions/classes/MANDRIVA/files/boot/grub/menu.lst/
people/lazyboy/fai-distributions/classes/MANDRIVA/files/boot/grub/menu.lst/MANDRIVA
people/lazyboy/fai-distributions/dists/centos3/
people/lazyboy/fai-distributions/dists/centos3/make-base-tgz
people/lazyboy/fai-distributions/etc/centos3.conf
people/lazyboy/fai-distributions/etc/mandriva.conf
Removed:
people/lazyboy/fai-distributions/classes/MANDRIVA/hooks/.prepareapt.MANDRIVA.swp
Modified:
people/lazyboy/fai-distributions/classes/MANDRIVA/hooks/instsoft.MANDRIVA
people/lazyboy/fai-distributions/debian/changelog
people/lazyboy/fai-distributions/dists/mandriva/make-base-tgz
people/lazyboy/fai-distributions/dists/ubuntu_breezy/make-base-tgz
people/lazyboy/fai-distributions/dists/ubuntu_hoary/make-base-tgz
people/lazyboy/fai-distributions/etc/ubuntu_breezy.conf
people/lazyboy/fai-distributions/etc/ubuntu_hoary.conf
Log:
this is what makes build 0.1-5 - adding centos3 stuff, fixing some bugs
Added: people/lazyboy/fai-distributions/classes/MANDRIVA/files/boot/grub/menu.lst/MANDRIVA
===================================================================
--- people/lazyboy/fai-distributions/classes/MANDRIVA/files/boot/grub/menu.lst/MANDRIVA 2006-01-21 12:18:45 UTC (rev 3257)
+++ people/lazyboy/fai-distributions/classes/MANDRIVA/files/boot/grub/menu.lst/MANDRIVA 2006-01-21 22:09:08 UTC (rev 3258)
@@ -0,0 +1,47 @@
+#
+timeout 5
+default 0
+color cyan/blue white/blue
+
+title mandriva
+root (hd0,0)
+kernel /boot/vmlinuz-2.6.11-6mdk root=/dev/hda1
+
+### BEGIN AUTOMAGIC KERNELS LIST
+## lines between the AUTOMAGIC KERNELS LIST markers will be modified
+## by the debian update-grub script except for the default optons below
+
+## DO NOT UNCOMMENT THEM, Just edit them to your needs
+
+## ## Start Default Options ##
+## default kernel options
+# kopt=root=/dev/hda1 ro
+
+## default grub root device
+## e.g. groot=(hd0,0)
+# groot=
+
+## should update-grub create alternative boot options
+## e.g. alternative=true
+## alternative=false
+# alternative=true
+
+## should update-grub lock alternative boot options
+## e.g. lockalternative=true
+## lockalternative=false
+# lockalternative=true
+
+## altoption boot targets option
+## multiple altoptions lines are allowed
+## e.g. altoptions=(extra menu suffix) extra boot options
+## altoptions=(recovery mode) single
+# altoptions=(recovery mode) single
+
+## add memtest86 if found
+# memtest86=true
+
+## ## End Default Options ##
+
+### END DEBIAN AUTOMAGIC KERNELS LIST
+
+
Property changes on: people/lazyboy/fai-distributions/classes/MANDRIVA/files/boot/grub/menu.lst/MANDRIVA
___________________________________________________________________
Name: svn:executable
+ *
Deleted: people/lazyboy/fai-distributions/classes/MANDRIVA/hooks/.prepareapt.MANDRIVA.swp
===================================================================
(Binary files differ)
Modified: people/lazyboy/fai-distributions/classes/MANDRIVA/hooks/instsoft.MANDRIVA
===================================================================
--- people/lazyboy/fai-distributions/classes/MANDRIVA/hooks/instsoft.MANDRIVA 2006-01-21 12:18:45 UTC (rev 3257)
+++ people/lazyboy/fai-distributions/classes/MANDRIVA/hooks/instsoft.MANDRIVA 2006-01-21 22:09:08 UTC (rev 3258)
@@ -1,12 +1,141 @@
-#! /bin/sh
+#!/usr/bin/perl
-#
-#local pkglist;
+#
+#*********************************************************************
+#
+# instsof-mandriva -- determine packages to install for mandriva linux
+# and install them
+#
+# This script is part of FAI (Fully Automatic Installation)
+# (c) 2000-2005, Thomas Lange, lange at informatik.uni-koeln.de
+#
+#*********************************************************************
+# 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.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; see the file COPYING. If not, write to the
+# Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+# MA 02111-1307, USA.
+#*********************************************************************
+my $version = "Version 2.14, 28-apr-2005";
+$0=~ s#.+/##; # remove path from program name
-pkglist=`install_rpms`
-echo "=======================packages to install====================================="
-echo $pkglist
-echo "==============================================================================="
-chroot $FAI_ROOT urpmi --auto --force --allow-force --keep $pkglist
+# import variables: $verbose, $MAXPACKAGES, $classes, $FAI, $FAI_ROOT
+my $verbose = 1;
+my $FAI_ROOT;
+my @classes;
+my $classpath;
+my $rootcmd;
+my @preloadlist;
+my @preloadrmlist;
+my %list;
+my %classisdef;
+
+# PRELOAD feature from Thomas Gebhardt <gebhardt at hrz.uni-marburg.de>
+
+$| = 1;
+# order of commands to execute
+
+$FAI_ROOT = $ENV{FAI_ROOT};
+$classpath = "$ENV{FAI}/package_config";
+ at classes = grep { !/^#|^\s*$/ } split(/[\s\n]+/,$ENV{classes});
+foreach (@classes) { $classisdef{$_}=1; }
+
+warn "Classes defined: ".join(' ', @classes)."\n" if $verbose;
+
+# read all package config files
+foreach (@classes) {
+ my $filename = "$classpath/$_";
+ &readconfig($filename) if -f $filename;
+}
+
+# get files which must exist before installing packages
+foreach my $entry (@preloadlist, at preloadrmlist) {
+ my ($url, $directory) = @$entry;
+ if ($url =~ m!^file:/(.+)!) {
+ my $file = $1;
+ exec("cp $FAI_ROOT/$file $FAI_ROOT/$directory") unless $listonly;
+ } else {
+ exec("wget -nv -P$FAI_ROOT/$directory $url") unless $listonly;
+ }
+}
+
+# remove preloaded files
+foreach my $entry (@preloadrmlist) {
+ my ($url, $directory) = @$entry;
+ $url =~ m#/([^/]+$)#;
+ my $file = "$directory/$1";
+ print "rm $file\n" if $verbose;
+ unlink $file || warn "Can't remove $file\n";
+}
+
+my $pkglist=join(" ", @{$list{'install'}})."\n";
+
+print "=======================packages to install=====================================";
+print $pkglist;
+print "===============================================================================";
+
+exec "chroot $FAI_ROOT urpmi --auto --force --allow-force --keep $pkglist";
+
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - -
+sub readconfig {
+
+ my $filename = shift;
+ my ($package,$type,$cllist, at oclasses,$doit);
+
+ open (FILE,"$filename") || warn "ERROR $0: Can't read config file: $filename\n";
+ warn "$0: read config file $filename\n" if $verbose;
+
+ while (<FILE>) {
+ next if /^#/; # skip comments
+ s/#.*$//; # delete comments
+ next if /^\s*$/; # skip empty lines
+ chomp;
+ /^PRELOAD\s+(\S+)\s+(\S+)/ and push(@preloadlist, [$1,$2]),next;
+ /^PRELOADRM\s+(\S+)\s+(\S+)/ and push(@preloadrmlist, [$1,$2]),next;
+
+ if (/^PACKAGES\s+(\S+)\s*/) {
+ ($type,$cllist) = ($1,$');
+ # by default no classes are listed after this command so doit
+ $doit = 1;
+ if ($cllist) {
+ # no classes specified after PACKAGES command
+ # so add all packages listed
+ # use packages on for a list of classes
+
+ $doit = 0; # assume no class is defined
+ @oclasses = split(/\s+/,$cllist);
+ # if a listed class is defined, add the packaes, otherwise skip these packages
+ foreach (@oclasses) { exists $classisdef{$_} and $doit = 1;}
+ }
+ next;
+ }
+
+ warn "PACKAGES .. line missing in $filename\n",next unless $type;
+ push @{$list{$type}}, split if $doit;
+ }
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - -
+sub usage {
+
+ print "
+install_packages $version
+
+Ow ow ow... I don't even know how to use this tool !
+";
+exit 0;
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+
Modified: people/lazyboy/fai-distributions/debian/changelog
===================================================================
--- people/lazyboy/fai-distributions/debian/changelog 2006-01-21 12:18:45 UTC (rev 3257)
+++ people/lazyboy/fai-distributions/debian/changelog 2006-01-21 22:09:08 UTC (rev 3258)
@@ -1,3 +1,9 @@
+fai-distributions (0.1-5) unstable; urgency=low
+
+ * optimize base-image fetching, fix bugs
+
+ -- Henning Sprang <henning at sprang.de> Sat, 21 Jan 2006 22:26:28 +0100
+
fai-distributions (0.1-4) unstable; urgency=low
* put florent vuillemin's 2.8.4 multi-distribution stuff in here and into
Added: people/lazyboy/fai-distributions/dists/centos3/make-base-tgz
===================================================================
--- people/lazyboy/fai-distributions/dists/centos3/make-base-tgz 2006-01-21 12:18:45 UTC (rev 3257)
+++ people/lazyboy/fai-distributions/dists/centos3/make-base-tgz 2006-01-21 22:09:08 UTC (rev 3258)
@@ -0,0 +1,59 @@
+#!/bin/sh
+PATH=/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin
+
+DISTRIBUTION="centos3"
+
+if [ `id -u` -ne 0 ]; then
+ echo "Run this program as root."
+ exit 9
+fi
+
+# option e currently does nothing
+while getopts vc:f: opt ; do
+ case "$opt" in
+ c) cfdir=$OPTARG ;;
+ v) verbose=1 ; v=-v ;;
+ f) cfg=$OPTARG ;;
+ ?) exit 5 ;; # error in option parsing
+ esac
+done
+
+set -e
+
+# source fai.conf and make-fai-nfsroot.conf
+[ -z "$cfdir" ] && cfdir=/etc/fai
+if [ ! -d "$cfdir" ]; then
+ echo "$cfdir is not a directory"
+ exit 6
+fi
+
+[ "$verbose" ] && echo "Using configuration files from directory $cfdir"
+if [ -n "$cfg" ]; then
+ . $cfdir/$cfg
+else
+ . $cfdir/fai.conf
+fi
+
+
+. /etc/fai-distributions/${DISTRIBUTION}.conf
+
+if [ -z "$NFSROOT" ]; then
+ echo "\$NFSROOT is not set. Please check your settings in $cfdir/fai.conf."
+ exit 4
+fi
+
+
+# FIXME: can/should probably be defined somewhere in /etc/fai?
+TMPDIR="/tmp/fai/${DISTRIBUTION}_debootstrap/"
+echo "TMPDIT is $TMPDIR"
+
+rpmstrap centos3 $TMPDIR $MIRROR
+
+echo "Creating base-$DISTRIBUTION.tgz"
+
+cd $TMPDIR
+tar cfz $NFSROOT/var/tmp/base-$DISTRIBUTION.tgz *
+
+#chroot $TMPDIR umount /dev
+chroot $TMPDIR umount /.dev
+
Modified: people/lazyboy/fai-distributions/dists/mandriva/make-base-tgz
===================================================================
--- people/lazyboy/fai-distributions/dists/mandriva/make-base-tgz 2006-01-21 12:18:45 UTC (rev 3257)
+++ people/lazyboy/fai-distributions/dists/mandriva/make-base-tgz 2006-01-21 22:09:08 UTC (rev 3258)
@@ -42,53 +42,31 @@
exit 4
fi
-# call debootstrap as necesary - (how can this be done without having the
-# ubuntu debootstrap installed?)
+# workaround/timesaver: fetch a pre-build base image
+if ! [ -z $BASE_IMAGE ];then
+ cd /tmp/
+ if [ -e $BASE_IMAGE ]; then
+ rm $BASE_IMAGE
+ fi
+ wget $BASE_IMAGE_ARCHIVE/$BASE_IMAGE
-### in case the bootstrapper isn't installed, fetch it.
-#BOOTSTRAP_DIR=/var/fai/bootstrappers/$DISTRIBUTION
-#mkdir -p $BOOTSTRAP_DIR
-#cd $BOOTSTRAP_DIR
-#wget $BOOTSTRAP_ARCHIVE/ubuntu_breezy/$BOOTSTRAP_PACKAGE
+ mv $BASE_IMAGE $NFSROOT/var/tmp/
+ echo "base image $BASE_IMAGE successfully fetched and placed in nfsroot"
+ exit 0
+fi
-# extact debootstrap archive
-#dpkg-deb -x $BOOTSTRAP_PACKAGE .
-
-#cd -
-
# FIXME: can/should probably be defined somewhere in /etc/fai?
TMPDIR="/tmp/fai/${DISTRIBUTION}_debootstrap/"
echo "TMPDIT is $TMPDIR"
-#FAI_DEBOOTSTRAP_OPTIONS="--arch i386 \
-# --exclude=pcmcia-cs,pppoe,dhcp-client,exim4,exim4-base,exim4-config,exim4-daemon-light,modconf,libident,exim \
-# --include=lilo \
-# breezy \
-# $TMPDIR \
-# $MIRROR_LOCATION"
-# cleanup
-#echo "cleaning up TMPDIR $TMPDIR"
-#rm -rf $TMPDIR
-
-#cd `dirname $0`
-
-#export DEBOOTSTRAP_DIR=$BOOTSTRAP_DIR/usr/lib/debootstrap/
-
-#echo run $BOOTSTRAP_DIR/usr/sbin/debootstrap $FAI_DEBOOTSTRAP_OPTIONS
-#$BOOTSTRAP_DIR/usr/sbin/debootstrap $FAI_DEBOOTSTRAP_OPTIONS
-
+# FIXME: doesn't work yet
+#rpmstrap --include=$BASE_EXTRA_PACKAGES mandriva10 $TMPDIR $MANDRIVA_MIRROR
rpmstrap mandriva10 $TMPDIR $MANDRIVA_MIRROR
-#chroot $TMPDIR apt-get clean
-
-
-
echo "Creating base-$DISTRIBUTION.tgz"
cd $TMPDIR
tar cfz $NFSROOT/var/tmp/base-$DISTRIBUTION.tgz *
-#chroot $TMPDIR umount /dev
-chroot $TMPDIR umount /.dev
-
+rm -r $TMPDIR
Modified: people/lazyboy/fai-distributions/dists/ubuntu_breezy/make-base-tgz
===================================================================
--- people/lazyboy/fai-distributions/dists/ubuntu_breezy/make-base-tgz 2006-01-21 12:18:45 UTC (rev 3257)
+++ people/lazyboy/fai-distributions/dists/ubuntu_breezy/make-base-tgz 2006-01-21 22:09:08 UTC (rev 3258)
@@ -67,10 +67,6 @@
$TMPDIR \
$MIRROR_LOCATION"
-# cleanup
-echo "cleaning up TMPDIR $TMPDIR"
-rm -rf $TMPDIR
-
cd `dirname $0`
export DEBOOTSTRAP_DIR=$BOOTSTRAP_DIR/usr/lib/debootstrap/
@@ -88,3 +84,8 @@
chroot $TMPDIR umount /dev
chroot $TMPDIR umount /.dev
+# cleanup
+echo "cleaning up TMPDIR $TMPDIR"
+rm -rf $TMPDIR
+
+
Modified: people/lazyboy/fai-distributions/dists/ubuntu_hoary/make-base-tgz
===================================================================
--- people/lazyboy/fai-distributions/dists/ubuntu_hoary/make-base-tgz 2006-01-21 12:18:45 UTC (rev 3257)
+++ people/lazyboy/fai-distributions/dists/ubuntu_hoary/make-base-tgz 2006-01-21 22:09:08 UTC (rev 3258)
@@ -69,10 +69,6 @@
$TMPDIR \
ftp://$mirrorhost/ubuntu"
-# cleanup
-echo "cleaning up TMPDIR $TMPDIR"
-rm -rf $TMPDIR
-
cd `dirname $0`
export DEBOOTSTRAP_DIR=$BOOTSTRAP_DIR/usr/lib/debootstrap/
@@ -90,3 +86,6 @@
chroot $TMPDIR umount /dev
chroot $TMPDIR umount /.dev
+# cleanup
+echo "cleaning up TMPDIR $TMPDIR"
+rm -rf $TMPDIR
Added: people/lazyboy/fai-distributions/etc/centos3.conf
===================================================================
--- people/lazyboy/fai-distributions/etc/centos3.conf 2006-01-21 12:18:45 UTC (rev 3257)
+++ people/lazyboy/fai-distributions/etc/centos3.conf 2006-01-21 22:09:08 UTC (rev 3258)
@@ -0,0 +1,2 @@
+MIRROR=http://mirror.centos.org/centos/3/os/i386/RedHat/RPMS/
+
Added: people/lazyboy/fai-distributions/etc/mandriva.conf
===================================================================
--- people/lazyboy/fai-distributions/etc/mandriva.conf 2006-01-21 12:18:45 UTC (rev 3257)
+++ people/lazyboy/fai-distributions/etc/mandriva.conf 2006-01-21 22:09:08 UTC (rev 3258)
@@ -0,0 +1,5 @@
+MANDRIVA_MIRROR=ftp://debmirror/mandriva_dvd_10.2/media/main/
+#BASE_EXTRA_PACKAGES="perl-Locale-gettext-1.01-14mdk.i586.rpm,wget-1.9.1-5mdk.i586.rpm,libgcc1-3.4.3-7mdk.i586.rpm,urpmi-4.6.24-3mdk.noarch.rpm"
+BASE_IMAGE_ARCHIVE="http://faiwiki.informatik.uni-koeln.de/download/fai-multi-distribution/base-images/"
+BASE_IMAGE="base-mandriva.tgz"
+
Modified: people/lazyboy/fai-distributions/etc/ubuntu_breezy.conf
===================================================================
--- people/lazyboy/fai-distributions/etc/ubuntu_breezy.conf 2006-01-21 12:18:45 UTC (rev 3257)
+++ people/lazyboy/fai-distributions/etc/ubuntu_breezy.conf 2006-01-21 22:09:08 UTC (rev 3258)
@@ -1,3 +1,4 @@
-MIRROR_LOCATION="http://$mirrorhost/ubuntu"
+#MIRROR_LOCATION="http://$mirrorhost/ubuntu"
+MIRROR_LOCATION="http://de.archive.ubuntu.com/ubuntu"
BOOTSTRAP_PACKAGE=debootstrap_0.3.1.6ubuntu1_all.deb
-BOOTSTRAP_ARCHIVE="http://debmirror/fai-distributions/bootstrap-archive"
+BOOTSTRAP_ARCHIVE="http://faiwiki.informatik.uni-koeln.de/download/fai-multi-distribution/bootstrap-archive"
Modified: people/lazyboy/fai-distributions/etc/ubuntu_hoary.conf
===================================================================
--- people/lazyboy/fai-distributions/etc/ubuntu_hoary.conf 2006-01-21 12:18:45 UTC (rev 3257)
+++ people/lazyboy/fai-distributions/etc/ubuntu_hoary.conf 2006-01-21 22:09:08 UTC (rev 3258)
@@ -1,3 +1,3 @@
MIRROR_LOCATION="http://de.archives.ubuntu/ubuntu"
BOOTSTRAP_PACKAGE=debootstrap_0.2.45ubuntu27_i386.deb
-BOOTSTRAP_ARCHIVE="http://debmirror/fai-distributions/bootstrap-archive"
+BOOTSTRAP_ARCHIVE="http://faiwiki.informatik.uni-koeln.de/download/fai-multi-distribution/bootstrap-archive/"
More information about the Fai-commit
mailing list