[Fai-commit] r5621 - in branches: . lhm lhm/bin lhm/conf lhm/debian lhm/doc lhm/doc/entities lhm/examples lhm/examples/etc lhm/examples/simple lhm/examples/simple/class lhm/examples/simple/debconf lhm/examples/simple/disk_config lhm/examples/simple/files lhm/examples/simple/files/boot lhm/examples/simple/files/boot/grub lhm/examples/simple/files/boot/grub/menu.lst lhm/examples/simple/files/etc lhm/examples/simple/files/etc/X11 lhm/examples/simple/files/etc/apache2 lhm/examples/simple/files/etc/apache2/conf.d lhm/examples/simple/files/etc/apt-proxy lhm/examples/simple/files/etc/apt-proxy/apt-proxy-v2.conf lhm/examples/simple/files/etc/default lhm/examples/simple/files/etc/default/tftpd-hpa lhm/examples/simple/files/etc/dhcp3 lhm/examples/simple/files/etc/dhcp3/dhcpd.conf lhm/examples/simple/files/etc/fai lhm/examples/simple/files/etc/fai/apt lhm/examples/simple/files/etc/fai/apt/sources.list lhm/examples/simple/files/etc/fai/fai.conf lhm/examples/simple/files/etc/fai/make-fai-nfsroot.conf lhm/examples/simple/files/etc/fai/menu.lst lhm/examples/simple/files/etc/kernel-img.conf lhm/examples/simple/files/etc/motd lhm/examples/simple/files/etc/rc2.d lhm/examples/simple/files/etc/rc2.d/S99fai-setup lhm/examples/simple/hooks lhm/examples/simple/package_config lhm/examples/simple/scripts lhm/examples/simple/scripts/AMD64 lhm/examples/simple/scripts/DEMO lhm/examples/simple/scripts/FAIBASE lhm/examples/simple/scripts/FAISERVER lhm/examples/simple/scripts/GRUB lhm/examples/simple/scripts/LAST lhm/examples/simple/scripts/LILO lhm/lib lhm/lib/setup-storage lhm/man lhm/pixmaps lhm/utils

Ignaz Forster ifo-guest at alioth.debian.org
Thu Oct 29 16:12:46 UTC 2009


Author: ifo-guest
Date: 2009-10-29 16:12:46 +0000 (Thu, 29 Oct 2009)
New Revision: 5621

Added:
   branches/lhm/
   branches/lhm/Makefile
   branches/lhm/README
   branches/lhm/README.build-sources
   branches/lhm/THANKS
   branches/lhm/VERSION
   branches/lhm/bin/
   branches/lhm/bin/ainsl
   branches/lhm/bin/device2grub
   branches/lhm/bin/dhclient-fai-script
   branches/lhm/bin/fai
   branches/lhm/bin/fai-cd
   branches/lhm/bin/fai-chboot
   branches/lhm/bin/fai-class
   branches/lhm/bin/fai-debconf
   branches/lhm/bin/fai-do-scripts
   branches/lhm/bin/fai-mirror
   branches/lhm/bin/fai-setup
   branches/lhm/bin/fai-start-stop-daemon
   branches/lhm/bin/fai-statoverride
   branches/lhm/bin/faimond
   branches/lhm/bin/faimond-gui
   branches/lhm/bin/faireboot
   branches/lhm/bin/fcopy
   branches/lhm/bin/ftar
   branches/lhm/bin/install_packages
   branches/lhm/bin/make-fai-nfsroot
   branches/lhm/bin/policy-rc.d.fai
   branches/lhm/bin/setup-storage
   branches/lhm/bin/setup_harddisks
   branches/lhm/conf/
   branches/lhm/conf/NFSROOT
   branches/lhm/conf/apt.conf
   branches/lhm/conf/dhclient-fai.conf
   branches/lhm/conf/fai.conf
   branches/lhm/conf/fai_modules_off
   branches/lhm/conf/make-fai-nfsroot.conf
   branches/lhm/conf/menu.lst
   branches/lhm/conf/sources.list
   branches/lhm/debian/
   branches/lhm/debian/NEWS
   branches/lhm/debian/changelog
   branches/lhm/debian/compat
   branches/lhm/debian/control
   branches/lhm/debian/copyright
   branches/lhm/debian/docs
   branches/lhm/debian/fai-client.dirs
   branches/lhm/debian/fai-client.install
   branches/lhm/debian/fai-client.manpages
   branches/lhm/debian/fai-client.postrm
   branches/lhm/debian/fai-doc.dirs
   branches/lhm/debian/fai-doc.doc-base.package
   branches/lhm/debian/fai-nfsroot.dirs
   branches/lhm/debian/fai-nfsroot.install
   branches/lhm/debian/fai-nfsroot.postinst
   branches/lhm/debian/fai-nfsroot.postrm
   branches/lhm/debian/fai-nfsroot.preinst
   branches/lhm/debian/fai-nfsroot.prerm
   branches/lhm/debian/fai-quickstart.dirs
   branches/lhm/debian/fai-quickstart.links
   branches/lhm/debian/fai-quickstart.lintian
   branches/lhm/debian/fai-quickstart.postinst
   branches/lhm/debian/fai-quickstart.prerm
   branches/lhm/debian/fai-server.dirs
   branches/lhm/debian/fai-server.install
   branches/lhm/debian/fai-server.links
   branches/lhm/debian/fai-server.manpages
   branches/lhm/debian/fai-server.postinst
   branches/lhm/debian/fai-server.postrm
   branches/lhm/debian/fai-server.preinst
   branches/lhm/debian/fai-server.prerm
   branches/lhm/debian/rules
   branches/lhm/doc/
   branches/lhm/doc/FAQ
   branches/lhm/doc/Makefile
   branches/lhm/doc/QUESTIONNAIRE
   branches/lhm/doc/changelog.old
   branches/lhm/doc/classes_description.txt
   branches/lhm/doc/common.ent
   branches/lhm/doc/entities/
   branches/lhm/doc/entities/bootexample.sgml
   branches/lhm/doc/entities/bootlog.sgml
   branches/lhm/doc/entities/faisetup.sgml
   branches/lhm/doc/fai-guide.sgml
   branches/lhm/doc/links.html
   branches/lhm/doc/pixmaps.svg
   branches/lhm/examples/
   branches/lhm/examples/etc/
   branches/lhm/examples/etc/bootptab
   branches/lhm/examples/etc/dhcpd.conf
   branches/lhm/examples/etc/hosts
   branches/lhm/examples/etc/netgroup
   branches/lhm/examples/etc/sources.list
   branches/lhm/examples/simple/
   branches/lhm/examples/simple/class/
   branches/lhm/examples/simple/class/10-base-classes
   branches/lhm/examples/simple/class/20-hwdetect.source
   branches/lhm/examples/simple/class/50-host-classes
   branches/lhm/examples/simple/class/FAIBASE.var
   branches/lhm/examples/simple/class/GERMAN.var
   branches/lhm/examples/simple/debconf/
   branches/lhm/examples/simple/debconf/FAIBASE
   branches/lhm/examples/simple/debconf/FAISERVER
   branches/lhm/examples/simple/debconf/GERMAN
   branches/lhm/examples/simple/disk_config/
   branches/lhm/examples/simple/disk_config/FAIBASE
   branches/lhm/examples/simple/disk_config/FAISERVER
   branches/lhm/examples/simple/files/
   branches/lhm/examples/simple/files/boot/
   branches/lhm/examples/simple/files/boot/grub/
   branches/lhm/examples/simple/files/boot/grub/menu.lst/
   branches/lhm/examples/simple/files/boot/grub/menu.lst/GRUB
   branches/lhm/examples/simple/files/boot/grub/menu.lst/postinst
   branches/lhm/examples/simple/files/etc/
   branches/lhm/examples/simple/files/etc/X11/
   branches/lhm/examples/simple/files/etc/X11/XF86Config-4/
   branches/lhm/examples/simple/files/etc/apache2/
   branches/lhm/examples/simple/files/etc/apache2/conf.d/
   branches/lhm/examples/simple/files/etc/apache2/conf.d/FAISERVER
   branches/lhm/examples/simple/files/etc/apt-proxy/
   branches/lhm/examples/simple/files/etc/apt-proxy/apt-proxy-v2.conf/
   branches/lhm/examples/simple/files/etc/apt-proxy/apt-proxy-v2.conf/FAISERVER
   branches/lhm/examples/simple/files/etc/default/
   branches/lhm/examples/simple/files/etc/default/tftpd-hpa/
   branches/lhm/examples/simple/files/etc/default/tftpd-hpa/FAISERVER
   branches/lhm/examples/simple/files/etc/dhcp3/
   branches/lhm/examples/simple/files/etc/dhcp3/dhcpd.conf/
   branches/lhm/examples/simple/files/etc/dhcp3/dhcpd.conf/FAISERVER
   branches/lhm/examples/simple/files/etc/fai/
   branches/lhm/examples/simple/files/etc/fai/apt/
   branches/lhm/examples/simple/files/etc/fai/apt/sources.list/
   branches/lhm/examples/simple/files/etc/fai/apt/sources.list/FAISERVER
   branches/lhm/examples/simple/files/etc/fai/fai.conf/
   branches/lhm/examples/simple/files/etc/fai/fai.conf/FAISERVER
   branches/lhm/examples/simple/files/etc/fai/make-fai-nfsroot.conf/
   branches/lhm/examples/simple/files/etc/fai/make-fai-nfsroot.conf/FAISERVER
   branches/lhm/examples/simple/files/etc/fai/menu.lst/
   branches/lhm/examples/simple/files/etc/fai/menu.lst/FAISERVER
   branches/lhm/examples/simple/files/etc/fai/sources.list/
   branches/lhm/examples/simple/files/etc/kernel-img.conf/
   branches/lhm/examples/simple/files/etc/kernel-img.conf/DEFAULT
   branches/lhm/examples/simple/files/etc/motd/
   branches/lhm/examples/simple/files/etc/motd/FAIBASE
   branches/lhm/examples/simple/files/etc/rc2.d/
   branches/lhm/examples/simple/files/etc/rc2.d/S99fai-setup/
   branches/lhm/examples/simple/files/etc/rc2.d/S99fai-setup/FAISERVER
   branches/lhm/examples/simple/hooks/
   branches/lhm/examples/simple/hooks/instsoft.FAIBASE
   branches/lhm/examples/simple/hooks/savelog.LAST.source
   branches/lhm/examples/simple/package_config/
   branches/lhm/examples/simple/package_config/DEFAULT
   branches/lhm/examples/simple/package_config/DEMO
   branches/lhm/examples/simple/package_config/FAIBASE
   branches/lhm/examples/simple/package_config/FAISERVER
   branches/lhm/examples/simple/package_config/GERMAN
   branches/lhm/examples/simple/package_config/GNOME
   branches/lhm/examples/simple/package_config/XORG
   branches/lhm/examples/simple/scripts/
   branches/lhm/examples/simple/scripts/AMD64/
   branches/lhm/examples/simple/scripts/AMD64/99-discover-bug
   branches/lhm/examples/simple/scripts/DEMO/
   branches/lhm/examples/simple/scripts/DEMO/10-misc
   branches/lhm/examples/simple/scripts/DEMO/30-demo
   branches/lhm/examples/simple/scripts/FAIBASE/
   branches/lhm/examples/simple/scripts/FAIBASE/10-misc
   branches/lhm/examples/simple/scripts/FAIBASE/20-removable_media
   branches/lhm/examples/simple/scripts/FAIBASE/30-interface
   branches/lhm/examples/simple/scripts/FAIBASE/40-misc
   branches/lhm/examples/simple/scripts/FAISERVER/
   branches/lhm/examples/simple/scripts/FAISERVER/10-conffiles
   branches/lhm/examples/simple/scripts/FAISERVER/20-copy-mirror
   branches/lhm/examples/simple/scripts/GRUB/
   branches/lhm/examples/simple/scripts/GRUB/10-setup
   branches/lhm/examples/simple/scripts/LAST/
   branches/lhm/examples/simple/scripts/LAST/50-misc
   branches/lhm/examples/simple/scripts/LILO/
   branches/lhm/examples/simple/scripts/LILO/20-create-liloconf
   branches/lhm/fai_lhm_branch.ls
   branches/lhm/lib/
   branches/lhm/lib/check_status
   branches/lhm/lib/create_resolv_conf
   branches/lhm/lib/dhclient-perl
   branches/lhm/lib/disk-info
   branches/lhm/lib/fai-abort
   branches/lhm/lib/fai-divert
   branches/lhm/lib/fai-mount-disk
   branches/lhm/lib/fai-savelog
   branches/lhm/lib/fai-savelog-ftp
   branches/lhm/lib/get-boot-info
   branches/lhm/lib/get-config-dir
   branches/lhm/lib/get-config-dir-cvs
   branches/lhm/lib/get-config-dir-file
   branches/lhm/lib/get-config-dir-git
   branches/lhm/lib/get-config-dir-nfs
   branches/lhm/lib/get-config-dir-svn
   branches/lhm/lib/list_disks
   branches/lhm/lib/load_keymap_consolechars
   branches/lhm/lib/mount2dir
   branches/lhm/lib/prcopyleft
   branches/lhm/lib/setup-storage/
   branches/lhm/lib/setup-storage/Commands.pm
   branches/lhm/lib/setup-storage/Exec.pm
   branches/lhm/lib/setup-storage/Fstab.pm
   branches/lhm/lib/setup-storage/Init.pm
   branches/lhm/lib/setup-storage/Parser.pm
   branches/lhm/lib/setup-storage/Sizes.pm
   branches/lhm/lib/setup-storage/Volumes.pm
   branches/lhm/lib/subroutines
   branches/lhm/lib/subroutines-linux
   branches/lhm/lib/task_sysinfo
   branches/lhm/lib/updatebase
   branches/lhm/man/
   branches/lhm/man/ainsl.1
   branches/lhm/man/fai-cd.8
   branches/lhm/man/fai-chboot.8
   branches/lhm/man/fai-class.1
   branches/lhm/man/fai-debconf.1
   branches/lhm/man/fai-do-scripts.1
   branches/lhm/man/fai-mirror.1
   branches/lhm/man/fai-setup.8
   branches/lhm/man/fai-start-stop-daemon.8
   branches/lhm/man/fai-statoverride.8
   branches/lhm/man/fai.8
   branches/lhm/man/faimond-gui.1
   branches/lhm/man/faimond.8
   branches/lhm/man/fcopy.8
   branches/lhm/man/ftar.8
   branches/lhm/man/install_packages.8
   branches/lhm/man/make-fai-nfsroot.8
   branches/lhm/man/setup-storage.8
   branches/lhm/pixmaps/
   branches/lhm/pixmaps/bar.gif
   branches/lhm/pixmaps/begin.gif
   branches/lhm/pixmaps/fail.gif
   branches/lhm/pixmaps/minor.gif
   branches/lhm/pixmaps/ok.gif
   branches/lhm/pixmaps/warning.gif
   branches/lhm/utils/
   branches/lhm/utils/all_hosts
   branches/lhm/utils/create-nfsroot-tar
   branches/lhm/utils/mkdebmirror
   branches/lhm/utils/prtnetgr
   branches/lhm/utils/rshall
Log:
Import of current LHM FAI branch based on FAI 3.2.16

Added: branches/lhm/Makefile
===================================================================
--- branches/lhm/Makefile	                        (rev 0)
+++ branches/lhm/Makefile	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,51 @@
+include VERSION
+
+SHELL=/bin/bash
+DESTDIR=$(shell pwd)/debian/tmp
+export DOCDIR = $(shell pwd)/debian/fai-doc/usr/share/doc/fai-doc
+LIBDIR = $(DESTDIR)/usr/lib/fai
+SHAREDIR = $(DESTDIR)/usr/share/fai
+USRSBIN_SCRIPTS = make-fai-nfsroot fai-setup fcopy ftar install_packages fai-chboot faimond fai-cd fai setup_harddisks faireboot fai-statoverride setup-storage
+
+USRBIN_SCRIPTS = fai-class fai-do-scripts fai-mirror fai-debconf device2grub policy-rc.d.fai ainsl faimond-gui
+
+# do not include .svn dir and setup-storage subdir
+libfiles=$(patsubst lib/setup-storage,,$(wildcard lib/[a-z]*))
+
+all:
+	$(MAKE) -C doc all
+
+clean:
+	find -name svn-commit\*.tmp -o -name svn-commit.tmp~ | xargs -r rm
+	$(MAKE) -C doc clean
+
+veryclean: clean
+	$(MAKE) -f debian/rules clean
+
+install: 
+	mkdir -p $(DESTDIR)/{sbin,man} $(DESTDIR)/etc/{modutils,dhcp3,apt/apt.conf.d}
+	mkdir -p $(DESTDIR)/usr/{sbin,bin} $(DESTDIR)/usr/lib/fai $(DESTDIR)/etc/fai/apt
+	mkdir -p $(DESTDIR)/etc/init.d $(DESTDIR)/usr/share/fai/{pixmaps,setup-storage}
+	install man/* $(DESTDIR)/man
+	$(MAKE) -C doc install
+	-install $(libfiles) $(LIBDIR)
+	install lib/setup-storage/* $(SHAREDIR)/setup-storage
+	cd bin ; install $(USRSBIN_SCRIPTS) $(DESTDIR)/usr/sbin
+	cd bin ; install $(USRBIN_SCRIPTS) $(DESTDIR)/usr/bin
+	ln -s faireboot $(DESTDIR)/usr/sbin/faishutdown
+	install bin/fai-start-stop-daemon $(DESTDIR)/sbin
+	install bin/dhclient-fai-script  $(DESTDIR)/etc/dhcp3
+	install -m644 conf/dhclient-fai.conf $(DESTDIR)/etc/dhcp3
+	install -m644 conf/apt.conf $(DESTDIR)/etc/apt/apt.conf.d/90fai
+	install -m644 conf/fai.conf conf/menu.lst $(DESTDIR)/etc/fai/
+	install -m644 conf/make-fai-nfsroot.conf $(DESTDIR)/etc/fai/
+	install -m644 conf/sources.list $(DESTDIR)/etc/fai/apt/
+	install -m644 conf/NFSROOT $(DESTDIR)/etc/fai
+	install -m644 conf/fai_modules_off $(DESTDIR)/etc/modutils
+	install -m755 lib/fai-abort $(DESTDIR)/etc/init.d
+	install -p -m644 pixmaps/*.gif $(DESTDIR)/usr/share/fai/pixmaps
+	perl -pi -e 's/FAIVERSIONSTRING/$(VERSIONSTRING)/' $(DESTDIR)/usr/sbin/fai
+	cp -a examples $(DOCDIR)
+	cp -a utils $(DOCDIR)/examples
+
+.PHONY: clean veryclean

Added: branches/lhm/README
===================================================================
--- branches/lhm/README	                        (rev 0)
+++ branches/lhm/README	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,53 @@
+This is FAI (Fully Automatic Installation) for Linux
+
+		   FAIVERSIONSTRING
+		
+FAI is a non interactive system to install a Debian GNU/Linux
+operating system on a PC cluster. You can take one or more virgin PCs,
+turn on the power, and after a few minutes, Linux is installed,
+configured, and running on the whole cluster, without any interaction
+necessary. Thus it's a scalable method for installing and updating a
+Beowulf cluster or a network of workstations unattended with little
+effort involved. FAI uses the Debian distribution and a collection of
+shell and Perl scripts for the installation process. Changes to the
+configuration files of the operating system are made by cfengine,
+shell and Perl scripts.
+
+The home page for FAI is
+
+	http://www.informatik.uni-koeln.de/fai/
+
+This release of FAI is tested with the Debian 4.0 release (called etch).
+
+FAI is free software, distributed under the terms of the GNU General
+Public License, version 2. For more information, see the file
+COPYING. There is no warranty, expressed or implied, associated with
+this product. Use at your own risk. Please read the file changelog for
+changes in new versions of FAI. Comments, bug reports, fixes,
+enhancements etc. are welcome. Send them to
+
+	fai at informatik.uni-koeln.de
+
+Please fill out the questionnaire if you finished a projekt using
+FAI. I'm looking for short success stories or reports, so new users
+can see how others are using FAI in several types of environment.
+There's also a mailing list for FAI available. To subscribe to the
+mailing list, send a mail to majordomo at uni-koeln.de and put the
+command 'subscribe linux-fai' in the body of the mail. Send
+contributions to the list to linux-fai at uni-koeln.de. Mails may be
+written in english or german. Please send short reports, if you
+installed a cluster or some host using fai.
+
+now enjoy FAI and your saved time
+
+Thomas
+----------------------------------------------------------------------
+            Thomas Lange	
+Institut fuer Informatik        mailto:lange at informatik.Uni-Koeln.DE
+   Universitaet zu Koeln
+            Pohligstr. 1        Telefon: +49 221 470 5303
+             50969 Koeln        Fax    : +49 221 470 5317
+
+1024D/AB9B66FD AEA6 A8C1 BD8E 67C4 8EF6  8BCA DC13 E54E AB9B 66FD
+----------------------------------------------------------------------
+Copyright (c) 1999-2009 Thomas Lange. All rights reserved.

Added: branches/lhm/README.build-sources
===================================================================
--- branches/lhm/README.build-sources	                        (rev 0)
+++ branches/lhm/README.build-sources	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,10 @@
+# check out the sources to the directory fai-sources
+svn co svn://svn.debian.org/svn/fai/trunk fai-sources
+
+# build the packages
+cd fai-sources
+dpkg-buildpackage -I.svn -rfakeroot -uc -us
+cd ..
+
+# Now you have some fai Debian packages
+ls fai*.deb

Added: branches/lhm/THANKS
===================================================================
--- branches/lhm/THANKS	                        (rev 0)
+++ branches/lhm/THANKS	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,60 @@
+These people helped to improve FAI by submitting code, manuals, bug
+reports, patches or good suggestions:
+
+Jason Aten		jaten at ucla.edu
+Sune Rastad Bahn	srb at dmi.dk
+Daniel Baumann		daniel at debian.org
+Diego Biurrun		diego at biurrun.de
+Phil Biondi		biondi at cartel-securite.fr
+Frédéric Boiteux	fboiteux at prosodie.com
+Tobias Burnus		tobias.burnus at physik.fu-berlin.de
+Bruce Edge		bedge at troikanetworks.com
+Jonas Eriksson		zqad at hpc2n.umu.se
+Era Eriksson		era at iki.fi
+Stephane Fritsch	stephane.fritsch at rte-france.com
+Mattias Gaertner	gaertner at informatik.uni-koeln.de
+Sébastien Gallet	sgallet at ibourgogne.net
+Thomas Gebhardt		gebhardt at hrz.uni-marburg.de
+Sergio Gelato		Sergio.Gelato at astro.su.se
+Niklaus Giger		ngiger at mus.ch
+Henning Glawe		glaweh at physik.fu-berlin.de
+James Golovich		james at wwnet.net
+Constantin Hellweg	hellweg at informatik.uni-koeln.de
+Sebastian Hetze		s.hetze at linux-ag.com
+Jürgen Kahnert		Juergen.Kahnert at desy.de
+Derrick Karpo		derrick_karpo at intuit.com
+Christian Kern		kernch at in.tum.de
+Ronan Keryell		Ronan.Keryell at enst-bretagne.fr
+Christoffer Kugg	kugghjul at gmail.com
+Felix Kühling		fxkuehl at gmx.de
+Holger Levsen		holger at layer-acht.org
+Paul Lussier		p.lussier at comcast.net
+Marc Martinez		lastxit+fai at technogeeks.org
+Eric Mumpower		nocturne at permabit.com
+Riccardo Murri		murri at dmmm.uniroma1.it
+Florian Möllers		floria.moellers at jpberlin.de
+Paul Nijjar		pnijjar at utm.utoronto.ca
+Ulrike Nitzsche		U.Nitzsche at ifw-dresden.de
+Raphaël Pinson		raphink at ubuntu.com
+Thomas Pöhnitzsch	thpo at foobar-cpa.de
+Michael Prokop		mika at grml.org
+Ake Sandgren		Ake.Sandgren at hpc2n.umu.se
+Michal Svamberg		svamberg at civ.zcu.cz
+Timo Schnibbe		Timo.Schnibbe at bertelsmann.de
+Andreas Schockenhoff	asc at gmx.li
+Ulrich Scholler		scholler at fnb.tu-darmstadt.de
+Andreas Schuldei	andreas at debian.org
+Martin Schulte		msfai at guug.de
+Andreas Sindermann	sinder at thp.Uni-Koeln.DE
+Henning Sprang		henning_sprang at gmx.net
+Geert Stappers		Geert.Stappers at xs4all.nl
+Michael Tautschnig	mt at debian.org
+Arto Teras		arto.teras at hip.fi
+Björn Torkelsson	torkel at pdc.kth.se
+Diane Trout		diane at caltech.edu
+Colin Tuckley		colintu at gmail.com
+Chad Walstrom		chad at debian.org
+Ingo Wichmann		iw at linuxhotel.de
+Richard Wonka		Richard.Wonka at googlemail.com
+Niall Young		niall at chime.net.au
+Alexander Zangerl	az at bond.edu.au

Added: branches/lhm/VERSION
===================================================================
--- branches/lhm/VERSION	                        (rev 0)
+++ branches/lhm/VERSION	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1 @@
+VERSIONSTRING="$(shell perl -e 'while (<>) { /^(\S+).*\((.*)\)/ and print uc($$1) . " $$2, "; if (/ --.*,\s+(.*)\s\d+:/) { print "$$1" ; exit } }' $(SRCDIR)debian/changelog)"

Added: branches/lhm/bin/ainsl
===================================================================
--- branches/lhm/bin/ainsl	                        (rev 0)
+++ branches/lhm/bin/ainsl	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,123 @@
+#! /usr/bin/perl
+
+# $Id$
+#*********************************************************************
+#
+# ainsl -- AppendIfNoSuchLine written in Perl
+#
+# This script is part of FAI (Fully Automatic Installation)
+# Copyright (C) 2006-2008 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.
+#
+# 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.
+#
+# A copy of the GNU General Public License is available as
+# '/usr/share/common-licences/GPL' in the Debian GNU/Linux distribution
+# or on the World Wide Web at http://www.gnu.org/copyleft/gpl.html.  You
+# can also obtain it by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#*********************************************************************
+
+my $version = "Version 1.2, 18-june-2008";
+
+use Getopt::Std;
+our ($opt_a,$opt_h,$opt_D,$opt_n,$opt_s,$opt_v,$opt_q,$opt_Q);
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+sub usage {
+
+  print << "EOF";
+ainsl, AppendIfNoSuchLine written in Perl. $version
+
+   Copyright (C) 2006-2008 by Thomas Lange
+
+Usage: ainsl [OPTION] FILE LINE [PATTERN]
+
+   -a         Autocreate file if not existing.
+   -D         Create debug output.
+   -h         Show summary of options.
+   -n         Print the actions, but do not execute them.
+   -Q         Quote all metacharacters in pattern. Uses perl\'s \\Q function.
+   -q         Quote * and + metacharacters in pattern.
+   -s         Convert blanks in line to '\\s+' regexp.
+   -v         Create verbose output.
+
+Report bugs to <lange\@informatik.uni-koeln.de>.
+EOF
+  exit 0;
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+sub autocreate {
+
+  -f $filename && return;
+  print "ainsl: create $filename\n" if $verbose;
+  $opt_n && return;
+  open (FILE,">$filename") || die "ainsl: can't create $filename $!";
+  close (FILE);
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+getopts('aDhsvnQq') || usage;
+
+$opt_h && usage;
+$verbose = $opt_v || $ENV{verbose} || 0;
+$debug   = $opt_D || $ENV{debug}   || 0;
+
+$filename = shift;
+$line     = shift;
+$optpattern  = shift;
+$found = 0;
+usage() unless defined $line;
+
+print "FILE: $filename\nLINE: $line\nPATTERN: $pattern\n" if $debug;
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+$opt_a && autocreate;
+
+$pattern = (defined $optpattern) ? $optpattern: $line;
+# process pattern and line
+# remove ^ and $ in line (only at start and end), but still use it for pattern
+# in no explicit pattern was given
+
+unless (defined $optpattern) {
+# remove special chars ^ and $ from line
+  $line =~ s/^\^//;
+  $line =~ s/\$$//;
+# escape '(' and ')' if no pattern was given and line is used
+  $pattern =~s/\(/\\(/g;
+  $pattern =~s/\)/\\)/g;
+  $pattern =~s/\+/\\+/g;
+}
+$opt_s && $pattern=~ s/\s+/\\s+/g;
+$opt_q && $pattern=~ s/\*/\\*/g;
+$opt_q && $pattern=~ s/\+/\+/g;
+$pattern="\Q$pattern\E" if $opt_Q;
+
+print "ainsl: newpattern: $pattern\n" if $debug;
+print "ainsl: newline: $line\n" if $debug;
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# check if pattern already included in file
+open (INFILE, "<$filename") or die "Can't open $filename $!";
+while (<INFILE>) {
+  if (/$pattern/o) {
+    print "aisnl: Pattern found. Nothing to append.\n" if $debug;
+    $found=1;
+    last;
+  }
+}
+close(INFILE);
+exit 0 if $found; # nothing to append
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Append line to file
+print "ainsl: appending to $filename: $line\n" if $verbose;
+exit 0 if $opt_n;
+open (INFILE, ">>$filename") or die "ainsl: can't open $filename for writing. $!";
+print INFILE $line,"\n";
+close(INFILE);


Property changes on: branches/lhm/bin/ainsl
___________________________________________________________________
Added: svn:executable
   + 

Added: branches/lhm/bin/device2grub
===================================================================
--- branches/lhm/bin/device2grub	                        (rev 0)
+++ branches/lhm/bin/device2grub	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,35 @@
+#! /usr/bin/perl
+# copyright Thomas Lange 2001-2007, lange at debian.org
+# map "normal" device notation to grub notation
+
+# TODO: read from stdin if no parameter given
+
+use strict;
+my $grubdevice;
+my %map;
+
+my $device=shift;
+my $devicemap="$ENV{target}/boot/grub/device.map";
+
+open (DEVICEMAP,"<$devicemap") || die "Can't open $devicemap\n";
+while (<DEVICEMAP>) {
+  my ($grubdevice,$olddevice) = split;
+  $map{$olddevice} = $grubdevice;
+}
+
+$device=~ m#^(/dev/(?:[sh]d\D|ida/c\d*d\d*|cciss/c\d*d\d*))p*(\d*)$# || die "Can't match device: $device\n";
+my ($disk,$partition) = ($1,$2);
+
+if ($map{$disk}) {
+  $grubdevice=$map{$disk};
+} else {
+  die "No match in $devicemap for $disk\n";
+}
+
+if ($partition) {
+  $partition--;
+  $grubdevice=~s/\)/,$partition\)/;
+}
+
+print "$grubdevice\n";
+exit 0;


Property changes on: branches/lhm/bin/device2grub
___________________________________________________________________
Added: svn:executable
   + 

Added: branches/lhm/bin/dhclient-fai-script
===================================================================
--- branches/lhm/bin/dhclient-fai-script	                        (rev 0)
+++ branches/lhm/bin/dhclient-fai-script	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+# execute perl script to obtain dhcp data
+
+perl /usr/lib/fai/dhclient-perl


Property changes on: branches/lhm/bin/dhclient-fai-script
___________________________________________________________________
Added: svn:executable
   + 

Added: branches/lhm/bin/fai
===================================================================
--- branches/lhm/bin/fai	                        (rev 0)
+++ branches/lhm/bin/fai	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,334 @@
+#!/bin/bash
+# $Id: fai 5240 2009-01-12 11:38:27Z lange $
+#*********************************************************************
+#
+# fai -- main installation script executed after booting
+#
+# This script is part of FAI (Fully Automatic Installation)
+# (c) 1999-2009 by Thomas Lange, lange at informatik.uni-koeln.de
+# Universitaet zu Koeln
+# (c) 2001-2005 by Henning Glawe, glaweh at physik.fu-berlin.de
+# Freie Universitaet Berlin
+#
+#*********************************************************************
+# 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.
+# 
+# A copy of the GNU General Public License is available as
+# `/usr/share/common-licences/GPL' in the Debian GNU/Linux distribution
+# or on the World Wide Web at http://www.gnu.org/copyleft/gpl.html. You
+# can also obtain it by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#*********************************************************************
+
+#set -xv # for full debugging
+
+export PATH=/usr/local/sbin:/usr/local/bin:/usr/lib/fai:/bin:/sbin:/usr/bin:/usr/sbin:
+# some variables
+export FAI_VERSION=FAIVERSIONSTRING
+stamp=/var/run/fai/FAI_INSTALLATION_IN_PROGRESS
+export romountopt="-o async,noatime,nolock,ro,actimeo=1800"
+export FAI_ABORT="reboot"
+
+export STOP_ON_ERROR=99999
+export faimond=0
+export renewclass=0
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+fai_init() {
+
+    set -a # now export all variables
+    set -o pipefail
+
+    umask 022
+    if [ ! -d "$FAI_ETC_DIR" ]; then
+	echo "$FAI_ETC_DIR is not a directory"
+	exit 6
+    fi
+    [ -f $FAI_ETC_DIR/fai.conf ] && . $FAI_ETC_DIR/fai.conf
+
+    if [ -f /etc/RUNNING_FROM_FAICD ]; then   # we are booting from fai cd
+	umount /initrd
+	romountopt=
+	FAI_DEBMIRROR="--bind /media/mirror"
+	MNTPOINT=/media/mirror
+	FAI_CONFIG_SRC="file://$FAI"   # on a fai-cd the config space is already available
+    fi
+
+    # some variables from are not needed any more
+    #unset FAI_CONFIGDIR
+
+    # read subroutine definitions
+    local sub=/usr/lib/fai/subroutines
+    [ -f $sub ] && . $sub
+    [ -f $sub-linux ] && . $sub-linux
+
+    [ -f "$stamp" ] && {
+       echo -n "$0 already running or was aborted before. PID: "
+       cat $stamp
+       echo "You may remove $stamp and try again."
+       exit 1
+    }
+
+    DEBIAN_FRONTEND=noninteractive
+    # local disks are mounted to $FAI_ROOT
+    if [ -z "$FAI_ROOT" ] ; then
+      [ $do_init_tasks -eq 1 ] && FAI_ROOT=/target || FAI_ROOT=/
+    fi
+    # executed command in the environment of the new system
+    ROOTCMD="chroot $FAI_ROOT"
+    # no chroot needed
+    [ "$FAI_ROOT" = '/' ] && ROOTCMD=
+    target=$FAI_ROOT
+
+    if [ $do_init_tasks -eq 1 ]; then
+        if [ "$FAI_ABORT" = "shutdown" ]; then
+            trap 'echo "Now shutting down";faishutdown' INT QUIT
+        else
+            trap 'echo "Now rebooting";faireboot' INT QUIT
+        fi
+    else
+        trap "echo 'Aborted';rm -f $stamp" INT QUIT
+    fi
+
+    if [ $do_init_tasks -eq 1 ]; then
+	eval_cmdline
+	mount -t sysfs sysfs /sys
+	# we really need to start udev
+	[ -x /etc/init.d/udev ] && /etc/init.d/udev start
+	mkdir -p /var/run/network
+	mkdir -p /dev/shm/network # when using initrd kernels
+	ifup lo
+	[ -x /sbin/portmap ] && /sbin/portmap
+	mount -t devpts devpts /dev/pts
+	cat /proc/kmsg >/dev/tty4 &
+    fi
+
+    # since HOSTNAME may change define classes now, so we can call hooks before fai-class is called
+    [ -z "$classes" ] && classes="DEFAULT $(uname -s | tr a-z A-Z) $HOSTNAME LAST"
+
+    prcopyleft
+
+    [ $do_init_tasks -eq 1 ] && save_dmesg
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+usage() {
+    cat <<-EOF
+	fai $FAI_VERSION. Copyright (C) 1999-2009 Thomas Lange
+	Usage: $0 [options] [action]
+       
+	Options:
+	   -v|--verbose      display more information during the update
+	   -h|--help         display this help message
+	   -N|--new          renew list of classes
+	   -c|--class        comma separated list of classes
+	   -C|--cfdir CFDIR  Use CFDIR for  reading the config files
+
+EOF
+    exit 0
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+fstart() {
+
+    # these tasks can define variables, that are needed later
+    [ -n "$etc_message" ] && echo ""
+    echo "$etc_message"
+    [ $do_init_tasks -eq 1 ] || echo "Using configuration files from $FAI_ETC_DIR"
+    unset etc_message
+    task confdir
+    task setup
+    task defclass
+    unset cmdlineclasses renewclass
+    [ $do_init_tasks -eq 1 ] && set_disk_info
+    task defvar
+    [ $do_init_tasks -eq 1 ] && load_keymap_consolechars
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Main routine
+
+# Parse commandline options
+TEMP=$(getopt -o u:Nhvc:C: --long hostname:,new,help,verbose,class:,cfdir: -n "$0" -- "$@")
+if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
+# Note the quotes around `$TEMP': they are essential!
+eval set -- "$TEMP"
+unset TEMP
+
+while true ; do
+    case "$1" in
+        -h|--help)
+	    shift
+	    usage
+            ;;
+	-v|--verbose)
+	    shift
+	    export verbose=1
+	    ;;
+	-N|--new)
+	    shift
+	    renewclass=1
+	    ;;
+	-C|--cfdir)
+	    shift
+	    cfdir=$1
+	    shift
+	    ;;
+	-c|--class)
+
+	    if [ $renewclass -eq 1 ]; then
+		echo "You can't use -c|--classes and -N|--new at the same time."
+		exit 9
+	    fi
+	    shift
+	    export cmdlineclasses=$1
+	    shift
+	    cmdlineclasses=${cmdlineclasses//,/ }
+	    ;;
+	-u|--hostname)
+	    shift
+	    export newhostname=$1
+	    shift
+	    ;;
+        --) 
+            shift
+            break
+            ;;
+         *)
+            echo "$0: command line parsing error ! $@"
+            exit 1
+            ;;
+    esac
+done
+
+# use FAI_ETC_DIR from environment variable
+if [ -n "$FAI_ETC_DIR" -a -z "$cfdir" ]; then
+    # print this message later so it gets into the log files
+    etc_message="Using environment variable \$FAI_ETC_DIR."
+fi
+[ -n "$cfdir" ] && FAI_ETC_DIR=$cfdir
+unset cfdir
+: ${FAI_ETC_DIR:=/etc/fai}
+FAI_ETC_DIR=$(readlink -f $FAI_ETC_DIR) # canonicalize path
+export FAI_ETC_DIR
+
+# override FAI_ACTION later if a command line argument is given
+[ "$1" ] && export action=$1
+[ "$2" ] && export FAI_ROOT=$2 # only used for dirinstall
+
+if [ X$action = Xdirinstall ]; then
+    if [ -z "$FAI_ROOT" ]; then
+	echo "Please specify a target directory. Aborted"
+	exit 3
+    fi
+    if [ $renewclass -eq 0 -a -z "$cmdlineclasses" ]; then
+	echo "Please use -c or -N. Aborted"
+	exit 4
+    fi
+
+    # two lines taken from task_dirinstall
+    mkdir -p $FAI_ROOT
+    FAI_ROOT=$(cd $FAI_ROOT;pwd)
+
+    # check if target directory is mounted with bad options
+    fs=$(df $FAI_ROOT | tail -1 | awk '{print $6}')
+    if mount | grep "on $fs " |  awk '{print $6}' | egrep -q "nosuid|nodev"; then
+	echo "Target directory is mounted using nosuid or nodev. Aborting"
+	exit 5
+    fi
+    unset fs
+
+    export NFSROOT=$(source $FAI_ETC_DIR/make-fai-nfsroot.conf; echo $NFSROOT)
+    export FAI_DEBOOTSTRAP=$(source $FAI_ETC_DIR/make-fai-nfsroot.conf; echo $FAI_DEBOOTSTRAP)
+    export FAI_DEBOOTSTRAP_OPTS=$(source $FAI_ETC_DIR/make-fai-nfsroot.conf; echo $FAI_DEBOOTSTRAP_OPTS)
+
+fi
+
+if [ $(id -u) != "0" ]; then
+    echo "Run this program as root."
+    exit 1
+fi
+
+# exit if we do not run from nfsroot and no parameter is given
+if [ ! -f /.THIS_IS_THE_FAI_NFSROOT -a "X$1" = "X" ]; then
+    echo "Please give more parameters if not run from the nfsroot."
+    exit 2
+fi
+
+# are we called as an init substitute ?
+export do_init_tasks=0
+[ "$0" = "/etc/init.d/rcS" ] && do_init_tasks=1
+if [ $do_init_tasks -eq 1 ]; then
+    hostname $HOSTNAME
+    renewclass=1 # always renew class list when installing
+    mkdir -p /var/lib/discover /var/discover /etc/sysconfig
+fi
+
+[ -f /proc/version ] || mount -n -t proc proc /proc # ubuntu initrd does not mount /proc
+export start_seconds=$(cut -d . -f 1 /proc/uptime)
+
+if [ X$action = Xdirinstall -a -n "$newhostname" ]; then
+    export HOSTNAME=$newhostname
+fi
+
+if [ $do_init_tasks -eq 1 ]; then
+    # we are running an initial installation
+    export LOGDIR=/tmp/fai
+    mkdir -p $LOGDIR
+else
+    export fai_rundate=$(date +'%Y%m%d_%H%M%S')
+    export LOGDIR=/var/log/fai/$HOSTNAME/$action-$fai_rundate
+    mkdir -p $LOGDIR
+    ln -snf $action-$fai_rundate $LOGDIR/../last-$action
+    ln -snf $action-$fai_rundate $LOGDIR/../last
+fi
+chown root $LOGDIR
+chgrp adm  $LOGDIR
+chmod 0750 $LOGDIR
+
+fai_init
+if [ X$action = Xdirinstall ]; then
+    [ -n "$newhostname" ] && echo "Hostname set to $HOSTNAME" | tee -a $LOGDIR/fai.log
+    unset newhostname
+    skiptask confdir
+    export FAI=$FAI_CONFIGDIR
+    set -a
+    clean_exit() {
+	rm -f $stamp
+	[ -z "$FAI_ROOT" ] && return
+	[ -d $FAI_ROOT/proc/self ] && umount $FAI_ROOT/proc $FAI_ROOT/sys
+	umount $FAI_ROOT/dev/pts 2>/dev/null || true
+	[ -f /etc/init.d/udev ] && umount $FAI_ROOT/dev
+    }
+    trap 'clean_exit' EXIT
+fi
+
+# remove this crap, use old thing
+mkfifo $LOGDIR/logfifo
+tee -a $LOGDIR/fai.log < $LOGDIR/logfifo &
+# in bash &> redirect stdout and stderr to file
+fstart &> $LOGDIR/logfifo
+rm $LOGDIR/logfifo
+sleep 1 # wait for tee to complete. One second should be ok
+# old code
+# {
+# # a bash group command with { does not work on sparc
+# task confdir
+# task setup
+# task defclass
+# task defvar
+# load_keymap_consolechars
+# set_disk_info
+# } > >( tee -a $LOGDIR/fai.log )  2>&1
+
+[ "$action" ] && export FAI_ACTION=$action
+unset action
+task action 2>&1 | tee -a $LOGDIR/fai.log
+
+[ -L "/var/run/fai/current_config" ] && rm -f "/var/run/fai/current_config"
+
+echo "End of $0"


Property changes on: branches/lhm/bin/fai
___________________________________________________________________
Added: svn:executable
   + 

Added: branches/lhm/bin/fai-cd
===================================================================
--- branches/lhm/bin/fai-cd	                        (rev 0)
+++ branches/lhm/bin/fai-cd	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,308 @@
+#!/bin/bash
+
+# $Id: fai-cd 5096 2008-09-05 17:59:26Z lange $
+#*********************************************************************
+#
+# fai-cd -- make a fai CD, a bootable CD that performs the FAI
+#
+# This script is part of FAI (Fully Automatic Installation)
+# (c) 2004-2008 by Thomas Lange, lange at informatik.uni-koeln.de
+# Universitaet zu Koeln
+#
+# based on a script called make-fai-bootcd by Niall Young <niall at holbytla.org>
+#
+#*********************************************************************
+# 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.
+#
+# A copy of the GNU General Public License is available as
+# `/usr/share/common-licences/GPL' in the Debian GNU/Linux distribution
+# or on the World Wide Web at http://www.gnu.org/copyleft/gpl.html.  You
+# can also obtain it by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#*********************************************************************
+
+set -e 
+version="fai-cd 3.3.6, 10-sep-2008"
+
+forceremoval=0;
+burn=0
+keep=0
+makeiso=1
+makeusb=0
+hidedirs="/usr/share/locale /usr/share/doc /var/lib/apt /var/cache/apt /usr/share/man /var/lib/dpkg/info /media/mirror/aptcache /media/mirror/.apt-move"
+
+# we need FAI_CONFIGDIR, NFSROOT
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+usage() {
+
+    cat <<-EOF
+	$version. Copyright (C) 2004-2008 Thomas Lange
+	Report bugs to <fai at informatik.uni-koeln.de>.
+
+	Usage: fai-cd [OPTIONS] -m MIRRORDIR ISONAME
+	Create a fai CD, a bootable CD that performs the FAI.
+	Read the man pages pages fai-cd(8).
+EOF
+exit 0
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - -
+die() {
+
+    local e=$1   # first parameter is the exit code
+    shift
+
+    echo "ERROR: $@"    # print error message
+    exit $e
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - -
+create_grub_image() {
+
+    mkdir -p $tmp/boot/grub $nfsrootdir/live/filesystem.dir
+
+    [ -d $NFSROOT/usr/lib/grub ] && cp -p $NFSROOT/usr/lib/grub/*-pc/stage2_eltorito $tmp/boot/grub/
+    [ -d $NFSROOT/usr/lib/grub ] && cp -p $NFSROOT/usr/lib/grub/*-pc/stage{1,2} $tmp/boot/grub/
+    cp $grub_config $tmp/boot/grub/menu.lst
+    # insert date into grub menu
+    perl -pi -e "s/_VERSIONSTRING_/   $isoversion     /" $tmp/boot/grub/menu.lst
+    cp -p $NFSROOT/boot/vmlinuz-$kernelversion $tmp/boot/vmlinuz
+    cp -p $NFSROOT/boot/initrd.img-$kernelversion $tmp/boot/initrd.img
+    cp -p $NFSROOT/boot/config-$kernelversion $tmp/boot/
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - -
+customize_nfsroot() {
+
+    # hide some dirs to save space and make the CD image smaller
+    local d
+
+    mkdir $tmp/empty
+    for d in $hidedirs; do
+	if [ -d $nfsrootdir/$d ]; then
+	    [ "$debug" ] && echo "hiding $d"
+	    mount --bind $tmp/empty $nfsrootdir/$d
+	fi
+    done
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - -
+unhide_dirs() {
+
+    set +e
+    for d in $hidedirs; do
+	if [ -d $nfsrootdir/$d ]; then
+	    [ "$debug" ] && echo "disclosing $d"
+	    umount $nfsrootdir/$d 2>/dev/null
+	fi
+    done
+    set -e
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - -
+umount_dirs() {
+
+    set +e
+    local d
+    local dirs="boot $FAI media/mirror etc/apt/sources.list"
+    for d in $dirs; do
+	umount $nfsrootdir/$d 2>/dev/null
+    done
+    rm -f $nfsrootdir/etc/RUNNING_FROM_FAICD
+    [ -d $nfsrootdir ] && umount $nfsrootdir
+    set -e
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - -
+sleep_now() {
+
+	sleep 6666 || true
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - -
+mkiso() {
+
+    if [ $makeiso -eq 1 ]; then
+	echo "Writing FAI CD-ROM image to $isoname. This may need some time."
+	mkisofs --iso-level 4 -V "$vname" -A "$aname" -log-file /dev/null -quiet -R -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -o $isoname $tmp || die 12 "mkisofs failed." 
+	echo -n "ISO image size and filename: "; du -h $isoname
+    fi
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - -
+mkusb(){
+
+    if [ $makeusb -eq 1 ]; then
+	# TODO: If usbdir is a device (matches /dev/) mount it
+	[ -d $usbdir ] || die 17 "$usbdir does not exist."
+	if [ $rsync -eq 1 ]; then
+	    echo "Syncing FAI data to USB device $usbdir"
+	    rsync --delete -av $tmp/live $tmp/boot $usbdir || true
+	else
+	    echo "Writing FAI data to USB device $usbdir"
+	    cp -a $tmp/live $tmp/boot $usbdir 2>/dev/null || true
+	fi
+	echo $isoversion > $usbdir/.FAI-CD-VERSION
+
+	# now make the USB device bootable
+	rootpartition=$(find_fai_data | grep -A 1 'find /.FAI-CD-VERSION' | grep -v 'find /.FAI-CD-VERSION')
+	usbdev=$(echo $rootpartition | sed -e 's/,[[:digit:]]//')
+	echo "Root partition is $rootpartition, device is: $usbdev"
+	if [ -n "$rootpartition" -a -n "$usbdev" ]; then
+	    echo "Installing grub."
+	    grub --batch >/dev/null << EOM
+root $rootpartition
+setup $usbdev
+EOM
+	else
+	    echo "Device could not be detemined. Installing grub will be skipped."
+	fi
+    fi
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - -
+create_iso() {
+
+    # Create the El Torito bootable iso9660 cdrom image
+    # or copy all FAI data to directory (for USB)
+
+    echo "Bind mounting all required parts"
+
+    mount --bind $NFSROOT $nfsrootdir && echo "NFSROOT $NFSROOT mounted"
+    mkdir -p $nfsrootdir/media/mirror || true
+
+    > $nfsrootdir/etc/RUNNING_FROM_FAICD
+    mount --bind $FAI_CONFIGDIR $nfsrootdir/$FAI && echo "Config space $FAI_CONFIGDIR mounted"
+    mount --bind $mirrordir $nfsrootdir/media/mirror && echo "Mirror $mirrordir mounted"
+# TODO: customize /etc/apt, copy apt preferences etc.
+
+    # this will be the sources.list for the CD
+    tmp1=$(mktemp) || exit 12
+    cat > $tmp1 <<EOF
+# mirror location for fai CD, file generated by fai-cd
+EOF
+
+    dists=$(find $mirrordir -name "Packages*" | grep binary | sed 's/binary-.*//' | \
+         sed "s#$mirrordir/*dists/##" | xargs -r -n 1 dirname | sort | uniq )
+    [ -z "$dists" ] && die 19 "No suitable Packages file found in mirror."
+
+    for i in $dists ; do
+	comp=$(find $mirrordir/dists/$i -maxdepth 2 -type d -name "binary-*" | \
+        sed -e "s#$mirrordir/*dists/$i/##" -e 's#/binary-.*##' | tr '\n' " ")
+	echo "deb file:/media/mirror $i $comp" >> $tmp1
+    done
+
+    mount --bind $tmp1 $nfsrootdir/etc/apt/sources.list
+    customize_nfsroot
+
+    if [ $keep -eq 1 ]; then
+	echo "fai-cd script stopped for 6666 seconds. The filesystem is now available in $tmp."
+	echo "To continue the script and call the cleanup call: pkill -f 'sleep 6666'"
+	sleep_now 2>/dev/null || true
+	echo "Continue cleanup."
+    fi
+
+    mkiso
+    mkusb
+    rm $tmp1
+    unhide_dirs
+    umount_dirs
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - -
+find_fai_data() {
+
+  grub --batch <<EOM
+find /.FAI-CD-VERSION
+EOM
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - -
+burniso() {
+
+    cdrecord -v -eject $isoname
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - -
+# main program
+
+rsync=0
+[ -x $(which rsync) ] && rsync=1
+
+# Parse commandline options
+while getopts "nkfhg:bm:C:u:" opt ; do
+    case "$opt" in
+        C)  cdir=$OPTARG ;;
+	f)  forceremoval=1 ;;
+	h)  usage ;;
+	g)  grub_config="$OPTARG" ;;
+	k)  keep=1 ;;
+	m)  mirrordir="$OPTARG" ;;
+	n)  makeiso=0 ;;
+	b)  burn=1 ;;
+	u)  usbdir="$OPTARG"
+	    makeusb=1
+	    makeiso=0
+	    [ $rsync -eq 0 -a -e $usbdir/live ] && die 11 "Please remove $usbdir/live. Aborting."
+	    ;;
+	?)  usage ;;
+    esac
+done
+shift $(($OPTIND - 1))
+isoname=$1
+
+[ $makeiso -eq 1 -a "$#" -eq 0 ]        && die 2 "Please specify the output file for the ISO image."
+[ -z "$mirrordir" ]   && die 4 "Please specify the directory of your mirror using -m"
+[ -d "$mirrordir" ]   || die 5 "$mirrordir is not a directory"
+[ -z "$(ls $mirrordir)" ] && die 18 "No mirror found in $mirrordir. Empty directory."
+[ -f "$isoname" ]     && [ $forceremoval -eq 1 ] && rm $isoname
+[ -f "$isoname" ]     && die 3 "Outputfile $isoname already exists. Please remove it or use -f."
+[ $(id -u) != "0" ]   && die 9 "Run this program as root."
+
+if [ $makeiso -eq 1 ]; then
+    [ -x "$(which mkisofs)" ] || die 8 "mkisofs not found. Please install package."
+fi
+
+# use FAI_ETC_DIR from environment variable
+if [ -n "$FAI_ETC_DIR" -a -z "$cdir" ]; then
+    echo "Using environment variable \$FAI_ETC_DIR."
+    cfdir=$FAI_ETC_DIR
+fi
+[ -n "$cdir" ] && cfdir=$cdir
+: ${cfdir:=/etc/fai}
+cfdir=$(readlink -f $cfdir) # canonicalize path
+if [ ! -d "$cfdir" ]; then
+    echo "$cfdir is not a directory"
+    exit 6
+fi
+[ "$verbose" ] && echo "Using configuration files from $cfdir"
+. $cfdir/fai.conf
+export NFSROOT=$(source $cfdir/make-fai-nfsroot.conf; echo $NFSROOT)
+NFSROOT="$NFSROOT/live/filesystem.dir"
+
+[ -d "$NFSROOT/etc/fai" ] || die 10 "Please create NFSROOT by calling make-fai-nfsroot or fai-setup."
+
+# if -g is a file name, add prefix
+
+[ -z "$grub_config" ] && grub_config="$cfdir/menu.lst" # set default if undefined
+# if grub_config contains / do not change it, else add prefix $cfdir
+echo $grub_config | grep -q '/' || grub_config="$cfdir/$grub_config"
+[ -f "$grub_config" ] || die 13 "Grub menu file $grub_config not found."
+
+[ -z "$FAI_CONFIGDIR" ]  && die 14 "Variable \$FAI_CONFIG not set."
+[ -d $FAI_CONFIGDIR ] || die 15 "Can't find config space $FAI_CONFIGDIR."
+[ -d $FAI_CONFIGDIR/class ] || die 16 "Config space $FAI_CONFIGDIR seems to be empty."
+
+tmp=$(mktemp -t -d fai-cd.XXXXXX) || exit 13
+nfsrootdir=$tmp/live/filesystem.dir
+kernelversion=$(ls -tr $NFSROOT/boot/vmlinu?-* | tail -1 | sed -e 's#.*/vmlinuz-##')
+
+faiversion=$(dpkg --root=$NFSROOT -l fai-client|grep fai-client|awk '{print $3}')
+isoversion="FAI $faiversion -- build $(date '+%c')"
+vname="Fully Automatic Installation CD"
+aname="Fully Automatic Installation by Thomas Lange, $isoversion"
+
+create_grub_image
+
+trap "unhide_dirs;umount_dirs" EXIT ERR
+create_iso
+rm -rf $tmp
+[ "$burn" -eq 1 ] && burniso
+exit 0


Property changes on: branches/lhm/bin/fai-cd
___________________________________________________________________
Added: svn:executable
   + 

Added: branches/lhm/bin/fai-chboot
===================================================================
--- branches/lhm/bin/fai-chboot	                        (rev 0)
+++ branches/lhm/bin/fai-chboot	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,457 @@
+#! /usr/bin/perl
+
+# $Id: fai-chboot 4837 2008-01-16 11:26:40Z lange $
+#*********************************************************************
+#
+# fai-chboot -- manage configuration for network boot
+#
+# This script is part of FAI (Fully Automatic Installation)
+# Copyright (C) 2003-2008 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.
+#
+# 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.
+#
+# A copy of the GNU General Public License is available as
+# '/usr/share/common-licences/GPL' in the Debian GNU/Linux distribution
+# or on the World Wide Web at http://www.gnu.org/copyleft/gpl.html.  You
+# can also obtain it by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#*********************************************************************
+
+# variable needed: $nfsroot
+$version="version 3.4.4 16-january-2008";
+
+use Socket;
+use Net::hostent;
+use Getopt::Std;
+use File::Copy;
+
+our ($opt_D, $opt_p,$opt_h,$opt_t,$opt_s,,$opt_C);
+$Getopt::Std::STANDARD_HELP_VERSION=1;
+
+$0=~ s#.+/##; # remove path from program name
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+sub ip2hex {
+
+  my $ipadr = shift;
+  my $hex = sprintf("%02X%02X%02X%02X", split(/\./,$ipadr));
+  return ($ipadr,$hex);
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+sub host2hex {
+
+  my $host = shift;
+
+  if ($host =~ /^\d+\.\d+\.\d+\.\d+$/) {
+    # hostname is already an IP address
+    return ip2hex($host);
+  }
+  return ('no IP','default') if ($host =~ /^default/);
+
+  my $h = gethost($host);
+  die "$0: unknown host: $host\n" unless $h;
+
+  if ( @{$h->addr_list} > 1 ) {
+    my $i;
+    for my $addr ( @{$h->addr_list} ) {
+      $ipadr = inet_ntoa($addr);
+      printf "$host \taddr #%d is [%s]\n", $i++, $ipadr if $debug;
+    }
+  } else {
+    $ipadr = inet_ntoa($h->addr);
+    printf "$host \taddress is [%s]\n", $ipadr if $debug;
+  }
+  ip2hex($ipadr);
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+sub readpxedir {
+
+  # read all files in pxedir and add them to different arrays
+
+  opendir(DIR, $pxedir) || die "Can't opendir $pxedir: $!";
+  foreach (readdir(DIR)) {
+    next if /^\./;
+    if (/^(default|[0-9A-F]+)$/) { push @enabled,   $_ ; next}
+    if (/\.tmpl$/)               { push @templates, $_ ; next}
+    if (/\.disable$/) {
+      my $filename=(split (/\./,$_))[0];
+      if (-f "$pxedir/$filename") {
+	warn "Skipping $_ as disabled host because also enabled.\n" if $verbose;
+      } else {
+	push @disabled, $_;
+      }
+      next;
+    }
+    push @other, $_;
+  }
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+sub lsdir {
+
+# -ld list only disabled hosts
+# -le list only enabled hosts
+# -lt list only templates
+# -lo list only "other", i.e that does not match templates or hosts
+# -lg list by goups (enabled, disabled, templates, others)
+# -l[detog] <pattern> list matching pattern
+
+  my ($n,$host,$iaddr,$hex,$type);
+
+  @patterns = @_; # a global variable
+
+  readpxedir();
+
+  # create list which entries we want to list
+  @allfiles = (@enabled, at disabled, at templates, at other);
+  $opt_d and @allfiles = @disabled;
+  $opt_e and @allfiles = @enabled;
+  $opt_t and @allfiles = @templates;
+  $opt_o and @allfiles = @other;
+  $opt_g and @allfiles = (@enabled, at disabled, at templates, at other);
+
+  # map all entries (in HEX) to hostname or IP
+  foreach $hex (@allfiles) {
+    undef $host;
+    undef $type;
+
+    if ($hex =~ /^default(.disable)?$/) {
+      $host = $hex;
+      $type = '[DEFAULT]';
+    }
+    if ($hex =~ /\.tmpl$/) {
+      $host = "$hex";
+      $type = '[Template]';
+    }
+
+    if ($hex =~ /[0-9A-F]+/) {
+      my $hexstrip = (split /\./,$hex)[0]; # remove .disable if necessary
+      $n = $hexstrip;
+      # hex to ip/subnet address
+      while ( length $n ) {
+	$host = sprintf( "%s%d" ,$host?"$host.":$host,
+                 (hex substr $n,0,1,"" ) * 16 + (hex substr $n,0,1,""));
+      }
+      if ( $host and ( length($hexstrip) < 8) ) {
+	$host = "Subnet: $host/". length($hexstrip)*4
+      } else {
+        # ip to hostname
+        $iaddr = inet_aton($host);
+        if ($h = gethostbyaddr($iaddr, AF_INET)) {
+	  $host = $h->name;
+          $host =~ s/^([^.]+).*/$1/; # strip domain from FQDN so we have short hostnames
+        }
+      }
+    }
+
+    if ( !$host ) {
+      $host = $hex;
+      $type = '[Other]';
+    }
+
+    $hexname{$host} = $hex;
+    $hname{$hex}= $host;
+    $type{$hex} = $type if $type;
+  }
+
+  if ($opt_g) { # print in group, sorted inside each group
+    prtsorted(@enabled);
+    prtsorted(@disabled);
+    prtsorted(@templates);
+    prtsorted(@other);
+    exit 0;
+  }
+
+  prtsorted(keys %hname);
+  exit 0;
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+sub prtsorted {
+
+  my @list = @_;
+
+  @list = sort map {$hname{$_}} @list;
+  foreach (@list) {
+    printpxe ($_,$hexname{$_}, $type{$_});
+  }
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+sub printpxe {
+
+  my ($host,$hex, $type) = @_;
+  my ($kernelname,$append);
+
+  $match = (@patterns) ? 0: 1; # set match to 1 if no pattern is given
+  foreach (@patterns) {
+    $match = 1 if $host =~ /$_/;
+  }
+  return unless $match; # do not print entries if no pattern matches
+
+  # read pxe config file for a host
+  undef $kernelname;
+  open (CFG,"$pxedir/$hex") || die "$! $@\n";
+  while (<CFG>) {
+    /\bkernel\s+(\S+)/ and $kernelname = $1;
+    /\b(localboot.+)/ and $kernelname = $1;
+    /\bappend\s+(.+)/ and $append = $1;
+  }
+  close (CFG);
+
+  if ($opt_l && ! $opt_L) {
+    $append =~ /FAI_ACTION=(\S+)/;
+    $append = $1;
+#   printf "%-16.16s $append $kernelname %-8s\n",$host,$hex;
+    printf "%-26.26s  %-20.20s $append $kernelname\n",$type?$type:$host,$hex;
+  } else {
+    printf "%s %s $kernelname $append\n",$type?$type:$host,$hex;
+  }
+
+  undef $append;
+  undef $kernelname;
+}
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+sub usage {
+
+  &VERSION_MESSAGE;
+  &HELP_MESSAGE;
+  exit 0;
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+sub VERSION_MESSAGE {
+
+  print "$0 $version\n";
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+sub HELP_MESSAGE {
+
+  print << "EOM";
+ Please read the manual pages fai-chboot(8).
+EOM
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+sub mkpxecfg {
+
+  my ($host,$kernel,$rootfs,$initrd) = @_;
+  my ($ipadr,$hex) = host2hex($host);
+
+  warn "$host has $ipadr in hex $hex\n" if $verbose;
+  if (-f "$pxedir/$hex.disable") {
+    unlink "$pxedir/$hex.disable";
+    print "removed old $pxedir/$hex.disable\n";
+  }
+  warn "Writing file $pxedir/$hex for $host\n" if $verbose;
+  return if $opt_n;
+
+  if ($opt_p && -e "$pxedir/$hex") {
+    warn "WARNING: $pxedir/$hex already exists.\nSkipping file creation. ";
+    return;
+  }
+  open (FILE,"> $pxedir/$hex") or warn "$0 $@ $!";
+  print FILE << "EOM";
+# generated by fai-chboot for host $host with IP $ipadr
+default fai-generated
+
+label fai-generated
+$kernel
+EOM
+
+  $append="append $initrd $bootprot $rootfs $opt_k $flags $action\n";
+  print FILE $append if $rootfs;
+  close FILE;
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+sub disable {
+
+  # rename network config file
+  my ($host) = shift;
+  my ($ipadr,$hex) = host2hex($host);
+  if (! -e "$pxedir/$hex") {
+    print "$host ($hex) is not enabled\n";
+    return;
+  }
+  print "disable pxe config for $host in hex $hex\n" if $verbose;
+  return if $opt_n;
+  rename "$pxedir/$hex","$pxedir/$hex.disable" or $error .= "\nRename for $hex failed. $! $@";
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+sub enable {
+
+  # rename network config file
+  my ($host) = shift;
+  my ($ipadr,$hex) = host2hex($host);
+
+  -e "$pxedir/$hex" and print "$host ($hex) is already enabled\n" and return;
+  if (! -e "$pxedir/$hex.disable") {
+    print "$host ($hex) is not disabled\n";
+    return;
+  }
+
+  print "reenable pxe config for $host in hex $hex\n" if $verbose;
+  return if $opt_n;
+  rename "$pxedir/$hex.disable","$pxedir/$hex" or $error .= "\nRename for $hex failed. $! $@";
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+sub docopy {
+
+  my ($srcfile, $pxedir, $desthex, $desthost, $ipadr) = @_;
+  open (SOURCE, "$srcfile");
+  open (DEST, ">$pxedir/$desthex") || die "Can't opendir $pxedir: $!";
+  print DEST "# template generated by fai-chboot for host $desthost with IP $ipadr from source $srcfile\n";
+  while (<SOURCE>) {
+    print DEST $_;
+  }
+  close SOURCE;
+  close DEST;
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+sub tcopy {
+
+  my ($srchost,$desthost) = @_;
+  my ($ipadr,$srcfile,$srchex,$desthex);
+
+  if (gethost($srchost)) {
+    ($ipadr,$srchex) = host2hex($srchost);
+
+    if (-e "$pxedir/$srchex") {
+      $srcfile = "$pxedir/$srchex";
+    } elsif (-e "$pxedir/$srchex.disable") {
+      $srcfile = "$pxedir/$srchex.disable";
+    } elsif (-e "$pxedir/$srchost" ) {
+      $srcfile = "$pxedir/$srchost";
+    } elsif (-e "$pxedir/$srchost.tmpl" ) {
+      $srcfile = "$pxedir/$srchost.tmpl";
+    } else {
+      warn "Source file for $srchost ($srchex) not available\n";
+      return;
+    }
+  } elsif ( -e "$pxedir/$srchost") {
+      $srcfile = "$pxedir/$srchost";
+  } elsif ( -e "$pxedir/$srchost.tmpl") {
+      $srcfile = "$pxedir/$srchost.tmpl";
+  } else {
+      warn "Source file for $srchost not available\n";
+      return;
+  }
+  if ($desthost =~ /\.tmpl$/) {
+    if (-e "$pxedir/$desthost") {
+      warn "Template $desthost already exist. Copying aborted.\n";
+      return;
+    }
+    print "copy pxe config from $srchost to template $desthost\n" if $verbose;
+    docopy($srcfile,$pxedir,$desthost,$desthost,$ipadr);
+  } else {
+    ($ipadr,$desthex) = host2hex($desthost);
+    if (-f "$pxedir/$desthex.disable") {
+      unlink "$pxedir/$desthex.disable";
+      print "removed old $pxedir/$desthex.disable\n";
+    }
+    print "copy pxe config from $srchost to $desthost ($desthex)\n" if $verbose;
+    docopy($srcfile,$pxedir,$desthex,$desthost,$ipadr);
+  }
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+getopts('gBc:C:D:edhnvlLiIpf:Fk:Ss:to') || usage;
+$opt_h and usage;
+defined @ARGV or usage;
+
+$opt_n and $opt_v = 1;
+$opt_v and $verbose = 1;
+$cfdir = $opt_C || $ENV{'FAI_ETC_DIR'} || '/etc/fai';
+$opt_L and $opt_l = 1;
+($opt_B and $opt_F) && die "ERROR: use only one option out of -B and -F\n";
+($opt_S and $opt_I) && die "ERROR: use only one option out of -I and -S\n";
+#TODO: also -e, -r and -c can't be used together
+
+# read the nfsroot variable; a little bit ugly, but it works
+$nfsroot = `. $cfdir/make-fai-nfsroot.conf 2>/dev/null; echo \$NFSROOT`;
+chomp $nfsroot;
+$nfsroot = '/srv/fai/nfsroot' unless $nfsroot;
+
+$tftproot = `. $cfdir/make-fai-nfsroot.conf 2>/dev/null; echo \$TFTPROOT`;
+chomp $tftproot;
+$tftproot = '/srv/tftp/fai' unless $tftproot;
+
+$pxedir = $opt_D || "$tftproot/pxelinux.cfg";
+
+(-d $pxedir) || die "PXE directory $pxedir does not exist.";
+
+$opt_l and lsdir(@ARGV);
+
+if ($opt_d) {
+  die "Missing host name(s). Can't disable network booting.\n" unless @ARGV;
+  foreach (@ARGV) {
+    disable($_);
+  }
+  $error and die "$0: $error\n";
+  exit 0;
+}
+
+if ($opt_c) {
+  die "Missing destination host name(s). Can't copy.\n" unless @ARGV;
+  # copy a template config to multiple hosts
+  foreach (@ARGV) {
+    tcopy($opt_c,$_);
+  }
+  $error and die "$0: $error\n";
+  exit 0;
+}
+
+if ($opt_e) {
+  die "Missing host name(s). Can't reenable network booting.\n" unless @ARGV;
+  foreach (@ARGV) {
+    enable($_);
+  }
+  $error and die "$0: $error\n";
+  exit 0;
+}
+
+if ($opt_S) {
+  $opt_i = 1;
+  $action="FAI_ACTION=sysinfo";
+}
+if ($opt_I) {
+  $opt_i = 1;
+  $action="FAI_ACTION=install";
+}
+
+$kernelsuffix = (glob "$tftproot/vmlinuz*$opt_s")[-1];
+$kernelsuffix=~ s/.+vmlinuz-//;
+die "No kernel found matching $tftproot/vmlinuz*$opt_s\n" unless $kernelsuffix;
+
+if ($opt_i) {
+  # create config so host will boot the install kernel
+  $kernelname = "kernel vmlinuz-$kernelsuffix";
+  $initrd     = "initrd=initrd.img-$kernelsuffix";
+#  $rootfs     = "root=/dev/nfs nfsroot=$nfsroot,v3,tcp,rsize=32768,wsize=32768 boot=live";
+  $rootfs     = "root=/dev/nfs nfsroot=$nfsroot boot=live";
+  $bootprot   = "ip=dhcp ";
+
+} elsif ($opt_o) {
+  $kernelname = 'localboot 0';
+  $rootfs   = '';
+  $bootprot = '';
+  $flags    = '';
+} else {
+  $kernelname = shift;
+  $kernelname = "kernel $kernelname";
+#  $rootfs = shift or die "No rootfs specified.\n";
+}
+
+$opt_F and $opt_f="verbose,sshd,createvt";
+$opt_B and $opt_f="verbose,sshd,reboot";
+$opt_f and $flags="FAI_FLAGS=$opt_f";
+warn "Booting $kernelname\n" if $verbose;
+warn " append $initrd $bootprot $opt_k $flags\n\n" if $verbose;
+$opt_k && print "Kernel parameters: $opt_k\n";
+
+die "No host specified.\n" unless @ARGV;
+foreach (@ARGV) { mkpxecfg($_,$kernelname,$rootfs,$initrd); }


Property changes on: branches/lhm/bin/fai-chboot
___________________________________________________________________
Added: svn:executable
   + 

Added: branches/lhm/bin/fai-class
===================================================================
--- branches/lhm/bin/fai-class	                        (rev 0)
+++ branches/lhm/bin/fai-class	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,206 @@
+#! /bin/bash
+
+# $Id: fai-class 4677 2007-11-10 13:55:48Z lange $
+#*********************************************************************
+#
+# fai-class - determine all classes a host belongs to
+#
+# This script is part of FAI (Fully Automatic Installation)
+# (c) 2002-2007 by 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.
+#
+# 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.
+# 
+# A copy of the GNU General Public License is available as
+# `/usr/share/common-licences/GPL' in the Debian GNU/Linux distribution
+# or on the World Wide Web at http://www.gnu.org/copyleft/gpl.html. You
+# can also obtain it by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#*********************************************************************
+
+version="version 1.5.6, 4-jul-2007"
+
+# import variables: $LOGDIR $verbose $debug
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+verbosemsg() {
+
+    # a very nice subroutine
+    # write message if the verbose flag is set
+    [ "$verbose" ] && echo "$@"
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+debugmsg() {
+
+    # a very nice subroutine
+    # write message if the debug flag is set
+    [ "$debug" ] && echo "$0: $@"
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+addclass() {
+
+    # append classes to a file
+    while read line ; do
+	case $line in
+	\#*) ;; # strip comments
+	  *) debugmsg "Adding class $line"
+	     for class in $line ; do
+		 echo $class >> $filename
+	     done
+	esac
+    done
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+fc_check_status() {
+
+    cmd=$1
+    st=$2
+
+    if [ $st -eq 0 ]; then
+	res="OK."
+    else
+	res="FAILED with exit code $st."
+    fi
+    # put result in the log file and write to stdout
+    printf "%-20s $res\n" $cmd | tee -a $LOGDIR/status.log
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+usage() {
+
+    ex=$1
+    cat <<-EOF
+	fai-class $version. Copyright (C) 2002-2005 Thomas Lange
+	Report bugs to <fai at informatik.uni-koeln.de>.
+
+	Usage: fai-class [OPTION] DIRECTORY CLASSFILE
+	Define classes using files and scripts in DIRECTORY
+
+	Executes scripts in DIRECTORY starting with two digits.
+	The standard output of these scripts are names of classes which
+	are written to CLASSFILE.
+EOF
+    exit $ex
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+testclass() {
+
+    # test if some classes are define multiple times
+    duplicate=$(sort $filename | uniq -dc)
+    if [ -n "$duplicate" ]; then
+	echo "$0: WARNING. Following classes are defined multiple times: $duplicate"
+	exit 2
+    fi
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+setup() {
+
+    # parse options, test and set some basic variables
+
+    while getopts "dhvt:T" opt ; do
+        case "$opt" in
+        d) debug=1 ;;
+        v) verbose=1 ;;
+        h) usage 0 ;;
+        T) ctest=1 ;;
+        t) LOGDIR=$OPTARG; export LOGDIR ;;
+        *) usage 1 ;;
+	esac
+    done
+    shift $(($OPTIND - 1))
+    [ -z "$2" ] || [ -n "$3" ] && usage 1
+
+    classdir=$1
+    filename=$2
+    cd $classdir || {
+	echo "$0: Can't change dir to $classdir."
+	exit 99
+    }
+    if [ -s $filename ]; then
+	verbosemsg "$filename exists. Renaming to $filename.bak"
+	mv $filename $filename.bak
+    fi
+    if [ -z "$LOGDIR" ]; then
+	verbosemsg "Setting LOGDIR to default value /tmp/fai"
+	LOGDIR=/tmp/fai; export LOGDIR
+    fi
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# main program
+
+PATH=.:$PATH    # so scripts in /fai/class are found
+export PATH
+
+setup "$@"
+verbosemsg "$0: Defining classes."
+
+echo DEFAULT | addclass
+
+# define classes by executing scripts
+# alphabetical sort is important
+if [ "$debug" ]; then
+    scripts=$(echo [0-9][0-9]*)
+else
+    scripts=$(echo [0-9][0-9]* 2>/dev/null)
+fi
+debugmsg "Scripts found: $scripts"
+
+for f in $scripts ; do
+    [ -f $f ] || continue # skip sockets, pipes, symlinks
+    debugmsg "File $f found."
+    if [ ! -x $f ]; then
+	echo "File $f is not executable, so it's not used for defining classes."
+	continue
+    fi
+    classes=$(cat $filename)
+    export classes
+    case $f in
+	*~|*.bak) debugmsg "Skipping backup file $f" ;;
+	*.source)
+	    verbosemsg "Executing $classdir/$f."
+	    # this script can define $newclasses
+	    newclasses=
+	    . $f
+	    fc_check_status $f $?
+	    echo $newclasses | addclass ;; 
+	*)
+	    verbosemsg "Executing $classdir/$f."
+	    classes=$($f </dev/null)
+	    fc_check_status $f $?
+	    echo $classes | addclass
+	    ;;
+    esac
+done
+
+# $LOGDIR should not be writable by everybody
+# scripts can also write additional classes to a file, if they
+# can't print them to stdout. Define these classes.
+
+if [ -f $LOGDIR/additional-classes ]; then
+    cat $LOGDIR/additional-classes | addclass
+    rm -f $LOGDIR/additional-classes
+    # remove the file after it was used. Do not use the same file more than once.
+fi
+
+# add all classes which are listed in a file with the hostname
+LOWER_HOSTNAME="$(echo $HOSTNAME | tr [A-Z] [a-z])"
+if [ -f "$LOWER_HOSTNAME" ]; then
+	verbosemsg "Using classes from file $classdir/$LOWER_HOSTNAME"
+	grep -v "^#" $LOWER_HOSTNAME | addclass
+fi
+
+# now add the hostname (the only class in lowercase) and LAST to
+# the list of classes
+echo $LOWER_HOSTNAME LAST | addclass
+
+# show all classes if verbose
+debugmsg List of all classes: $(cat $filename)
+[ "$ctest" ] && testclass
+exit 0


Property changes on: branches/lhm/bin/fai-class
___________________________________________________________________
Added: svn:executable
   + 

Added: branches/lhm/bin/fai-debconf
===================================================================
--- branches/lhm/bin/fai-debconf	                        (rev 0)
+++ branches/lhm/bin/fai-debconf	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,123 @@
+#! /bin/bash
+
+#*********************************************************************
+#
+# fai-debconf - set debconf values using classes
+#
+# This script is part of FAI (Fully Automatic Installation)
+# (c) 2005-2006 by 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.
+#
+# 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.
+# 
+# A copy of the GNU General Public License is available as
+# `/usr/share/common-licences/GPL' in the Debian GNU/Linux distribution
+# or on the World Wide Web at http://www.gnu.org/copyleft/gpl.html. You
+# can also obtain it by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#*********************************************************************
+
+version="version 1.3, 8-september-2006"
+
+# variables needed: $classes, $ROOTCMD, $LOGDIR, $target
+    
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+call_conf() {
+
+    # loop over all files in debconf
+    local class f
+    cd $debconfdir
+    for class in $classes ; do
+	[ -f $class ] && add_data $class
+	if [ -d $class ]; then
+	   for f in $(ls $class/* | grep -v ~$) ; do
+	       [ -f $f ] && add_data $f
+	   done
+	fi
+    done
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+add_data() {
+
+    # add debconf data
+    local file=$1
+
+    [ "$verbose" ] && echo "Adding debconf data from $debconfdir/$file"
+    $ROOTCMD debconf-set-selections -v < $debconfdir/$file 2>> $LOGDIR/debconf.log
+#    grep -v ^# $debconfdir/$file >> $LOGDIR/debconf.data
+    cat $debconfdir/$file >> $LOGDIR/debconf.data
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+reconfigure_packages() {
+
+     local packages p tmpdb
+
+     [ -s $LOGDIR/debconf.data ] || return # nothing to do if is size 0 or missing
+     if [ -r $LOGDIR/debconf.old ] ; then
+       $ROOTCMD debconf-get-selections > $LOGDIR/debconf.new
+       diff --changed-group-format="%>" --unchanged-line-format="" \
+         $LOGDIR/debconf.old $LOGDIR/debconf.new > $LOGDIR/debconf.data
+     fi
+     packages=$(awk '{print $1}' $LOGDIR/debconf.data | sort | uniq)
+     # backup database
+     tmpdb=$($ROOTCMD mktemp -t fai-debconf.XXXXXXXXXX)
+     $ROOTCMD debconf-copydb configdb faidb --config=Name:faidb --config=Driver:File --config=Filename:$tmpdb
+     for p in $packages; do
+	 # test if package is installed
+	 if [ -f $target/var/lib/dpkg/info/$p.list ]; then
+	     echo "Reconfiguring package $p"
+       DEBCONF_DB_OVERRIDE="File{$tmpdb readonly:true}" DEBIAN_FRONTEND=noninteractive $ROOTCMD /usr/sbin/dpkg-reconfigure $p
+	 else
+	     :
+	     # for debugging only
+	     # echo "Package $p is not yet installed. Skipping reconfiguration."
+	 fi
+     done
+     rm -f $target/$tmpdb $target/$tmpdb-old
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+usage() {
+
+    local ex=$1
+    cat <<-EOF
+    fai-debconf $version. Copyright (C) 2005-2006 Thomas Lange
+    Report bugs to <fai at informatik.uni-koeln.de>.
+
+    Usage: fai-debconf [OPTION] DIRECTORY
+EOF
+    exit $ex
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# main program
+
+reconf=1 # call dpkg-reconfigure by default
+forcereconf=0 # don't call dpkg-reconfigure for unchanged packages
+while getopts "hvsf" opt ; do
+    case "$opt" in
+	h) usage 0 ;;
+	s) reconf=0 ;;
+	v) verbose=1 ;;
+	f) forcereconf=1 ;;
+    esac
+done
+shift $(($OPTIND - 1))
+[ -z "$1" ] || [ -n "$2" ] && usage 1
+debconfdir=$1 # will be /fai/debconf
+
+if [ "x$classes" = "x" ]; then
+    echo "No classes are defined."
+    exit 9
+fi
+
+[ $forcereconf -eq 0 -a -x $target/usr/bin/debconf-get-selections ] && $ROOTCMD debconf-get-selections > $LOGDIR/debconf.old
+call_conf # add data to debconf database
+[ $reconf -eq 1 ] && reconfigure_packages


Property changes on: branches/lhm/bin/fai-debconf
___________________________________________________________________
Added: svn:executable
   + 

Added: branches/lhm/bin/fai-do-scripts
===================================================================
--- branches/lhm/bin/fai-do-scripts	                        (rev 0)
+++ branches/lhm/bin/fai-do-scripts	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,188 @@
+#! /bin/bash
+
+#*********************************************************************
+#
+# fai-do-scripts - call configuration scripts for every defined class
+#
+# This script is part of FAI (Fully Automatic Installation)
+# (c) 2003-2008 by 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.
+#
+# 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.
+# 
+# A copy of the GNU General Public License is available as
+# `/usr/share/common-licences/GPL' in the Debian GNU/Linux distribution
+# or on the World Wide Web at http://www.gnu.org/copyleft/gpl.html. You
+# can also obtain it by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#*********************************************************************
+
+version="version 1.6.1, 9-aug-2008"
+
+# variables needed: $classes, $cfclasses, $LOGDIR
+# 
+# And many other variables like:
+
+# execute all scripts that match the name of a class.
+# If class is a directory, execute all $class/[0-9][0-9]* scripts in
+# it, but do not execute files ending in ~
+    
+# TODO: -n only shows which scripts should be executed, but do not execute them
+
+maxstatus=0
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+savemaxstatus() {
+
+    # save the highest exit status
+    [ $1 -gt $maxstatus ] && maxstatus=$1
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+fc_check_status() {
+
+    local cmd st res
+    cmd=$1
+    st=$2
+
+    if [ $st -eq 0 ]; then
+	res="OK."
+    else
+	res="FAILED with exit code $st."
+	savemaxstatus $st
+    fi
+    # put result in the log file and write to stdout
+    printf "%-20s $res\n" $cmd | tee -a $LOGDIR/status.log
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+call_conf() {
+
+    local class f
+    cd $1
+    for class in $classes ; do
+	[ -x $class -a -f $class ] && do_script $class
+	if [ -d $class ]; then
+	   for f in $(echo $class/{S,}[0-9][0-9]* ) ; do
+	       [ -x $f -a -f $f ] && do_script $f
+	   done
+	fi
+    done
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+do_script() {
+
+    # execute scripts and save their output in log files
+    # cfengine, shell, perl and expect scripts are known types
+    local shelldebug file filetype name
+
+    file=$1
+
+    # may be remove some day
+    case $file in
+	*~) [ "$debug" ] && echo "Skipping backup file $file"
+	    return ;;
+    esac
+
+    name=$(basename $file)
+    case $name in
+	S[0-9][0-9]*) echo -e "WARNING: The script $name does not match [0-9][0-9]*.\nIt's not executed. Please rename it."; return ;;
+    esac
+
+    filetype=$(file -b $file)
+
+    if [ "$fake" ]; then
+	echo "Executing $filetype"
+	return
+    fi
+
+    shelldebug=
+    case $filetype in
+	*"POSIX shell script"*|*"Bourne shell script"*)
+	    [ "$debug" ] && shelldebug="sh -x" ;;
+	*"Bourne-Again shell script"*)
+	    [ "$debug" ] && shelldebug="bash -x" ;;
+    esac
+
+    case $filetype in
+
+	*"POSIX shell script"*|*"executable shell script"*|*"/bash script"*|*"Bourne shell script"*|*"Bourne-Again shell script"*)
+	    echo "Executing   $shelldebug shell: $file"
+	    echo "=====   shell: $file   =====" >> $LOGDIR/shell.log 2>&1
+	    $shelldebug ./$file >> $LOGDIR/shell.log 2>&1
+	    fc_check_status $file $? | tee -a $LOGDIR/shell.log
+	;;
+
+	*"cfagent"*)
+	    echo "Executing cfagent: $file"
+	    echo "=====   cfagent: $file   =====" >> $LOGDIR/cfagent.log 2>&1
+	    ./$file -qKI -D${cfclasses} >> $LOGDIR/cfagent.log 2>&1
+	    fc_check_status $file $? | tee -a $LOGDIR/cfagent.log
+	;;
+
+	*"cfengine script"*)
+	    echo "Executing cfengine: $file"
+	    echo "=====   cfengine: $file   =====" >> $LOGDIR/cfengine.log 2>&1
+	    ./$file -K -v -f $file -D${cfclasses} >> $LOGDIR/cfengine.log 2>&1
+	    fc_check_status $file $? | tee -a $LOGDIR/cfengine.log
+	;;
+
+	*"perl"*"script"*)
+	    echo "Executing    perl: $file"
+	    echo "=====   perl: $file   =====" >> $LOGDIR/perl.log 2>&1
+	    ./$file >> $LOGDIR/perl.log 2>&1
+	    fc_check_status $file $? | tee -a $LOGDIR/perl.log
+	;;
+
+	*"expect script"*)
+	    echo "Executing  expect: $file"
+	    echo "=====   expect: $file   =====" >> $LOGDIR/expect.log 2>&1
+	    ./$file >> $LOGDIR/expect.log 2>&1
+	    fc_check_status $file $? | tee -a $LOGDIR/expect.log
+	;;
+
+	*) echo "File $file has unsupported type $filetype." ;;
+    esac
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+usage() {
+
+    local ex
+    ex=$1
+    cat <<-EOF
+        fai-do-scripts $version. Copyright (C) 2003-2007 Thomas Lange
+        Read the manual page fai-do-scripts(1) for more information.
+
+        Usage: fai-do-scripts [OPTION] DIRECTORY
+
+EOF
+    exit $ex
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ # main program
+
+while getopts "nhL:" opt ; do
+    case "$opt" in
+	h) usage 0 ;;
+        L) LOGDIR=$OPTARG; export LOGDIR ;;
+	n) fake=1 ;;
+    esac
+done
+shift $(($OPTIND - 1))
+[ -z "$1" ] || [ -n "$2" ] && usage 1
+
+if [ "x$classes" = "x" ]; then
+    echo "No classes are defined."
+    exit 9
+fi
+
+call_conf $1
+# move error number from child scripts to 100+x if any error happened
+[ $maxstatus -gt 0 ] && maxstatus=$((100+$maxstatus))
+exit $maxstatus

Added: branches/lhm/bin/fai-mirror
===================================================================
--- branches/lhm/bin/fai-mirror	                        (rev 0)
+++ branches/lhm/bin/fai-mirror	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,336 @@
+#! /bin/bash
+
+# $Id: fai-mirror 5222 2008-12-09 12:15:53Z lange $
+#*********************************************************************
+#
+# fai-mirror -- create and manage a partial mirror for FAI
+#
+# This script is part of FAI (Fully Automatic Installation)
+# (c) 2004-2007, 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.
+#*********************************************************************
+
+version="Version 1.9.12, 4-december-2008"
+
+# variables: NFSROOT, FAI_CONFIGDIR, FAI_ETC_DIR
+
+export FAI_ROOT=/ # do not execute in chroot, needed for install_packages call
+export PATH=$PATH:/usr/sbin
+
+trap "umount_dirs" EXIT ERR
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+usage() {
+
+    echo "fai-mirror -- create and manage a partial mirror for FAI."
+    echo "$version"
+    echo "Please read the manual page fai-mirror(1)."
+    exit
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - -
+die() {
+
+    local e=$1   # first parameter is the exit code
+    shift
+
+    echo "$@"    # print error message
+    exit $e
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+excludeclass() {
+
+    # removes/excludes all classes in $* from $classes
+    local insert eclasses newclass c e
+
+    eclasses="$*"
+    eclasses=${eclasses//,/ }
+
+    for c in $classes; do
+        insert=1
+        for e in $eclasses; do
+          [ $c = $e ] && insert=0
+        done
+        [ $insert = 1 ] && newclass="$newclass $c"
+    done
+    classes="$newclass"
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+get_addpackages() {
+
+    # add packages (mostly kernels) which are defined in the variable $addpackages
+    # TODO: maybe better to create a tmp file with all these package
+    # names, then to call install_packages for the tmp file
+
+    local f p pkg pkglist
+
+    for f in $(echo $FAI_CONFIGDIR/class/*.var); do
+	pkg=$(egrep ^addpackages= $f | sed 's/addpackages=//'|sed 's/"//g'| perl -pe 's/\$[\w_-]+//g')
+
+	[ -n "$pkg" ] && pkglist="$pkglist $pkg"
+    done
+    [ -z "$pkglist" ] && return 0
+
+    echo -n "Adding packages from variable \$addpackages:"
+    # loop over the list, because maybe some packages doesn't exist in the
+    # partial mirror, but only in the local repository. These can't be
+    # downloaded via the normal method
+    for p in $pkglist; do
+	echo -n " $p"
+	# test if .deb file is available
+	if [ ! -f $FAI_CONFIG/files/packages/${p}_*.deb ]; then
+	    apt-get $qflag -d $aptoptions -y --force-yes --fix-missing install $p
+	fi
+    done
+    echo ""
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+umount_dirs() {
+
+    [ "$FAI_DEBMIRROR" ] && umount $MNTPOINT 2>/dev/null 1>&2 || true
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+cleandirs() {
+
+    return # currently nothing to do
+#    rm $statefile
+#    rm -rf $mirrordir/.apt-move  $statefile
+#    [ $debug -eq 1 ] || rm -rf $aptcache $archivedir
+#    rm -rf $aptcache $archivedir
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+initialize() {
+
+    # TODO: root is only needed when FAI_DEBMIRROR is defined. Then we
+    # must mount a directory
+
+    debdist=$(echo "$FAI_DEBOOTSTRAP" | awk '{print $1}')
+    # store all packages temporary in the mirror partition so we need only a move,
+    # not a copy later during apt-move
+    aptcache=$mirrordir/aptcache   # holds the package cache data
+    archivedir=$aptcache/var/cache/apt/archives
+    aptmovefile=$aptcache/etc/apt-move.conf # stores apt-move.conf
+    statefile=$aptcache/statefile
+
+    # also used in install_packages.conf
+    export aptoptions=" \
+       -o Aptitude::Log=/dev/null \
+       -o Aptitude::CmdLine::Ignore-Trust-Violations=yes\
+       -o APT::Get::AllowUnauthenticated=true \
+      -o DPkg::force-conflicts::=yes \
+      -o Dir::State::status=$statefile \
+      -o APT::Get::Force-Yes=true \
+      -o Dir::Cache=$aptcache/var/cache/apt \
+      -o Dir::State=$aptcache/var/cache/apt \
+      -o Dir::Cache::Archives=$archivedir \
+      -o Dir::Etc::sourcelist=$aptcache/etc/apt/sources.list \
+      -o Dir::State::Lists=$aptcache/var/lib/apt/lists/"
+
+    # not needed
+    # -o APT::Get::ReInstall
+    # ."-o APT::Get::Download-Only=true -o Aptitude::Cmd-Line::Download-Only=true "
+
+    # we only need some empty dirs
+    set -e
+    mkdir -p $archivedir/partial $aptcache/etc/apt $aptcache/var/lib/apt/lists/partial 
+    > $statefile
+    set +e
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+delete_base_packages() {
+
+    # now delete all packages that are already included in base.tgz
+    local p
+
+    if [ ! -f $NFSROOT/var/tmp/base-pkgs.lis ]; then
+	echo "$NFSROOT/var/tmp/base-pkgs.lis not available."
+	echo "Can't remove wasteful packages that are already in base.tgz."
+	return
+    fi
+    echo "Removing packages that are already included in base.tgz"
+    for p in $(cat $NFSROOT/var/tmp/base-pkgs.lis); do
+	if [ -f $archivedir/${p}_*.deb ]; then
+	    [ $verbose -eq 1 ] && echo "deleting package $p"
+	    rm $archivedir/${p}_*.deb
+        # else commands only for debugging
+        #    else
+        #	echo "package $p not found"
+        #	ls $archivedir/${p}_*.deb
+	fi
+    done
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+add_base_packages() {
+
+    local plist
+    # add packages from base.tgz and additional packages in nfsroot
+
+    # arch dependent packages defined in make-fai-nfsroot
+    echo "Adding packages of $cfdir/NFSROOT."
+    if [ -f $NFSROOT/var/tmp/packages.nfsroot ]; then
+	plist=$(< $NFSROOT/var/tmp/packages.nfsroot)
+	apt-get $qflag -d $aptoptions -y --force-yes --fix-missing install $plist
+    else
+	echo "WARNING: $NFSROOT/var/tmp/packages.nfsroot does not exists."
+	echo "Can't add those packages. Maybe the nfsroot is not yet created."
+    fi
+
+    # now use sources.list for debootstrap packages
+    echo "$FAI_DEBOOTSTRAP" | awk '{printf "deb %s %s main\n",$2,$1}' | perl -p -e 's/file:/copy:/' > $aptcache/etc/apt/sources.list
+    echo "Adding packages from base.tgz."
+    if [ -f $NFSROOT/var/tmp/base-pkgs.lis ]; then
+	plist=$(< $NFSROOT/var/tmp/base-pkgs.lis)
+	apt-get $quiet $aptoptions update >/dev/null
+	apt-get $qflag -d $aptoptions -y --force-yes --fix-missing install $plist
+    else
+	echo "WARNING: $NFSROOT/var/tmp/base-pkgs.lis does not exists."
+	echo "Can't add those packages. Maybe the nfsroot is not yet created."
+    fi
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+set-classes() {
+
+    # if -c is given, ignore -x
+    if [ -n "$cclasses" ]; then
+	export classes=${cclasses//,/ }
+	return
+    fi
+
+    set +e
+    # all available file names are classes
+    classes=$(cd $FAI_CONFIGDIR/package_config; ls -1 | egrep -i "^[a-zA-Z0-9_-]+$")
+    addclasses=$(grep -h PACKAGES $FAI_CONFIGDIR/package_config/* | sed -e 's/#.*//' | awk '{printf $3"\n"$4"\n"$5"\n"$6"\n"}')
+    export classes=$(echo -e "$classes\n$addclasses\n" | sort | uniq)
+    [ -n "$exclasses" ] && excludeclass $exclasses
+    set -e
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+[ -x "$(which apt-move)" ] || die 5 "apt-move not found. Please install package."
+
+preserve=0
+verbose=0
+add=1
+qflag=-qq
+while getopts "Bvhx:pc:C:" opt ; do
+    case "$opt" in
+	B) add=0 ;;
+	C) cfdir=$OPTARG ;;
+	h) usage ;;
+	x) exclasses="$OPTARG";;
+	c) cclasses="$OPTARG";;
+	p) preserve=1;;
+	v) verbose=1; vflag=-v; qflag='';;
+	?) die 1 "Unknown option";;
+    esac
+done
+shift $(($OPTIND - 1))
+
+# use FAI_ETC_DIR from environment variable
+if [ -n "$FAI_ETC_DIR" -a -z "$cfdir" ]; then
+    echo "Using environment variable \$FAI_ETC_DIR."
+fi
+cfdir=${FAI_ETC_DIR:=/etc/fai}
+cfdir=$(readlink -f $cfdir) # canonicalize path
+if [ ! -d "$cfdir" ]; then
+    echo "$cfdir is not a directory"
+    exit 6
+fi
+[ "$verbose" ] && echo "Using configuration files from $cfdir"
+. $cfdir/fai.conf
+. $cfdir/make-fai-nfsroot.conf
+export NFSROOT="$NFSROOT/live/filesystem.dir"
+
+[ -n "$packages" ] && die "WARNING: The use of \$packages in make-fai-nfsroot.conf is now deprecated. Please include this information into $cfdir/NFSROOT."
+[ -n "$NFSROOT_PACKAGES" ] && die "WARNING: The use of \$packages in make-fai-nfsroot.conf is now deprecated. Please include this information into $cfdir/NFSROOT."
+
+[ -n "$exclasses" -a -n "$cclasses" ] && die 3 "Options -x and -c not allowed at the same time."
+debug=0
+[ $debug -eq 0 ] && quiet=-q
+
+mirrordir=$1
+if [ -z "$mirrordir" ]; then
+    die 2 "Please give the absolute path to the mirror."
+fi
+{ echo $mirrordir | egrep -q '^/'; } || die 4 "Mirrordir must start with a slash /."
+if [ -d $mirrordir/pool -o -d $mirrordir/dists ]; then
+    die 3 "Please first remove $mirrordir/pool and $mirrordir/dists"
+fi
+
+[ -d $FAI_CONFIGDIR/package_config ] || die 6 "Can't find package config files in $FAI_CONFIGDIR."
+
+# set default if undefined
+[ -z "$MAXPACKAGES" ] && export MAXPACKAGES=1
+
+initialize
+
+# if we are using nfs mounts for Debian mirror, this may fail here, since inside a chroot environment different dir are used
+
+# if sources.list includes file AND FAI_DEBMIRROR is defined we have to mount
+# otherwise mounting is not needed. call task_mirror
+
+if [ "$FAI_DEBMIRROR" ]; then
+    mkdir -p $MNTPOINT
+    mount -r $FAI_DEBMIRROR $MNTPOINT || exit 9
+fi
+
+# TODO: use -p to preserve sources.list
+perl -p -e 's/file:/copy:/' $cfdir/apt/sources.list > $aptcache/etc/apt/sources.list
+
+echo "Getting package information"
+apt-get $quiet $aptoptions update >/dev/null
+
+set-classes
+echo "Downloading packages for classes:" $classes
+FAI=$FAI_CONFIGDIR install_packages -d $vflag
+[ $add -eq 1 ] && add_base_packages
+get_addpackages
+umount_dirs
+trap "" EXIT ERR
+[ $add -eq 0 ] && delete_base_packages
+
+# create mirror directory structure
+echo "Calling apt-move"
+cat > $aptmovefile <<EOF   # generate apt-move.conf
+APTSITES=*
+LOCALDIR=$mirrordir
+DIST=$debdist
+FILECACHE=$archivedir
+LISTSTATE=$aptcache/var/lib/apt/lists
+DELETE=no
+CONTENTS=no
+PKGCOMP='none gzip'
+EOF
+apt-move $quiet -c $aptmovefile update
+# since Packages.gz from apt-move does not include packages from my
+# repository, let's use apt-ftparchive for generiating correct index
+# files
+pfilegz=$(find $mirrordir/dists -name Packages.gz)
+pfile=$(find $mirrordir/dists -name Packages)
+pdist=$(cd $mirrordir/dists ; ls)
+cd $mirrordir
+# md5sums of apt-move are not valid, when we recreate Packages.gz using
+# apt-ftparchive, but we can use the header of the Release file
+grep -B99 MD5Sum:  $mirrordir/dists/$pdist/Release | grep -v MD5Sum: > $mirrordir/tmpfile
+rm $mirrordir/dists/$pdist/Release
+apt-ftparchive packages pool > $pfile
+gzip -c $pfile > $pfilegz
+apt-ftparchive release dists/$pdist >> tmpfile
+mv tmpfile dists/$pdist/Release
+
+echo "$0 finished."
+echo -n "Mirror size and location: ";du -sh $mirrordir
+cleandirs


Property changes on: branches/lhm/bin/fai-mirror
___________________________________________________________________
Added: svn:executable
   + 

Added: branches/lhm/bin/fai-setup
===================================================================
--- branches/lhm/bin/fai-setup	                        (rev 0)
+++ branches/lhm/bin/fai-setup	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,200 @@
+#! /bin/bash
+
+# $Id: fai-setup 4995 2008-06-19 07:35:28Z lange $
+#*********************************************************************
+#
+# fai-setup -- set up FAI
+#
+# This script is part of FAI (Fully Automatic Installation)
+# (c) 2000-2008 by 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.
+#
+# 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.
+# 
+# A copy of the GNU General Public License is available as
+# `/usr/share/common-licences/GPL' in the Debian GNU/Linux distribution
+# or on the World Wide Web at http://www.gnu.org/copyleft/gpl.html.  You
+# can also obtain it by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#*********************************************************************
+
+PATH=/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin
+
+set -e
+
+cfdir=/etc/fai
+
+options=$@ # all options are also passed to make-fai-nfsroot
+
+while getopts ervC:f:kKV: opt ; do
+    case "$opt" in
+	C) cfdir=$OPTARG ;;
+	v) verbose=1 ; v=-v ;;
+	e) expert=1 ;;
+    esac
+done
+
+
+. $cfdir/fai.conf
+. $cfdir/make-fai-nfsroot.conf
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+add_export_line() {
+
+    # add a line to /etc/exports
+
+    pattern=$1
+    shift
+    options="$@"
+
+    [ -f /etc/exports ] && grep -q "^$pattern[[:space:]]" /etc/exports && return
+    echo "Adding line to /etc/exports: $pattern $options"
+    echo "$pattern $options" >> /etc/exports
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+add_fai_account() {
+
+    if id $LOGUSER 2>/dev/null 1>&2 ; then
+	echo Account \$LOGUSER=$LOGUSER  already exists.
+	echo Make sure that all install clients can
+	echo log into this account without a password.
+	return
+    fi
+
+    adduser --system --disabled-password --home /var/log/fai --gecos "FAI account for log files" $LOGUSER
+    # there's a bug when the encrypted password is !, so change it to *
+    perl -pi.bak -e "s#^$LOGUSER:.:(.+):/bin/false#$LOGUSER:*:\1:/bin/bash#" /etc/passwd
+    # get the home dir of a user in a variable; do not exit when set -e is used
+    # loguserhome is unset if $LOGUSER does not exists
+    # this is not a evil hack, it's a very clever piece of code
+    loguserhome=$(eval "cd ~$LOGUSER 2>/dev/null && pwd;true")
+    touch $loguserhome/.account_created_by_fai_package
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+setup_fai_account() {
+
+    # most things should be executed as user $LOGUSER, since root may not have write
+    # permissions to $loguserhome (e.g if mount via NFS without no_root_squash)
+
+    set +e
+    loguserhome=$(eval "cd ~$LOGUSER 2>/dev/null && pwd;true")
+    sshdir=$loguserhome/.ssh
+    if [ -z "$loguserhome" ]; then
+	echo "Can't determine home directory for user $LOGUSER."
+	echo "LOGUSER= $LOGUSER    loguserhome= $loguserhome"
+	exit 8
+    fi
+
+    if [ "$FAI_LOGPROTO" = "ssh" ]; then
+	# set up ssh on the server
+	mkdir -p -m 700 $loguserhome/.ssh
+	
+	#Generating keys for LOGUSER
+	[ -f $sshdir/id_rsa ] || {
+	    ssh-keygen -t rsa -N '' -f $sshdir/id_rsa -C "$LOGUSER@$HOSTNAME"
+	    cat $sshdir/id_rsa.pub >> $sshdir/authorized_keys
+	}
+
+	[ -f $sshdir/id_dsa ] || {
+	    ssh-keygen -t dsa -N '' -f $sshdir/id_dsa -C "$LOGUSER@$HOSTNAME"
+	    cat $sshdir/id_dsa.pub >> $sshdir/authorized_keys
+	}
+	
+	#Adding servers keys to known_hosts list of LOGUSER. 
+	#So that installed clients can ssh $LOGUSER@$HOSTNAME without password
+	if [ ! -f $sshdir/known_hosts ]; then
+	    [ -f /etc/ssh/ssh_host_dsa_key.pub ] && DSASERVER=$(sed -e "s/= .*$/=/" /etc/ssh/ssh_host_dsa_key.pub)
+	    [ -f /etc/ssh/ssh_host_rsa_key.pub ] && RSASERVER=$(sed -e "s/= .*$/=/" /etc/ssh/ssh_host_rsa_key.pub )
+	    # determine all IP addresses, and their host names
+	    ips=$(LC_ALL=C ifconfig| perl -ne '/addr:([\d.]+)/ && print"$1\n"'|grep -v 127.0.0.1)
+	    for ip in $ips; do
+		hname=$(getent hosts $ip| tr -s ' ' ',')
+		[ -z "$hname" ] && hname=$ip
+		echo "Adding $hname to known_hosts."
+		[ -z "$DSASERVER" ] || echo "$hname $DSASERVER" >> $sshdir/known_hosts
+		[ -z "$RSASERVER" ] || echo "$hname $RSASERVER" >> $sshdir/known_hosts
+	    done
+	    echo "$sshdir/known_hosts created."
+	else
+	    echo "$sshdir/known_hosts remained unchanged."
+	fi
+
+	chmod 0600 $sshdir/authorized_keys
+	echo "$sshdir/authorized_keys created."
+    fi
+    if [ "$FAI_LOGPROTO" = "rsh" -a ! -f $loguserhome/.rhosts ]; then
+	# use .rhosts authentication
+	echo "+ at faiclients root" > $loguserhome/.rhosts
+	chmod go-rwx $loguserhome/.rhosts
+	echo "$loguserhome/.rhosts created."
+    fi
+
+    logusergid=$(id -ng $LOGUSER)
+    echo "User account $LOGUSER set up."
+    set -e
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+{ # start huge block for capturing output
+
+if [ -n "$LOGUSER" ]; then
+    add_fai_account
+    setup_fai_account
+fi
+
+make-fai-nfsroot $options
+
+if [ -n "$LOGUSER" ]; then
+    # chown only if cd was successful
+    cd $loguserhome
+    if [ $? -eq 0 ]; then
+	[ -e .rhosts ] && chown $LOGUSER:$logusergid . .rhosts || true
+	[ -d .ssh ] && chown -R $LOGUSER:$logusergid .ssh || true
+    fi
+    mkdir -p $TFTPROOT
+    chown -R $LOGUSER:$logusergid $TFTPROOT || true
+fi
+
+if [ -z "$FAI_CONFIGDIR" ]; then
+    echo "FAI_CONFIGDIR not set in /etc/fai/fai.conf."
+    echo "Using /srv/fai/config as default."
+    FAI_CONFIGDIR=/srv/fai/config
+fi
+mkdir -p $FAI_CONFIGDIR
+
+# in expert mode, do not export nfs directories
+if [ -z "$expert" ]; then
+    test -f /etc/init.d/nfs-kernel-server && nfsserver=nfs-kernel-server
+    test -f /etc/init.d/nfs-user-server && nfsserver=nfs-user-server
+
+    addr=$(LC_ALL=C ifconfig $SERVERINTERFACE | grep -v 127.0.0.1 | perl -ne '/addr:([\d.]+)/ && print"$1\n"'|head -1)
+    mask=$(LC_ALL=C ifconfig $SERVERINTERFACE | grep -v 127.0.0.1 | perl -ne '/Mask:([\d.]+)/ && print"$1\n"'|head -1)
+    add_export_line $FAI_CONFIGDIR  "$addr/$mask(async,ro,no_subtree_check)"
+    add_export_line $NFSROOT  "$addr/$mask(async,ro,no_subtree_check,no_root_squash)"
+    if [ -z "$nfsserver" ]; then
+	echo "Could not find the type of your nfs server. Maybe"
+	echo "no nfs server is installed. I can't restart it."
+    else
+	/etc/init.d/$nfsserver reload
+    fi
+fi
+
+if [ ! -d $FAI_CONFIGDIR/class ]; then
+    echo ""
+    echo "   You have no FAI configuration space yet. Copy the simple examples with:"
+    echo "   cp -a /usr/share/doc/fai-doc/examples/simple/* $FAI_CONFIGDIR"
+    echo "   Then change the configuration files to meet your local needs."
+    echo ""
+fi
+echo "FAI setup finished."
+} 2>&1 | tee /var/log/fai/fai-setup.log
+echo "Log file written to /var/log/fai/fai-setup.log"

Added: branches/lhm/bin/fai-start-stop-daemon
===================================================================
--- branches/lhm/bin/fai-start-stop-daemon	                        (rev 0)
+++ branches/lhm/bin/fai-start-stop-daemon	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,50 @@
+#! /bin/sh
+
+# $Id: fai-start-stop-daemon 4677 2007-11-10 13:55:48Z lange $
+#*********************************************************************
+#
+# start-stop-daemon -- a version which never starts daemons
+#
+# This script is part of FAI (Fully Automatic Installation)
+# (c) 2000-2006 by 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.
+#
+# 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.
+# 
+# A copy of the GNU General Public License is available as
+# `/usr/share/common-licences/GPL' in the Debian GNU/Linux distribution
+# or on the World Wide Web at http://www.gnu.org/copyleft/gpl.html.  You
+# can also obtain it by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#*********************************************************************
+
+while [ $# -gt 0 ]; do
+    case $1 in
+        -x|--exec) shift; prog="for $1" ;;
+        -o|--oknodo) oknodo=1 ;;
+        -S|--start) start=1 ;;
+        -K|--stop) stop=1 ;;
+        esac
+    shift
+done
+
+case $prog in
+    *udevd) /sbin/start-stop-daemon.distrib --start --quiet --exec /sbin/udevd -- --daemon
+	   ;;
+	*) echo ""
+	   echo "Warning: Dummy start-stop-daemon called $prog. Doing nothing."
+	   ;;
+esac
+
+[ -n "$stop" -a -z "$oknodo" ] && exit 1
+
+exit 0


Property changes on: branches/lhm/bin/fai-start-stop-daemon
___________________________________________________________________
Added: svn:executable
   + 

Added: branches/lhm/bin/fai-statoverride
===================================================================
--- branches/lhm/bin/fai-statoverride	                        (rev 0)
+++ branches/lhm/bin/fai-statoverride	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,23 @@
+#! /bin/bash
+
+# override owner and mode of a file or directory
+# call dpkg-statoverride with multiple files, 
+# this command is idempotent
+
+# copyright Thomas Lange, Uni Koeln, 2005
+
+err=0
+
+owner=$1;shift
+group=$1;shift
+ mode=$1;shift
+
+for f in $* ;do
+    $ROOTCMD dpkg-statoverride --list | grep -q " $f"
+    if [ "$?" -eq 1 ]; then
+	echo "Overriding owner and mode: $owner $group $mode $f" 
+	$ROOTCMD dpkg-statoverride --update --add $owner $group $mode $f && err=1
+    fi
+done
+
+exit $err


Property changes on: branches/lhm/bin/fai-statoverride
___________________________________________________________________
Added: svn:executable
   + 

Added: branches/lhm/bin/faimond
===================================================================
--- branches/lhm/bin/faimond	                        (rev 0)
+++ branches/lhm/bin/faimond	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,198 @@
+#!/usr/bin/perl -w
+# vim:et:ts=2:sw=2:
+
+# $Id: faimond 4546 2007-08-30 15:59:20Z lange $
+#*********************************************************************
+#
+# faimond -- monitor daemon which collects client status info
+#
+# This script is part of FAI (Fully Automatic Installation)
+# (c) 2003-2007 by Thomas Lange, lange at informatik.uni-koeln.de
+# Universitaet zu Koeln
+#
+#*********************************************************************
+
+use strict;
+use Socket;
+use Getopt::Std;
+use Proc::Daemon;
+
+$| = 1;
+my ($port, $timeout, $daemon, $timestamp);
+my $pidfile = '/var/run/faimond.pid';
+my $logfile = '-';
+my $daemonlogfile = '/var/log/faimond.log';
+my $useip;
+
+our ($opt_b,$opt_h,$opt_p,$opt_l,$opt_t,$opt_d,$opt_P,$opt_T,$opt_i);
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+sub logline(@) {
+  open(LOGFILE, $logfile) or return 0;
+  print LOGFILE (scalar localtime(), ' - ') if ($timestamp);
+  print LOGFILE @_ or return 0;
+  close(LOGFILE);
+  return 1;
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+sub signal_die(@) {
+  logline(@_);
+  unlink($pidfile);
+  exit(1);
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+sub signal_warn(@) {
+  logline(@_) or die "log: $!";
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+sub signal_deadly(@) {
+  # Use the die-handler
+  signal_die('Caught deadly signal ' . shift() . "\n");
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+sub server_init() {
+  logline("FAI monitoring daemon starting..\n") or die "log: $!";
+
+  # Init signals
+  $SIG{INT} = \&signal_deadly;
+  $SIG{QUIT} = \&signal_deadly;
+  $SIG{TERM} = \&signal_deadly;
+  $SIG{__DIE__} = \&signal_die;
+  $SIG{__WARN__} = \&signal_warn;
+  # HUP is usually used to reopen log files. This is not a problem
+  # in this design.
+  $SIG{HUP} = 'IGNORE';
+
+  if ($daemon) {
+    if (-e $pidfile) {
+    # Pid file already exists. Check if it's a valid pid.
+      open(PIDFILE, '<', "$pidfile") or die "open $pidfile: $!";
+      my $pid = <PIDFILE>;
+      chomp($pid);
+      if ($pid ne '') {
+      # Kill -0 exits with value 0 if pid is alive
+        system("kill -0 $pid 2> /dev/null");
+        if ($? == 0) {
+          logline("Pidfile $pidfile exists and contains an existing pid. Exiting.\n");
+          exit(1);
+        }
+      }
+      close(PIDFILE);
+    }
+    Proc::Daemon::Init;
+    umask 022;
+
+    open(PIDFILE, '>', "$pidfile") or die "open $pidfile: $!";
+    print PIDFILE $$ or die "print $pidfile: $!";
+    close(PIDFILE);
+  }
+
+  # Listen
+  my $proto = getprotobyname('tcp');
+  socket(SERVER, PF_INET, SOCK_STREAM, $proto) or die "socket: $!";
+  setsockopt(SERVER, SOL_SOCKET, SO_REUSEADDR, 1) or die "setsockopt: $!";
+
+  my $paddr = sockaddr_in($port, INADDR_ANY);
+
+  bind(SERVER, $paddr) or die "bind: $!";
+  listen(SERVER, SOMAXCONN) or die "listen: $!";
+  logline("FAI monitoring daemon started on port $port with pid $$\n") or die "log: $!";
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+sub big_loop() {
+
+  # accept a connection, print message received and close
+  my ($client_addr);
+  while ($client_addr = accept(CLIENT, SERVER)) {
+    my ($port, $iaddr) = sockaddr_in($client_addr);
+    my $ip = inet_ntoa($iaddr);
+
+    my $inp = '';
+
+    eval {
+      local $SIG{__DIE__};
+      local $SIG{__WARN__};
+      local $SIG{'ALRM'} = sub { die("Timeout"); };
+
+      alarm($timeout);
+      $inp = <CLIENT>;
+      alarm(0);
+    };
+
+    close CLIENT;
+
+    if (!defined($inp) || $inp eq '') {
+      # Client did not send anything, or alarm went off
+      logline("$ip:$port: No data or timeout.\n") or die "log: $!"; 
+      next;
+    }
+
+    if ($inp =~ /^([^\s;]+)\s+TASKEND install 0/ && $opt_b) {
+      my $cname = $1;
+      if ($useip) {
+        $cname = $ip;
+      }
+      system('fai-chboot', '-d', $cname);
+      logline("$ip:$port: Disabling pxelinux configuration for $cname\n") or die "log: $!";
+    }
+    logline("$inp") or die "log: $!";
+  }
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+sub usage {
+
+  print << "EOF";
+faimond, FAI monitor daemon.
+
+    Copyright (C) 2003-2007 by Thomas Lange
+
+Usage: faimond [OPTIONS]
+
+    -b                  Call fai-chboot to change boot parameter.
+    -p PORT             Set port to listen to. Default is 4711.
+    -l FILE             Logfile. Default is standard out and
+                        '$daemonlogfile' in daemon mode.
+    -t TIMEOUT          Timeout for bad clients. 0 to disable.
+    -d                  Daemon mode.
+    -P FILE             PID-file. Default is '$pidfile'.
+                        Used only if starting in daemon mode.
+    -T                  Print timestamps in the log.
+    -i                  When using -b: send IP of client to fai-choot
+                        instead of the hostname the host reports.
+
+EOF
+  exit 0;
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+getopts('bhTp:l:t:dP:i') || usage;
+$opt_h && usage;
+$port = $opt_p || 4711;
+$timeout = $opt_t || 5;
+$daemon = $opt_d || 0;
+$timestamp = $opt_T || 0;
+$useip = $opt_i || 0;
+
+if (defined($opt_P)) {
+  $pidfile = $opt_P;
+}
+
+if (defined($opt_d)) {
+  # If in daemon mode, use standard daemon log file
+  $logfile = $daemonlogfile;
+}
+
+if (defined($opt_l)) {
+  $logfile = $opt_l;
+}
+
+# Constuct a $logfile that open can take as an argument
+if ($logfile eq '-') {
+  $logfile = ">&STDOUT";
+}
+else {
+  $logfile = ">>$logfile";
+}
+
+
+server_init;
+big_loop;


Property changes on: branches/lhm/bin/faimond
___________________________________________________________________
Added: svn:executable
   + 

Added: branches/lhm/bin/faimond-gui
===================================================================
--- branches/lhm/bin/faimond-gui	                        (rev 0)
+++ branches/lhm/bin/faimond-gui	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,177 @@
+#! /usr/bin/perl
+
+# faimond-gui: graphical FAI monitor daemon
+#
+# This script is part of FAI (Fully Automatic Installation)
+# Copyright (C) 2007 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.
+#
+# 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.
+#
+# A copy of the GNU General Public License is available as
+# '/usr/share/common-licences/GPL' in the Debian GNU/Linux distribution
+# or on the World Wide Web at http://www.gnu.org/copyleft/gpl.html.  You
+# can also obtain it by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#*********************************************************************
+
+# TODO: Add support for TASKERROR
+
+use Tk;
+use Tk::HList;
+use Tk::ItemStyle;
+use Tk::Balloon;
+
+my $tcounter;
+my $n;
+
+$debug = 0;
+$icondir='/usr/share/fai/pixmaps';
+
+#@tasklist = qw/hostname confdir defclass action partition mountdisks extrbase mirror debconf prepareapt instsoft configure chboot savelog faiend reboot/;
+ at tasklist = qw/hostname confdir defclass partition extrbase debconf instsoft configure savelog faiend reboot/;
+$tasklist[0] = ' 'x15 . 'hostname'. ' 'x15;
+
+$rowcount = 0;
+%message = ( 'TASKBEGIN' => 'BEG', 'TASKEND' => 'END', 'REBOOT' => 'reboot');
+
+# -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
+sub getinp {
+
+  $line = <INP>;
+  return 0 if $line =~/^FAI monitoring daemon start/; # ignore start up messages from faimond
+  warn "INPUT received $line" if $debug;
+  hostentry($line);
+  return 0;
+}
+# -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
+sub mkgraphics {
+
+  #Style entries
+
+  $icon{'success'} = $top->Photo(-file=>"$icondir/ok.gif");
+  $icon{'minor'}   = $top->Photo(-file=>"$icondir/minor.gif");
+  $icon{'warning'} = $top->Photo(-file=>"$icondir/warning.gif");
+  $icon{'fail'}    = $top->Photo(-file=>"$icondir/fail.gif");
+  $icon{'begin'}   = $top->Photo(-file=>"$icondir/begin.gif");
+  $icon{'host'}    = $top->Photo(-file=>"$icondir/bar.gif");
+
+  $defstyle = $hlist->ItemStyle("imagetext",
+				-foreground => $forecolor,
+				-background => $backcolor,
+				-font => $font,
+			       );
+
+  $headerstyle = $hlist->ItemStyle("imagetext",
+				   -bg=>$backcolor,
+				   -fg=>$headercolor,
+				   -font=>$font
+				  );
+
+  # not yet used
+  # $balloonstatus = $top->Balloon();
+  # $balloonstatus->attach($top,-msg=>"status",-balloonposition=>"mouse");
+}
+# -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
+sub icon {
+
+    my ($host,$task,$iname) = @_;
+
+    $hlist->itemCreate($row{$host}, $task{$task}, -text=>'' ,-itemtype=>"imagetext",-image=>$icon{$iname});
+    $hlist->itemConfigure($row{$host}, $task{$task}, -itemtype=>"imagetext",-style=>$defstyle);
+}
+# -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
+sub hostentry {
+
+  my $str = shift(@_);
+  my ($host,$startstop,$task,$code) = split(/\s+/,$str);
+
+  warn "hostentry: $host $startstop $task $code\n" if $debug;
+
+  unless (exists $row{$host}) {
+    # add host, first column
+    $row{$host} = $rowcount++;
+
+    $hlist->add($row{$host},-state=>"disabled");
+    $hlist->itemCreate($row{$host}, 0,
+		       -itemtype => "imagetext",
+		       -text => $host,
+		       -style=>$headerstyle,
+		       -image=>$icon{'host'});
+  }
+
+  # remove old information when doing an reinstallation
+  if ($startstop eq 'check') {
+    foreach (1 .. $#tasklist) {
+      warn "XXX $row{$host} X $_\n" if $debug;
+      $hlist->itemCreate($row{$host}, $_, -text => '');
+    }
+    return;
+  }
+
+  warn "create: $row{$host} X  $task{$task} X $startstop $message{$startstop} $code\n" if $debug;
+  unless (exists $task{$task}) {
+    # do not show unknown tasks
+    return;
+  }
+
+  $message = ($startstop =~ /TASKEND/) ?  $message="$message{$startstop} $code": $message{$startstop};
+
+  ($message eq 'BEG')   && icon($host,$task,'begin');
+  if ($message =~ /END (\d+)/) {
+    $ret = $1; # save error code
+    ($ret < 300) and icon($host,$task,'success'),return;
+    ($ret < 500) and icon($host,$task,'warning'),return;
+    ($ret < 700) and icon($host,$task,'minor'),return;
+    icon($host,$task,'fail');
+  }
+
+}
+# -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
+# main program
+
+open(INP, "<$ARGV[0]") or die "Can't open input file. $@";
+
+$backcolor="#76716f";
+$forecolor="#ffffff";
+$headercolor="#ffffff";
+$font="Sans 15";
+
+$top = new MainWindow;
+#$top->configure(-background=> $backcolor);
+$hlist = $top->Scrolled("HList",
+            -header => 1,
+            -columns => $#tasklist+1,
+            -scrollbars => 'oe',
+            -width => 102,
+	    -height => 20,
+            -selectbackground => $backcolor,
+	    -background=> $backcolor,
+	    -selectborderwidth=>0,
+	    -selectmode=>'single',
+	    -highlightthickness=>0,
+	    -relief=>'flat',
+	    -borderwidth=>0,
+         )->pack(-expand => 1, -fill => 'both');
+
+mkgraphics;
+$top->fileevent(INP,'readable', [\&getinp]);
+
+foreach (@tasklist) {
+  $hlist->header('create', $n++, -text => $_,
+		 -headerbackground=>"#aabbcc",
+		 -borderwidth=>1,
+		 -relief=>"groove");
+  $task{$_} = $tcounter++;
+}
+
+MainLoop();


Property changes on: branches/lhm/bin/faimond-gui
___________________________________________________________________
Added: svn:executable
   + 

Added: branches/lhm/bin/faireboot
===================================================================
--- branches/lhm/bin/faireboot	                        (rev 0)
+++ branches/lhm/bin/faireboot	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,56 @@
+#! /bin/bash
+
+# $Id: faireboot 4113 2006-10-26 19:13:12Z lange $
+# reboot FAI correctly, Thomas Lange, Uni Koeln, copyright 2000-2004
+
+faimond=0
+. /usr/lib/fai/subroutines
+. /usr/lib/fai/subroutines-`uname -s | tr A-Z a-z`
+
+[ -f /tmp/fai/variables.log ] && . /tmp/fai/variables.log
+
+while getopts s opt ; do
+        case "$opt" in
+        s) fai-savelog -r ;;
+        esac
+done
+
+name=`basename "$0"`
+action="reboot"
+[ "${name}" = "faishutdown" ] && action="shutdown"
+
+cd /
+killall -STOP rcS
+killall -q apt-get dpkg tar gzip yes cat syslogd 
+
+[ "X" == "X$SSH_CLIENT" -a  "$TERM" != "dumb" ] && killall -q sshd
+
+fai-divert -R
+
+umount $FAI_ROOT/proc $FAI_ROOT/dev/pts
+umount -ar
+killall udevd
+
+sendmon "FAIREBOOT"
+if [ "$action" = "reboot" ]; then
+    echo "$HOSTNAME now rebooting"
+else
+    echo "$HOSTNAME now shutting down"
+fi
+
+if [ "X" == "X$SSH_CLIENT" -a  "$TERM" != "dumb" ]; then
+    if [ "$action" = "reboot" ]; then
+        exec reboot -dfi
+    else
+        exec shutdown -dfi
+    fi
+else
+    killall -CONT rcS
+    killall rcS
+    if [ "$action" = "reboot" ]; then
+        init 6 &
+    else
+        init 0 &
+    fi
+fi
+


Property changes on: branches/lhm/bin/faireboot
___________________________________________________________________
Added: svn:executable
   + 

Added: branches/lhm/bin/fcopy
===================================================================
--- branches/lhm/bin/fcopy	                        (rev 0)
+++ branches/lhm/bin/fcopy	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,483 @@
+#! /usr/bin/perl
+
+# $Id: fcopy 5209 2008-10-22 10:25:19Z lange $
+#*********************************************************************
+#
+# fcopy -- copy files using FAI classes and preserve directory structure
+#
+# This script is part of FAI (Fully Automatic Installation)
+# Copyright (C) 2000-2007 Thomas Lange, lange at informatik.uni-koeln.de
+# Universitaet zu Koeln
+# Copyright (C) 2001-2005 Henning Glawe, glaweh at physik.fu-berlin.de
+# Freie Univeritaet Berlin
+#
+#*********************************************************************
+# 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.
+#
+# A copy of the GNU General Public License is available as
+# '/usr/share/common-licences/GPL' in the Debian GNU/Linux distribution
+# or on the World Wide Web at http://www.gnu.org/copyleft/gpl.html.  You
+# can also obtain it by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#*********************************************************************
+
+my $version = "Version 2.3, 22-october-2008";
+
+use strict;
+use File::Copy;
+use File::Compare;
+use File::Find;
+use File::Path;
+use File::Basename;
+use File::Spec;
+use File::Temp qw/tempfile/;
+use Getopt::Std;
+
+use vars qw/*name/;
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Global variables
+my $debug;
+my $error = 0;
+my $verbose;
+my $target;
+my $source;
+my $logfile;
+my @classes;
+my $dryrun;
+
+my @opt_modes;
+my @rlist;
+my %changed;
+my %lastclass;
+my $modeset;
+my $nobackup;
+my $opt_update;
+my $backupdir;
+my @ignoredirs = qw'CVS .svn .arch-ids {arch}';
+
+# getopts:
+our ($opt_s, $opt_t, $opt_r, $opt_m, $opt_M, $opt_v, $opt_d, $opt_D, $opt_i);
+our ($opt_B, $opt_c, $opt_C, $opt_h, $opt_F, $opt_l, $opt_L, $opt_P, $opt_b);
+our ($opt_I, $opt_U, $opt_n);
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+sub copy_one {
+
+  # copy file $prefix/$source/$class to $target/$source
+  my ($prefix,$source,$target) = @_;
+  my ($class,$sourcefile,$destfile);
+  # 'normalize' source filenames: very important for updating !
+  $source =~ s/^(\.\/|\/)*//;
+
+  my $ps = "$prefix/$source";
+  $ps =~ s#//#/#;
+  my $tpath = "$target/" . dirname $source;
+  my $preserve = 0;
+  my $logcomment = "";
+  my ($tmpfh,$tmpfile);
+
+  warn "copy_one: source: $source: ps: $ps tpath: $tpath\n" if $debug;
+
+  # $prefix/$source must be a directory
+  if (-f $ps) { ewarn("$ps is a file, but must be a directory containing templates.");return };
+  unless (-d $ps) { ewarn("Nonexisting directory $ps. No files copied.");return }
+  # use the last class for which a file exists
+  foreach (@classes) { $class = $_,last if -f "$ps/$_"; }
+  $destfile = "$target/$source";
+
+  my $backupfile = $backupdir ? "$backupdir/$source" : "$destfile.pre_fcopy";
+  my $bpath = dirname $backupfile;
+
+  unless (defined $class) {
+    ewarn("no matching file for any class for $source defined.");
+    # do not copy
+    if ($opt_d and -f $destfile) {
+      print LOGFILE "$source\tNONE\t# removed (no matching class)\n" if $logfile;
+      if ($nobackup) {
+        _unlink($destfile) || ewarn("Could not remove file $destfile");
+      } else {
+        _mkpath($bpath,$debug,0755) unless -d $bpath;
+	_move($destfile,$backupfile) if -d $bpath;;
+      }
+    }
+    return;
+  }
+  warn "using class: $class\n" if $debug;
+  $tmpfile = $sourcefile = "$ps/$class";
+
+  # do nothing if source and destination files are equal
+  if ($opt_update and not -x "$ps/preinst") {
+    # compare logically
+    if ($lastclass{$source}) {
+      # $source has already been copied last time
+
+      if ($lastclass{$source} ne $class) {
+        $logcomment = "\t# changed class" if $logfile;
+      } else {
+        if ($changed{"$source/$class"} or
+            $changed{"$source/postinst"} or
+            $changed{"$source/file-modes"}) {
+          $logcomment = "\t# changed file" if $logfile;
+        } else {
+          $logcomment = "\t# preserved (logical)" if $logfile;
+          $preserve = 1;
+        }
+      }
+    } else {
+      $logcomment = "\t# new (logical)" if $logfile;
+    }
+  } else {
+    # compare literally
+    if ( -x "$ps/preinst" ) {
+      warn "preinst script found, switching to literal change detection" if
+        ($opt_P and $debug);
+      ($tmpfh,$tmpfile)=tempfile("fcopy.XXXXXX",DIR=>File::Spec->tmpdir());
+      warn "preinst script found, copying $sourcefile to $tmpfile" if $debug;
+      ewarn("copying $sourcefile for preinst processing failed !") unless
+        _copy($sourcefile,$tmpfh);
+      runscript("preinst",$ps,$tmpfile,$class);
+    };
+
+    if ( compare($tmpfile,$destfile)) {
+      $logcomment="\t# new (literal)";
+    } else {
+      $logcomment="\t# preserved (literal)" if $logfile;
+      $preserve = 1;
+    }
+  }
+  #if a package is being purged, our information about its config files is
+  #wrong, so first check if they exist. if not, don't preserve, but copy
+  if ($preserve && ! -e $destfile) {
+    $logcomment="\t# magically disappeared (maybe purged)";
+    $preserve=0;
+  }
+
+  print LOGFILE "$source\t$class$logcomment\n" if $logfile;
+  if ($preserve) {
+    warn "preserving $source \n";
+    _unlink($tmpfile) unless ($tmpfile eq $sourcefile);
+    set_mode($ps,$destfile,$class); # set mode even no file was copied
+    return;
+  }
+
+  # if destination is a symlink and -l is given, complain about it
+  if ($opt_l && -l $destfile) {
+    ewarn("Destination $destfile is a symlink");
+    _unlink($tmpfile) unless ($tmpfile eq $sourcefile);
+    return;
+  }
+
+  # create subdirectories if they do not exist
+  _mkpath($tpath,$debug,0755) unless -d $tpath;
+
+  # save existing file, add suffix .pre_fcopy
+  # what should I do if $destfile is a symlink?
+  $nobackup or (-f $destfile and
+    (-d $bpath or _mkpath($bpath,$debug,0755)) and _move($destfile,$backupfile));
+  if (_copy($tmpfile,$destfile)) {
+    print "fcopy: copied $sourcefile to $destfile\n" ;
+    set_mode($ps,$destfile,$class);
+    runscript("postinst",$ps,$destfile,$class);
+  } else {
+    ewarn("copy $sourcefile to $destfile failed. $!") ;
+  }
+  _unlink($tmpfile) unless ($tmpfile eq $sourcefile);
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+sub _mkpath {
+
+  return 1 if $dryrun; # do not execute if -n or FCOPY_DRYRUN was given
+  mkpath(@_);
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+sub _unlink {
+
+  return 1 if $dryrun; # do not execute if -n or FCOPY_DRYRUN was given
+  unlink(@_);
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+sub _move {
+
+  return 1 if $dryrun; # do not execute if -n or FCOPY_DRYRUN was given
+  move(@_);
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+sub _copy {
+
+  return 1 if $dryrun; # do not execute if -n or FCOPY_DRYRUN was given
+  copy(@_);
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+sub runscript {
+
+  my ($scriptname,$sourcefile,$destfile,$class) = @_;
+  return unless -x "$sourcefile/$scriptname";
+  warn "executing $sourcefile/$scriptname $class $destfile\n" if $debug;
+  return if $dryrun; # do not execute if -n or FCOPY_DRYRUN was given
+  system "$sourcefile/$scriptname $class $destfile";
+  my $rc = $?>>8;
+  warn "ERROR: $scriptname returned code $rc\n" if $rc;
+  $error=1 if $rc;
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+sub name2num {
+
+  # convert names to numeric uid, gid
+  my ($user, $group) = @_;
+  my ($uid, $gid);
+
+  if( !defined( $ENV{ROOTCMD} ) || $ENV{ROOTCMD} =~ /^\s*$/ )
+  {
+    $uid = ($user  =~ /^\d+$/) ? $user  : getpwnam $user;
+    $gid = ($group =~ /^\d+$/) ? $group : getgrnam $group;
+  }
+  else
+  {
+    $uid = ($user  =~ /^\d+$/) ? $user  : `$ENV{ROOTCMD} perl -e '\$uid = getpwnam "$user"; print \$uid'`;
+    $gid = ($group =~ /^\d+$/) ? $group : `$ENV{ROOTCMD} perl -e '\$gid = getgrnam "$group"; print \$gid'`;
+  }
+  warn "name2num $user = $uid ; $group = $gid\n" if $debug;
+  return ($uid,$gid);
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+sub set_mode {
+
+  # set target file's owner, group, mode and time
+  # use owner,group,mode from -m or from the file file-modes or
+  # use the values from the source file
+  my ($sourcefile,$destfile,$class) = @_;
+  my ($uid,$gid,$owner,$group,$mode);
+  # get mtime,uid,gid,mode from source file
+  my ($stime, at defmodes) = (stat("$sourcefile/$class"))[9,4,5,2];
+
+  if ($modeset) { # use -m values
+    ($owner,$group,$mode) = @opt_modes;
+  } elsif (-f "$sourcefile/file-modes"){
+    ($owner,$group,$mode) = read_file_mode("$sourcefile/file-modes",$class);
+  } else { # use values from source file
+    ($owner,$group,$mode) = @defmodes;
+  }
+
+  ($uid,$gid) = name2num($owner,$group);
+  warn "chown/chmod u:$uid g:$gid m:$mode $destfile\n" if $debug;
+  return if $dryrun; # do not execute if -n or FCOPY_DRYRUN was given
+  chown ($uid,$gid,     $destfile) || ewarn("chown $owner $group $destfile failed. $!");
+  chmod ($mode,         $destfile) || ewarn("chmod $mode $destfile failed. $!");
+  utime ($stime,$stime, $destfile) || ewarn("utime for $destfile failed. $!");
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+sub check_mopt {
+
+  # save and check -m options
+  $modeset = 1;
+  my $n = @opt_modes = split(/,/,$opt_m);
+  ($n != 3) &&
+    die "fcopy: wrong number of options for -m. Exact 3 comma separated items needed.\n";
+   unless ($opt_modes[2] =~/^[0-7]+$/) {
+     die "fcopy: file mode should be an octal number. Value is: $opt_modes[2]\n";
+   }
+  $opt_modes[2] = oct($opt_modes[2]);
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+sub read_file_mode {
+
+  my ($modefile,$class) = @_;
+  my ($owner,$group,$mode,$fclass, at defaults);
+
+  warn "reading $modefile\n" if $verbose;
+  open (MODEFILE,"<$modefile") || die "fcopy: can't open $modefile\n";
+  while (<MODEFILE>) {
+    # skip empty lines
+    next if /^\s*$/;
+    # skip comment lines
+    next if /^#/;
+    ($owner,$group,$mode,$fclass) = split;
+    $mode = oct($mode);
+    # class found
+    return ($owner,$group,$mode) if ($fclass eq $class);
+    # when no class is specified use data for all classes
+    $fclass or @defaults = ($owner,$group,$mode);
+  }
+  close MODEFILE;
+  return @defaults if @defaults;
+  ewarn("no modes found for $class in $modefile");
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+sub read_classes {
+
+  # read class names from a file
+  my $file = shift;
+  my @classes;
+
+  open(CLASS,$file) || die "fcopy: can't open class file $file. $!\n";
+  while (<CLASS>) {
+    next if /^#/;
+    push @classes, split;
+  }
+  close CLASS;
+  return @classes;
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+sub ewarn {
+
+  # print warnings and set error to 1
+  $error = 1;
+  warn "fcopy: @_\n";
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+sub read_status {
+  my $n = my @status_files=split(/,/,$opt_update);
+  ($n != 2) && die "fcopy: need both log and changes file\n";
+
+  open(LASTLOG,$status_files[0]);
+  while (<LASTLOG>) {
+    s/\#.*//g;
+    chomp;
+    my ($source,$class) = split(/\s/,$_,2);
+    $class=~s/\s*//g;
+    $lastclass{$source} = $class;
+  }
+  close(LASTLOG);
+
+  $_=$source; /([^\/]+)$/;
+  my $source_base = $1;
+  open(CHANGES,$status_files[1]);
+  while (<CHANGES>) {
+    s/\#.*//g;
+    chomp;
+    m#$source_base/(\S+)$# and $changed{$1} = 1;
+  }
+  close(CHANGES);
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+sub read_files {
+
+  # read list of files
+  # lines starting with # are comments
+  my $file = shift;
+  my @list;
+
+  open(LIST,"<$file") || die "fcopy: Can't open file $file\n";
+  while (<LIST>) {
+    next if /^#/;
+    chomp;
+    push @list, $_;
+  }
+  return @list;
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+sub usage {
+
+  print << "EOF";
+fcopy, copy files using classes. $version
+
+   Copyright (C) 2001-2006 by Thomas Lange
+
+Usage: fcopy [OPTION] ... SOURCE ...
+
+   -B                   Remove backup file.
+   -c class[,class]     Define classes.
+   -C file              Read classes from file.
+   -d                   Remove target file if no class applies.
+   -D                   Create debug output.
+   -F file              Read list of sources from file.
+   -h                   Show summary of options.
+   -i                   Exit with 0 when no class applies.
+   -I dir[,dir]         Override default list of ignored subdirectories
+   -l                   Do not copy if destination is a symbolic link.
+   -L file              Log destination and used class to file
+   -m user,group,mode   Set user, group and mode for copied files.
+   -M                   Same as -m root,root,0644
+   -n                   Print the commands, but do not execute them.
+   -P log,changes       Copy if class or source for class has changed since
+                        previous run
+   -r                   Copy recursivly but skip ignored directories.
+   -s source_dir        Look for source files relative to source_dir.
+   -t target_dir        Copy files relativ to target_dir.
+   -b backup_dir        Where to save backups of overwritten files
+   -v                   Create verbose output.
+
+Report bugs to <lange\@informatik.uni-koeln.de>.
+EOF
+  exit 0;
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# main program
+
+$|=1;
+getopts('Ms:t:rm:vidDc:C:hF:lL:P:Bb:I:Un') || usage;
+$opt_h && usage;
+$dryrun = $ENV{FCOPY_DRYRUN} || $opt_n || 0; # is true if in dry-run mode
+$dryrun and warn "Dry-run only! Nothing is really executed.\n";
+$opt_M and $opt_m = "root,root,0644";  # set default modes
+$opt_m && check_mopt();
+$nobackup = $opt_B || $ENV{FCOPY_NOBACKUP} || 0;
+$verbose = $opt_v || $ENV{verbose} || 0;
+$debug   = $opt_D || $ENV{debug}   || 0;
+$source  = $opt_s || $ENV{FAI} && "$ENV{FAI}/files" || `pwd`;
+chomp $source; # since pwd contains a newline
+$target  = $opt_t || $ENV{FAI_ROOT} || $ENV{target};
+$target eq "/" or $ENV{'ROOTCMD'}="chroot $target";
+$logfile = $opt_L || $ENV{LOGDIR} && "$ENV{LOGDIR}/fcopy.log" || 0;
+$logfile and (open(LOGFILE,">> $logfile") || die("can't open logfile: $!"));
+$backupdir = $opt_b || $ENV{FAI_BACKUPDIR};
+
+if ($opt_U && -f "/var/run/fai/fai_softupdate_is_running" ) {
+  print "Skipping this fcopy command during softupdate." if $verbose;
+  exit 0;
+}
+
+if ($ENV{FCOPY_LASTLOG} and $ENV{FCOPY_UPDATELOG}) {
+	$opt_update = "$ENV{FCOPY_LASTLOG},$ENV{FCOPY_UPDATELOG}";
+}
+$opt_P and $opt_update=$opt_P;
+$opt_update and read_status();
+
+#for postinst scripts
+$ENV{'FAI_ROOT'} = $ENV{'target'} = $target;
+
+# last class has highest priority
+$ENV{classes} and @classes = split /\s+/,$ENV{classes};
+$opt_c and @classes = split /,/,$opt_c;
+$opt_C and @classes = read_classes($opt_C);
+warn join ' ','Classes:', at classes,"\n" if $debug;
+ at classes = reverse @classes;
+$opt_F and @ARGV = read_files($opt_F);
+$ENV{'FCOPY_IGNOREDIRS'} and @ignoredirs = split /\s+/,$ENV{'FCOPY_IGNOREDIRS'};
+$opt_I and @ignoredirs = split /,/,$opt_I;
+
+die "fcopy: source undefined\n" unless $source;
+die "fcopy: target undefined\n" unless $target;
+
+if ($opt_r) {
+  foreach (@ARGV) { $_="$source/$_"; } # add prefix to list of directories
+  my %has_subdirs;
+  my %ignoredirs;
+  map $ignoredirs{$_}=1, at ignoredirs;
+  File::Find::find({
+    wanted=>sub{ $has_subdirs{$File::Find::dir} |= -d},
+    preprocess=>sub{grep ! (-d and exists($ignoredirs{$_})), at _}},
+    @ARGV);
+  foreach (keys %has_subdirs) {
+    unless ($has_subdirs{$_}) {
+      # remove prefix from all files found
+      s#^\Q$source/##;
+      push @rlist,$_;
+    }
+  }
+  warn "List of all files found by File::Find::find: @rlist" if $debug;
+  @ARGV = @rlist;
+}
+
+foreach (@ARGV) { copy_one($source,$_,$target); }
+$opt_i && exit 0; # ignore any warning
+exit $error;


Property changes on: branches/lhm/bin/fcopy
___________________________________________________________________
Added: svn:executable
   + 

Added: branches/lhm/bin/ftar
===================================================================
--- branches/lhm/bin/ftar	                        (rev 0)
+++ branches/lhm/bin/ftar	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,142 @@
+#! /bin/bash
+
+# $Id: ftar 4993 2008-06-16 12:29:06Z lange $
+#*********************************************************************
+#
+# ftar -- extract tar files using FAI classes
+#
+# This script is part of FAI (Fully Automatic Installation)
+# Copyright (C) 2001-2008 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.
+#
+# 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.
+# 
+# A copy of the GNU General Public License is available as
+# '/usr/share/common-licences/GPL' in the Debian GNU/Linux distribution
+# or on the World Wide Web at http://www.gnu.org/copyleft/gpl.html.  You
+# can also obtain it by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#*********************************************************************
+
+version="Version 1.6.2, 16-june-2008"
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+die() {
+    echo "ftar died with error: $1"
+    exit 99
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+extract() {
+
+    local file=$1
+    local catname=$2
+
+    echo "ftar: extracting $file to $target/$dir"
+    $catname $file | tar -C $target/$dir $vflag -xf -
+    tardone=1
+    # if option -1 is set, only one class will be used
+    [ $single -eq 1 ] && exit 0
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+usage() {
+
+    cat <<EOF
+ftar, extract tar files using classes. $version
+
+   Copyright (C) 2001-2008 by Thomas Lange
+
+Usage: ftar [OPTION] ... SOURCE
+
+   -1                   Use only first tar file matching class name.
+   -c class[class]      Define classes (space separated).
+   -d                   Delete all files in target before extracting.
+   -D                   Create debug output.
+   -h                   Show summary of options.
+   -r                   Recursively remove files in target before extracting.
+   -s source_dir        Look for source files relative to source_dir.
+   -t target_dir        Extract files relativ to target_dir.
+   -v                   Be verbose. Not yet used.
+
+Report bugs to <lange at informatik.uni-koeln.de>.
+EOF
+    exit 0
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+source=$FAI/files
+target=$FAI_ROOT
+deletefiles=0
+removedir=0
+tardone=0
+single=0
+
+while getopts 1hDdrvs:t:c: opt ; do
+        case "$opt" in
+        d) deletefiles=1 ;;
+        D) debug=1 ;;
+        r) removedir=1 ;;
+#        v) verbose=1 ;;
+        1) single=1 ;;
+        s) source=$OPTARG ;;
+        t) target=$OPTARG ;;
+        c) classes=$OPTARG ;;
+        h) usage ;;
+	esac
+done
+shift $(($OPTIND - 1))
+
+[ "$1" ] || usage
+[ -f $ENV{LOGDIR}/FAI_CLASSES ] && classes=$(< $ENV{LOGDIR}/FAI_CLASSES)
+# last class has highest priority
+
+# reverse order of classes
+for class in $classes; do
+    revclasses="$class $revclasses"
+done
+
+[ "$debug" ] && vflag="-v"
+[ "$debug" ] && echo "ftar: classes : $revclasses"
+[ -z "$source" ] && die "Source directory undefined."
+[ -z "$target" ] && die "Target directory undefined."
+
+# currently only one directory is used
+dir=$1
+fpath=$source/$dir
+[ -d $fpath ] || die "No directory $fpath"
+
+[ $deletefiles -eq 1 ] && cd $target/$dir && rm -f  .* * 2>/dev/null
+
+if [ $removedir -eq 1 ]; then
+    cd $target/$dir
+    if [ $PWD = "/" ]; then
+	echo "ftar WARNING: Will not do recursive removal of directory /"
+    else
+	rm -rf .* * 2>/dev/null
+    fi
+fi
+
+for c in $revclasses ; do
+    # what if a directory exists which is equal to the hostname or a classname?
+    # [ -f $fpath/$c ]          && extract $fpath/$c cat
+    [ -f $fpath/$c.tgz ]      && die "Suffix .tgz not supported. Use .tar.gz"
+    [ -f $fpath/$c.tar ]      && extract $fpath/$c.tar cat
+    [ -f $fpath/$c.tar.gz ]   && extract $fpath/$c.tar.gz zcat
+    [ -f $fpath/$c.tar.bz2 ]  && extract $fpath/$c.tar.bz2 bzcat
+done
+
+if [ $tardone -eq 0 ]; then
+    echo "ftar: No matching class found in $fpath"
+    exit 1
+else
+    exit 0
+fi
+


Property changes on: branches/lhm/bin/ftar
___________________________________________________________________
Added: svn:executable
   + 

Added: branches/lhm/bin/install_packages
===================================================================
--- branches/lhm/bin/install_packages	                        (rev 0)
+++ branches/lhm/bin/install_packages	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,515 @@
+#!/usr/bin/perl
+
+# $Id: install_packages 5213 2008-10-27 20:20:54Z lange $
+#*********************************************************************
+#
+# install_packages -- read package config and install packages via apt-get
+#
+# This script is part of FAI (Fully Automatic Installation)
+# (c) 2000-2008, Thomas Lange, lange at informatik.uni-koeln.de
+# (c) 2003-2004, Henning Glawe, glaweh at physik.fu-berlin.de
+# (c) 2004     , Jonas Hoffmann, jhoffman at physik.fu-berlin.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 4.1.6, 27-oct-2008";
+$0=~ s#.+/##; # remove path from program name
+
+# import variables: $verbose, $MAXPACKAGES, $classes, $FAI, $FAI_ROOT
+
+use strict;
+use Getopt::Std;
+
+# global variables
+our ($opt_d,$opt_l,$opt_L,$opt_v,$opt_h,$opt_H,$opt_m,$opt_n,$opt_N,$opt_p);
+my $listonly; # flag, that indicates that only a list of packages will be printed
+our @commands;
+our %command;
+our $atype;    # type of action (for apt-get, aptitude,..) that will be performed
+my $dryrun=0;
+my $verbose;
+my $FAI_ROOT;
+my @classes;
+my $classpath;
+my $rootcmd;
+my @preloadlist;
+my @preloadrmlist;
+my $_config;
+my $_system;
+my $hasdebian=0;  # some Debian related commands/types are used in package_config
+my %list;   # hash of arrays, key=type (yumi,aptitude,..), list of packages
+my %types;  # hash containing the types found in all loaded package_config files
+my %classisdef;
+my $maxpl;  # maximum length of package list
+my $cache;  # instance of AptPkg::Cache
+my @unknown; # unknown packages
+my @known;   # list of all known packages
+my $execerrors; # counts execution errors
+my $downloaddir="/var/cache/apt/archives/partial/"; # where to download packages that gets only unpacked
+
+# PRELOAD feature from Thomas Gebhardt  <gebhardt at hrz.uni-marburg.de>
+
+$| = 1;
+# order of commands to execute
+
+my $aptopt='-y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confnew"';
+ at commands = qw/y2i y2r yast rpmr urpmi urpme yumgroup yumi yumr smarti smartr hold taskrm taskinst clean-internal aptitude aptitude-r install unpack remove dselect-upgrade/;
+%command = (
+          "install" => "apt-get $aptopt --fix-missing install",
+    "inst-internal" => "apt-get $aptopt --fix-missing -s install",
+	   "remove" => "apt-get $aptopt --purge remove",
+  "dselect-upgrade" => "apt-get $aptopt dselect-upgrade",
+         "taskinst" => "tasksel install",
+           "taskrm" => "tasksel remove",
+             "hold" => "dpkg --set-selections",
+   "clean-internal" => "apt-get clean",
+         "aptitude" => "aptitude -R $aptopt install",
+       "aptitude-r" => "aptitude -r $aptopt install",
+           "unpack" => "cd $downloaddir; aptitude download",
+  "unpack-internal" => "dpkg --unpack --recursive $downloaddir; rm $downloaddir/*.deb",
+ "pending-internal" => "dpkg --configure --pending",
+   "dpkgc-internal" => "dpkg -C",
+	    "urpmi" => "urpmi --auto --foce --allow-force --keep",
+	    "urpme" => "urpme --auto --foce --allow-force --keep",
+	     "yumi" => "yum -y install",
+	     "yumr" => "yum -y remove",
+        "yumgroup"  => "yum -y groupinstall",
+	     "y2i"  => "y2pmsh isc",
+	     "y2r"  => "y2pmsh remove",
+	     "yast" => "yast -i",
+	     "rpmr" => "rpm -e",
+             smarti => "smart install -y",
+             smartr => "smart remove -y",
+  "smartc-internal" => "smart clean",
+);
+
+getopts('dhHvlLm:p:nN');
+
+my $use_aptpkg=0;
+$opt_N || check_aptpkg(); # do not use AptPkg when -N is given
+
+$listonly = $opt_l || $opt_L;
+$opt_h && usage();
+$opt_H && showcommands();
+$dryrun=1 if $opt_n;
+$verbose=$ENV{verbose} || $opt_v;
+$opt_d && setdownloadonly();
+$maxpl=$ENV{MAXPACKAGES} || $opt_m ;
+$maxpl && $verbose && warn "Maxmimum number of packages installed at a time set to $maxpl\n";
+$maxpl or $maxpl = 99 ; # set default value
+
+my $qopt="-qq" unless $verbose;
+my $devnull=">/dev/null" unless $verbose;
+
+$FAI_ROOT = $ENV{FAI_ROOT};
+$classpath = $opt_p || "$ENV{FAI}/package_config";
+$rootcmd = ($FAI_ROOT eq "/" ) ? '' : "chroot $FAI_ROOT";
+ at classes = grep { !/^#|^\s*$/ } split(/[\s\n]+/,$ENV{classes});
+foreach (@classes) { $classisdef{$_}=1;}
+
+# do not use AptPkg if target is not a Debian system
+if ($use_aptpkg) {
+  $_config->init;                 # initialize AptPkg
+  $_config->set("Dir",$FAI_ROOT); # simulate "chroot"
+  $_config->{quiet}=2;            # don't show cache initialization messages
+  $_system = $_config->system;
+  $cache = new AptPkg::Cache;
+}
+
+warn "$0: reading config files from directory $classpath\n";
+# read all package config files
+foreach (@classes) {
+  &readconfig($classpath,$_) if -f "$classpath/$_";
+}
+
+# check if any Debian related commands/types are used in package_config
+my @debiantypes= qw/taskinst aptitude aptitude-r install remove dselect-upgrade smarti/;
+foreach my $dt (@debiantypes) {
+  $types{$dt} and $hasdebian=1;
+  if ($types{$dt} eq 'smarti') {
+    $command{'clean-internal'} = $command{'smartc-internal'};
+    $command{'pending-internal'} = "true";
+    $command{'dpkgc-internal'} = "true";
+  }
+}
+
+# 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;
+    execute("cp $FAI_ROOT/$file $FAI_ROOT/$directory") unless $listonly;
+  } else {
+    execute("wget -nv -P$FAI_ROOT/$directory $url") unless $listonly;
+  }
+}
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# begin of the big foreach loop
+# - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# call apt-get or tasksel for each type of command whith the list of packages
+foreach $atype (@commands) {
+
+  if ($atype eq "clean-internal" && $hasdebian) {
+    execute("$rootcmd $command{'clean-internal'}") unless $listonly;
+    next;
+  }
+
+  # skip if empty list
+  next unless defined $list{$atype};
+
+  if ($atype eq "dselect-upgrade") {
+    dselectupgrade($atype);
+    next;
+  }
+
+  my $packlist = join(' ',@{$list{$atype}});
+
+  if ($atype eq "hold") {
+    my $hold = join " hold\n", @{$list{hold}}, " hold\n";
+    execute("echo \"$hold\" | $rootcmd $command{hold}");
+    next;
+  }
+
+  if ($atype eq "install" || $atype eq "smarti" || $atype eq "aptitude" || $atype eq "unpack" || $opt_l || $opt_L) {
+
+    mkpackagelist(@{$list{$atype}}); # create lists of known and unknown packages
+    if ($opt_l) {
+      # only print the package list
+      print join ' ', at known,"\n";
+      exit 0;
+    }
+    if ($opt_L) {
+      # only print the package list
+      execute("$rootcmd $command{'inst-internal'} @known | egrep ^Inst");
+      exit 0;
+    }
+    # pass only maxpl packages to apt-get
+    while (@known) {
+      my $shortlist = join(' ', splice @known,0,$maxpl);
+      # print "SL $shortlist\n";
+      execute("$rootcmd $command{$atype} $shortlist") if $shortlist;
+      execute("$rootcmd $command{'clean-internal'}") if $hasdebian;
+      execute("$rootcmd $command{'unpack-internal'}") if ($atype eq "unpack"); # unpack and rm deb files
+    }
+    next;
+  }
+
+  if ($atype eq "taskinst" || $atype eq "taskrm") {
+    foreach my $tsk (@{$list{$atype}}) {
+      execute("$rootcmd $command{$atype} $tsk");
+    }
+    next;
+  }
+
+  # other types
+  execute("$rootcmd $command{$atype} $packlist") if $packlist;
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# end of the big foreach loop
+# - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+# 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";
+}
+
+if ($hasdebian) {
+  # in case of unconfigured packages because of apt errors
+  # retry configuration
+  execute("$rootcmd $command{'pending-internal'}");
+  # check if all went right
+  execute("$rootcmd $command{'dpkgc-internal'}");
+  # clean apt cache
+  execute("$rootcmd $command{'clean-internal'}");
+}
+
+if ($execerrors) {
+  warn "$execerrors errors during executing of commands\n";
+  exit 3;
+}
+
+exit 0; # end of program
+# - - - - - - - - - - - - - - - - - - - - - - - - - - -
+sub readconfig {
+
+  my ($path,$file) = @_;
+  my ($package,$type,$cllist, at oclasses,$doit);
+
+  open (FILE,"$path/$file") || warn "ERROR $0: Can't read config file: $path/$file\n";
+  warn "$0: read config file $file\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,$');
+      warn "WARNING: Unknow action $type after PACKAGES\n." unless defined $command{$type};
+      # 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;
+    }
+
+    # warning if uppercase letters are found (package are always lowercase)
+    warn "WARNING: Uppercase character found in package name in line $_\n" if $_ =~ /[A-Z]/;
+    warn "ERROR: PACKAGES .. line missing in $file\n",next unless $type;
+    push @{$list{$type}}, split if $doit;
+    $types{$type}=1 if $doit;   # remember which types are used in package_config
+  }
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - -
+sub execute {
+
+  # execute a command or only print it
+  my @cmds = @_;
+
+  # TODO: split cmds into array except when a pipe is found
+
+  my $command = join (' ', at cmds);
+  my $error;
+
+  $dryrun and $verbose = 1;
+  $verbose and warn "$0: executing $command\n";
+  $dryrun and return;
+
+  # @cmds should me more efficient
+  $error = system @cmds;
+  warn "ERROR: $error $?\n" if $error;
+  my $rc = $?>>8;
+  warn "ERROR: $cmds[0] return code $rc\n" if $rc;
+  $execerrors++ if $rc;
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - -
+sub dselectupgrade {
+
+  my $type = shift;
+  my ($package,$action,$list);
+  my $tempfile = "$FAI_ROOT/tmp/dpkg-selections.tmp"; # TODO: use better uniq filename
+  while (@{$list{$type}}) {
+    $package = shift @{$list{$type}};
+    $action  = shift @{$list{$type}};
+    $list .= "$package $action\n";
+  }
+
+  open TMP,"> $tempfile" || die " Can't write to $tempfile";
+  print TMP $list;
+  close TMP;
+
+  execute("$rootcmd dpkg --set-selections < $tempfile");
+  execute("$rootcmd $command{$type}");
+  unlink $tempfile;
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - -
+sub installable {
+
+  # ckeck, wether package can be installed.
+  # return false for packages which only exist in
+  # dpkg status files
+
+  my $package  = shift;
+  # print "Checking wether $package is installable...\n";
+
+  # version list of package
+  my $vlist = $cache->{$package}{VersionList};
+
+  # for each version
+  foreach my $version (@$vlist) {
+    # list of package files
+    my $flist = $version->{FileList};
+    foreach my $fitem (@$flist) {
+      # if the file is a package index (not a dpkg status file)
+      # the package is installable
+      return 1 if ($fitem->{File}{IndexType} eq "Debian Package Index");
+    }
+  }
+
+  # no package index file found for the current package
+  return 0;
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - -
+sub mkpackagelist {
+
+  my @complete = @_; # copy original list
+  my @orig = ();
+  @unknown = @known = ();
+  my %complete = ();
+
+  # create two list of packages
+  # @unknown contains the unknown packages
+  # @known contains the known packages
+
+  # nothing to do, when no Debian types/commands are used at all
+  unless ($hasdebian) {
+    @known = @complete;
+    return;
+  }
+
+  # no package name checking when using smart
+  if ($atype eq "smarti" || $atype eq "smartr") {
+    @known=@complete;
+    return;
+  }
+
+  # ignore packages ending with - when using -d
+  @complete = grep {!/-$/} @complete if $opt_d;
+
+  foreach (reverse @complete) {
+    my $pack = $_;
+    if ( /^(.+)[_=+-]$/ and $1 and $cache->exists($1)) {
+      $pack = $1;
+    }
+    if (! defined ($complete{$pack})) {
+      $complete{$pack} = 1;
+      unshift @orig, $_;
+    }
+  }
+
+  # currently we disable the complete checking of package names if aptitude
+  # is used. This is because we can't check task names, which are supported by aptitude
+  if ($atype eq "aptitude") {
+    @known=@orig;
+    return;
+  }
+
+  foreach my $pack (@orig) {
+
+#     if ($atype eq "aptitude" && $pack =~ /^~/) {
+#       # add to known if is it an aptitude search pattern
+#       push @known, $pack;
+#       next;
+#     }
+# TODO: aptitude also can install tasks. How do we check them? Currently they will push to @unknown
+
+    if ($cache->exists($pack)) { # simple package name
+      # check for packages with no installation candidates
+      # explicitely don't check if the name is provided by some other package:
+      # apt-get install <virtual> fails with newer apt
+
+      if (installable($pack)) {
+	push @known, $pack;
+      } else {
+	push @unknown, $pack;
+      }
+
+    }
+
+    # simulate APTs and aptitudes understanding of "special" package names
+    # suffixed by -, +
+    elsif ( $pack =~ /^(.+)[_=+-]$/ and $cache->exists($1)) {
+
+      if (defined ($cache->{$1}{VersionList})) {
+	push @known, $pack;
+      } else {
+	push @unknown, $pack;
+      }
+
+    } else {
+      push @unknown, $pack;
+    }
+  }
+  warn "WARNING: These unknown packages are removed from the installation list: " . join(' ',sort @unknown) . "\n" if @unknown;
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - -
+sub usage {
+
+  print << "EOF";
+install_packages $version
+
+ Please read the manual pages install_packages(8).
+EOF
+  exit 0;
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - -
+sub setdownloadonly {
+
+# Definitions for install_packages(8) for download only mode
+# Used by fai-mirror(1)
+
+# we are using a variable from %ENV
+# for debugging remove >/dev/null and -q
+
+undef @commands;
+undef %command;
+
+$maxpl=9999;
+ at commands = qw/taskinst aptitude aptitude-r install unpack/;
+%command = (
+	  "install" => "apt-get $qopt -d $ENV{aptoptions} -y --fix-missing install",
+         "taskinst" => "aptitude -d $ENV{aptoptions} -y install $devnull",
+         "aptitude" => "aptitude -R -d $ENV{aptoptions} -y install $devnull",
+       "aptitude-r" => "aptitude -r -d $ENV{aptoptions} -y install $devnull",
+           "unpack" => "cd $downloaddir; aptitude download",
+   "clean-internal" => 'true',
+ "pending-internal" => 'true',
+   "dpkgc-internal" => 'true',
+);
+
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - -
+sub check_aptpkg {
+
+  # check if the Perl module is available
+  if (eval "require AptPkg::Config") {
+    $use_aptpkg=1;
+    eval "require AptPkg::System";
+    eval "require AptPkg::Cache";
+
+    $_config = $AptPkg::Config::_config;
+    $_system = $AptPkg::System::_system;
+    eval 'import AptPkg::Config $_config';
+    eval 'import AptPkg::System $_system';
+    eval 'import AptPkg::Cache';
+  }
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - -
+sub showcommands {
+
+  # show all available commands
+  print "List of known commands for package_config files\n";
+  print "Short list:\n";
+  foreach (sort keys %command) {
+    next if /-internal/; # skip internal commands
+    print "$_\n";
+  }
+
+  print "\nLong list:\n";
+  foreach (sort keys %command) {
+    next if /-internal/; # skip internal commands
+    printf "%15s    $command{$_}\n",$_;
+  }
+  exit 0;
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - -


Property changes on: branches/lhm/bin/install_packages
___________________________________________________________________
Added: svn:executable
   + 

Added: branches/lhm/bin/make-fai-nfsroot
===================================================================
--- branches/lhm/bin/make-fai-nfsroot	                        (rev 0)
+++ branches/lhm/bin/make-fai-nfsroot	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,599 @@
+#! /bin/bash
+
+# $Id: make-fai-nfsroot 5187 2008-10-14 13:11:02Z lange $
+#*********************************************************************
+#
+# make-fai-nfsroot -- create nfsroot directory and add additional packages
+#
+# This script is part of FAI (Fully Automatic Installation)
+# (c) 2000-2008 by Thomas Lange, lange at informatik.uni-koeln.de
+# Universitaet zu Koeln
+# (c) 2004      by Henning Glawe, glaweh at physik.fu-berlin.de
+# Freie Universitaet Berlin
+#
+#*********************************************************************
+# 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.
+# 
+# A copy of the GNU General Public License is available as
+# `/usr/share/common-licences/GPL' in the Debian GNU/Linux distribution
+# or on the World Wide Web at http://www.gnu.org/copyleft/gpl.html.  You
+# can also obtain it by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#*********************************************************************
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+usage() {
+
+    cat <<-EOF
+	Copyright (C) 1999-2008 Thomas Lange
+	Report bugs to <fai at informatik.uni-koeln.de>.
+
+	Usage: make-fai-nfsroot [OPTIONS]
+  Create an NFSROOT for FAI.
+	Read the man pages pages make-fai-nfsroot(8).
+EOF
+    exit 0
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+die() {
+
+    echo "ERROR: $@"
+    echo "Log file written to /var/log/fai/make-fai-nfsroot.log"
+    exit 99
+}
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+check_nfsroot() {
+
+    set +e
+    # simple test, to see if important thing are available inside the nfsroot
+#    [ -d $NFSROOT/usr/share/live-initramfs ] || die "live-initramfs was not installed inside the nfsroot."
+    local files=$(ls $NFSROOT/boot/initrd* 2>/dev/null)
+    [ -z "$files" ] && die "No initrd installed."
+    egrep -q "^ERROR: " /var/log/fai/make-fai-nfsroot.log && bad_exit
+    return 0
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+badupdateto32() {
+
+    cat <<-EOF
+        It seems that you have updated an older FAI version without checking files in /etc/fai/
+        Please check the NEWS file for changes in variable names and if you have a linux-image package
+        defined in /etc/fai/NFSROOT.
+EOF
+    die $@
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+PATH=/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin
+
+merror="properly"
+sshpreserve=0
+symlink=0
+nfs_subdir="/live/filesystem.dir"
+divert=1
+
+if [ -f /etc/lsb-release ]; then
+    . /etc/lsb-release
+    case "$DISTRIB_ID" in
+	Ubuntu) divert=0 ;;
+    esac
+fi
+
+# option e currently does nothing
+while getopts hervC:f:kKpUSD opt ; do
+    case "$opt" in
+        C) cfdir=$OPTARG ;;
+        v) verbose=1 ; v=-v ;;
+        r) recover=1 ;;
+        f) die "Option -f is not supported any more. Use option -C instead" ;;
+        k) kinstall=1 ;;
+        K) kremove=1;;
+        h) usage ;;
+        e) expert=1 ;; # a dummy option, that only fai-setup uses
+        p) sshpreserve=1 ;;
+        U) divert=0 ;;
+        S) symlink=1 ;;
+        D) nfs_subdir=$OPTARG ;;
+        ?) exit 5 ;; # error in option parsing
+    esac
+done
+
+if [ $(id -u) != "0" ]; then
+    echo "Run this program as root."
+    exit 9
+fi
+
+set -e
+
+# use FAI_ETC_DIR from environment variable
+if [ -n "$FAI_ETC_DIR" -a -z "$cfdir" ]; then
+    echo "Using environment variable \$FAI_ETC_DIR."
+fi
+[ -z "$cfdir" ] && cfdir=${FAI_ETC_DIR:=/etc/fai}
+cfdir=$(readlink -f $cfdir) # canonicalize path
+if [ ! -d "$cfdir" ]; then
+    echo "$cfdir is not a directory"
+    exit 6
+fi
+[ "$verbose" ] && echo "Using configuration files from $cfdir"
+. $cfdir/fai.conf
+
+# read config file for this tool
+if [ -f "$cfdir/make-fai-nfsroot.conf" ]; then
+    . $cfdir/make-fai-nfsroot.conf
+else
+    echo "Can't read $cfdir/make-fai-nfsroot.conf"
+    exit 8
+fi
+
+# IMO this may be removed, since all information should be included into sources.list
+[ -n "$FAI_LOCAL_REPOSITORY" ] && die "The use of \$FAI_LOCAL_REPOSITORY is now deprecated. Please include this information into sources.list." 
+[ -n "$packages" ] && badupdateto32 "The use of \$packages in make-fai-nfsroot.conf is now deprecated. Please include this information into $cfdir/NFSROOT."
+[ -n "$NFSROOT_PACKAGES" ] && die "The use of \$NFSROOT_PACKAGES in make-fai-nfsroot.conf is now deprecated. Please include this information into $cfdir/NFSROOT."
+[ -n "$FAI_SOURCES_LIST" ] && die "The use of \$FAI_SOURCES_LIST is deprecated. Please use sources.list now."
+
+[ -z "$NFSROOT" ] && die "\$NFSROOT is not set. Please check your settings in $cfdir/fai.conf."
+[ -z "$TFTPROOT" ] && badupdateto32 "\$TFTPROOT is not set. Please check your settings in $cfdir/make-fai-nfsroot.conf."
+[ -n "$KERNELPACKAGE" ] && badupdateto32 "The use of \$KERNELPACKAGE is deprecated. Please use $cfdir/NFSROOT now."
+[ ! -d "$cfdir/apt" ] && die "$cfdir/apt/ does not exists. Can't continue."
+
+oldnfsroot=$NFSROOT
+NFSROOT="${NFSROOT}${nfs_subdir}"
+ROOTCMD="chroot $NFSROOT"
+
+RUNDIR=/var/run/fai/make-fai-nfsroot
+mkdir -p $RUNDIR
+export DEBIAN_FRONTEND=noninteractive
+[ "$recover" ] || rm -rf $RUNDIR/*
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+bad_exit() {
+
+    merror="with errors"
+    echo "An error occured during make-fai-nfsroot."
+    echo "Please fix the error or try make-fai-nfsroot -v"
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+call_with_stamp() {
+
+    local func=$1
+    local stamp=$RUNDIR/$func
+    # call subroutine
+    [ "$recover" -a -f $stamp ] && return 0 
+    # make a stamp only on success.
+    "$@" && : > $stamp
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+call_verbose() {
+
+    if [ "$verbose" ]; then
+        "$@"
+	return $?
+    else
+	"$@" > /dev/null
+	return $?
+    fi
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+install_kernel_nfsroot() {
+
+    if [ $divert = 1 ]; then
+	rm $NFSROOT/usr/sbin/update-initramfs
+	LC_ALL=C $ROOTCMD dpkg-divert --rename --remove /usr/sbin/update-initramfs
+	$ROOTCMD update-initramfs -k all -t -u
+    fi
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+setup_ssh() {
+
+    # nothing to do if no ssh is available in nfsroot
+    [ -f $NFSROOT/usr/bin/ssh ] || return 0
+    if [ $sshpreserve = 1 ]; then
+	tar -C $NFSROOT -xf $tmptar
+	rm $tmptar
+	return 0
+    fi
+
+    mkdir -p -m 700 $NFSROOT/root/.ssh
+    if [ -n "$LOGUSER" ] ; then
+        loguserhome=$(eval "cd ~$LOGUSER 2>/dev/null && pwd;true")
+        [ -f $loguserhome/.ssh/known_hosts ] && cp $loguserhome/.ssh/known_hosts $NFSROOT/root/.ssh/known_hosts
+        [ -d $loguserhome/.ssh ] && {
+	    [ -f $loguserhome/.ssh/id_dsa ] &&
+	       cp -p $loguserhome/.ssh/id_dsa* $NFSROOT/root/.ssh/
+	    [ -f $loguserhome/.ssh/id_rsa ] &&
+	       cp -p $loguserhome/.ssh/id_rsa* $NFSROOT/root/.ssh/
+	}
+    fi
+
+    # enable root login
+    perl -pi -e 's/PermitRootLogin no/PermitRootLogin yes/' $NFSROOT/etc/ssh/sshd_config
+    if [ -f "$SSH_IDENTITY" ]; then
+        cp $SSH_IDENTITY $NFSROOT/root/.ssh/authorized_keys
+	chmod 0644 $NFSROOT/root/.ssh/authorized_keys
+        echo You can log into install clients without password using $SSH_IDENTITY
+    fi
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+copy_fai_files() {
+
+    # copy to nfsroot
+    echo "root:$FAI_ROOTPW" | $ROOTCMD chpasswd --encrypted
+    cp -Rpv $cfdir/* $NFSROOT/etc/fai
+    # append additional variables to fai.conf for the install clients
+    [ -z "$FAI_CONFIG_SRC" ] && echo "FAI_CONFIG_SRC=nfs://`hostname`$FAI_CONFIGDIR" >> $NFSROOT/etc/fai/fai.conf
+
+    # remove some files that should not be copied
+    rm -f $NFSROOT/etc/fai/make-fai-nfsroot.conf
+    [ -f $cfdir/.cvspass ] && cp -p $v $cfdir/.cvspass $NFSROOT/.cvspass
+    $ROOTCMD shadowconfig on
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+call_debootstrap() {
+    
+    # check if NFSROOT directory is mounted with bad options
+    fs=$(df $NFSROOT | tail -1 | awk '{print $6}')
+    if mount | grep "on $fs " |  awk '{print $6}' | egrep -q "nosuid|nodev"; then
+        die "NFSROOT directory $NFSROOT is mounted using nosuid or nodev. Aborting"
+    fi
+    local dversion=$(dpkg -l debootstrap | awk '/debootstrap/ {print $3}')
+    echo "Creating base system using debootstrap version $dversion"
+    echo "Calling debootstrap $1 $NFSROOT $2 $3"
+    yes '' | LC_ALL=C call_verbose debootstrap $FAI_DEBOOTSTRAP_OPTS $1 $NFSROOT $2 $3
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+add_all_host_entries() {
+
+    local ips=$(ifconfig | grep -w inet | cut -d : -f 2 | cut -d ' ' -f 1 | grep -v 127.0.0.1)
+    for eth in $ips; do
+	getent hosts $eth >> etc/hosts || true
+    done
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+create_base() {
+
+    if [ "$FAI_DEBOOTSTRAP" ]; then
+        call_with_stamp call_debootstrap $FAI_DEBOOTSTRAP
+        $ROOTCMD apt-get clean
+	rm -f $NFSROOT/etc/resolv.conf
+        echo "Creating base.tgz"
+        tar --one-file-system -C $NFSROOT -cf - --exclude var/tmp/base.tgz --exclude 'var/lib/apt/lists/*_*' . | gzip > $NFSROOT/var/tmp/base.tgz
+	touch $NFSROOT/.THIS_IS_THE_FAI_NFSROOT
+    else
+	die "\$FAI_DEBOOTSTRAP not defined."
+    fi
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+create_nfsroot() {
+
+    mkdir -p $NFSROOT/$FAI
+    cd $NFSROOT || die "Can't cd to $NFSROOT"
+
+    call_with_stamp create_base
+    # save the list of all packages in the base.tgz
+    $ROOTCMD dpkg --get-selections | egrep 'install$' | awk '{print $1}' > var/tmp/base-pkgs.lis
+
+    if [ "$FAI_DEBMIRROR" ]; then
+	[ "$verbose" ] && echo "Mounting $FAI_DEBMIRROR to $NFSROOT/$MNTPOINT."
+        mkdir -p $NFSROOT/$MNTPOINT
+        mount -o ro,noatime,rsize=8192 $FAI_DEBMIRROR $NFSROOT/$MNTPOINT || \
+                die "Can't mount $FAI_DEBMIRROR to $NFSROOT/$MNTPOINT."
+        fi
+
+    # hoaks some packages
+    # liloconfig, dump and raidtool2 needs these files
+    echo "# UNCONFIGURED FSTAB FOR BASE SYSTEM" > etc/fstab
+    > etc/raidtab
+    echo 'NTPSERVERS=""' > etc/default/ntp-servers
+
+    cp -a $cfdir/apt $NFSROOT/etc
+
+    ainsl -as $NFSROOT/etc/hosts "127.0.0.1 localhost"
+    ainsl     $NFSROOT/etc/hosts "$NFSROOT_ETC_HOSTS"
+    add_all_host_entries
+
+    # we need these option before installing the first package. So we
+    # can't put this into fai-nfsroot /etc/apt/apt.conf.d/90fai
+    cat <<EOF >$NFSROOT/etc/apt/apt.conf.d/10fai
+APT::Get::AllowUnauthenticated "true";
+Aptitude::CmdLine::Ignore-Trust-Violations yes;
+EOF
+    echo "Upgrading $NFSROOT"
+    LC_ALL=C call_verbose call_with_stamp upgrade_nfsroot  
+
+    # overwrite default live.conf
+    if [ -f $cfdir/live.conf ]; then
+	cp -p $cfdir/live.conf etc/live.conf
+    else
+	cat > etc/live.conf <<EOF
+# UNIONTYPE=aufs # if unionfs is broken
+NOUSER="Yes"
+NOHOSTS="Yes"
+export UNIONTYPE NOHOSTS NOUSER
+EOF
+    fi
+
+    LC_ALL=C call_with_stamp add_packages_nfsroot
+    call_with_stamp copy_fai_files
+
+    # set timezone in nfsroot
+    timezone=$(readlink /etc/localtime | sed 's%^/usr/share/zoneinfo/%%')
+    echo $timezone > etc/timezone 
+    rm -f etc/localtime && ln -sf /usr/share/zoneinfo/$timezone etc/localtime
+
+    rm etc/mtab && ln -s /proc/mounts etc/mtab
+    ln -s /usr/sbin/fai etc/init.d/rcS
+
+    # definition for loopback device
+    echo "iface lo inet loopback" > etc/network/interfaces
+
+    cat >> root/.profile <<-EOF
+        PATH=/usr/local/sbin:/usr/local/bin:/usr/lib/fai:/bin:/sbin:/usr/bin:/usr/sbin:
+        export PATH
+	. /usr/lib/fai/subroutines
+	. /usr/lib/fai/subroutines-linux
+	set -a
+        . /tmp/fai/variables.log 2>/dev/null
+EOF
+
+    call_verbose call_with_stamp setup_ssh
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+upgrade_nfsroot() {
+
+    if [ -f /etc/resolv.conf ]; then
+	cp -p $v /etc/resolv.conf $NFSROOT/etc/resolv.conf-installserver
+	cp -p $v /etc/resolv.conf $NFSROOT/etc/resolv.conf # this is needed during make-fai-nfsroot
+    fi
+    mount -t proc /proc $NFSROOT/proc
+    mount -t devpts devpts $NFSROOT/dev/pts
+    $ROOTCMD apt-get update
+    $ROOTCMD aptitude -Rfy install fai-nfsroot
+    $ROOTCMD apt-get check
+    rm -rf $NFSROOT/etc/apm
+
+    if [ $divert = 1 ]; then
+	fdivert /usr/sbin/update-initramfs
+	ln -s /bin/true $NFSROOT/usr/sbin/update-initramfs
+    fi
+    fdivert /sbin/start-stop-daemon /sbin/discover-modprobe
+    cp -p /sbin/fai-start-stop-daemon $NFSROOT/sbin
+    cp -p /sbin/fai-start-stop-daemon $NFSROOT/sbin/start-stop-daemon
+    $ROOTCMD apt-get -y dist-upgrade
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+add_packages_nfsroot() {
+
+    local iarch=$($ROOTCMD dpkg --print-installation-architecture|tr /a-z/ /A-Z/)
+    export FAI_ROOT=$NFSROOT
+    export classes="NFSROOT $iarch"
+cat > $NFSROOT/etc/kernel-img.conf << EOF
+do_bootloader = No
+do_initrd = No
+warn_initrd = No
+EOF
+    install_packages -l -p$cfdir > $NFSROOT/var/tmp/packages.nfsroot
+    echo "Adding additional packages to $NFSROOT:"
+    cat $NFSROOT/var/tmp/packages.nfsroot
+    call_verbose install_packages $v -p$cfdir
+    echo "install_packages exit code: $?"
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+umount_dirs() {
+
+    [ -f $NFSROOT/usr/sbin/dpkg-divert ] && 
+       LC_ALL=C $ROOTCMD dpkg-divert --rename --remove /sbin/discover-modprobe
+    cd /
+    [ -d $NFSROOT/proc/self ] && umount $NFSROOT/proc 
+    [ -d $NFSROOT/proc/self ] && die "/proc still mounted inside the nfsroot."
+    umount $NFSROOT/dev/pts 2> /dev/null || true
+
+    if [ "$FAI_DEBMIRROR" ]; then
+        test -d $NFSROOT/$MNTPOINT && umount $NFSROOT/$MNTPOINT || true
+    fi
+    # show directories still mounted on nfsroot
+    mount | grep " on $NFSROOT " || true
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+symlink_kernels() {
+    local KVER=""
+    local NKVER
+    local kfile=${1}
+
+    echo "Creating kernel and initrd symlinks"
+
+    # cleanup pending symlinks in TFTPROOT
+    for file in `ls -1 $TFTPROOT/*`; do
+        if [ -h "$file" -a ! -e "$file" ]; then
+            rm -f "$file"
+        fi
+    done
+
+    # symlink kernels
+    echo -n "Kernels:"
+    for KERN in `ls -1 $NFSROOT/boot/$kfile-*`; do
+        ln -sf $KERN $TFTPROOT
+        NKVER=$(basename ${KERN})
+        NKVER=${NKVER#vmlinu?-}
+        echo -n " $NKVER"
+        if [ "x" != "x$KVER" ]; then
+            dpkg --compare-versions $NKVER gt $KVER
+            if [ $? -eq 0 ]; then
+                KVER=$NKVER
+            fi
+        else
+            KVER=$NKVER
+        fi
+
+        INITRD="$(dirname ${KERN})/initrd.img-$NKVER"
+        if [ -e "$INITRD" ]; then
+            ln -sf $INITRD $TFTPROOT
+        fi
+    done
+    echo
+
+    # create default links
+    rm -f $TFTPROOT/$kfile-install
+    rm -f $TFTPROOT/initrd.img-install
+
+    if [ -e "$TFTPROOT/$kfile-$KVER" ]; then
+        echo "Linking default kernel: $KVER"
+
+        # default kernel
+        ln -sf $kfile-$KVER $TFTPROOT/$kfile-install
+
+        if [ -e "$TFTPROOT/initrd.img-$KVER" ]; then
+            # default initrd
+            ln -s initrd.img-$KVER $TFTPROOT/initrd.img-install
+        fi
+    else
+        echo "Warning - no kernel found!"
+    fi
+}
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+setup_dhcp(){
+
+    # pxe and dhcp environment
+    local pxebin=/usr/lib/syslinux/pxelinux.0
+    local kfile=`basename $(ls -1 $NFSROOT/boot/vmlinu?-* | head -n 1)`
+    kfile=${kfile%%-*}
+
+    rm -f $NFSROOT/boot/*.bak
+    mkdir -p $TFTPROOT/pxelinux.cfg
+    if [ 1 -eq $symlink ]; then
+        symlink_kernels "${kfile}"
+    else
+        cp -pv $NFSROOT/boot/${kfile}-* $NFSROOT/boot/initrd.img-* $TFTPROOT
+    fi
+    [ -f $pxebin ] && cp $pxebin $TFTPROOT
+    echo "DHCP environment prepared. If you want to use it, you have to enable the dhcpd and the tftp-hpa daemon."
+}
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+fdivert() {
+
+    local item
+    for item in "$@"; do
+	LC_ALL=C $ROOTCMD dpkg-divert --quiet --add --rename $item
+    done
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+kernel_install() {
+
+# Install the kernel package
+
+    # create tftp boot images
+    call_with_stamp install_kernel_nfsroot
+
+    # setup for DHCP, BOOTP or both
+    [ "x$FAI_BOOT" = "x" ] && FAI_BOOT="dhcp"
+    
+    for bootopt in $FAI_BOOT; do
+    	case $bootopt in
+    		dhcp|DHCP)      
+			call_with_stamp setup_dhcp ;;
+    		bootp|BOOTP)      
+			echo "You have to setup BOOTP support manually." ;;
+		*)
+			echo "Unknown boot option" ;;
+    	esac
+    done
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+run_hooks() {
+
+    local file
+    if [ -z "$NFSROOT_HOOKS" ]; then
+	return
+    fi
+    if [ -d "$NFSROOT_HOOKS"  ]; then
+        echo "Running hooks..."
+        for file in $(ls $NFSROOT_HOOKS/* 2>/dev/null); do
+            . $file
+        done
+    fi
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - -
+# main routine
+
+trap 'echo "Aborting";umount_dirs' EXIT
+trap "bad_exit" ERR
+{
+
+# remove all kernels from nfsroot
+[ -n "$kremove" ] && {
+    echo "Removing all kernels from NFSROOT."
+    $ROOTCMD aptitude -y purge ~nlinux-image
+    exit
+}
+
+# just install a new kernel to the nfsroot
+[ -n "$kinstall" ] && {
+    trap "true" EXIT
+    echo "Installing new kernel into the nfsroot."
+    if [ $divert = 1 ]; then
+	fdivert /usr/sbin/update-initramfs
+	ln -s /bin/true $NFSROOT/usr/sbin/fai
+    fi
+    mount -t proc /proc $NFSROOT/proc
+    LC_ALL=C add_packages_nfsroot
+    run_hooks
+    kernel_install
+    umount_dirs
+    trap "true" EXIT
+    echo "make-fai-nfsroot finished $merror."
+    exit 0
+}
+
+echo "Creating FAI nfsroot in $NFSROOT."
+echo "By default it needs more than 390 MBytes disk space."
+echo "This may take a long time."
+
+if [ $sshpreserve = 1 ]; then
+    # save old .ssh directory
+    tmptar=$(mktemp) || exit 12
+    # should we set the umask before? Does it influence the other parts?
+    tar -C $NFSROOT -cvf $tmptar root/.ssh
+fi
+
+# Kill the directory if not in recover mode
+if [ -d $NFSROOT/proc -a ! "$recover" ]
+then
+    echo $NFSROOT already exists. Removing $NFSROOT
+    umount $NFSROOT/dev/pts 1>/dev/null 2>&1 || true
+    [ -L $NFSROOT/proc/self ] && umount $NFSROOT/proc || true
+    [ -L $NFSROOT/proc/self ] && die "/proc is still mounted inside the nfsroot."
+    rm -rf $oldnfsroot/.??* $oldnfsroot/*
+    # also remove files $NFSROOT/.? but not . and ..
+    find $oldnfsroot -xdev -maxdepth 1 ! -type d | xargs -r rm -f
+fi
+
+# Create a new nfsroot
+if [ ! -x "$(which debootstrap)" ]; then
+    die "Can't find debootstrap command. Aborting."
+fi
+call_with_stamp create_nfsroot
+
+run_hooks
+kernel_install
+
+check_nfsroot
+umount_dirs
+echo "make-fai-nfsroot finished $merror."
+exit 0
+} 2>&1 | tee /var/log/fai/make-fai-nfsroot.log
+umount_dirs
+trap "true" EXIT
+echo "Log file written to /var/log/fai/make-fai-nfsroot.log"
+
+# vim:ts=4:sw=4:expandtab:shiftwidth=2:syntax:paste
+


Property changes on: branches/lhm/bin/make-fai-nfsroot
___________________________________________________________________
Added: svn:executable
   + 

Added: branches/lhm/bin/policy-rc.d.fai
===================================================================
--- branches/lhm/bin/policy-rc.d.fai	                        (rev 0)
+++ branches/lhm/bin/policy-rc.d.fai	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+# which init.d do we like to start?
+
+case "$1" in
+    udev)
+	exit 0
+	;;
+esac
+
+# all other will not be started
+exit 101


Property changes on: branches/lhm/bin/policy-rc.d.fai
___________________________________________________________________
Added: svn:executable
   + 

Added: branches/lhm/bin/setup-storage
===================================================================
--- branches/lhm/bin/setup-storage	                        (rev 0)
+++ branches/lhm/bin/setup-storage	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,217 @@
+#!/usr/bin/perl -w
+
+#*********************************************************************
+# 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.
+#
+# A copy of the GNU General Public License is available as
+# `/usr/share/common-licences/GPL' in the Debian GNU/Linux distribution
+# or on the World Wide Web at http://www.gnu.org/copyleft/gpl.html. You
+# can also obtain it by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#*********************************************************************
+
+use strict;
+
+# treat all warnings about uninitialised values as errors
+use warnings FATAL => qw(uninitialized);
+
+################################################################################
+#
+# @file setup-storage
+#
+# @brief The main function of setup-storage - the tool to configure the
+# partitioning from within FAI.
+#
+# This is an implementation from scratch to properly support LVM and RAID. The
+# input format is documented in @ref parser.pm
+#
+# Some (developer) documentation may be found on
+# http://faiwiki.informatik.uni-koeln.de/index.php/Setup-storage
+#
+# Some coding conventions:
+# - no whitespace after ( and before )
+# - keyword<whitespace>(...)
+# - do not start a new line for {
+# - } goes on a line on its own
+# - one blank line after sub ...
+#
+# $Id: setup-storage 5235 2008-12-22 13:52:09Z lange $
+#
+# @author Christian Kern, Michael Tautschnig
+# @date Sun Jul 23 16:09:36 CEST 2006
+#
+################################################################################
+
+package FAI;
+
+my $version = "1.0.3";
+
+# command line parameter handling
+use Getopt::Std;
+our ($opt_X, $opt_f, $opt_h, $opt_d); # the variables for getopt
+&getopts('Xf:hd') || die <<EOF;
+setup-storage version $version
+
+USAGE: [-X]                     no test, your harddisks will be formated
+                                default: only test, no real formating
+       [-f<config-filename>]    default: parse classes
+       [-d]                     enable debug output (equivalent to debug=1)
+       [-h]                     print this help message
+EOF
+
+# $disklist must be provided by the environment
+defined ($ENV{disklist}) or die "Environment variable disklist is not set\n";
+
+################################################################################
+#
+# @brief Really write any changes to disk
+#
+################################################################################
+$FAI::no_dry_run = 0;
+$opt_X and $FAI::no_dry_run = 1;
+$opt_X or warn "setup-harddisks is running in test-only mode\n";
+
+# include all subparts, which are part of the FAI perl package
+use lib "/usr/share/fai/setup-storage/";
+use Init;
+use Volumes;
+use Parser;
+use Sizes;
+use Commands;
+use Fstab;
+use Exec;
+
+# the config source file
+my $config_file = undef;
+# use the config file, if given
+open($config_file, $opt_f) or die "Failed to open config file $opt_f\n" if ($opt_f);
+unless ($opt_f) {
+  # see which class file to use
+  foreach my $classfile (reverse split(/\s+/, $ENV{classes})) {
+    next unless (-r "$ENV{FAI}/disk_config/$classfile");
+    open($config_file, "$ENV{FAI}/disk_config/$classfile") 
+      or die "Failed to open $ENV{FAI}/disk_config/$classfile\n";
+    $opt_f = "$ENV{FAI}/disk_config/$classfile";
+    last;
+  }
+}
+
+# if we could not find any matching class file, bail out
+defined ($config_file) or die "No matching disk_config found\n";
+
+# start the parsing - thereby $FAI::configs is filled
+warn "Starting setup-storage $version\n";
+print "Using config file: $opt_f\n";
+&FAI::run_parser($config_file);
+
+# mark devices as preserve, where not all already done so
+&FAI::propagate_preserve;
+
+# read the sizes and partition tables of all disks listed in $FAI::disks
+&FAI::get_current_disks;
+
+# see whether there are any existing LVMs
+&FAI::get_current_lvm;
+
+# see whether there are any existing RAID devices
+&FAI::get_current_raid;
+
+# debugging only: print the current configuration
+if ($FAI::debug) {
+  # for debugging purposes to print the hash structures
+  use Data::Dumper;
+
+  print "Current disk layout\n";
+
+  # make sure perl doesn't warn about it being used only once, same below
+  our %current_config;
+  print Dumper \%current_config;
+
+  print "Current LVM layout\n";
+
+  our %current_lvm_config;
+  print Dumper \%current_lvm_config;
+
+  print "Current RAID layout\n";
+
+  our %current_raid_config;
+  print Dumper \%current_raid_config;
+}
+
+# compute the new LVM and partition sizes; do the partition sizes first to have
+# them available for the the volume group size estimation
+&FAI::compute_partition_sizes;
+&FAI::compute_lv_sizes;
+
+# print the current contents of $FAI::configs
+$FAI::debug and print "Desired disk layout\n";
+$FAI::debug and print Dumper \%FAI::configs;
+
+# generate the command script
+&FAI::build_disk_commands;
+&FAI::build_raid_commands;
+&FAI::build_lvm_commands;
+&FAI::order_commands;
+
+# run all commands
+# debugging only: print the command script
+if ($FAI::debug) {
+  foreach (&numsort(keys %FAI::commands)) {
+    defined($FAI::commands{$_}{cmd}) or &FAI::internal_error("Missing command entry for $_");
+    print "$_:" . $FAI::commands{$_}{cmd} . "\n";
+    defined($FAI::commands{$_}{pre}) and print "\tpre: " . $FAI::commands{$_}{pre} . "\n";
+    defined($FAI::commands{$_}{post}) and print "\tpost: " . $FAI::commands{$_}{post} . "\n";
+  }
+}
+
+# run the commands (if $FAI::no_dry_run is set)
+&FAI::execute_with_udevsettle($FAI::commands{$_}{cmd}) foreach (&numsort(keys %FAI::commands));
+
+# generate the proposed fstab contents
+# wait for udev to set up all devices
+`udevsettle --timeout=10`;
+my @fstab = &FAI::generate_fstab(\%FAI::configs);
+
+# print fstab
+$FAI::debug and print "$_\n" foreach (@fstab);
+
+# write the proposed contents of fstab to $LOGDIR/fstab
+if ($FAI::no_dry_run) {
+  open(FSTAB, ">$ENV{LOGDIR}/fstab")
+    or die "Failed to open $ENV{LOGDIR}/fstab for writing\n";
+  print FSTAB "$_\n" foreach (@fstab);
+  close FSTAB;
+}
+
+# write variables to $LOGDIR/disk_var.sh
+# debugging
+$FAI::debug and print "$_=$FAI::disk_var{$_}\n"
+  foreach (keys %FAI::disk_var);
+
+if ($FAI::no_dry_run)
+{
+  open(DISK_VAR, ">$ENV{LOGDIR}/disk_var.sh")
+    or die "Unable to write to file $ENV{LOGDIR}/disk_var.sh\n";
+  print DISK_VAR "$_=$FAI::disk_var{$_}\n" foreach (keys %FAI::disk_var);
+  close DISK_VAR;
+}
+
+# print crypttab
+$FAI::debug and print "$_\n" foreach (@FAI::crypttab);
+
+# write the proposed contents of fstab to $LOGDIR/fstab
+if ($FAI::no_dry_run && scalar(@FAI::crypttab)) {
+  open(CRYPTTAB, ">$ENV{LOGDIR}/crypttab")
+    or die "Failed to open $ENV{LOGDIR}/crypttab for writing\n";
+  print CRYPTTAB "$_\n" foreach (@FAI::crypttab);
+  close CRYPTTAB;
+}
+


Property changes on: branches/lhm/bin/setup-storage
___________________________________________________________________
Added: svn:executable
   + 

Added: branches/lhm/bin/setup_harddisks
===================================================================
--- branches/lhm/bin/setup_harddisks	                        (rev 0)
+++ branches/lhm/bin/setup_harddisks	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,1123 @@
+#!/usr/bin/perl
+
+# $Id: setup_harddisks 4292 2007-05-23 15:49:57Z lange $
+#*********************************************************************
+#
+# setup_harddisks -- create partitions and filesystems on harddisk
+#
+# This script is part of FAI (Fully Automatic Installation)
+# Copyright (c) 1999, 2000 by ScALE Workgroup, Universitaet zu Koeln
+# Copyright (c) 2000-2007 by Thomas Lange, Uni 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.
+#
+# 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.
+#*********************************************************************
+#
+# This program first read the configfiles, partitions and formats the harddisks,
+# produces fstab and FAI-variables-file.  It uses sfdisk, mke2fs, mkswap
+#
+# Parameters:
+# [-X]                     no test, your harddisks will be formated
+#                          default: only test, no real formating
+# [-f<config-filename>]    default: parse classes
+# [-c<class-path>]         default: $FAI/disk_config/
+# [-d]                     default: no DOS alignment
+#
+#---------------------------------------------------
+# Last changes:  see svn log
+# Last changes:  31.3.2005 by Thomas Lange add sub mapdisk{}
+# Last changes:  8.11.2004 by Thomas Lange add $devdisklist when calling sfdisk
+# Last changes:   3.2.2004 by Thomas Lange typos
+# Last changes: 14.07.2003 by Thomas Lange add xfs filesystem support
+# Last changes: 23.01.2003 by Thomas Lange print info data to stdout
+# Last changes: 03.12.2002 by Thomas Lange remove ida, cciss stuff. Just match everything
+# Last changes: 27.11.2002 by Thomas Lange allow more that 3 primary partitions
+# Last changes: 14.05.2002 by Thomas Lange use strict
+# Last changes: 04.05.2002 by Thomas Lange use strict
+# Last changes: 29.04.2002 by Thomas Lange add swaplist
+# Last changes: 12.01.2002 by Thomas Lange
+# /dev/ida/ patch 12.01.2002 by Marc Martinez <lastxit+fai at technogeeks.org>
+# Last changes: 9.11.2001 by Thomas Lange
+# reiserfs patch 8.11.2001 by Diane Trout <diane at caltech.edu>
+# Last changes: 25.10.2001 by Thomas Lange
+# Last changes: 09.07.2001 by Thomas Lange
+# Last changes: 04.07.2001 by Thomas Lange
+# Last changes: 06.05.2001 by Thomas Lange
+# Last changes: 09.03.2001 by Thomas Lange
+# Last changes: 05.12.2000 by Thomas Lange
+# Last changes: 03.05.2000 by Thomas Lange
+# Last changes: 03.04.2000 by Mattias Gaertner
+#---------------------------------------------------
+#
+# config-file format:
+#   lines beginning with # are comments
+#
+# "disk_config <device>|<diskN>|end"
+#   The disk_config command starts the parsing.
+#   It has to be the first command.
+#    <device> is the harddisk to format in short form like "hda" or "sdc".
+#    <diskN>  if first is used, the N-th disk of $disklist is used
+#    "end"    = end parsing here
+#   Example: "disk_config hdb"
+#   Example: "disk_config disk3"
+#
+# Defining one partition:
+# "primary|logical mountpoint|swap|- <size in mb>|preserve<No> [fstab-options][;extraordinary options]"
+#    "primary|logical":
+#      "primary": this are the bootable partitions like the
+#         root directory "/" or the DOS "C:" disk.
+#      "logical": this are all other partitions like a linux
+#         "/var" or a swap partition or a DOS disk.
+#
+#    "mountpoint|swap|-":
+#      "mountpoint": 
+#         This is the mount-point for fstab.
+#         For example "/","/var","/usr". There must not
+#         be a space in the mountpoint.
+#      "swap":
+#         swap-partitions
+#      "-":
+#         do not mount this partition.
+#
+#    "<size in mb>|preserve<No>":
+#      "<size in mb>":
+#        The size of the partition in megabyte
+#         Examples:
+#          "30"     = 30 mb
+#          "10-100" = 10 to 100 mb
+#          "20-"    = minimum of 20 mb
+#          "-500"   = 1 to 500 mb
+#          The megabytes will be rounded up to cylinders.
+#      "preserve<No>":
+#         This is the alternative for the size attribute.
+#         <No> is the partition number. For example
+#         preserve3 for the third partition. If the
+#         <device> was hda then this results in hda3.
+#         The partition will be left unchanged. This
+#         is useful if you have partitions that do not
+#         need re-installation or if you want to have
+#         other operation systems on the device together
+#         with Linux. Extended Partitions can not be preserved.
+#         The bootable flag will not be preserved.
+#         Preserved partitions are mounted readonly during
+#         installation.
+#
+#    "fstab-options":
+#         These options are copied to the fstab-file. The
+#         default is "default"
+#
+#   After the semicolon there could be extra options like:
+#     -i <bytes>   : Bytes per inodes
+#                    (only ext2/3 filesystem)
+#     -m <blocks>% : reserved blocks percentage for superuser
+#                    (only ext2/3 filesystem)
+#     -j	   : format in ext3
+#     -c           : check for bad blocks
+#     format       : Always format this partition even if preserve
+#     lazyformat   : Do not format if partition has not moved
+#                    (useful for testing the installation)
+#     boot         : make this partition the boot-partition (the
+#                    linux root filesystem is the default)
+#     ext2         : Extended 2 filesystem (this is the default)
+#     swap         : swap partition
+#     dosfat16     : DOS 16bit FAT file system
+#     winfat32     : Win95 FAT32 file system
+#     writable     : mounts a preserved partition writable
+#     xfs          : xfs
+#     reiser       : reiserfs
+#       -h <hash>  : set reiserfs hash
+#       -v <ver>   : set reiserfs version
+#     mounttype=<type> : The way the device is refered in /etc/fstab
+#                        Can be "device" (default), "label" or 'uuid'
+#     label="<label>"  : A filesystem label, labeled filesystems
+#                        may be mounted with mount -l <label>
+#                        (only for ext2, ext3, reiserfs, jfs, xfs)
+#     uuid="<uuid>"    : For some filesystems you can change the UUID
+#
+use strict;
+# getopts variables:
+our ($opt_X, $opt_f, $opt_c, $opt_d, $opt_n);
+my $test;
+
+$| = 1;                     # flush always
+
+#****************************************************
+# Variables
+#****************************************************
+
+my $Version = "version 0.43fai";
+
+my $megabyte = 1024 * 1024;    # guess
+# $gigabyte = 1024 * $megabyte;
+my $sectorsize = 512;
+
+# used programs
+my $sfdisk_options = "-q $ENV{sfdisk}";     # be quiet
+my $mke2fs_options = "-q";     # be quiet
+my $mkreiserfs_options = "";
+my $mkxfs_options = "-f";
+my $mkswap_options = "";
+
+# FAI input variables
+my $ClassPath = "$ENV{FAI}/disk_config";# this directory contains the classes
+my $ConfigFileName = "";   # alternative classfile, only for tests
+my $DOS_Alignment = "";    # align partitions for tracks
+my $DryRun = 0;            # Don't format, just simulate
+
+# FAI output variables
+my $BootPartition;         # the boot partition like "hda1"
+my $BOOT_DEVICE;           # the root device like "hda" or "sdb"
+my $FAIOutputFile = "$ENV{LOGDIR}/disk_var.sh"; # write output variables to this file
+
+# old partition tables
+my %DiskUnits = ();        # unit size of each disk in sectors
+my %DiskSize = ();         # size of every disk in units
+my %SectorsAlignment = ();  # tracksize in sectors
+my %PartOldBoot = ();      # partition was bootable. "yes"=yes
+my %PartOldStart = ();     # old startunit of partition
+my %PartOldEnd = ();       # old endunit of partition
+my %PartOldStartSec = ();  # old startsector of partition
+my %PartOldEndSec = ();    # old endsector of partition
+my %PartOldID = ();        # old ID of partition
+my %OldNotAligned = (); # "yes" if old partition boundaries are not DOS aligned
+
+# mountpoints  ("/<path>" or "swap<No>" or "no<No>" or "extended<disk>")
+my $NofSwapPart = 0;       # number of swap partitions
+my $NofNotMoPart = 0;      # number of not mountet partitions
+my %DiskMountpoints = ();  # mountpoints of every disk. separated by spaces
+my %MountpointPart = ();   # partition of every mountpoint. e.g. "hda2"
+my %PartMountpoint = ();   # mountpoint of every partition.
+my @swaplist;              # list of all swpa devices
+
+# size of partition/mountpoint
+my %MPMinSize = ();        # minimum size of mountpoint in units
+my %MPMaxSize = ();        # maximum size of mountpoint in units
+my %MPPreserve = ();       # preserve partition: "yes"=yes
+my %MPPrimary = ();        # primary partition: "yes"=yes
+my %MPStart = ();          # start of partition in units
+my %MPSize = ();           # size of partition in units
+my %MPID = ();             # id of partition
+
+# Label, UUID
+my %MPMounttype = ();      # way in which each mountpoint is mounted
+my %MPLabel = ();          # the label for each mountpoint
+my %MPuuid = ();           # the UUID for each mountpoint
+
+# options
+my %MPfstaboptions = ();   # fstab options for every mountpoint
+my %MPOptions = ();        # extra options for every mountpoint
+
+# sfdisk partition tables
+my %sfdiskTables = ();     # partition tables for sfdisk
+
+my $verbose = 0;
+$verbose = $ENV{verbose} if $ENV{verbose};
+
+# Parse command line
+
+use Getopt::Std;
+&getopts('Xf:c:dn') || die "
+USAGE: [-X]                     no test, your harddisks will be formated
+                                default: only test, no real formating
+       [-f<config-filename>]    default: parse classes
+       [-c<class-path>]         default: \$FAI/disk_config/
+       [-d]                     default: no DOS alignment
+       [-n]                     dry-run
+";
+
+print "setup_harddisks $Version\n";
+if (defined $opt_X){
+    $test = 2;
+} else {
+    print "TEST ONLY - no real formating\n\n";
+    $test = 1;
+}
+$ConfigFileName = $opt_f if $opt_f;# alternative config file
+$ClassPath      = $opt_c if $opt_c;# search classes here
+$DOS_Alignment  = "yes" if $opt_d; # track alignment
+$DryRun         = 1 if $opt_n;
+
+# main part
+&GetAllDisks;
+&ParseAllConfigFiles;
+&BuildNewPartTables;
+&PartitionPersfdisk;
+&FormatDisks;
+&WriteFSTab;
+&WriteFAIVariables;
+exit 0;
+#****************************************************
+
+#****************************************************
+# get a partition pathname
+#****************************************************
+sub PartName {
+    my ($disk, $partno) = @_;
+    my $ppath;
+    for ($disk) {
+      /^(i2o\/)?[a-z]+$/ and $ppath = "${disk}${partno}";
+      /\d$/ and $ppath = "${disk}p${partno}";
+    }
+    return $ppath;
+}
+
+#****************************************************
+# Read all partition tables of this machine
+#****************************************************
+sub GetAllDisks{
+    my $line=""; my $disk=""; my $device=""; my $rest; my $result; my $divi;
+    my $devdisklist="";
+
+    foreach my $device(split(/\s/,$ENV{disklist})){
+      $devdisklist = "$devdisklist /dev/$device";
+    }
+    print "Probing disks: $devdisklist\n";
+    print "Disks found:";
+    $result = `sh -c "LC_ALL=C sfdisk -g -q $devdisklist"`;
+    foreach my $line(split(/\n/,$result)){
+	if($line =~ m'^/dev/(.+?):\s+(\d+)\s+cylinders,\s+(\d+)\s+heads,\s+(\d+)\s+sectors'i){
+	    $disk = $1;
+	    $DiskUnits{$disk} = $3 * $4;# heads * sectors = cylinder size in sectors
+	    $DiskSize{$disk} = $2;      # cylinders
+	    ($DOS_Alignment eq "yes") ? ($SectorsAlignment{$disk} = $4) : ($SectorsAlignment{$disk} = 1);
+	    print " $disk";
+	}
+    }
+    $result = `sh -c "LC_ALL=C sfdisk -d -q $devdisklist"`;
+    foreach my $line(split(/\n/,$result)){
+#	if($line =~ m'# partition table of /dev/(cciss/c\dd\d|ida/c\dd\d|rd/c\dd\d|[a-z]+)'i){
+# now just match all devices
+	if($line =~ m'# partition table of /dev/(\S+)$'i){
+	   $disk = $1;
+        }
+	if($line =~ m#^/dev/(.+?)\s*:\s+start=\s*(\d+),\s+size=\s*(\d+),\s+Id=\s*([a-z0-9]+)\b(.*)$#i){
+	    $device = $1;
+            # Sectors
+            $PartOldStartSec{$device} = $2;
+            $PartOldEndSec{$device} = $2 + $3 - 1;
+            # DiskUnits
+	    $PartOldStart{$device} = int ($2 / $DiskUnits{$disk});
+	    $PartOldEnd{$device} = int (($2 + $3 - 1) / $DiskUnits{$disk});
+	    $divi = $2 / $SectorsAlignment{$disk};
+	    ($divi != int ($divi)) && ($OldNotAligned{$device} = "yes");
+	    $divi = $3 / $SectorsAlignment{$disk};
+	    ($divi != int ($divi)) && ($OldNotAligned{$device} = "yes");
+	    $PartOldID{$device} = $4;
+	    $rest = $5;
+	    $PartOldBoot{$device} = ($rest =~ /bootable/) ? "yes" : "";
+	}
+    }
+    print "\n\n";
+}
+
+#****************************************************
+# parse config file or all class files
+#****************************************************
+sub ParseAllConfigFiles{
+    my $ConfigFileExists = 0;  # no config file parsed yet
+    if ($ConfigFileName){
+	# Read config filename
+	&ParseConfigFile($ConfigFileName);
+	$ConfigFileExists = 1;
+    } else {
+	# Read classes
+	foreach my $classfile (reverse split(/\s+/,$ENV{"classes"})){
+	    my $filename = "$ClassPath/$classfile";
+	    if (($classfile) && (-r $filename)) {
+               &ParseConfigFile($filename);
+               $ConfigFileExists = 1;
+            }
+	    ($ConfigFileExists) && last;
+	}
+    }
+    ($ConfigFileExists == 0) && die "ERROR: no config file for setup_harddisk found. Please check you classes and files in disk_config.\n";
+}
+
+#****************************************************
+# map "disk_config first" to real disk device
+#****************************************************
+sub mapdisk {
+
+  my ($disk) = @_;
+  my @dlist = split /\s+/,$ENV{disklist};
+  unshift @dlist, "nodisk"; # add dummy element, so disk1 will be mapped to dlist[1]
+
+  if ($disk =~ /disk(\d+)/) {
+    my $n = $1;
+    print "Mapping disk name disk$n to $dlist[$n]\n";
+    $disk = $dlist[$n];
+  }
+  return $disk;
+}
+
+#****************************************************
+# parse config-file
+#****************************************************
+sub ParseConfigFile {
+    my $size=""; my $mountpoint=""; my $device ="";
+    my $fstaboptions=""; my $options=""; my $disk=""; my $command = "";
+    my $LogPartNo; my $PrimPartNo; my $NoMoreLogicals;
+    my $LastPresPart; my $extmp; my $Min; my $Max;
+    my $filename = shift;
+    my $parse_error = 0;
+    open (FILE,"$filename")
+      || die "config file not found: $filename\n";
+    (print "Using config file: $filename\n");
+    $disk = "";
+    my $a = 1, my $paras ="", my $number=0;
+    while (my $line = <FILE>){
+	chomp($line);
+	$a++;
+	next if( $line =~ /^#|^\s*$/ );
+
+	# disk_config - command
+	if ($line =~ /^disk_config(.*)/i){
+	    $paras = $1;
+	    if ($paras =~ / end/i){
+		$disk = "";
+	    } else {
+		if($paras =~ m# (/dev/)?(\S+)#i){
+		    $disk = mapdisk($2);
+		    if($DiskMountpoints{$disk}) {
+		        print "ERROR: there are more than one configuration of disk $disk.\n";
+			$parse_error = 1;
+			next;
+		    }
+		    if(!$DiskSize{$disk}) {
+		        print "ERROR: could not read device /dev/$disk\n";
+			$parse_error = 1;
+			next;
+		    }
+		    ($test != 1) || (print "config: $disk\n");
+		    $DiskMountpoints{$disk} = "";
+		    $MPPrimary{"extended$disk"} = "";
+		    $LogPartNo = 4;
+		    $PrimPartNo = 0;
+		    $NoMoreLogicals = 0;
+		    $LastPresPart = "";
+		    $extmp = "extended$disk";
+		} else {
+		    print "SYNTAX ERROR line $a, unknown disk_config parameter $paras\n$line\n";
+		    $parse_error = 1;
+		    next;
+		}
+	    }
+	}
+
+	if ($disk){
+	    # primary|partition - command
+	    if($line =~ /^\s*(primary|logical)\s+(.*)$/i){
+		$command = $1;
+		# split variables
+		$paras = $2;
+		$options = "";
+		if($paras =~ /(.*?)\s*;\s*(.*)$/){
+		    $paras = $1;
+		    $options = $2;
+		}
+		$size="";
+		$mountpoint ="";
+		$fstaboptions = "";
+		($mountpoint,$size,$fstaboptions)=split(/\s+/,$paras);
+
+		# mountpoint
+		if( $mountpoint !~ m#^/.*|^swap$|^-$#i ) {
+		    print "SYNTAX ERROR line $a: mountpoint = '$mountpoint'\n  $line\n";
+		    $parse_error = 1;
+		    next;
+		}
+		if( exists $MountpointPart{$mountpoint} ) {
+		    print "SYNTAX ERROR line $a: Mountpoint '$mountpoint' redefined.\n  $line\n";
+		    $parse_error = 1;
+		    next;
+		}
+		if($mountpoint eq "/"){
+		    ($BootPartition) || ($BOOT_DEVICE = $disk);
+		}
+		if($mountpoint eq "-"){
+		    $NofNotMoPart++;
+		    $mountpoint = "no$NofNotMoPart";
+		}
+		if($mountpoint eq "swap"){
+		    $NofSwapPart++;
+		    $mountpoint = "swap$NofSwapPart";
+		    ($options !~ /\bswap\b/i) && ($options .= " swap");
+		    ($fstaboptions) || ($fstaboptions = "sw");
+		}
+		if($mountpoint =~ m#^/#){
+		    ($fstaboptions) || ($fstaboptions = "defaults");
+		}
+		if ($command eq "primary") {
+		    ($MPPrimary{$extmp} eq "yes") && ($NoMoreLogicals = 1);
+		    $MPPrimary{$mountpoint} = "yes";
+		    $PrimPartNo++;
+                    if($PrimPartNo >4 ) {
+		        print "ERROR line $a: Too much primary partitions (max 4). "
+                            . "All logicals together need one primary too.\n";
+			$parse_error = 1;
+			next;
+		    }
+		    $MountpointPart{$mountpoint} = PartName($disk,$PrimPartNo);
+		    if($options =~ /\bboot\b/i){
+		        if(defined $BootPartition) {
+			    print "ERROR line $a: only one partition can be bootable at a time.";
+			    $parse_error = 1;
+			    next;
+			}
+			$BootPartition = $MountpointPart{$mountpoint};
+			$BOOT_DEVICE = $disk;
+		    }
+		} else {
+		    if($NoMoreLogicals != 0) {
+		        print "ERROR line $a: the logical partitions must be together.\n";
+			$parse_error = 1;
+			next;
+		    }
+		    $MPPrimary{$mountpoint} = "";
+		    $LogPartNo++;
+		    $MountpointPart{$mountpoint} = PartName($disk,$LogPartNo);
+		    if (!$MPPrimary{$extmp}){
+		        $MPPreserve{$extmp} = "";
+		        $MPPrimary{$extmp} = "yes";
+			$MPMinSize{$extmp} = 0;
+			$MPMaxSize{$extmp} = 0;
+			$MPID{$extmp} = 5;
+			$PrimPartNo++;
+			($PrimPartNo == 3) && ($disk =~ /^sd/) && ($PrimPartNo++);
+                        if($PrimPartNo >4 ) {
+			    print "ERROR line $a: too much primary partitions (max 4).".
+                                  " All logicals together need one primary too.\n";
+			    $parse_error = 1;
+			    next;
+			}
+			$MountpointPart{$extmp} = PartName($disk,$PrimPartNo);
+			$DiskMountpoints{$disk} .= " $extmp";
+		    }
+		}
+		$DiskMountpoints{$disk} .= " $mountpoint";
+		# size
+		if($size !~ /^preserve\d+$|^\d+\-?\d*$|^-\d+$/i) {
+		    print "SYNTAX ERROR in config file line $a, size: $size\n$line\n";
+		    $parse_error = 1;
+		    next;
+		}
+		if($size =~ /^preserve(\d+)$/i){
+		    my $number = $1;
+		    $device = PartName($disk,$number);
+		    if($OldNotAligned{$device} eq "yes") {
+		        print "ERROR line $a: unable to preserve partition /dev/$device. Partition is not DOS aligned.";
+			$parse_error = 1;
+			next;
+	            }
+		    if(($command eq "primary") && ($number != $PrimPartNo)) {
+                         print "NUMERATION ERROR line $a: the number of the partition can not be preserved:\n$line\n";
+			 $parse_error = 1;
+			 next;
+	            }
+		    if(($command eq "logical") && ($number != $LogPartNo)) {
+                         print "NUMERATION ERROR line $a: the number of the partition can not be preserved:\n$line\n";
+			 $parse_error = 1;
+			 next;
+	            }
+		    if ($PartOldEnd{$device}){
+		        if(($PartOldID{$device} == 5) || ($PartOldID{$device} == 85)) {
+			    print "ERROR line $a:".
+                                  " Extended partitions can not be preserved. /dev/$device\n$line\n";
+			    $parse_error = 1;
+			    next;
+		        }
+			$MPPreserve{$mountpoint}="yes";
+			$MPMinSize{$mountpoint} = $PartOldEnd{$device}-$PartOldStart{$device}+1;
+			$MPMaxSize{$mountpoint} = $MPMinSize{$mountpoint}; # Max=Min
+			$MPStart{$mountpoint} = $PartOldStart{$device};
+			$MPSize{$mountpoint} = $MPMinSize{$mountpoint};
+			$MPID{$mountpoint} = $PartOldID{$device};
+		    } else {
+			print "ERROR line $a: cannot preserve partition $device. partition not found.$PartOldEnd{$device}\n";
+			$parse_error = 1;
+			next;
+		    }
+		    if( (defined $LastPresPart) &&
+		        ($PartOldStart{$device} < $PartOldStart{$LastPresPart}) ) {
+			  print "ERROR line $a: misordered partitions: cannot preserve partitions $LastPresPart and $device\n".
+                              "       in this order because of their positions on disk.";
+			  $parse_error = 1;
+			  next;
+		    }
+		    $LastPresPart = $device;
+		    if($MPMinSize{$mountpoint} < 1) {
+		        print "ERROR line $a: unable to preserve partitions of size 0.\n$line\n ";
+			$parse_error = 1;
+			next;
+	            }
+		  } else {
+		    # If not preserve we must know the filesystemtype
+	            ($options !~ /\b(ext2|ext3|auto|swap|dosfat16|winfat32|reiser|xfs)\b/i ) && ($options .= " auto");
+		  }
+		if($size =~ /^(\d*)(\-?)(\d*)$/){
+		    $Min = $1;
+		    $Min||= 1;
+		    $Max = $3;
+		    $MPMinSize{$mountpoint} = int (($Min * $megabyte - 1) / ($DiskUnits{$disk} * $sectorsize)) + 1;
+		    if ($2 eq "-"){
+			if($Max =~ /\d+/){
+			    $MPMaxSize{$mountpoint} = int (($Max * $megabyte - 1) / ($DiskUnits{$disk} * $sectorsize)) + 1;
+			} else {
+			    $MPMaxSize{$mountpoint} = $DiskSize{$disk};
+			}
+		    } else {
+			$MPMaxSize{$mountpoint} = $MPMinSize{$mountpoint}; # Max=Min
+		    }
+		    if($MPMinSize{$mountpoint} > $DiskSize{$disk}) {
+		        print "ERROR line $a: Minsize larger than disk.\n$line\n";
+			$parse_error = 1;
+			next;
+		    }
+		    if($MPMinSize{$mountpoint} > $MPMaxSize{$mountpoint}) {
+                       print "SYNTAX ERROR line $a: MIN-MAX-size: $MPMinSize{$mountpoint}-$MPMaxSize{$mountpoint}\n$line\n";
+		       $parse_error = 1;
+		       next;
+		    }
+		    if($MPMinSize{$mountpoint} < 1) {
+		        print "SYNTAX ERROR line $a: Minsize must be greater than 1.\n$line\n";
+			$parse_error = 1;
+			next;
+	            }
+		    $MPPreserve{$mountpoint} = "";
+		}
+		# fstaboptions
+		$MPfstaboptions{$mountpoint} = $fstaboptions;
+
+		# extra options
+		($options =~ /\b(ext[23]|auto)\b/i) && ($MPID{$mountpoint} = 83); # Linux native
+		($options =~ /\bswap\b/i) && ($MPID{$mountpoint} = 82); # Linux swap
+		($options =~ /\bdosfat16\b/i) && ($MPID{$mountpoint} = 6); # DOS FAT 16bit (>=32MB, will be changed later)
+		($options =~ /\bwinfat32\b/i) && ($MPID{$mountpoint} = "b"); # Win 95 FAT 32
+		$MPOptions{$mountpoint} = $options;
+
+                # check for label extra options
+		if($options =~ /\blabel=(\'|\")([^\'\"]*)\1/i) { 
+		    $MPLabel{$mountpoint} = $2;
+		} elsif($options =~ /\blabel=(\S+)/) {
+		    $MPLabel{$mountpoint} = $1;
+		}
+
+		# check for uuid extra option (b06b3305-4b80-4456-a6ab-e239f391d2b5)
+		if($options =~ /\buuid=(\'|\")([^\'\"]*)\1/i) {
+		    $MPuuid{$mountpoint} = lc( $2 );
+		} elsif($options =~ /\buuid=(\S+)/) {
+		    $MPuuid{$mountpoint} = lc( $1 );
+		}
+                if( exists $MPuuid{$mountpoint} &&
+		  ($MPuuid{$mountpoint} !~ /^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$/) )
+		{
+		    delete $MPuuid{$mountpoint};
+		    print( "ERROR line $a: Invalid UUID for '$mountpoint'\n" );
+		    $parse_error = 1;
+		    next;
+		}
+
+                ($options =~ /\bmounttype=(\'|\"|)(device|label|uuid)\1/i) && ( $MPMounttype{$mountpoint} = lc($2));
+		defined($ENV{debug}) && print $MPMounttype{$mountpoint}."\n";
+		if( ($MPMounttype{$mountpoint} eq 'label') && !defined($MPLabel{$mountpoint})) {
+		    print "ERROR line $a: mountpoint=$mountpoint: mounttype=label, but no label defined\n";
+		    $parse_error = 1;
+		    next;
+		}
+		if($test == 1){
+		    print "$mountpoint,$MPMinSize{$mountpoint}-$MPMaxSize{$mountpoint},";
+		    print "$fstaboptions,$options";
+		    ($MPPreserve{$mountpoint} eq "yes") && (print " Preserve: $MountpointPart{$mountpoint}");
+		    print "\n";
+		}
+	    }
+	}
+    }
+    close(FILE);
+    die( "Errors while parsing disk config '$filename'" ) if( $parse_error );
+    exit( 0 ) if( $DryRun );
+}
+
+#****************************************************
+# Build all partition tables
+#****************************************************
+sub BuildNewPartTables{
+    my ($disk, $mountpoint, $part, $PrimaryMP, $LogicalMP);
+    ($test != 1) || (print "\nBuilding partition tables:\n");
+    # Build PartMountpoint array
+    foreach $disk(keys %DiskMountpoints) {
+	$DiskMountpoints{$disk} =~ s/\s(\s)/$1/g;
+	$DiskMountpoints{$disk} =~ s/^\s//;
+	$DiskMountpoints{$disk} =~ s/\s$//;
+	foreach $mountpoint(split(/\s/,$DiskMountpoints{$disk})) {
+	    $PartMountpoint{$MountpointPart{$mountpoint}} = $mountpoint;
+	}
+    }
+    foreach $disk(keys %DiskMountpoints) {
+	&SetPartitionPositions($disk);
+        # change units to sectors
+        foreach $mountpoint(split(/\s/,$DiskMountpoints{$disk})) {
+            if($MPPreserve{$mountpoint} eq "yes"){
+	        $MPStart{$mountpoint} = $PartOldStartSec{$MountpointPart{$mountpoint}};
+	        $MPSize{$mountpoint} = $PartOldEndSec{$MountpointPart{$mountpoint}} - $MPStart{$mountpoint} + 1;
+	    } else {
+	        $MPStart{$mountpoint} *= $DiskUnits{$disk};
+	        $MPSize{$mountpoint} *= $DiskUnits{$disk};
+	        # align first partition for mbr
+	        if($MPStart{$mountpoint} == 0){
+	            $MPStart{$mountpoint} += $SectorsAlignment{$disk};
+		    $MPSize{$mountpoint} -= $SectorsAlignment{$disk};
+	        }
+	    }
+	}
+	# align all logical partitions
+        foreach $mountpoint(split(/\s/,$DiskMountpoints{$disk})) {
+            next if ($MPPrimary{$mountpoint} eq "yes");
+	    if ($MountpointPart{$mountpoint} eq "${disk}5") {
+	        # partition with number 5 is first logical partition and start of extended partition
+  	        $MPStart{"extended$disk"} = $MPStart{$mountpoint};
+                ($MPPreserve{$mountpoint} eq "yes") && ($MPStart{"extended$disk"} -= $SectorsAlignment{$disk});
+	    }
+            if ($MPPreserve{$mountpoint} ne "yes") {
+  	        $MPStart{$mountpoint} += $SectorsAlignment{$disk};
+	        $MPSize{$mountpoint} -= $SectorsAlignment{$disk};
+	    }
+	}
+        &CalculateExtPartSize($disk);
+        # sort mountpoints of partition number
+        $PrimaryMP = "";
+        $LogicalMP = "";
+        foreach $mountpoint(split(/\s/,$DiskMountpoints{$disk})) {
+	  ($MPPrimary{$mountpoint} eq "yes") ? ($PrimaryMP .= " $mountpoint") : ($LogicalMP .= " $mountpoint");
+	}
+	$DiskMountpoints{$disk} = "$PrimaryMP$LogicalMP";
+	$DiskMountpoints{$disk} =~ s/^\s//;
+	# print partition table
+        ($test != 1) || (PrintPartitionTable($disk));
+    }
+    if (!$BootPartition){
+        $BootPartition = $MountpointPart{"/"};
+    }
+}
+
+#****************************************************
+# set position for every partition
+#****************************************************
+sub SetPartitionPositions{
+    my $disk = shift;
+    my $mountpoint; my $DynGroup =""; my $StartPos; my $EndPos;
+    # Build groups of unpreserved partitions between
+    # preserved partitions
+    $StartPos = 0;
+    foreach $mountpoint(split(/\s/,$DiskMountpoints{$disk})) {
+        if ($MPPreserve{$mountpoint} eq "yes") {
+	    $EndPos = $PartOldStart{$MountpointPart{$mountpoint}} - 1;
+            &SetGroupPos($DynGroup,$StartPos,$EndPos);
+	    $DynGroup = "";
+	    $StartPos = $PartOldEnd{$MountpointPart{$mountpoint}} + 1;
+        } else {
+	    $DynGroup .= " $mountpoint";
+	}
+    }
+    $EndPos = $DiskSize{$disk} - 1;
+    &SetGroupPos($DynGroup,$StartPos,$EndPos);
+    foreach $mountpoint(split(/\s/,$DiskMountpoints{$disk})) {
+	($MPOptions{$mountpoint} =~ /\bdosfat16\b/i)
+	    && (($MPSize{$mountpoint} * $DiskUnits{$disk} * $sectorsize) < 32 * $megabyte)
+		&& ($MPID{$mountpoint} = 4); # DOS 16-bit FAT <32MB
+    }
+}
+
+#****************************************************
+# set position for a group of unpreserved partitions
+# between start and end
+#****************************************************
+sub SetGroupPos{
+    my ($PartGroup,$Start,$End) = @_;
+    $PartGroup =~ s/^ //;
+    ($PartGroup) || return;
+    my $totalsize = $End - $Start + 1;
+    ($totalsize <= 0) && return;
+    my $mountpoint; my $mintotal = 0; my $maxmintotal = 0; my $rest = 0; my $EndUnit = 0;
+    # compute total of MinSizes and difference to MaxSizes
+    foreach $mountpoint (split(/\s/,$PartGroup)) {
+        $mintotal += $MPMinSize{$mountpoint};
+        $maxmintotal += ($MPMaxSize{$mountpoint} - $MPMinSize{$mountpoint});
+        $MPSize{$mountpoint} = $MPMinSize{$mountpoint};
+    }
+    # Test if partitions fit
+    ($mintotal > $totalsize)
+      && die "ERROR: Mountpoints $PartGroup do not fit.\n";
+    # Maximize partitions
+    $rest = $totalsize - $mintotal;
+    ($rest > $maxmintotal) && ($rest = $maxmintotal);
+    if ($rest > 0) {
+        foreach $mountpoint (split(/\s/,$PartGroup)) {
+            $MPSize{$mountpoint} += int ((($MPMaxSize{$mountpoint} - $MPMinSize{$mountpoint}) * $rest) / $maxmintotal);
+        }
+    }
+    # compute rest
+    $rest = $totalsize;
+    foreach $mountpoint (split(/\s/,$PartGroup)) {
+        $rest -= $MPSize{$mountpoint};
+    }
+    # Minimize rest
+    foreach $mountpoint (split(/\s/,$PartGroup)) {
+        if (($rest >0) && ($MPSize{$mountpoint} < $MPMaxSize{$mountpoint})){
+            $MPSize{$mountpoint}++;
+	    $rest--;
+	}
+    }
+    # Set start for every partition
+    foreach $mountpoint (split(/\s/,$PartGroup)) {
+        $MPStart{$mountpoint} = $Start;
+	$Start += $MPSize{$mountpoint};
+	$EndUnit = $MPStart{$mountpoint} + $MPSize{$mountpoint} - 1;
+    }
+}
+
+#****************************************************
+# calculate extended partition size
+#****************************************************
+sub CalculateExtPartSize{
+    my ($disk) = @_;
+    my $extmp = "extended$disk";
+    my $mountpoint; my $ExtEnd; my $NewEnd;
+    ($MPPrimary{$extmp}) || return;
+    $ExtEnd = $MPStart{$extmp};
+    foreach $mountpoint(split(/\s/,$DiskMountpoints{$disk})) {
+        next if ($MPPrimary{$mountpoint} eq "yes");
+	$NewEnd = $MPStart{$mountpoint} + $MPSize{$mountpoint} - 1;
+	($NewEnd > $ExtEnd) && ($ExtEnd = $NewEnd);
+    }
+    $MPSize{$extmp} = ($ExtEnd - $MPStart{$extmp} + 1);
+}
+
+#****************************************************
+# Print partition "number - mountpoint" table
+#****************************************************
+sub PrintPartitionTable{
+    my ($disk) = @_;
+    my $part; my $mountpoint; my $mountpointname; my $end;
+    foreach $part (sort %MountpointPart) {
+        next if($part !~ /^$disk/);
+	$mountpoint = $PartMountpoint{$part};
+        if ($mountpoint =~ /^no(.*)/){
+            $mountpointname = "no mountpoint ($1)";
+	} else {
+	    $mountpointname = $mountpoint;
+	}
+	$end = $MPStart{$mountpoint} + $MPSize{$mountpoint} - 1;
+	print <<"EOM";
+/dev/$part $mountpointname start=$MPStart{$mountpoint} size=$MPSize{$mountpoint} end=$end id=$MPID{$mountpoint}
+EOM
+      }
+}
+
+#****************************************************
+# build all partition tables for sfdisk
+#****************************************************
+sub PartitionPersfdisk{
+    my ($disk, $mountpoint, $line, $part, $PrimaryNo);
+    my ($command, $result, $filename, $number);
+    print "Creating partition table: ";
+    foreach $disk(keys %DiskMountpoints) {
+        $sfdiskTables{$disk} = "# partition table of device: /dev/$disk\nunit: sectors\n\n";
+	$PrimaryNo = 1;
+        foreach $mountpoint(split(/\s/,$DiskMountpoints{$disk})) {
+	    $part = $MountpointPart{$mountpoint};
+	    $part =~ /(\d+)$/;
+	    ($1 < 5) && ($PrimaryNo++);
+	    if ( ($1 == 5) && ($PrimaryNo < 5) ){
+	        for my $number($PrimaryNo..4) {
+		    $sfdiskTables{$disk} .= BuildsfdiskDumpLine(PartName($disk,$number),0,0,0)."\n";
+	        }
+	    }
+	    $line = BuildsfdiskDumpLine($MountpointPart{$mountpoint},$MPStart{$mountpoint},$MPSize{$mountpoint},$MPID{$mountpoint});
+            ($part eq $BootPartition) && ($line .= ", bootable");
+            $sfdiskTables{$disk} .= "$line\n";
+	}
+#	print $sfdiskTables{$disk};
+	$filename = "$ENV{LOGDIR}/partition." . (($disk=~ m#/#) ? join('_', split('/', $disk)) : $disk);
+	if(($test != 1) && ($filename)){
+	    open(FILE, ">$filename") || die "unable to write temporary file $filename\n";
+	    print FILE $sfdiskTables{$disk};
+	    close(FILE);
+        }
+	$command = "LC_ALL=C sfdisk $sfdisk_options /dev/$disk < $filename";
+	if($test != 1){
+            print "$command\n";
+	    $result = `sh -c "$command"`;
+	    (($? >> 8) == 0) || (die "\nSFDISK ERROR:\n $result\n");
+	    -f "/etc/init.d/udev" && sleep 10; # when using udev, it takes some time until the device entries for each partition are available
+	}
+    }
+}
+
+#****************************************************
+# build a sfdisk dump line
+#****************************************************
+sub BuildsfdiskDumpLine{
+
+  sprintf "/dev/%-5s: start=%10s, size=%10s, Id=%3s", at _;
+}
+
+#****************************************************
+# Format all disks
+#****************************************************
+sub FormatDisks{
+    my ($disk, $device, $mountpoint, $mountpointname, $command, $result);
+    print "Creating file systems:\n";
+    foreach $disk(keys %DiskMountpoints) {
+        foreach $mountpoint (split(/\s/,$DiskMountpoints{$disk})) {
+	    $device = $MountpointPart{$mountpoint};
+            if ($mountpoint =~ /^no/){
+                $mountpointname = "no mountpoint";
+            } else {
+	        $mountpointname = $mountpoint;
+	    }
+            # generate UUID if needed
+            if ($MPMounttype{$mountpoint} eq 'uuid' && $MPOptions{$mountpoint} =~ /\b(ext[23]|auto|reiser|xfs)\b/i) {
+                chomp($MPuuid{$mountpoint} = `uuidgen`);
+		if($ENV{debug}) { print "DEBUG: created UUID for $mountpoint: $MPuuid{$mountpoint}\n"; }
+	    }
+	    # preserved partition
+	    if ( ($MPPreserve{$mountpoint} eq "yes") && ($MPOptions{$mountpoint} !~ /\bformat\b/i)){
+  	        print "Preserve partition $device";
+                if ($mountpoint =~ /^no$1/){
+                    print " with no mountpoint\n";
+                } else {
+	            print " with mountpoint $mountpoint\n";
+	        }
+		next;
+	    }
+	    # lazy format
+	    if ( ( $MPOptions{$mountpoint} =~ /\blazyformat\b/i )
+              && ($MPStart{$mountpoint} == $PartOldStartSec{$device})
+              && (($MPStart{$mountpoint} + $MPSize{$mountpoint} - 1) == $PartOldEndSec{$device}) ){
+	        print "Lazy format: $device";
+                if ($mountpoint =~ /^no$1/){
+                    print " with no mountpoint";
+                } else {
+	            print " with mountpoint $mountpoint";
+	        }
+                print " was neither moved nor formated.\n";
+		next;
+	    }
+	    # swap
+	    if ($mountpoint =~ /^swap/i) {
+#	        print "Make swap partition:\n";
+	        $command = "mkswap $mkswap_options";
+		($MPOptions{$mountpoint} =~ /(\-c)\b/i) && ($command .= " $1");
+		$MPLabel{$mountpoint} && ($command .= " -L '$MPLabel{$mountpoint}'");
+		push @swaplist, "/dev/$device";
+		$command .= " /dev/$device";
+	        print "  $command\n";
+	        if($test != 1){
+	            $result = `$command`;
+		    (($? >> 8) == 0) || (die "\nMKSWAP ERROR:\n $result\n");
+		}
+		next;
+	    }
+	    # Linux Reiser file system
+	    if ($MPOptions{$mountpoint} =~ /\breiser\b/i) {
+#	        print "Make Reiser Filesystem:\n";
+	        $command = "echo y | LC_ALL=C mkreiserfs $mkreiserfs_options";
+		($MPOptions{$mountpoint} =~ /(\-h\s*\w+)\b/) && ($command .= " $1");
+		($MPOptions{$mountpoint} =~ /(\-v\s*\d+)\b/) && ($command .= " $1");
+                $MPLabel{$mountpoint} && ($command .= " -l '$MPLabel{$mountpoint}'");
+                $MPuuid{$mountpoint}  && ($command .= " -u '$MPuuid{$mountpoint}'");
+		$command .= " /dev/$device";
+		print "  $command\n";
+		if ($test != 1){
+		    $result = `$command`;
+		    (($? >> 8) == 0) || die "\nMKREISERFS ERROR:\n $result\n";
+		}
+		next;
+	    }
+	    # Linux XFS file system
+	    if ($MPOptions{$mountpoint} =~ /\bxfs\b/i) {
+#	        print "Make XFS Filesystem:\n";
+	        $command = "mkfs.xfs $mkxfs_options";
+		$MPLabel{$mountpoint} && ($command .= " -L '$MPLabel{$mountpoint}'");
+		$command .= " /dev/$device";
+		print "  $command\n";
+		if ($test != 1){
+		    $result = `$command`;
+		    (($? >> 8) == 0) || die "\nMKFS.XFS ERROR:\n $result\n";
+		}
+                # mkfs.xfs doesn't support the setting of the UUID
+                # but xfs_admin allows this change for an unmounted system
+                if($MPuuid{$mountpoint}) {
+                    $command = "xfs_admin -U '$MPuuid{$mountpoint}' /dev/$device";
+                    print "  $command\n";
+                    if ($test != 1){
+                          $result = `$command`;
+                          (($? >> 8) == 0) || die "\nXFS_ADMIN ERROR:\n $result\n";
+                    }
+                }
+		next;
+	    }
+	    # Linux Extended 2 file system
+	    if ($MPOptions{$mountpoint} =~ /\b(ext[23]|auto)\b/i) {
+#	        print "Make Extended 2/3 Filesystem:\n";
+	        $command = "mke2fs $mke2fs_options";
+		($MPOptions{$mountpoint} =~ /(\-c)\b/i) && ($command .= " $1");
+		($MPOptions{$mountpoint} =~ /(\-i\s*\d+)\b/) && ($command .= " $1");
+		($MPOptions{$mountpoint} =~ /(\-m\s*\d+)\b/) && ($command .= " $1");
+		($MPOptions{$mountpoint} =~ /(\-j)\b/) && ($command .= " $1");
+		$MPLabel{$mountpoint} && ($command .= " -L '$MPLabel{$mountpoint}'");
+		$command .= " /dev/$device";
+		print "  $command\n";
+		if ($test != 1){
+		    $result = `$command`;
+		    (($? >> 8) == 0) || die "\nMKE2FS ERROR:\n $result\n";
+		}
+                # mke2fs doesn't support the setting of the UUID
+                # but tune2fs allows this change even for a mounted system
+                if($MPuuid{$mountpoint}) {
+                    $command = "tune2fs -U '$MPuuid{$mountpoint}' /dev/$device";
+                    print "  $command\n";
+                    if ($test != 1){
+                          $result = `$command`;
+                          (($? >> 8) == 0) || die "\nTUNE2FS ERROR:\n $result\n";
+                    }
+                }
+		next;
+	    }
+	    # DOS 16bit FAT / Win95 FAT 32
+	    if ($MPOptions{$mountpoint} =~ /\b(dosfat16|winfat32)\b/i) {
+	        print "Clear first sector for DOS/Windows\n";
+	        $command = "dd if=/dev/zero of=/dev/$MountpointPart{$mountpoint} bs=512 count=1";
+		print "  $command\n";
+		if ($test != 1){
+		    $result = `$command`;
+		    (($? >> 8) == 0) || die "\nDD ERROR:\n $result\n";
+		}
+		next;
+	    }
+        }
+    }
+}
+
+#****************************************************
+# Build fstab and write it to <root>/etc/fstab
+#****************************************************
+sub WriteFSTab{
+    my ($FileSystemTab, $device, $type, $filename);
+    $FileSystemTab  = << "EOM";
+# /etc/fstab: static file system information.
+#
+#<file sys>          <mount point>     <type>   <options>   <dump>   <pass>
+EOM
+    # 1. /
+    $type = "ext2";
+    ($MPOptions{'/'} =~ /\b(reiser)\b/i) && ($type = "reiserfs");
+    ($MPOptions{'/'} =~ /\b(xfs)\b/i) && ($type = "xfs");
+    ($MPOptions{'/'} =~ /\b(ext3)\b/i) && ($type = "ext3");
+    ($MPOptions{'/'} =~ /\b(ext2)\b/i) && ($type = "ext2");
+
+    $device = '/dev/'.$MountpointPart{'/'};
+    if($MPMounttype{'/'} eq 'label' && $MPLabel{'/'} ne '' && $type =~ /ext2|ext3|reiserfs|xfs/) {
+       $device = "LABEL=".$MPLabel{'/'};
+    }
+    $MPuuid{'/'} && ($device = "UUID=".$MPuuid{'/'});
+    $FileSystemTab .= BuildfstabLine($device,"/",$type,$MPfstaboptions{'/'},0,1);
+   
+    # 2. swap partitions
+    foreach my $mountpoint (%PartMountpoint){
+	next if( $mountpoint !~ /^swap/i);
+	if('label' eq $MPMounttype{$mountpoint} && '' ne $MPLabel{$mountpoint}) {
+            $device = "LABEL=".$MPLabel{$mountpoint};
+        }
+	else { $device = "/dev/$MountpointPart{$mountpoint}"; }
+	$FileSystemTab .= BuildfstabLine($device,
+                           "none","swap",$MPfstaboptions{$mountpoint},0,0);
+    }
+
+    # 3. /proc
+    $FileSystemTab .= BuildfstabLine("proc","/proc","proc","rw,nosuid,noexec",0,0);
+
+    # 4. sorted others
+    foreach my $mountpoint (sort %PartMountpoint){
+	next if ( ($mountpoint !~ m#^/#) || ($mountpoint eq "/"));
+	$type = "ext2";
+	($MPOptions{$mountpoint} =~ /\b(dosfat16|winfat32)\b/i) && ($type = "vfat");
+	($MPOptions{$mountpoint} =~ /\b(ntfs)\b/i) && ($type = "ntfs");
+	($MPOptions{$mountpoint} =~ /\b(reiser)\b/i) && ($type = "reiserfs");
+	($MPOptions{$mountpoint} =~ /\b(xfs)\b/i) && ($type = "xfs");
+	($MPOptions{$mountpoint} =~ /\b(ext3)\b/i) && ($type = "ext3");
+	($MPOptions{$mountpoint} =~ /\b(ext2)\b/i) && ($type = "ext2");
+	$device = '/dev/'.$MountpointPart{$mountpoint};
+        if($MPMounttype{$mountpoint} eq 'label' && $MPLabel{$mountpoint} ne '' && $type =~ /ext2|ext3|reiserfs|xfs/) {
+            $device = "LABEL=".$MPLabel{$mountpoint};
+        }
+        $MPuuid{$mountpoint} && ($device = "UUID=".$MPuuid{$mountpoint});
+        $FileSystemTab .= BuildfstabLine($device,$mountpoint,$type,$MPfstaboptions{$mountpoint},0,2);
+    }
+
+    # write it
+    $filename = "$ENV{LOGDIR}/fstab";
+#    print $FileSystemTab;
+    print "Write fstab to $filename\n" if $verbose;
+    if($test != 1){
+	open(FILE, ">$filename") || die "unable to write fstab $filename\n";
+	print FILE $FileSystemTab;
+	close(FILE);
+    }
+}
+
+#****************************************************
+# Build fstab line
+#****************************************************
+sub BuildfstabLine{
+
+    sprintf "%-10s   %-15s   %-6s  %-8s  %-4s %-4s\n", at _;
+}
+
+#****************************************************
+# Write all FAI variables of this program to file
+#****************************************************
+sub WriteFAIVariables{
+
+  my $swaps;
+
+  print "Write FAI variables to file $FAIOutputFile\n" if $verbose;
+  my $root_partition = "/dev/$MountpointPart{'/'}";
+  my $type = "ext2";
+  ($MPOptions{'/'} =~ /\b(reiser)\b/i) && ($type = "reiserfs");
+  ($MPOptions{'/'} =~ /\b(xfs)\b/i) && ($type = "xfs");
+  ($MPOptions{'/'} =~ /\b(ext3)\b/i) && ($type = "ext3");
+  ($MPOptions{'/'} =~ /\b(ext2)\b/i) && ($type = "ext2");
+  if($MPMounttype{'/'} eq 'label' && $MPLabel{'/'} ne '' && $type =~ /ext2|ext3|reiserfs|xfs/) {
+      $root_partition = "LABEL=".$MPLabel{'/'};
+  }
+  $MPuuid{'/'} && ($root_partition = "UUID=".$MPuuid{'/'});
+  $swaps = join ' ', at swaplist;
+  if($test != 1) {
+    open(FILE, ">$FAIOutputFile") || die "Unable to write file $FAIOutputFile\n";
+  } else {
+      *FILE = *STDOUT;
+      print "___contents of ${FAIOutputFile}___\n";
+  }
+    print FILE << "EOM";
+BOOT_DEVICE=/dev/$BOOT_DEVICE
+ROOT_PARTITION=$root_partition
+BOOT_PARTITION=/dev/$BootPartition
+SWAPLIST="$swaps"
+EOM
+    close(FILE);
+}


Property changes on: branches/lhm/bin/setup_harddisks
___________________________________________________________________
Added: svn:executable
   + 

Added: branches/lhm/conf/NFSROOT
===================================================================
--- branches/lhm/conf/NFSROOT	                        (rev 0)
+++ branches/lhm/conf/NFSROOT	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,37 @@
+# package list for creating the NFSROOT
+
+PACKAGES aptitude
+nfs-common fai-nfsroot module-init-tools dhcp3-client ssh rdate lshw portmap
+bootpc rsync lftp less dump reiserfsprogs e2fsprogs usbutils
+hwinfo psmisc pciutils hdparm smartmontools parted mdadm lvm2
+dnsutils ntpdate dosfstools cvs jove xfsprogs xfsdump
+procinfo dialog discover mdetect
+console-tools console-common
+expect iproute udev subversion
+
+# needed for the simple examples
+cfengine2 libapt-pkg-perl
+
+# you should not edit the lines below
+# architecture dependend list of packages that are installed
+
+PACKAGES aptitude I386
+grub lilo read-edid
+linux-image-486 aufs-modules-2.6-486
+
+PACKAGES install AMD64
+grub lilo
+linux-image-2.6-amd64 aufs-modules-2.6-amd64
+
+PACKAGES aptitude IA64
+elilo gnu-efi efibootmgr
+
+PACKAGES aptitude SPARC
+silo sparc-utils
+
+PACKAGES aptitude ALPHA
+aboot
+
+PACKAGES aptitude POWERPC
+linux-image-2.6-powerpc aufs-modules-2.6-powerpc
+yaboot

Added: branches/lhm/conf/apt.conf
===================================================================
--- branches/lhm/conf/apt.conf	                        (rev 0)
+++ branches/lhm/conf/apt.conf	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,25 @@
+// This file is used in the chroot environment from install_packages
+// (called by rcS_fai)
+
+// Options for apt-get for FAI
+APT 
+{
+  // Options for apt-get
+  Get 
+  {
+     Assume-Yes "true";     
+     Fix-Missing "true";     
+     Show-Upgraded "true";
+     Purge "true";		// really purge! Also removes config files
+     List-Cleanup "true";
+     ReInstall "false";
+  };
+};
+
+DPkg 
+{
+  Options {
+	  "--abort-after=4711";	  // a magic number in cologne ;-)
+	  "--force-confdef";
+	  }
+};

Added: branches/lhm/conf/dhclient-fai.conf
===================================================================
--- branches/lhm/conf/dhclient-fai.conf	                        (rev 0)
+++ branches/lhm/conf/dhclient-fai.conf	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,16 @@
+# $Id: dhclient-fai.conf 3503 2006-06-09 13:15:26Z lange $
+
+# fai configuration for dhclient v3
+
+request
+
+  subnet-mask, domain-name-servers, domain-name,
+  host-name, routers, time-servers, ntp-servers, 
+  nis-domain, nis-servers, tftp-server-name;
+
+send dhcp-max-message-size 2048;
+
+timeout 30;
+retry 2;
+initial-interval 1;
+

Added: branches/lhm/conf/fai.conf
===================================================================
--- branches/lhm/conf/fai.conf	                        (rev 0)
+++ branches/lhm/conf/fai.conf	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,49 @@
+# $Id: fai.conf 4568 2007-09-13 10:21:58Z lange $
+
+# /etc/fai/fai.conf -- configuration for FAI (Fully Automatic Installation)
+
+# Access to Debian mirror via NFS mounted directory
+# If FAI_DEBMIRROR is defined, install clients mount it to $MNTPOINT
+#FAI_DEBMIRROR=yournfs debianmirror:/path/to/debianmirror
+
+# LOGUSER: an account on the install server which saves all log-files
+# and which can change the kernel that is booted via network.
+# Configure .rhosts for this account and PAM, so that root can log in
+# from all install clients without password. This account should have
+# write permissions for /srv/tftp/fai. For example, you can use write
+# permissions for the group linuxadm. chgrp linuxadm /srv/tftp/fai;chmod
+# g+w /srv/tftp/fai. If the variable is undefined, this feature is disabled.
+# Define it, to enable it, eg. LOGUSER=fai
+LOGUSER=
+
+# set protocol type for saving logs. Values: ssh, rsh, ftp
+FAI_LOGPROTO=ssh
+
+# the configuration space on the install server
+FAI_CONFIGDIR=/srv/fai/config
+
+# how to access the fai config space
+# default if undefined here: nfs://`hostname`/$FAI_CONFIGDIR
+# supported URL-types: nfs, file, cvs, cvs+ssh, svn+file, svn+http,
+# git, git+http, 
+#FAI_CONFIG_SRC=nfs://yourservername$FAI_CONFIGDIR
+
+#
+# Change the default monitoring message prefix
+#   host (default), pxe, mac
+#
+#FAI_MONITOR_SEND_ID=
+
+#
+# Default action on abort
+# valid values: reboot shutdown
+#
+#FAI_ABORT=reboot
+
+# the following variables are read only for most users
+
+# mount point where the mirror will be mounted
+MNTPOINT=/media/mirror
+
+# the local configuration directory on the install client
+FAI=/var/lib/fai/config

Added: branches/lhm/conf/fai_modules_off
===================================================================
--- branches/lhm/conf/fai_modules_off	                        (rev 0)
+++ branches/lhm/conf/fai_modules_off	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,23 @@
+# turn error messages of modprobe off
+
+alias block-major-8 off
+alias block-major-13 off
+alias block-major-22 off
+alias block-major-33 off
+alias block-major-34 off
+alias block-major-36 off
+alias block-major-48 off
+alias block-major-49 off
+alias block-major-50 off
+alias block-major-51 off
+alias block-major-52 off
+alias block-major-53 off
+alias block-major-54 off
+alias block-major-55 off
+alias block-major-72 off
+alias block-major-73 off
+alias block-major-104 off
+alias block-major-105 off
+alias net-pf-10 off
+alias net-pf-11 off
+alias net-pf-18 off

Added: branches/lhm/conf/make-fai-nfsroot.conf
===================================================================
--- branches/lhm/conf/make-fai-nfsroot.conf	                        (rev 0)
+++ branches/lhm/conf/make-fai-nfsroot.conf	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,32 @@
+# these variables are only used by make-fai-nfsroot(8)
+# here you can use also variables defined in fai.conf
+
+# directory on the install server where the nfsroot for FAI is
+# created, approx size: 390MB, also defined in bootptab or dhcp.conf
+NFSROOT=/srv/fai/nfsroot
+
+# TFTP root directory
+TFTPROOT=/srv/tftp/fai
+
+# Add a line for mirrorhost and installserver when DNS is not available
+# on the clients. This line(s) will be added to $nfsroot/etc/hosts.
+#NFSROOT_ETC_HOSTS="192.168.1.250 yourinstallserver"
+
+FAI_DEBOOTSTRAP="lenny http://ftp.debian.org/debian"
+
+# the encrypted (with md5 or crypt) root password on all install clients during
+# installation process; used when log in via ssh; default pw is: fai
+FAI_ROOTPW='$1$kBnWcO.E$djxB128U7dMkrltJHPf6d1'
+
+# location of a identity.pub file; this user can log to the install
+# clients in as root without a password; only useful with FAI_FLAGS="sshd"
+#SSH_IDENTITY=/home/admin/.ssh/identity.pub
+
+# directory of hooks to be sourced at the end of make-fai-nfsroot,
+# i.e they have to be shell scripts.
+#NFSROOT_HOOKS=/etc/fai/nfsroot-hooks/
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# following lines should be read only for most of you
+
+FAI_DEBOOTSTRAP_OPTS="--exclude=dhcp-client,info"

Added: branches/lhm/conf/menu.lst
===================================================================
--- branches/lhm/conf/menu.lst	                        (rev 0)
+++ branches/lhm/conf/menu.lst	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,44 @@
+# grub menu.lst for fai-cd
+
+# Boot automatically after some secs.
+timeout 30
+
+color light-gray/black light-gray/red
+default 6
+
+title |
+root (cd)
+title +------------------------------------------------------+
+root (cd)
+title |    FAI-CD (c) 2006, Thomas Lange, lange at debian.org   |
+root (cd)
+title | _VERSIONSTRING_ |
+root (cd)
+title +------------------------------------------------------+
+root (cd)
+title |
+root (cd)
+title |
+
+title boot from local disk
+rootnoverify (hd0)
+chainloader +1
+
+title Fully Automatic Installation - demohost (pw: installme)
+password installme
+kernel /boot/vmlinuz boot=live FAI_FLAGS="verbose,createvt" FAI_ACTION=install ip=192.168.1.1:::::eth0:off hostname=demohost
+initrd /boot/initrd.img
+
+title Fully Automatic Installation with GNOME (pw: installme)
+password installme
+kernel /boot/vmlinuz boot=live FAI_FLAGS="verbose,createvt" FAI_ACTION=install ip=192.168.1.1:::::eth0:off hostname=gnomehost
+initrd /boot/initrd.img
+
+title Fully Automatic Installation - faiserver (pw: installme)
+password installme
+kernel /boot/vmlinuz boot=live FAI_FLAGS="verbose,createvt" FAI_ACTION=install ip=192.168.1.250::192.168.1.254:255.255.255.0::xxx:off hostname=faiserver
+initrd /boot/initrd.img
+
+title FAI rescue system, no installation
+kernel /boot/vmlinuz boot=live FAI_FLAGS="verbose,createvt" FAI_ACTION=sysinfo ip=192.168.1.1:::::eth0:off hostname=demohost
+initrd /boot/initrd.img

Added: branches/lhm/conf/sources.list
===================================================================
--- branches/lhm/conf/sources.list	                        (rev 0)
+++ branches/lhm/conf/sources.list	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,10 @@
+# These lines should work for many sites
+# A more comprehensive example is at /usr/share/doc/fai-doc/examples/etc
+
+deb http://ftp.debian.org/debian lenny main contrib non-free
+#deb http://ftp.debian.org/debian lenny-proposed-updates main contrib non-free
+
+# repository that may contains newer fai packages for lenny
+#deb http://www.informatik.uni-koeln.de/fai/download lenny koeln
+
+deb http://security.debian.org/debian-security lenny/updates main contrib non-free

Added: branches/lhm/debian/NEWS
===================================================================
--- branches/lhm/debian/NEWS	                        (rev 0)
+++ branches/lhm/debian/NEWS	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,665 @@
+fai (3.2.8) unstable; urgency=low
+
+  - new partition tool setup-storage added
+
+ -- Thomas Lange <lange at debian.org>  Sun, 15 Jun 2008 12:47:16 +0200
+
+fai (3.2.2) unstable; urgency=low
+
+  - LOGDIR is now /var/log/fai/$HOSTNAME/$FAI_ACTION_date+time
+  - LOGDIR is /tmp/fai during an installation (not dirinstall), and
+    will be copied to the path above at the end of an installation
+
+ -- Thomas Lange <lange at debian.org>  Fri, 16 Nov 2007 17:46:49 +0100
+
+fai (3.2) unstable; urgency=low
+
+  - replace special fai-kernels with plain Debian kernel and an initrd
+    build by initramfs ($KERNELPACKAGE removed)
+  - FAI uses live-initramfs for booting, the whole nfsroot is now
+    writeable for the clients (by using unionfs)
+  - fai-cd can create bootable USB sticks
+  - major update to the fai guide
+  - scp/ssh are now the default methods instead of rcp/rsh when
+    contacting the install server
+  - faimond can now call fai-chboot (instead of rsh/ssh call)
+  - Task extrbase can also extract files from directory ../basefiles/
+  - /tmp/target is now /target
+
+ -- Thomas Lange <lange at debian.org>  Tue, 21 Aug 2007 17:43:30 +0200
+
+fai (3.1) unstable; urgency=medium
+
+  - rename action dirinst to dirinstall
+  - fai: add option -u,--hostname 
+
+ -- Thomas Lange <lange at debian.org>  Wed, 18 Oct 2006 16:18:36 +0200
+
+fai (3.0) unstable; urgency=low
+
+  - WARNING: the fai-guide does not yet reflect the changes from FAI 2 to FAI 3
+  - rename NEWS to NEWS.Debian
+  - /etc/fai/sources.list moved to /etc/fai/apt/sources.list
+  - lots of new pathes:
+    use /srv/tftp/fai instead of /boot/fai
+    use /srv/tftp/fai/pxelinux.cfg instead of /boot/fai/pxelinux.cfg
+    use /srv/fai/config  instead of /usr/local/share/fai
+    use /srv/fai/nfsroot instead of /usr/lib/fai/nfsroot
+    use /var/lib/fai/config instead of /fai
+    use /var/lib/fai/mirror instead of /mnt
+  - changed file names
+    variables.sh is now variables.log
+  - new config file /etc/fai/NFSROOT which contains the package list
+    for the nfsroot
+  - changes in variables
+    remove FAI_REMOTESH and FAI_REMOTECP from fai.conf,
+     use FAI_LOGPROTO instead 
+    remove $installserver and $mirrorhost in fai.conf
+    replace FAI_LOCATION by FAI_CONFIG_SRC, use default if undefined:
+      "nfs://`hostname`$FAI_CONFIGDIR"
+    LOGSERVER, LOGREMOTEDIR, LOGPASSWD removed from fai.conf, set
+      them in the config space
+    MNTPOINT now set to /media/mirror
+    SERVERINTERFACE not needed by default in make-fai-nfsroot.conf
+    NFSROOT moved to make-fai-nfsroot.conf
+    FAICLIENTS, NFSROOT_PACKAGES removed from make-fai-nfsroot.conf
+    $terror renamed to $task_error
+    all flags from FAI_FLAGS are now defined as $flag_xxx
+    $time_zone renamed to $TIMEZONE
+    $videodrv renamed to $VIDEODRIVER
+    $FAI_CONSOLEFONT renamed to $CONSOLEFONT
+    $FAI_KEYMAP renamed to $KEYMAP
+    $rootpw renamed to $ROOTPW
+    $moduleslist renamed to $MODULESLIST
+    new variable FAI_ALLOW_UNSIGNED
+  - task_updatebase does not use updatebase.log any more
+  - task_updatebase now logs to fai.log
+  - all IP addresses of the install server are added to $NFSROOT/etc/hosts
+  - automatic reboot if no errors are found (if error.log is empty)
+  - new task dirinst for creating a chroot environment
+  - try ftar $FAI/basefiles before extracting base.tgz
+  - install_packages: new option -p (see man install_packages)
+  - make-fai-nfsroot: add option -V (see man make-fai-nfsroot)
+  - fai-chboot: change in options, -d is now -D, -r is now -d, -r is
+    not used any more
+  - add policy-rc.d support
+  - move some -c to -C, so now all scripts use -C for cfdir, setting
+    $FAI_ETC_DIR does the same
+  - fai-cd can now eject the CD after installation
+  - fai-mirror remove option -a (now default), add -B
+  - default is kernel 2.6.17
+  - convert cfengine (version 1) scripts to cfengine2
+  - rename class XFREE to XORG
+  - new script ainsl, implements AppendIfNoSuchLine from cfeninge in Perl
+  - config space can be checked out from a subversion repository
+
+ -- Thomas Lange <lange at debian.org>  Wed, 27 Sep 2006 14:41:11 +0200
+
+fai (2.10.1) unstable; urgency=low
+
+  - minor fix in fai-chboot
+  - packages in /files/packages are not supported any more
+  - fai-mirror: add option -C
+  - fai-cd: add option -C, grub menu now shows FAI version
+  - after the installation you can leave the FAI-CD in the drive,
+    since it now boot from local disk by default
+  - FAI_FLAG syslogd was removed, syslogd is now started by default
+
+ -- Thomas Lange <lange at debian.org>  Thu, 20 Apr 2006 11:46:12 +0200
+
+fai (2.10) unstable; urgency=low
+
+  - add option -n to fcopy
+  - several new listing options for fai-chboot, add option -c for
+    copying PXE configurations
+  - verbose output when defining variables
+  - add urpmi and yum support to install_packages
+  - add new subroutine mkrw(), which makes read-only directories
+    writeable. Very cool and usefull thing until we can use unionfs
+  - When booting from fai-cd the config space /fai is now writeable
+  - class FAISERVER sets up an apt-proxy
+
+ -- Thomas Lange <lange at debian.org>  Mon,  3 Apr 2006 15:11:30 +0200
+
+fai (2.9.1) unstable; urgency=low
+
+  - new class FAISERVER can install the fai install server from CD
+  - new command fai-statoverride
+  - some bug fixes
+
+ -- Thomas Lange <lange at debian.org>  Sun,  5 Mar 2006 22:37:31 +0100
+
+fai (2.9) unstable; urgency=low
+
+  - lots of bug fixes
+  - splitting the FAI package into more packages:
+    fai-server, fai-client, fai-nfsroot, fai-doc, fai-quickstart
+  - use a 2.6 kernel by default
+  - Config scripts named S[0-9][0-9]* are not executed any
+    more. Rename them to match [0-9][0-9]*.
+  - fcopy now supports a preinst script, add option -U, ignore .svn
+    directories
+  - new option -I for make-fai-bootfloppy can specify default
+    interface, new option -B creates 2.88M floppy
+  - use md5 hash for passwords
+  - backticks and variables can't be used in package_config any more
+  - root-path does not need to be defined in dhcpd.conf any more
+    (fai-chboot does it for you)
+  - fai-cd's El Torito boot image is not limited to 2.88M any more
+
+ -- Thomas Lange <lange at debian.org>  Tue, 13 Dec 2005 15:53:00 +0100
+
+fai (2.8.4) unstable; urgency=high
+
+  - small but important bug fix: remove non-US entry
+
+ -- Thomas Lange <lange at debian.org>  Wed, 25 May 2005 13:59:39 +0200
+
+fai (2.8.3) unstable; urgency=high
+
+  - remove debconf support for package itself, debconf support for
+    the installation was not removed
+
+ -- Thomas Lange <lange at debian.org>  Thu, 19 May 2005 15:54:18 +0200
+
+fai (2.8.2) unstable; urgency=high
+
+  - close some bugs, which occured when using softupdates
+
+ -- Thomas Lange <lange at debian.org>  Fri,  6 May 2005 09:23:34 +0200
+
+fai (2.8.1) unstable; urgency=low
+
+  - minor bug fixes
+  - added $COLOR_FAI_LOGO which is off unless doing initial
+    installations
+  - added german and french translation of the debconf templates
+  - task sysinfo mounts the local partitions read only
+  - move some classes from 10-base-classes to the new script
+    50-host-classes  
+  - fixed a lot of typos in the fai guide
+
+ -- Thomas Lange <lange at debian.org>  Sat, 30 Apr 2005 21:20:53 +0200
+
+fai (2.8) unstable; urgency=high
+
+  - rename rcS_fai to fai, add manual page fai.8
+  - new simple examples using class FAIBASE
+  - add debconf support for the package itself
+  - new action softupdates, update a system without reinstallation
+  - fai-do-scripts now executes scripts matching [0-9][0-9]*
+  - rcS.log is now fai.log
+  - major updates in fai-guide (softupdate, fai on other archs)
+  - add task prepareapt
+  - variable $addpackages removed from examples scripts
+
+ -- Thomas Lange <lange at debian.org>  Sat,  9 Apr 2005 23:43:27 +0200
+
+fai (2.7) unstable; urgency=high
+
+  - closes grave and important bugs
+  - add fai-cd(8) script for creating a bootable FAI CD image
+  - add option -a to fai-mirror
+  - add option -d to install_packages
+
+ -- Thomas Lange <lange at debian.org>  Fri, 25 Mar 2005 23:51:34 +0100
+
+fai (2.6.7) unstable; urgency=low
+
+  - add task debconf and new script fai-debconf for preseeding
+  - minor updates in the fai guide
+
+ -- Thomas Lange <lange at debian.org>  Thu, 10 Mar 2005 11:00:05 +0100
+
+fai (2.6.6) unstable; urgency=medium
+
+  - new command fai-mirror(1) to create a partial Debian mirror
+  - setup_harddisks: bug fix: error redefined mountpoint is wrongly
+    reported, allow space before keywords primary and logical
+  - install_packages: add option -f
+  - task_sysinfo calls hwinfo if available (very nice hardware info)
+  - 06hwdetect.source: SCSI detect code for 2.6 kernel
+  - new variable FAICLIENTS in make-fai-nfsroot.conf. Used by
+    fai-setup for exporting the nfsroot and the config space via NFS
+  - create a list of all packages in base.tgz (for fai CD)
+  - ftar: test if directory is / before removing files recursively
+  - enable shadow passwords for passwd and group in examples
+  - save files FAI_CLASSES, variables.sh and disk_var.sh to
+    /var/log/fai not to /etc/fai
+  - add supprt for booting from CD
+  - other bug fixes
+
+ -- Thomas Lange <lange at debian.org>  Fri, 21 Jan 2005 04:24:26 +0100
+
+fai (2.6.5) unstable; urgency=medium
+
+  - fcopy now handles svn and arch subdirectories, added option -I
+  - install_packages does not remove unknown package names when
+    using aptitude, so aptitude's search patterns can be used
+
+ -- Thomas Lange <lange at debian.org>  Thu, 11 Nov 2004 15:14:08 +0100
+
+fai (2.6.4) unstable; urgency=medium
+
+  - bug fixes
+  - install_packages and files in package_config/ have now support
+    for aptitude
+
+ -- Thomas Lange <lange at debian.org>  Mon,  8 Nov 2004 14:38:58 +0100
+
+fai (2.6.3) unstable; urgency=high
+
+  - make $rootpw not readable for users
+  - use default kernel 2.4.27
+  - fai-setup: add option -e
+  - make-fai-nfsroot: add option -K
+  - add xfs support into the nfsroot
+  - define kernel parameters using $kappend 
+
+ -- Thomas Lange <lange at debian.org>  Mon, 13 Sep 2004 18:40:36 +0200
+
+fai (2.6.2) unstable; urgency=high
+
+  - Workaround to support new tasksel behaviour
+  - fix broken grub entry when using class FAI_BOOTPART
+  - fai-chboot: add option -e
+
+ -- Thomas Lange <lange at debian.org>  Thu, 26 Aug 2004 20:09:15 +0200
+
+fai (2.6.1) unstable; urgency=medium
+
+  - new option -k for make-fai-nfroot only installs a new kernel
+  - catnc() greps now through multiple files
+  - when logging in with ssh all variables for FAI are defined by
+    sourcing /tmp/fai/variables.sh
+  - faireboot sends message to fai monitor daemon
+  - install_packages now supports taskrm (which calls tasksel
+    remove), default number of packages that are install with one
+    command is set to 99
+  - better support for installing a client with a different hostname
+    than during installaion
+
+ -- Thomas Lange <lange at debian.org>  Mon,  9 Aug 2004 14:02:13 +0200
+
+fai (2.6) unstable; urgency=low
+
+  - make FAI ready-to-use for sarge
+  - make the examples much easier, remove a lot of unused stuff
+  - fai.conf is split into two files, make-fai-nfsroot specific
+    variables are moved to /etc/fai/make-fai-nfsroot.conf
+  - make-fai-nfsroot: more packages for hardware detection included,
+    write a warning if $FAI_SOURCES_LIST is used
+  - rcS_fai: if a file /.nocolorlogo exists, do not enable colored
+    logo and let scroll region unchanged
+  - 06hwdetect.source: better hardware detection uses discover2,
+    load all pci IDE drivers, enables DMA mode for disks, include
+    code of 11modules.source
+  - task_sysinfo: show serial numbers of hard disks, show usb
+    information
+  - tasks can set return code ($terror) so faimond receives it
+  - faimond receives more messages
+  - fai-chboot: new options -d, can use localboot, so we need not
+    copy the kernel image and initrd to the install server
+  - grub-install does not probe floppy drive (which can hang the system
+    for a long time)
+  - install_packages: add option -L, new code for detecting unknown
+    package names which uses perl module AptPkg
+  - mkdebmirror: mirrors now woody and sarge in one directory
+
+ -- Thomas Lange <lange at debian.org>  Mon, 26 Jul 2004 17:22:44 +0200
+
+fai (2.5.4) unstable; urgency=low
+
+  - fix bug in make-fai-bootfloppy when using -f
+  - make-fai-bootfloppy: added option -i that creates a bootable
+    ISO9960 cdrom image 
+  - some sparc and PowerPC adjustments
+
+ -- Thomas Lange <lange at debian.org>  Thu, 26 Feb 2004 17:07:31 +0100
+
+fai (2.5.3) unstable; urgency=low
+
+  - default kernel is 2.4.24
+  - add option -c to make-fai-{nfsroot,bootfloppy} to define a
+    different configuration directory than /etc/fai
+  - make-fai-bootfloppy: add option -c and -F, now DHCP is the
+    default protocol when -d is not used
+  - fai.conf: exclude more packages from debootstrap
+    adjust KERNELPACKAGE to new name (since fai-kernels_1.6)
+    put important variables to the top
+    remove some comments
+  - fai-chboot: new option -S sets FAI_ACTION=sysinfo
+  - The variable FAI_SOURCES_LIST is now obsolete,
+    use /etc/fai/sources.list or /etc/apt/sources.list instead
+  - new examples for sources.list in
+    /usr/share/doc/fai/examples/etc/sources.list
+  - remove some packages that are not needed and not available in
+    sarge
+  - utility chkdebnames mostly rewritten
+  - package recommends mknbi, and does not work with netboot package
+    when using BOOTP
+
+ -- Thomas Lange <lange at debian.org>  Wed,  4 Feb 2004 14:42:40 +0100
+
+fai (2.5.2) unstable; urgency=low
+
+  - fai monitor daemon added, see faimond(8)
+  - colored copyright message on console
+  - variable hdparm included again; can be used if the kernel does
+    not enables DMA for brand new IDE controllers by default
+  - package names can contain pinning information
+  - preferences file is copied from /etc/fai if it exists
+  - default kernel version is 2.4.22
+  - bug fixes
+
+ -- Thomas Lange <lange at debian.org>  Tue,  6 Jan 2004 15:20:10 +0100
+
+fai (2.5.1) unstable; urgency=low
+
+  - minor bug fixes
+  - added chapter to the fai guide how to receive the configuration
+    space using CVS 
+  - initrd support when booting new kernel via network
+
+ -- Thomas Lange <lange at debian.org>  Fri, 10 Oct 2003 14:58:16 +0200
+
+fai (2.5) unstable; urgency=low
+
+  - a new section in the manual which describes a simple
+    installation example. Read the chapter 'For the impatient user'
+  - old templates now split into simple and advanced examples. They
+    are located in /usr/share/doc/fai/examples/{simple,advanced}
+  - added script fai-chboot which manages the network boot
+    configuration files for PXE boot
+  - the installation time is printed in seconds
+  - menu entries for grub now works also if /boot is a separate
+    partition
+  - number of packages installed at a time can be limited (use
+    $MAXPACKAGES)
+  - log files can be saved using FTP protocol
+  - the files in /fai/class that are list of classes can contain
+    comment lines. All lines starting with a hash are ignored
+  - syslogd now works during installation
+  - add an grub entry for memtest86 if installed
+  - do not fsck ext3 partitions
+  - add -M option to fcopy
+  - make-fai-nfsroot: new option -f; print error message if it fails
+  - a new example configuration for a demo host using GNOME, DHCP
+  - added XFS support to setup_harddisks
+  - files class/*.mod and modules.log removed, use 11modules.source
+    instead
+  - packages for xfree server now in file/class XFREE
+  - added SunOS support; you can install Solaris using FAI
+  - bug fixes as always
+
+ -- Thomas Lange <lange at debian.org>  Wed,  6 Aug 2003 16:02:26 +0200
+
+fai (2.4.1) unstable; urgency=low
+
+  - use dhcp3, dhcp support was broken in FAI 2.4
+  - disk_config examples are using ext3 file systems
+  - add SERVERINTERFACE to fai.conf
+  - add FAI_BOOT to fai.conf; the list of boot protocols to set
+    up (boot or dhcp or both)
+  - DHCP install kernel file /boot/fai/installkernel renamed to
+    vmlinuz-install 
+  - new script fai-do-scripts; include the functions from do_script
+    and task_configure, this makes the Solaris port easier
+  - some bug fixes
+
+ -- Thomas Lange <lange at debian.org>  Thu,  3 Apr 2003 16:57:12 +0200
+
+fai (2.4) unstable; urgency=low
+
+  - Era Erikson did some great work on proofreading all manuals and
+    script comments. Great work Era!
+  - lots of updates in the fai guide
+  - use the script fai-class for defining classes; scripts in class/
+    must not have prefix S; the following command renames your
+    existing scripts so they will work with the new command:
+    rename 's/S(\d\d.+)(\.sh|\.pl)/$1/' S*
+    the order of scripts executed has slightly changed; all classes
+    from the file $HOSTNAME are defined after the scripts in class/
+    are executed; the suffix .sh or .pl is not needed any more,
+    fai-class has a manual page
+  - kernel 2.4.20 is the default kernel during installation
+  - USB keyboard support during installation
+  - make-fai-bootfloppy creates a more generic boot floppy which
+    uses grub or lilo as boot loader, it supports more than one boot
+    protocol, more disk space is available on the floppy
+  - the exit status of every hook and script is written to
+    status.log
+  - the hook faiend.LAST parses all log files for warnings and
+    errors and writes them to error.log
+  - variable.sh lists all variables defined after task defvar has finished
+  - FAI_LOCATION is now defined in fai.conf, FAI_ACTION is defined
+    in LAST.var, do not use T170 and T171 via a BOOTP or DHCP server
+    (but it is still possible)
+  - hooks can make their tasks to be skipped (as in fai 2.2)
+  - templates scripts and config files has been rewritten and added
+    (eg. WWWKIOSK, a notebook with Windows and Linux)
+  - a new default location for the Debian mirror (in mkdebmirror and
+    fai.conf)
+  - much of reorganizing the code, but this does not change the user
+    visible behavior
+  - some functions that were defined as shell subroutines are now
+    separate scripts in /usr/lib/fai (fai-class, create_ramdisk,
+    prepare_apt, fai-divert, fai-savelog, task_sysinfo, ...), they
+    are not standalone script, most of them only work in the fai
+    environment, this should solve the problems with a too big
+    environment (when using xargs)
+  - PATH always starts with /usr/local/{sbin,bin}
+  - new FAI_FLAG syslogd starts log daemons (syslogd and klogd) only
+    on demand
+  - save log files to host $LOGSERVER if defined, otherwise use
+    $SERVER
+  - make-fai-nfsroot always does setup for dhcp and bootp, and uses
+    following sources to create the file sources.list for the
+    nfsroot: the variable $FAI_SOURCES_LIST or the files
+    /etc/fai/sources.list or /etc/apt/sources.list
+  - you can add a list of classes after the PACKAGE command in files
+    in package_config, so the following packages will only be
+    installed for this class (Please only use this in the file
+    package_config/DEFAULT)
+  - fcopy has new option -i and -B
+  - the variable addpackages can contain a list of packages without
+    their version number, therefore /fai/files/packages should be a
+    simple repository
+  - a lot of bug fixes
+
+ -- Thomas Lange <lange at debian.org>  Thu, 13 Feb 2003 11:45:29 +0100
+
+fai (2.3.4) unstable; urgency=low
+
+  - the default name for fai kernel-image package has changed to
+    kernel-image-2.2.20_fai1_i386.deb, since the package fai-kernel
+    >=1.4 contains install kernels which support both the BOOTP and
+    DHCP protocol
+
+ -- Thomas Lange <lange at debian.org>  Thu, 16 May 2002 14:42:00 +0200
+
+fai (2.3.3) unstable; urgency=medium
+
+  - important bug fix (wrong symlink for rcS_fai)
+  - copy id_dsa* and id_rsa* files in make-fai-nfsroot
+  - use strict enabled in perl scripts
+  - add "append ip=dhcp" in pxelinux.cfg/default
+  - minor changes in package_config files
+  - setup_harddisks default fs type changed from auto to ext2
+
+ -- Thomas Lange <lange at debian.org>  Thu, 16 May 2002 09:27:15 +0200
+
+fai (2.3.2) unstable; urgency=low
+
+  - minor bug fixes
+  - minor changes in package_config files
+  - use discover command for hardware detection and loading of scsi
+    kernel modules in class/S03hwdetect.source
+  - use swap partitions during installation if available
+
+ -- Thomas Lange <lange at debian.org>  Mon, 29 Apr 2002 19:47:39 +0200
+
+fai (2.3.1) unstable; urgency=low
+
+  - some minor bug fixes
+  - add variable $addpackages to DEFAULT.var
+  - $FAI_SUBDIR renamed to $FAI_SHAREDIR (fai.conf)
+  - changes in package_config files
+  - additional method to determine all ethernet devices
+  - manual updates for woody
+  - added a lot of comments into shell script
+  - add option -m to make-fai-bootfloppy
+
+ -- Thomas Lange <lange at debian.org>  Tue, 16 Apr 2002 13:30:04 +0200
+
+fai (2.3) unstable; urgency=low
+
+  - all default configurations are for Debian 3.0 aka woody
+  - /etc/fai.conf moved to /etc/fai/fai.conf
+  - moved some variables from fai.conf to class/*.var
+  - add FAI_DEBOOTSTRAP_OPTS to fai.conf
+  - temporary files are stored to $LOGDIR (default to /tmp/fai/),
+    can be set in fai.conf using mktemp if desired
+  - log files for every new run are stored in a separate directory,
+    last-$FAI_ACTION is pointing to the last log directory 
+  - if a task is skipped, also all its hooks are skipped
+  - uname -s in uppercase is also a default class
+  - all class/S[0-9]*.source scripts are sourced
+  - hooks that end in .source are sourced (formerly .sh), so they
+    can define variables
+  - new adddivert routine; make a diversion for a file and add it to
+    the list of all diversions; you need not care about removing the
+    diversion; the finish task will do this for you
+  - class/*.mod files can now define variables
+  - new examples class/S30menu.source (was hook/install.MENU)
+  - /fai can be a different location using $FAI in fai.conf
+  - /fai can be retrieved from a CVS repository: (see variables
+    FAI_LOCATION, FAI_CVSROOT, FAI_CVSMODULE) and create a
+    /etc/fai/.cvspass
+  - /etc/apt/preferences will be copied to nfsroot
+  - additional manual pages for fai-setup, make-fai-nfsroot,
+    make-fai-bootfloppy, install_packages
+  - setup_harddisks: called with option -d (DOS alignment)
+    support for ext3 and disk controllers using /dev/ida/, /dev/rd/
+    and /dev/cciss (Compaq SMART2 raid array and Mylex DAC960 PCI
+    RAID controller)
+  - make-fai-bootfloppy can write to a file, creates environment for
+    DHCP using pxelinux, does not copy System.map to floppy (now
+    more space left for the kernel image), new option -s
+  - bootpc and dhcp request will use only active network devices
+    ($netdevices_up determined by netdevice_info()) by default,
+    which can be overwritten with $netdevices 
+  - add a hint how to set up the kernel automounter for scratch
+    partitions
+  - fcopy skips CVS directories, executes postinst script if file
+    was copied, new options -L and -P
+  - added prtnetgr script which prints a flat list of all hosts
+    belonging to a netgroup
+  - execute all /fai/scripts/$class/S[0-9]* scripts if this
+    directory exists, so it's possible to execute multiple scripts
+    for one class; see examples in scripts/NETWORK/ and scripts/DEFAULT/
+  - use shm (was tmpfs) for ramdisk if available
+  - mkdebmirror uses passive ftp mode
+  - task sysinfo calls kudzu
+  - added THANKS file
+
+ -- Thomas Lange <lange at debian.org>  Tue,  9 Apr 2002 18:29:15 +0200
+
+fai (2.2.3) unstable; urgency=low
+
+  - woody support improved, but the default configuration is still
+    for potato
+  - added disk configuration for Beowulf nodes
+  - Wake on LAN section added to FAI guide
+  - reiserfs support in setup_harddisks (thanks to Diane Trout)
+  - make-fai-nfsroot -v output can be redirected to a file
+  - sysinfo also uses detect and discover to probe for hardware
+  - utilities moved to /usr/share/fai/utils
+  - install_packages checks all package names. If a package name is
+    misspelled, it will be removed from the installation list
+  - added class NOGETTY
+  - package_config: new action "hold", PRELOAD can use a file: url
+
+ -- Thomas Lange <lange at debian.org>  Thu,  8 Nov 2001 17:01:02 +0100
+
+fai (2.2.2) unstable; urgency=low
+
+  - bug fix: getting dhcp information
+  - added jmon to BEOWULF
+
+ -- Thomas Lange <lange at debian.org>  Wed, 10 Oct 2001 10:52:35 +0200
+
+fai (2.2.1) unstable; urgency=low
+
+  - FAI_FLAGS can be space or comma separated. They must be space
+    separated in bootptab. Use a comma to separate them as
+    additional kernel parameters.
+  - bootp requests on multiple ethernet devices show device name
+    (Thanks to Geert Stappers)
+  - script all_hosts doesn't use hardcoded list of hosts any more;
+    now it uses the netgroup allhosts
+
+ -- Thomas Lange <lange at debian.org>  Fri,  5 Oct 2001 17:19:14 +0200
+
+fai (2.2) unstable; urgency=low
+
+  - the fai guide has a new chapter about building a Beowulf cluster
+  - new utilities for Beowulf cluster: all_hosts and rshall
+  - new utility softupdate for updating packages on a running system
+  - improved example for diskless hook
+  - major reorganization of the rcS_fai code; most parts are moved
+    to the subroutines file
+  - source /fai/hooks/subroutines if file exists; here you can define
+    your own subroutines or redefine FAIs subroutines
+  - most tasks are now executed via task() and the name of the task
+    as option. This subroutine looks for a hook with the given name
+    and executes it. Hooks can skip the default task of FAI (called
+    task_<name>) by using skiptask(). So, hooks can replace the
+    default behavior, and not only add functions to the
+    installation process
+  - hooks can define classes by writing class names to
+    /tmp/additional-classes and variable by writing line to
+    /tmp/additional.var 
+  - new hooks/tasks added
+  - classes and variables are now defined in the very beginning
+    before task_action is called and $FAI_ACTION is evaluated
+  - FAI_ACTION can be any user defined value. FAI is looking for a
+    command in /fai/hooks/$FAI_ACTION and executes it.
+  - log file prepare-apt.log renamed to updatebase.log
+  - debian-non-US in local mirror script (mkdebmirror) has new location
+  - new type "PACKAGE taskinst" in package_config can install new
+    task packages (for Debian 3.0 and later releases)
+  - get_bootp_inf() and get_dhcp_info() support multiple ethernet
+    devices via $netdevices
+  - $netdevices can be set or automaticly determined to the list of
+    ethernet devices
+  - make-fai-bootfloppy: handle symlinks of lilo 21.5 and newer
+  - tlink can show symlink of a host or all file in /boot/fai
+  - new classes NOSECURETTY, BEOWULF, NOTCPD
+
+ -- Thomas Lange <lange at debian.org>  Fri, 14 Sep 2001 14:35:49 +0200
+
+fai (2.1) unstable; urgency=low
+
+  - NEWS file added (you found it already ;-), which contains the
+    user visible changes; changelog file is for developers
+  - woody support
+  - define $FAI_DEBOOTSTRAP for using debootstrap
+  - you can add your own functions using hooks (read the manual)
+  - /fai/fai_config not used anymore, replaced by a hook
+  - setup_harddisk does not complain when root partition is not in
+    the first 8GB, do not complain if not a primary partition
+  - no more problems when using other locales
+  - support for diskless clients
+  - grub support, new class LILO and GRUB
+  - new flag createvt; add this to FAI_FLAGS to get two additional
+    terminals and ctrl-c will interrupt the installation
+    process. Otherwise ctrl-c will reboot and no terminals are
+    available. In the past, this function was enabled by default.
+    Add createvt to FAI_FLAGS to get the old behavior.
+  - before any classes are defined using the scripts in /fai/class,
+    the classes DEFAULT, $HOSTNAME and LAST are defined
+  - new utility chkdebnames can check package names for a certain
+    distribution
+
+ -- Thomas Lange <lange at debian.org>  Fri, 20 Jul 2001 11:55:29 +0200

Added: branches/lhm/debian/changelog
===================================================================
--- branches/lhm/debian/changelog	                        (rev 0)
+++ branches/lhm/debian/changelog	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,2408 @@
+fai (3.2.16-lhm8) halut; urgency=low
+
+  * New workarround if usb-devices are connected to the system.
+  	We abort the installation.
+    Connected usb-devices may cause problems with the order of harddisks in grub. 
+
+ -- Tobias Fischbach <tobias.fischbach at muenchen.de>  Thu, 15 Oct 2009 17:22:08 +0200
+
+fai (3.2.16-lhm7) halut; urgency=low
+
+  * Bugfix in disk-info script. USB-device-detection failed. 
+
+ -- Tobias Fischbach <tobias.fischbach at muenchen.de>  Fri,  9 Oct 2009 13:12:39 +0200
+
+fai (3.2.16-lhm6) halut; urgency=low
+
+  * Always use new configuration files for softupdates
+
+ -- Ignaz Forster <ignaz.forster at muenchen.de>  Thu, 24 Sep 2009 11:40:08 +0200
+
+fai (3.2.16-lhm5) halut; urgency=low
+
+  * Apply aptopt on softupdates
+
+ -- Ignaz Forster <ignaz.forster at muenchen.de>  Tue, 22 Sep 2009 16:45:02 +0200
+
+fai (3.2.16-lhm4) halut; urgency=low 
+
+  * Change all Dpkg::Options from "--force-confold" to "--force-confnew"
+    (bin/install_packages, lib/updatebase)
+
+ -- Jan-Marek Glogowski <jan-marek.glogowski at muenchen.de>  Tue, 15 Sep 2009 16:17:35 +0200
+
+fai (3.2.16-lhm3) halut; urgency=low
+
+  [disk-info]
+    * Skip non existing block devices
+    * Skip block devices on usb bus
+  
+  * fai-class: always use a lowercase hostname for matches
+
+ -- Jan-Marek Glogowski <jan-marek.glogowski at muenchen.de>  Mon, 14 Sep 2009 15:51:40 +0200
+
+fai (3.2.16-lhm2) halut; urgency=low
+
+  * added fix (see #5046) to make perl scripts work again 
+
+ -- Florian Maier <limux_packaging at muenchen.de>  Mon, 30 Mar 2009 13:02:04 +0200
+
+fai (3.2.16-lhm1) halut; urgency=low
+
+  * New upstream release
+  * Always run faiend, so we can hook it
+  * New FAI_FLAG faiend, to run faiend task, even if not installing
+
+ -- Jan-Marek Glogowski <jan-marek.glogowski at muenchen.de>  Mon,  9 Feb 2009 14:37:54 +0100
+
+fai (3.2.16) unstable; urgency=high
+
+  [ Thomas Lange ]
+  * fai: fix RC bug, missing umount (closes: #511391)
+  * README: year++
+  * prcopyleft: year++
+
+  [ Colin Tuckley ]
+  * fixed spelling mistakes in faimond.8, faimond-gui.1
+
+ -- Thomas Lange <lange at debian.org>  Mon, 12 Jan 2009 13:12:26 +0100
+
+fai (3.2.15) unstable; urgency=low
+
+  [ Thomas Lange ]
+  * fai-server.manpages: faimond-gui.1 was not included into the package
+  * fix typos in mkdebmirror, NEWS, classes_description.txt, fai-mirror,
+    fai-cd.8, fai-guide.sgml
+  * lib/subroutines: check *.var files if they are readable
+  * bootexample.sgml: fix typo
+  * dhcpd.conf/FAISERVER: fix wrong path in example
+  * links.html: fix typo (closes: #508598)
+  * fai-guide.sgml: fix package name in documentation (closes: #504797)
+  * get-boot-info: fix wrong test parameter (closes: #509090)
+  * setup-storage: increase version number
+  
+  [ Colin Tuckley ]
+  * fixed spelling mistakes in fai-do-scripts.1, fai-mirror.1
+  
+  [ Sebastian Harl ]
+  * fai-guide.sgml: fix several typos, mention Git, use $FAI instead of
+    /fai (closes: #507129)
+  
+  [ Michael Tautschnig ]
+  * Commands.pm: Print an informational message whenever a volume or
+    partition is preserved or resized (closes: #508893)
+  
+ -- Thomas Lange <lange at debian.org>  Mon, 22 Dec 2008 14:51:54 +0100
+
+fai (3.2.14) unstable; urgency=low
+
+  * fai-guide.sgml: document behaviour of LOGSERVER (closes: #361524)
+  * install_packages: fix usage of option -n (closes: #489546)
+  * setup-storage, Commands.pm, Exec.pm: Call udevsettle before doing any
+    of the commands to avoid all the possible pitfalls, simplyfies the
+    code quite a bit. (closes: #503729)
+
+ -- Thomas Lange <lange at debian.org>  Tue, 28 Oct 2008 10:32:20 +0100
+
+fai (3.2.13-lhm2) halut; urgency=low
+
+  * Set default FAI_ABORT to reboot
+  * Fix missed fixed live-initramfs-tools directory string
+  * Don't error on missing live-initramfs-tools
+
+ -- Jan-Marek Glogowski <jan-marek.glogowski at muenchen.de>  Mon, 27 Oct 2008 15:18:43 +0100
+
+fai (3.2.13-lhm1) halut; urgency=low
+
+  * New upstream release
+  * Inverse unset shutdown and reboot flags
+  * Export FAI_ABORT changes
+  * Cleanup make-fai-nfsroot from unused stuff
+
+ -- Jan-Marek Glogowski <jan-marek.glogowski at muenchen.de>  Fri, 24 Oct 2008 20:50:21 +0200
+
+fai (3.2.13) unstable; urgency=low
+
+  * lib/setup-storage/Commands.pm: fixed dependency error in vgcreate
+    commands (closes: #502462)
+  * fcopy: fix ordering of classes (closes: #502975)
+
+ -- Thomas Lange <lange at debian.org>  Wed, 22 Oct 2008 12:14:51 +0200
+
+fai (3.2.12) unstable; urgency=low
+
+  * setup-storage/Parser.pm, setup-storage/Sizes.pm: Warn, if a
+    preserved partition does not match the size specified in the
+    disk_config; fail, if an extended partition is to be created in place
+    of a to-be-preserved partition (closes: #501772)
+  * setup-storage/Exec.pm: recent versions of parted log errors to
+    stdout instead of stderr + adaption of error messages to current ones
+    (closes: #500823)
+  * setup-storage/Volumes.pm: Handle new error message in case of
+    missing disk label (closes: #500823)
+  * setup-storage: extended debug output of sorted commands
+    (closes: #500822)
+  * setup-storage/Commands.pm: Properly sort commands, fixed dependency
+    errors, use start_byte for new config instead of begin_byte
+    (closes: #500822)
+  * setup-storage: increase version number
+  * make-fai-nfsroot: print version of debootstrap (closes: #500046)
+  * fai-guide.sgml: minor update in example
+  * fai-chboot.8: fix warning from man
+
+ -- Thomas Lange <lange at debian.org>  Wed, 15 Oct 2008 11:25:39 +0200
+
+fai (3.2.11-lhm2) halut; urgency=low
+
+  * Rename initramfs-utils -> initramfs-tools 
+
+ -- Jan-Marek Glogowski <jan-marek.glogowski at muenchen.de>  Thu, 16 Oct 2008 13:56:06 +0200
+
+fai (3.2.11-lhm1) halut; urgency=low
+
+  * Move live-initramfs dependency -> recommendation
+
+ -- Jan-Marek Glogowski <jan-marek.glogowski at muenchen.de>  Thu, 16 Oct 2008 13:25:19 +0200
+
+fai (3.2.11) unstable; urgency=low
+
+  * control: depend on syslinux-common instead of syslinux (closes: #494417)
+    use same intro for description for all packages,
+    add dependeny and recommends on openbsd-inetd | inet-superserver as
+    workaround for #404760
+  * fai-chboot.8, fai-cd.8, ainsl.1, fai.8, fai-class.8: apply patches
+    from Colin Tuckley
+  * THANKS: add Colin
+  * fai-chboot.8: add example for using templates, add link to pxelinux
+    documentation
+  * fai-cd.8: remove unused info
+  * fai-mirror.1: add information about files used by this script
+  * faimond.8: minor fixes
+  * install_packages.8: minor fixes
+  * make-fai-nfsroot.8: minor fixes
+  * fai-debconf.1: minor fixes
+  * setup-storage.8: replace mdoc macro version with man macro version,
+    reformat examples using tab stops, make groff happy
+  * fai-guide.sgml: remove info about make-fai-bootfloppy, add info about
+    kernel parameters
+  * faisetup.sgml: update messages
+  * bootexample.sgml: update example messages
+  * mkdebmirror: remove obsolete code for fetching boot floppy images
+
+ -- Thomas Lange <lange at debian.org>  Wed, 01 Oct 2008 14:20:45 +0200
+
+fai (3.2.10-lhm2) halut; urgency=low
+
+  * Revert SVN r4998
+    - rsyslogd is not available in etch; we stay with syslogd and klogd
+  * Call openvt without explicit VT, but verbose, so the log contains the tty
+  * Change new occurences of task_error $* -> task error $*
+
+ -- Jan-Marek Glogowski <jan-marek.glogowski at muenchen.de>  Fri, 26 Sep 2008 16:51:55 +0200
+
+fai (3.2.10-lhm1) halut; urgency=low
+
+  * New upstream release
+
+ -- Jan-Marek Glogowski <jan-marek.glogowski at muenchen.de>  Tue, 16 Sep 2008 14:45:45 +0200
+
+fai (3.2.10) unstable; urgency=low
+
+  * add texlive-latex-recommended and texlive-fonts-recommended to
+    build-depends-indep which fixes FTBFS (closes: #497683),
+    add cfengine2 as recommends to fai-client (closes: #442843),
+    remove mknbi from fai-docs recommends
+  * Init.pm: really add important bugfix (494784) that was only fixed in svn 
+    but not in 3.2.9 upload (closes: #494784), fix typo in variable name
+  * Volume.pm: ignore output line of parted containing "Model:"
+    (closes: #497066) 
+  * disk-info: fix bashism (closes: #498023),
+    add pattern for KVM devices like /dev/vd[abcd]X (closes: #494426)
+  * Makefile,VERSION: remove variable KERNELVERSION, because it's unused since
+    3.2 (closes: #494699)
+  * fai-cd: do not redirect stderr to /dev/null when calling find_fai_data,
+    otherwise we do not get any errors when the grub call fails
+  * subroutines: use proper path to RUNNING_FROM_FAICD to make eject work
+    (closes: #439101),
+    do not access /proc/uptime if /proc is not mounted (closes: #496234),
+    check if list of cdrom devices is empty (closes: #498052)
+  * fai-client.postrm: use rm -rf, we do so in other maintainer scripts as
+    well and /var/run/fai is probably the least critical place
+    (closes: #494423)
+  * remove old, unsupported and broken script make-fai-bootfloppy and its man 
+    page (it only works with fai-kernels which were removed from lenny)
+    (closes: #452375, #400373, #305363)
+  * remove old and unused util/tlink and the information about it from the 
+    documentation
+  * fai-guide.sgml: major review, remove boot floppy info, remove BOOTP
+    info, update location of RUNNING_FROM_FAICD
+  * fai-guide.sgml: minor documentation fix (closes: #473106),
+    do not propose make-fai-nfsroot -r (closes: #481111),
+    do reference NEWS.Debian (closes: #452760)
+  * ftar.8: minor fix (closes: #481528), update example used
+  * fcopy.8: minor fix (closes: #419787)
+  * fai-statoverride.8: add man page for fai-statoverride.8 (closes: #358967)
+  * setup-storage.8: document usage of USE_SETUP_STORAGE; some typo fixes
+  * fai-cd.8: add usage example, add warning that all data on USB stick
+    may be destroyed
+  * setup-storage.8: Properly escape \ in literal environments (thanks lintian)
+  * changes to the example classes:
+    - use new partition tool in simple examples
+    - remove class SETUPSTORAGE
+    - package_config/*: remove non-existing packages, change some package
+    - names
+    - package_config/GNOME: make gnome example smaller
+    - 10-misc: remove tune2fs call, now done by new partition tool
+    - use lenny in FAISERVER class
+    - remove empty directory /etc/X11 to make lintian happy
+    - 20-copy-mirror: set correct symlink, add comment
+  * update to standards version 3.8.0, no changes needed
+  * update the package description (closes: #496113)
+  * rules: Don't ignore errors from make clean
+  * Many thanks to Sebastian Harl, Holger Levsen, Michael Prokop and
+    Michael Tautschnig for all the discussions and for the help to create
+    this release
+  
+ -- Thomas Lange <lange at debian.org>  Tue, 09 Sep 2008 15:08:20 +0200
+
+fai (3.2.9-lhm4) halut; urgency=low
+
+  * Allow shutting down instead of reboot
+    + Introduce FAI_FLAGS=shutdown
+    + Extend faireboot to shutdown, if called as faishutdown
+    + Link faishutdown -> faireboot
+    + Add flag_nowait, which is set, if FAI_FLAGS contains shutdown or reboot
+
+ -- Jan-Marek Glogowski <jan-marek.glogowski at muenchen.de>  Wed,  3 Sep 2008 19:13:11 +0200
+
+fai (3.2.9-lhm3) halut; urgency=low
+
+  * Don't undefine the error handler after running once
+
+ -- Jan-Marek Glogowski <jan-marek.glogowski at muenchen.de>  Mon, 25 Aug 2008 15:58:00 +0200
+
+fai (3.2.9-lhm2) halut; urgency=low
+
+  * Fix symlinking in make-fai-nfsroot
+
+ -- Jan-Marek Glogowski <jan-marek.glogowski at muenchen.de>  Fri, 22 Aug 2008 16:55:51 +0200
+
+fai (3.2.9-lhm1) halut; urgency=low
+
+  * New upstream release
+  * Readd tetex as BuildDep alternative
+
+ -- Jan-Marek Glogowski <jan-marek.glogowski at muenchen.de>  Wed, 20 Aug 2008 08:43:18 +0200
+
+fai (3.2.9) unstable; urgency=low
+
+  * apply patch that fixes the RC-bug license issue (closes: #487866)
+  * debian/copyright: add people and reformat text
+  * ftar: exit with warning if unsupported suffix .tgz is found
+  * ainsl: add options -Q and -q (closes: #484722)
+  * fai-setup: fix syntax error (closes: #488404)
+  * setup-storage.8: add migration section, add info for createopts, move
+    comments in example to bottom, fixed and improved documentation for
+    preserve_{always,reinstall} syntax
+  * Sizes.pm: never scale logical volume sizes beyond the specified
+    maximum (closes: #494519)
+  * Init.pm: fix bug in return values of phys_dev() (closes: #494784)
+  * conf/NFSROOT, control: drop use of liblinux-lvm-perl
+    (closes: #494357), replace unionfs with aufs (closes: #487080),
+    ext2resize is now obsolete, replace it with e2fsprogs,
+    replace obsolete sysutils with procinfo,
+    add packages for powerpc arch (closes: #494440)
+  * control: use official control-fields Vcs-Browser and Vcs-Svn instead
+    of old XS-* friends (closes: #451013),
+    remove Homepage from Description field, use Homepage field instead
+  * Volumes.pm: reverted the code to handle existing LVMs to an earlier
+    version that does not use Linux::LVM, because this is severly broken
+    (closes: #494357)
+  * setup-storage: increase version number to 1.0.1 because of LVM change
+  * Commands.pm: bugfix in RAID volume handling in case of devices marked
+    missing: mdadm command requires device names to be replaced by
+    "missing" (closes: #494520)
+  * package_config/FAIBASE: replace obsolete sysutils with procinfo
+  * subroutines-linux: replace klogd and syslogd with rsyslog
+    (closes: #494387)
+  * conf/sources.list: replace etch with lenny, make koeln repository
+    optional (closes: #474326)
+  * make-fai-nfsroot.conf: replace etch with lenny, mount /dev/pts to
+    avoid warnings "Can not write log, openpty() failed",
+  * make-fai-nfsroot: umount /proc and /dev/pts inside nfsroot on exit
+    (closes: #494518, #494523),
+    move trap definitions outside of { } block (closes: #494518, #494523),
+    use arch independent name for linux kernel (closes: #494440)
+  * updatebase: mount /dev/pts into /target to avoid openpty() warning
+  * fai-do-scripts: use -b in call of file command, this makes the pattern
+    matching more robust, make file adjust regex to new output of file
+    command (closes: #490111)
+  * savelog.LAST.source: add error pattern
+  * fai-cd: add option "--iso-level 4" to mkisofs call (closes: #494443)
+  * rules: do not copy file for linda
+  * fai-quickstart.dirs:  linda directory not needed any more
+  * fai-quickstart.lintian: fix pattern
+  
+ -- Thomas Lange <lange at debian.org>  Tue, 12 Aug 2008 11:49:51 +0200
+
+fai (3.2.8-lhm1) halut; urgency=low
+
+  * New upstream release
+
+ -- Jan-Marek Glogowski <jan-marek.glogowski at muenchen.de>  Mon, 14 Jul 2008 11:13:56 +0200
+
+fai (3.2.8) unstable; urgency=low
+
+  * Merge setup-storage, the new partitioning tool
+    (closes: #380629, #330915, #277045, #356862, #416633, #484788)
+  * add variable $USE_SETUP_STORAGE
+  * setup-storage: move loading of kernel modules into 20hwdetect.source,
+    print which disk_config setup-storage is using
+  * Commands.pm: print also mountpoint when debugging tuneopts and
+    createopts, fix and document problem when only tuneopts are defined,
+    prevent warnings about uninitialized variables
+  * 20-hwdetect.source: load modules needed for setup-storage
+  * add class SETUPSTORAGE for easy testing
+  
+ -- Thomas Lange <lange at debian.org>  Sun, 15 Jun 2008 12:47:16 +0200
+
+fai (3.2.7) unstable; urgency=low
+
+  * update some messages to 2008
+  * fai-cd: check if list of Packages files is non-empty, change syntax of
+    ${...:=...}, use rsync for coping to USB stick if available
+  * fai-cd.8: add info for MAXPACKAGES
+  * fai-guide.sgml: fix order of tasks
+  * fai-setup: check if file exists
+  * make-fai-nfsroot: exclude files in var/lib/apt/lists from base.tgz
+    check if NFSROOT directory is mounted with bad options
+  * get-boot-info: parse live.log for detecting boot method
+  * disk-info: use group info for detecting disks, extend pattern for
+    detecting scsi disks
+  * subroutines: fix regex so softupdate will; now umount the config space
+  * add internal variable printk, for setting the console log level
+
+ -- Thomas Lange <lange at debian.org>  Sat, 31 May 2008 16:47:25 +0200
+
+fai (3.2.6) unstable; urgency=medium
+
+  * fai: remove local, fix regex (closes: #480685)
+  * fai-cd: fix syntax error (closes: #480830)
+
+ -- Thomas Lange <lange at debian.org>  Thu, 15 May 2008 17:10:37 +0200
+
+fai (3.2.5) unstable; urgency=low
+
+  * GRUB/10-setup: use absolute path
+  * fai: mount /proc if not already mounted (closes: #453017, #444156),
+    check if target directory for dirinstall is mounted with nosuid,nodev
+  * fai-mirror: set MAXPACKAGES=1 if undefined before
+  * make-fai-nfsroot: exit with error if software installation has errors
+    (closes: #442261)
+  * fai-guide.sgml: add info how to specify a certain release or version
+    of a package
+  * fai-cd: add prefix $cfdir to -g parameter if no path was specified,
+    fix setting of cfdir (closes: #475250)
+  * fai-cd.8: extend info for -g
+  * subroutines: remove local from variable (closes: #449236)
+  * install_packages: fix in detecting Debian specific actions
+  * fai-chboot: add check if kernelsuffix is defined
+  * fai-abort: add LSB formatted dependency info (closes: #469716)
+  * XF86Config-4/DEMO: remove obsolete example (closes: #474327)
+  * disk-info: add regex for Adaptec i2o controller (closes: #466670)
+  * ainsl: substitue \s+ afterwards (closes: #470799)
+
+ -- Thomas Lange <lange at debian.org>  Mon,  5 May 2008 18:27:02 +0200
+
+fai (3.2.4-lhm9) halut; urgency=low
+
+  * Added "task error" call to task_partition
+  * Lowered loglevel for klogd to 4 in order to make used of newt frontend
+
+ -- Cajus Pollmeier <pollmeier at gonicus.de>  Fri, 14 Mar 2008 16:22:16 +0100
+
+fai (3.2.4-lhm8) halut; urgency=low
+
+  * Just show kernel errors - everything else is loged by klogd
+
+ -- Jan-Marek Glogowski <jan-marek.glogowski at muenchen.de>  Fri, 15 Feb 2008 15:54:51 +0100
+
+fai (3.2.4-lhm7) halut; urgency=low
+
+  * Hopefully fix all snd -> send 
+
+ -- Jan-Marek Glogowski <jan-marek.glogowski at muenchen.de>  Mon,  4 Feb 2008 20:44:51 +0100
+
+fai (3.2.4-lhm6) halut; urgency=low
+
+  * subroutines-linux: Fix MAC address lookup
+
+ -- Jan-Marek Glogowski <jan-marek.glogowski at muenchen.de>  Mon,  4 Feb 2008 20:31:02 +0100
+
+fai (3.2.4-lhm5) halut; urgency=low
+
+  [make-fai-nfsroot]
+    * Never install kernels with initramfs
+    * Create initramfs at the very end
+    * Call hooks before creating initramfs
+    * Remove diversion stuff - if you don't want initrd's use "-k"
+
+ -- Jan-Marek Glogowski <jan-marek.glogowski at muenchen.de>  Thu, 17 Jan 2008 14:31:47 +0100
+
+fai (3.2.4-lhm4) halut; urgency=low
+
+  * Renamed $task_error to $task_error_code, as function task_error already
+    exists
+
+ -- Jan-Marek Glogowski <jan-marek.glogowski at muenchen.de>  Wed, 16 Jan 2008 17:31:48 +0100
+
+fai (3.2.4-lhm3) halut; urgency=low
+
+  * make-fai-nfsroot: make symlinks work with single kernels
+
+ -- Jan-Marek Glogowski <jan-marek.glogowski at muenchen.de>  Wed, 16 Jan 2008 16:18:15 +0100
+
+fai (3.2.4-lhm2) halut; urgency=low
+
+  * Fix setup_harddisks
+  * make-fai-nfsroot: add Option -D to change NFSROOT subdir
+
+ -- Jan-Marek Glogowski <jan-marek.glogowski at muenchen.de>  Wed, 16 Jan 2008 14:28:09 +0100
+
+fai (3.2.4-lhm1) halut; urgency=low
+
+  * New upstream release
+  * Revert BOOTP removal
+  * Try calling get-fai-dir of type $FAI_CONFIG_SRC as fallback
+  * Allow tasks to be called with parameters
+  * Convert all "task_<tid>" calls to "task tid" calls
+  * Also call hooks with parameters
+
+ -- Jan-Marek Glogowski <jan-marek.glogowski at muenchen.de>  Tue, 15 Jan 2008 09:15:55 +0100
+
+fai (3.2.4) unstable; urgency=high
+
+  * fai-cd.8: add missing -C option
+  * make-fai-nfsroot: remove code for creating BOOTP environment
+  * faimond-gui: show different icons depending on error code
+  * fai-setup: fix syntax error (closes: #453442)
+  * subroutines-linux: do not print hostname and kernel compile time
+  * fai: update date, remove mkdir
+  * savelog.LAST.source: remove duplicate messages which appear in fai.log
+    and software.log
+
+ -- Thomas Lange <lange at debian.org>  Thu, 29 Nov 2007 19:17:56 +0100
+
+fai (3.2.3-lhm1) halut; urgency=low
+
+  * New upstream release
+  * Ported LHM patches
+
+ -- Jan-Marek Glogowski <jan-marek.glogowski at muenchen.de>  Tue, 27 Nov 2007 06:41:20 +0100
+
+fai (3.2.3) unstable; urgency=medium
+
+  * fix wrong logic in updatebase (closes: #452516)
+
+ -- Thomas Lange <lange at debian.org>  Sat, 24 Nov 2007 16:08:36 +0100
+
+fai (3.2.2) unstable; urgency=low
+
+  * conf/NFSROOT: reomve duplicate package, use aptitude for installing,
+    add nfs-common (closes: #444079), remove live-initramfs from NFSROOT
+  * doc/fai-guide.sgml: add information for softupdate (closes: #439016)
+  * savelog.LAST.source: add ignore pattern, remove dot after filename
+  * make-fai-nfsroot: check if $TFTPROOT is defined, add badupdateto32(),
+    which prints more info about update without checking variable names,
+    remove whole /srv/fai/nfsroot, add check_nfsroot(), make stamp only on
+    success (closes: #370780), write output also into /var/log/fai,
+    return and print exit code from install_packages, create or copy
+    live.conf, try to umount /proc inside the nfsroot before removing an
+    old nfsroot, abort if this fails
+  * subroutines: add task_error(), which stores the maximum error code in
+    $task_error, do nothing if error=0, print traceback,
+    add stop_fai_installation(), write pid to stamp file, print PID in
+    case of error, add task_test stub, save function name that causes
+    fatal error, set $fai_rundate only if not yet defined
+  * subroutines-linux: add check if $monserver is defined, print kernel
+    version currently running, catch exit code from install_packages
+  * mount2dir: add support for UUID and LABEL
+  * fai: export $romountopt, get error codes from all commands in a pipe,
+    add $STOP_ON_ERROR, fix variable name (closes: #447080),
+    do not use /var/log/fai/current (closes: #445276), cleanup definition
+    of $LOGDIR, change permissions of LOGDIR (closes: #445276),
+    add symlinks for last and last-$action in the very beginning
+  * control: fai-nfsroot and fai-client conflicts to fai-kernels, add
+    recommends to debconf-utils (closes: #445109), improve package
+    description (closes: #419071), add Homepage field, add live-initramfs
+    to depends of fai-nfsroot
+    replace ssh with openssh-server and openssh-client (closes: #434356) 
+  * fai-cd: copy grub config always to menu.lst
+  * get-config-dir-nfs: add -n to mount
+  * get-config-dir-svn: error if svn call fails (closes: #447602, #441761)
+  * update FSF address (closes: #444154)
+  * fai-chboot: pxedir should also use $TFTPROOT, (closes: #443837)
+  * menu.lst/postinst: check if variables are defined (closes: #445978)
+  * ftar: make it a bash script
+  * fai-setup: add option -C (closes: #388157), fix mode of
+    authorized_keys
+  * fai-setup.8: add option -C
+  * fai-mirror: mkdir mountpoint before mounting (closes: #365004)
+  * updatebase: use aptitude when doing dist-upgrade (closes: #448426),
+    use safe-upgrade when available
+  * fai-divert: make it a bash script
+  * 30-interfaces: resolv.conf is now in /, not in /tmp
+  * make-fai-bootfloppy: script currently does not work, always die with
+    error message
+  * FAIBASE.var: add STOP_ON_ERROR
+  * fai-savelog: do not save log to local directory, if this directory
+    already exists (should only happen during softupdate), change
+    permissions of LOGDIR (closes: #445276)
+  * get-config-dir-*: call task_error after trying to access config space
+  * sources.list: add koeln repository
+  
+ -- Thomas Lange <lange at debian.org>  Thu, 22 Nov 2007 15:45:12 +0100
+
+fai (3.2.1-lhm1) unstable; urgency=low
+
+  * New upstream release
+  * Add debootstrap script parameter (subroutines + make-fai-nfsroot)
+  * Make SEND_ID configurable (host,pxe,mac)
+  * Allow UUIDs and LABELs when partitioning
+    (using patch from Debian Bug #416633)
+    + Allow LABELs for swapspace
+  * make-fai-nfsroot: new option -I -> skip initrd building
+
+ -- Jan-Marek Glogowski <jan-marek.glogowski at muenchen.de>  Tue, 25 Sep 2007 18:01:34 +0200
+
+fai (3.2.1) unstable; urgency=low
+
+  * mount swap partitions with identical priorities
+  * fai-mirror: also match lowercase class names (for hostsnames),
+    use $cfdir instead of fixed path /etc/fai
+  * subroutines-linux: add timeout to nc call
+  * subroutines: change message for faimond in task_faiend()
+  * control: readd libapt-pkg-perl to depends, nfs-server (user space)
+    does not support locking, so FAI cannot use it, remove wget, add arch
+    to mknbi
+  * get-config-dir-svn: add svn+ssh support
+  * QUESTIONNAIRE: add USB stick, split bootb and dhcp
+  * faimond, faimond.8: use Proc::Daemon, add options tTldP
+  * faimond: do not allow ; in message (security), do not print ip and
+    port number
+  * make-fai-nfsroot: add option -U, do not divert update-initramfs (added
+    because of a Ubuntu bug), activate -U if Ubuntu is detected
+    determine the arch inside the nfsroot for defining a class, this help
+    building amd64 nfsroots on i386 and vice versa,
+    add support for running hooks, (closes: #342467)
+  * make-fai-nfsroot.conf: add variable NFSROOT_HOOKS
+  * make-fai-nfsroot.9: add info about NFSROOT_HOOKS
+  * fai-mirror.8, make-fai-nfsroot.8: enhance/add info of -C, add info
+    about variable FAI_ETC_DIR
+  * packages_config/DEFAULT: fix typos in linux-image-amd64
+  * fai-chboot,fai-chboot.8: add option -C and support for $FAI_ETC_DIR
+  * savelog.LAST.source: add ignore pattern
+  * packages_config/FAIBASE: add fai-client
+  * fai-do-scripts: exit with maximum error code of all child scripts that
+    had an error
+  * fai: change message when stamp file already exists (closes: #441437)
+  * fai-cd: remove arch specific path
+  * fai-cd.8: add info about USB stick (closes: #441988),
+    improve man page (closes: #441991)
+  * new get-config-dir-git: add method git for access (closes: #441992)
+  * examples/etc/dhcpd.conf: fix path
+  * faimond-gui: new tool that produces graphical output of faimond
+  * faimond-gui.8: new man page
+  * get-config-dir-svn: fix svn+ssh with username (Closes: #442021)
+  * fai-guide.sgml: add info about NFSROOT_HOOKS
+
+ -- Thomas Lange <lange at debian.org>  Mon, 17 Sep 2007 13:30:34 +0200
+
+fai (3.2-lhm1) halut; urgency=low
+
+  * Ported minimal LHM changes from 3.1.8
+  * make-fai-nfsroot:
+    + Symlink kernels instead of copy
+  * Send MAC instead of IP to faimond:
+    + Use ip for MAC lookup
+
+ -- Jan-Marek Glogowski <jan-marek.glogowski at muenchen.de>  Wed,  5 Sep 2007 15:31:44 +0200
+
+fai (3.2) unstable; urgency=low
+
+  * subroutines-linux: fix extra slash in path (closes: #428860),
+    jobsrunning(): ignore rcS process (closes: #425725)
+    during dirinstall call debootstrap if no base.tgz is found
+  * setup_harddisks: fix file system type of /proc
+  * fai.conf: make ssh and scp the default (closes: #309678, #380085)
+  * fai-guide.sgml:
+    major update to reflect FAI 3.X changes (closes: #390508),
+    fix description of classes used (closes: #329984),
+    change /usr/share/doc/fai to /usr/share/doc/fai-doc (closes: #387541),
+    fix an url, add documentation for dirinstall (closes: #390508),
+    document usage of basefiles/ (closes: #391660),
+    document the order hooks are called (closes: #380337)
+  * get-config-dir-svn: add support for svn url's without username
+    (closes: #415875)
+  * subroutines: copy disk_var.sh only if available (closes: #415880),
+    fix wrong path for FAI_CLASSES
+  * savelog.LAST.source: add more patterns
+  * faimond: add options -p, -h, -b,
+    it can now call fai-boot (closes: #342477, #424608) 
+  * faimond.1: update man pages to reflect the new options
+  * fai-savelog: use $LOGREMOTEDIR when saving to remote
+    (closes: #290371), do not set $HOSTNAME, should be set all the time
+    (closes: #429553, #429733)
+  * make-fai-nfsroot: add option -p (closes: #359323), move from
+    fai-kernels to plain Debian kernel using initrd (closes: #410940),
+    remove unused things since we have now write access to the nfsroot,
+    use mkdir -p, live-initramfs needs NFSROOT in .../live/filesystem.dir,
+    move creating of subdirs from make-fai-nfsroot to fai (from server to
+    client), do not create shell script in make-fai-nfsroot,
+    remove -V, use aptitude to remove the kernels from the nfsroot, -k now
+    reinstalls all packages from /etc/fai/NFSROOT (closes: #431613),
+    update-initramfs symlinks to /bin/true during diversion
+  * make-fai-nfsroot.conf:
+    remove the variable KERNELPACKAGE (closes: #416531, #435098) 
+  * make-fai-nfsroot.8: remove -V, new description for -K and -k
+  * fcopy: set mode on file even no file was copied (closes: #360184),
+    check error code of preinst and postinst scripts (closes: #432681),
+    add quotes to variable (closes: #430127), skip comment lines in
+    file-modes
+  * fai-chboot: $NFSROOT is defined in new location (closes: #408247),
+    add initrd support, add option -s (closes: #356380), remove nfs
+    options from append line
+  * fai-chboot.8: ROOTFS parameter is not needed any more, add option -s
+  * device2grub: fix pattern to support /dev/cciss and /dev/ida devices
+    (closes: #416381)
+  * conf/NFSROOT: add packages needed for new fai-cd technique, add plain
+    debian kernel package, add ext2resize, hwinfo and change arch specific
+    packages,
+    move packages cfengine2 and libapt-pkg-perl from control to NFSROOT
+  * control: change dependencies from tetex to tetex or texlive, replace
+    Recommends of rsh-server with ssh (closes: #426093), add aptitude for
+    fai-server as Suggests, remove fai-kernels, add field XS-Vcs-Browser,
+    syslinux is only available on two architectures, do not depend on
+    cfengine (v1), since it does not exists any more
+  * fai: do not remount / read only, do not call create_ramdisk, now we
+    use unionfs, remove HOST variable, only use HOSTNAME now, use mkdir
+    -p, export $action for 20hwdetect.source, call save_dmesg only during
+    initial installation, during dirinstall set
+    LOGDIR=/var/log/fai/dirinstall/$HOSTNAME (closes: #429553)
+    define FAI_DEBOOTSTRAP, FAI_DEBOOTSTRAP_OPT for dirinstall
+    create syslog.conf before starting the syslog daemon
+    when doing dirinstall -c or -N must be specified (closes: #429554)
+    the local hard disks are now mounted to /target instead of /tmp/target
+  * move from mkinitrd-cd to live-initramfs to create a CD, use plain
+    Debian kernel
+  * menu.lst: remove unneeded options, add boot=live for new initrd,
+    remove root (cd), fix setting of hostname, instead of using ip=, we
+    now use hostname=
+  * create_resolv_conf: fix path, since we can now write on the whole
+    filesystem
+  * fai-cd: use plain Debian kernel with initrd and live-initramfs for
+    booting (closes: #401041),
+    add option -f, force removal of an existing ISO image
+    add option -k, this is for debugging
+    add option -n, do not create ISO image
+    add option -u, copy fai-cd data to a directory (USB support)
+    use $NFSROOT/live/filesystem.dir
+  * disk-info: do not include removable devices into list of disks
+  * fai-class: remove HOST variable, only use HOSTNAME now
+    do not set HOSTNAME from uname (closes: #431283) 
+  * multiple files: add some patches fixing english text
+    (closes: #428857, #428858)
+  * 20-removable_media: fix path for floppy mount point (closes: #428859)
+  * fai.8: add option -u, --hostname (closes: #361559)
+  * add variable TFTPROOT (closes: #408271, #431431)
+  * fai-mirror:
+    use $NFSROOT/live/filesystem.dir
+    do not ask questions, add unauthenticated packages to the mirror
+  * 20hwdetect.source: do not execute 20hwdetect.source during dirinstall
+  * debconf/FAIBASE: autodetect most xorg parameters, (but not resolution)
+  * install_packages: add option -N, change option -t to -n,
+    add patch that AptPkg module is only used when
+    available and target system is Debian (closes: #422225), move code to
+    check_aptpkg(), add smart package manager support (closes: #430798)
+    do execute Debian specific commands only when needed (closes: #392038),
+    grab error codes when executing commands,
+    exit with 3 when errors occured, add option -H (closes: #391659),
+    put suffix -internal to all internal commands,
+    remove -n from tasksel calls
+    print path once, then only config file names, not always full path
+  * install_packages.8: add option -N and -H, change option -t to -n,
+    add option -p (closes: #424848)
+  * create_ramdisk: replaced by unionfs
+  * fai-do-scripts: remove -k from cfagent call (closes: #425699),
+    add new strings for shell scripts (closes: #416616)
+  * fai-server.post*: do not manage $TFTPROOT (closes: #430000)
+  * package_config: move linux-image package from FAIBASE to DEFAULT, add
+    kernel name for architecture
+  * ainsl: escape + in pattern
+  * make S01fai-abort an init.d script
+  
+ -- Thomas Lange <lange at debian.org>  Tue, 21 Aug 2007 18:11:28 +0200
+
+fai (3.1.8) unstable; urgency=medium
+
+  * conf/NFSROOT: remove unknow package name (closes: 407950)
+  * setup_harddisks: use C locale when calling mkreiserfs (closes: 413504)
+  * fai-mirror: add /usr/sbin to $PATH so a normal user can also call
+    this command (closes: 413466)
+  * simple/package_config/GERMAN: fix wrong package name
+  * lib/subroutines: replace >>/dev/stderr with >&2
+
+ -- Thomas Lange <lange at debian.org>  Tue, 13 Mar 2007 23:39:56 +0100
+
+fai (3.1.7) unstable; urgency=medium
+
+  * subroutines: ifclass() should append to stderr (closes: #409059)
+  * examples/simple/, lib/fai-mount-disk, lib/mount2dir: use bash for
+    shell scripts (closes: #410084)  
+  * fix typo in bug number of older changelog entry
+  * install_packages.8: add info for variable MAXPACKAGES
+  
+ -- Thomas Lange <lange at debian.org>  Wed, 14 Feb 2007 12:11:29 +0100
+
+fai (3.1.6) unstable; urgency=high
+
+  * fix important and grave bugs
+  * fai-setup: do not fail (and exit) if $loguserhome is not writeable for
+    root (closes: #407947)
+  * fai-class: fix syntax error (closes: #408153)
+  
+ -- Thomas Lange <lange at debian.org>  Tue, 23 Jan 2007 23:49:33 +0100
+
+fai (3.1.5) unstable; urgency=low
+
+  * make-fai-nfsroot: remove copying of *.pub files (closes: #406334)
+  * fai-debconf: add template when create tmp file, remove also old
+    tmp files (closes: #406336)
+  * fai: add missing parameter to --long options (closes: #406125)
+  * fai-classs: set hostname from -u as intended (closes: #406125)
+  * scripts/FAISERVER/10-conffiles: fix wrong path (closes: #406500)
+  * README: update year from 2006 to 2007
+
+ -- Thomas Lange <lange at debian.org>  Fri, 12 Jan 2007 14:57:12 +0100
+
+fai (3.1.4) unstable; urgency=medium
+
+  * these are only document changes and a one liner for setup_harddisks
+  * fix default examples. A change in the xorg package dependencies broke
+    the default FAI example installation (closes: #405435)
+  * remove xlockmore package from example (closes: #405433)
+  * setup_harddisks: add support for mountig existing NTFS partitions
+    (closes: #404187)
+
+ -- Thomas Lange <lange at debian.org>  Thu,  4 Jan 2007 15:30:42 +0100
+
+fai (3.1.3) unstable; urgency=medium
+
+  * fai-savelog: fix a security tagged bug, make local copy of LOGDIR only
+    readable for root and group adm (closes: #402644)
+  * fai: add missing shift command (closes: #402588)
+  * fai.8: improve dirinstall info (closes: #402294)
+  * package_config/FAIBASE: add packages, this is only a documentation
+    change
+
+ -- Thomas Lange <lange at debian.org>  Sun, 17 Dec 2006 17:40:54 +0100
+
+fai (3.1.2) unstable; urgency=high
+
+  * use new fai kernel version 2.6.18
+  * control: add Vcs-Svn control field (closes: #399561)
+  * conf/NFSROOT: remove package hwtools, which do not exists any more
+  * fai-chboot: exit if file cannot be written, tmpfile was not always
+    removed
+  * make-fai-bootfloppy: remove sit interfaces from list of network
+    devices (closes: #400521), print error if it can't write to floppy
+    device (closes: #400522)
+  * fcopy: tmpfile was not always removed
+  * mount2dir: use noatime when mounting local file systems
+  * lib/subroutines-linux: change comment
+  * fix typo in changelog
+  * fai-server.postinst: change message (closes: #400324)
+
+ -- Thomas Lange <lange at debian.org>  Mon, 27 Nov 2006 20:04:51 +0100
+
+fai (3.1.1) unstable; urgency=low
+
+  * control: remove mkinitrd-cd from Recemmends: and Suggests:
+  * make-fai-nfsroot: add missing option h to getopt, fix typo, test if
+    $cfdir is already set (closes: #394884), no code change, reorder code
+    so a normal user gets help whem using -h,--help
+  * faireboot: fix file name to variables.log
+  * fai-chboot: fix several bugs for listing options, option -p expects an
+    argument, fix for -c behaviour (closes: #389905)
+  * fai-chboot.8: minor document fixes
+  * fai-mirror.1: fix example (closes: #390520)
+  * fcopy: remove temporary file after use
+  * fai: start udev before creating /dev/shm/network, remove set +a for
+    dirinstall, so $fai_rundate will be exported (closes: #390373)
+  * subroutines: umount config dir at the end of softupdate action,
+    cd back to old directory, convert FAI_ROOT to absolute path if doing
+    dirinstall (closes: #390346), die() only calls bash when
+    FAI_ACTION=install, add -i to bash call (closes: #362252)
+  * subroutines-linux: check exit status of get-config-dir
+  * get-config-dir: replace die call with echo and exit statement, add
+    error message
+  * get-config-dir-cvs: fixed regular expression as 'expr' automatically
+    anchors to the beginning
+  * LAST/50-misc: /sbin/unconfigured.sh is not used any more
+  * ainsl.8: explain ^ and $ treatment in more detail
+  * FAIBASE/10-misc: add anchors to ainsl pattern
+  * class/20hwdetect.source: change discover call
+  * aisnl,fcopy,fai-chboot: print help and exit if unknow option was given
+  * lib/task_sysinfo: remove call of kudzu since it's not available any
+    more in etch
+  
+ -- Thomas Lange <lange at debian.org>  Mon,  6 Nov 2006 15:57:01 +0100
+
+fai (3.1) unstable; urgency=medium
+
+  * Makefile: force bash in Makefile, fixes FTBFS in ubuntu
+  * rename action dirinst to dirinstall (closes: #390345)
+  * fai-cd: fix wrong path for sources.list (closes: #391639)
+  * scripts/FAIBASE/10-misc: use ainsl instead of echo >> ...
+  * lib/create_ramdisk: make /var/discover writeable
+  * make-fai-nfsroot: create directory var/discover, add option -h and
+    usage() subroutine
+  * subroutines: move find's maxdepth option to the left, prevent multiple
+    fai softupdate running simultaneously (closes: #390680), move
+    disk_var.sh from FAI 2.X installation old to new location
+    rename variable sndhostname to sendhostname
+  * get-config-dir*: replace \s and \S in expr with regex using [:space:],
+    so it also works for sarge's version of expr
+  * subroutines-liux: add test if base.tgz exists (closes: #390343),
+    sources.list must be used from /etc/apt during normal installation
+  * fai: add option -u,--hostname (closes: #390367), create
+    /dev/shm/network if directory not already exists (needed for initrd
+    kernels)
+  * LAST/50-misc: do not fail if hardware clock can't be set
+  * fcopy: swap call of postinst and set_mode
+  * install_packages: add missing package list to yum and rpm calls
+    (closes: #392032)
+  * rename sndmon() to sendmon()
+  * fai-start-stop-daemon: start udevd (needed for ubuntu) and do not fake
+    it, add carriage return
+  * package_config/DEMO: remove rstatd since it buggy atm
+  * 20hwdetect.source: xorg can discover the grpahics driver itself, do
+    not call discover
+  
+ -- Thomas Lange <lange at debian.org>  Thu, 19 Oct 2006 14:46:32 +0200
+
+fai (3.0) unstable; urgency=low
+
+  * conf/make-fai-nfsroot.conf,sources.list: move from sarge to etch
+  * fai: export FAI_ACTION, fix -c and -C in usage()
+  * subroutines-linux: fix path of resolv.conf
+  * fai-chboot: remove devfs=nomount, use NFS v3
+  * package_config/DEFAULT: replace kernel-image with linux-image
+  * faireboot: stop udevd
+  * rename class XFREE to XORG, use xorg packages
+  * bin/fai: rename $targetdir to $FAI_ROOT
+  * add debconf data for german environment (closes: #386192)
+  * package_config/GERMAN: new file includes packages for german
+    environment
+  * new script FAIBASE/20-removable_media creates fstab entries and makes
+    directories under /media
+  * new script and man page: ainsl, ainsl.1
+  * fai-start-stop-daemon: prints which daemon will not be started
+  * get-boot-info: fix duplicate call of get_dhcp_info()
+  * FAIBASE.var: add FAI_ALLOW_UNSIGNED=1
+  * fai-setup: add option no_subtree_check to etc/exports lines
+  * get-config-dir-svn: svn support for config space (closes: #314991)
+  * fai.8: add info about dirinst, add example
+  
+ -- Thomas Lange <lange at debian.org>  Wed, 27 Sep 2006 15:44:46 +0200
+
+fai (3~beta21) unstable; urgency=medium
+
+  * make pathes conform to FHS:
+    (closes: #340608, #311524, #336650, #309554, #340609)
+  * use /srv/tftp/fai    instead of /boot/fai
+  * use /srv/tftp/fai/pxelinux.cfg instead of /boot/fai/pxelinux.cfg
+  * use /srv/fai/config  instead of /usr/local/share/fai
+  * use /srv/fai/nfsroot instead of /usr/lib/fai/nfsroot
+  * use /var/lib/fai/config instead of /fai
+  * use /var/lib/fai/mirror instead of /mnt
+  * create_ramdisk: call mkrw with -n
+  * setup_harddisks: use more secure options for /proc line
+  * fai-chboot: use tcp as default for nfs, nfs v3 can will become default
+    with etch, existent .disable pxe file will be removed automatically,
+    add headline when copying from template, change in options: -d is now
+    -D, -r is now -d, -r is not used any more, abort if $pxedir does not
+    exist (closes: #373596) 
+  * subroutines-linux: task_updatebase does not use updatebase.log any
+    more (closes: #366823), try ftar $FAI/basefiles before extracting
+    base.tgz, create policy-rc.d in the chroot, copy sources.list from
+    $FAI_ETC_DIR, replace $FAI_REMOTESH with local variable $remotesh, fix
+    path for resolv.conf
+  * move /etc/fai/sources.list to /etc/fai/apt/sources.list  
+  * fix lintian error: build-depends-indep-should-be-build-depends
+    debhelper
+  * complies with policy 3.7.2
+  * added a linda override for fai-quickstart (ignore /usr/doc-symlink
+    warning)
+  * added Section: headers to binary packages in control
+  * conf/make-fai-nfsroot.conf: remove variables: $nfssize,
+    $NFSROOT_PACKAGES, $package
+  * new config file /etc/fai/NFSROOT which contains the package list
+  * fai.conf: remove FAI_REMOTESH and FAI_REMOTECP, use FAI_LOGPROTO
+    instead, LOGSERVER, LOGREMOTEDIR, LOGPASSWD removed installserver
+    removed (closes: #332837)
+  * lib/subroutines: remove get_fai_cvs(), get_fai_dir(), now separate
+    scripts, print warning if CD-ROM does not use DMA mode, eject fai-cd
+    at the end of the installation
+  * fai: replace $rclog with $LOGIDR/fai.log, add option -C,--cfdir,
+    -c,--class (closes: #353535), add support for dirinst, cleanup LOGDIR
+    before using it again (closes: #369534), remove variable rundir, mkdir
+    /var/run/fai if not existing, trap uses subroutine clean_exit() for
+    dirinst  
+  * fai-setup: use getent for getting IP address, make it a bash script,
+    change $HOME of LOGUSER (closes: #290449), do not use SERVERINTERFACE
+    for getting hostname, add all IP addresses and host names to
+    ssh_known_hosts (closes: #286692), remove variable FAICLIENTS, use IP
+    address and netmask for exportfs line (closes: #381261)
+  * make-fai-nfsroot: new subroutine all_host_entries(), use
+    install_packages and /etc/fai/NFSROOT for installing packages into the
+    nfsroot, install fai-nfsroot before other packages are installed, do
+    not exit if getent returns no information, rename -c to -C, use
+    readlink to determine $cfdir (closes: #358765)
+  * variable $fstab replaced with fstab (no more Solaris support using
+    vfstab)
+  * savelog.LAST: set reboot=1 if no errors are found
+  * fcopy: fix bug (closes: #374415)
+  * control: update to Standards-Version: 3.7.2, fai-quickstart depends on
+    tftpd-hpa
+  * make-fai-bootfloppy: read make-fai-nfsroot.conf instead of fai.conf,
+    replace backticks with $(), fix test (closes: #384624), rename -c to -C
+  * lib/get-boot-info: get network info via DHCP if ip=dhcp was set
+  * prcopyleft: remove osname from copyright logo
+  * subroutines: add task dirinst (closes: #322634), do not execute task
+    prepareapt on softupdates (closes: #315000), save FAI_CLASSES and
+    disk_var.sh to /var/lib/fai, do not save variables.log to /var
+  * move fai-divert to fai-client package
+  * ftar: fix exit code when no matching class was found
+  * move code from script get-config-dir to task_confdir()
+  * rename $DO_INIT_TASKS to $do_init_tasks
+  * install_packages: add option -p
+  * fai-mirror: use packages.nfsroot instead of packages.arch, check if
+    obsolete variables are used, remove -a, add -B
+  * add policy-rc.d support instead of diverting start-stop-daemon
+  * remove varaible diskvar, use $LOGDIR/disk_var.sh instead
+  * fai-debconf: use read-only temp file during reconfigure
+  * get-config-dir-file: access config space via local path, used by
+    fai-cd
+  * fai-cd: use $FAI instead of /fai
+  * fai-mirror: generate distrib name from FAI_DEBOOTSTRAP
+  * move some -c to -C, so now all scripts use -C for cfdir, setting
+    $FAI_ETC_DIR is the same as specifying -C cfdir, print message if this
+    variables is used
+  * move NEWS to NEWS.Debian
+  * VERSION: default is kernel 2.6.17
+  
+ -- Thomas Lange <lange at debian.org>  Wed, 13 Sep 2006 18:54:38 +0200
+
+fai (2.10.5) unstable; urgency=high
+
+  * fixes patch from last NMUs. (really, really closes: #373955)
+  * make-fai-nfsroot: print debootstrap version
+  * add package lftp to nfsroot
+  * create_ramdisk: make more directories writeable
+  * 20hwdetect.source: add some usb modules
+  * dhcpd.conf: next-server is needed in dhcpd3 >=3.0.3
+  
+ -- Thomas Lange <lange at debian.org>  Tue, 11 Jul 2006 16:28:21 +0200
+
+fai (2.10.4) unstable; urgency=high
+
+  * Non-maintainer upload.
+  * Fix previous patch; it should remove files from $FAI_ROOT/etc, not
+    /etc, as faireboot is not run inside the chroot. (Really
+    Closes: #373955)
+
+ -- Steinar H. Gunderson <sesse at debian.org>  Sun,  9 Jul 2006 18:59:55 +0200
+
+
+fai (2.10.3) unstable; urgency=high
+
+  * Non-maintainer upload.
+  * Remove /etc/apt/apt.conf.d/{10,90}fai in faireboot, since the settings
+    used during install_packages are not appropriate for the finished
+    system. (Closes: #373955)
+
+ -- Steinar H. Gunderson <sesse at debian.org>  Sun,  9 Jul 2006 15:54:55 +0200
+
+fai (2.10.2) unstable; urgency=medium
+
+  * lib/get-boot-info: call dhclient with different configuration and
+    script names, closes grave bug (closes: #369265), remove dpkg-divert
+    calls for /etc/dhcp3/dhclient-script and /etc/dhcp3/dhclient.conf
+  * create_ramdisk: make /etc/lvm writeable (closes: #365035)
+  * do not call mkrwsize if directory does not exist (closes: #365037)
+  * lib/mkrw: add option -n
+  * make-fai-nfsroot: grep before appending to file (closes: #364748),
+    enable DNS inside the nfsroot (closes: #358783)
+  * lib/subroutines-linux: task_prepareapt(): check $IPADDR before
+    appending to file (closes: #331258)
+  * lib/subroutines: make 100MB ramdisk for /fai when booting from CD
+  * bin/fai: do not mount --bind /tmp/fai on softupdate
+  
+ -- Thomas Lange <lange at debian.org>  Wed, 14 Jun 2006 11:51:19 +0200
+
+fai (2.10.1) unstable; urgency=low
+
+  * fai-chboot: fix division by zero error
+  * fai.conf: remove $OS_TYPE
+  * fai: remove $OS_TPYPE, set $targetdir, eval_cmdline is not needed for
+    install and dirinst, move prcopyleft() and additional code into
+    external script, use /var/log/fai/current as default LOGDIR,
+    /tmp/fai is currently a mount --bind to it
+  * fai-do-scripts: replace --no-lock with -K, this should fix cfengine's
+    segfault bug
+  * install_packages: add commands for y2pmsh, yast and rpm
+  * mount2dir: add more fs types that should be skipped
+  * fai-mirror: use different source.list when downloading packages for
+    debootstrap (closes: #361786), remove comments from PACKAGES line
+    (closes: #358910), add option -C, (closes: #318299), recreates
+    Package.gz and Release file using apt-ftparchive  
+  * fai-cd: add option -C (closes: #312198), print FAI version in grub
+    menu, not fai-cd version
+  * make-fai-nfsroot: print warning if -f is still used, add config for
+    aptitude to allow unsigned packages without prompting
+  * menu.lst: enable timeout, use localboot as default, remove syslogd
+    flag, remove unused entries, fix IP address for demohost
+  * subroutines: new path /var/log/fai/current/showvar.log
+  * fai-guide.sgml: include package splitting into fai guide
+  * make-fai-nfsroot.conf: new names packages in fai-kernel, add
+    console-tools to nfsroot (closes: #363480)
+  * get-boot-info: do not try to activate the first four ethernet devices
+  * conf/apt.conf: add aptitude option so untrusted repositories will also
+    be used
+  * instsoft.FAIBASE: use fcopy for kernel-img.conf
+  * subroutines-linux: use IP address when calling fai-chboot in
+    task_chboot, this helps when the install client has two network cards
+    and the host name lookup fails
+  * mkrw: fix typo (closes: #363521)
+  * dhcpd.conf: make deny unknown-clients default, remove range definition
+  * S99fai-setup: enable networking for faiserver
+  
+ -- Thomas Lange <lange at debian.org>  Thu, 20 Apr 2006 11:46:12 +0200
+
+fai (2.10) unstable; urgency=low
+
+  * setup_harddisks: mapdisk(): add support for more than two disks, fix
+    wrong comments (closes: #356265), allow logical partitions to be
+    bootable (closes: #344536)
+  * make-fai-nfsroot: do not copy files from /etc/apt to the nfsroot,
+    detect kernel version for new kernel name (closes: #352939),
+    remove patches-* file when using -K (closes: #348350), remove
+    update-modules call, remove symlink creation to /tmp, add warning if
+    $FAI_LOCAL_REPOSITORY is still used
+  * fai-chboot: change output of -l and -L, major rework of the lsdir
+    function, add more options for different listing formats, add template
+    copy function (closes: #342471, #356136), options added: -g -c -t -o  
+  * 20-hwdetect.source: test if discover is installed
+  * make-fai-bootfloppy: remove obsolete message (closes: #347974)
+  * fcopy: remove newline from $source, add \Q, (closes: #350015), warning
+    if unlink fails, add option -n (closes: #356378), preserving is not an
+    error (closes: #360183)
+  * make example scripts more cfengine2 compatible (closes: #312201)
+  * hooks/instsoft.FAIBASE: do not pause when kernel modules are already
+    available (closes: #314613)
+  * install_packages: new feature, just unpack packages (closes: #277079),
+    add urpmi, urpme and yum support
+  * fai: exit script if no parameters are given and no run from nfsroot
+  * subroutines: add verbose output when defining variables, add
+    subroutines mkrw and mkrwsize, set $diskvar during softupdate to
+    /var/log/fai/disk_var.sh, task_savelog: test if files exist before
+    copying them
+  * remove FAIBASE/20-save_diskvar (closes: #312296)
+  * task_sysinfo: call lshw if available
+  * lib/get-boot-info: remove duplicate network device names
+  * make-fai-nfsroot.conf: use SERVERINTERFACE for detecting subnet
+    (closes: #341577)
+  * create_ramdisk: use mkrw for making directories writeable
+  * fai-mirror: add warning if some files do not exist
+
+ -- Thomas Lange <lange at debian.org>  Mon,  3 Apr 2006 15:11:30 +0200
+
+fai (2.9.1) unstable; urgency=low
+
+  * install_packages: add aptitude-r to @commands (closes: #343361)
+  * new command fai-statoverride (like dpkg-statoverride)
+  * fai-chboot: use NFS v2 as default until FAI will drop sarge support
+  * fai.8: fix typo (closes: #343642)
+  * doc/classes_description.txt: remove all unused classes, update
+    description (closes: #322026)
+  * add script AMD64/99-discover-bug
+  * add class FAISERVER
+  * updatebase: mount /sys into chroot
+  * mkdebmirror: remove non-US stuff
+  * savelog.LAST: add segfault to error pattern
+  * make-fai-bootfloppy.8: fix typo (closes: #346428)
+  * make-fai-nfsroot: do not try to copy file if resolv.conf does not
+    exist
+  * menu.lst: add entry for faiserver
+  * fai-cd: adjust space, new code for generating sources.list file
+  * fai-debconf: add test if debconf data file exists (closes: #348857)
+
+ -- Thomas Lange <lange at debian.org>  Sun,  5 Mar 2006 22:37:31 +0100
+
+fai (2.9) unstable; urgency=low
+
+  * splitting binary package fai into fai-server, fai-client, fai-doc and
+    fai-nfsroot (closes: #210507)
+  * adjust some paths
+  * remove beowulf and advanced examples
+  * increase compat level to 4
+  * delete sunos code from source
+  * scripts/ directory is now bin/
+  * fai-cd: fixed hardcoded sources.list for the install client to be
+    generated, code by Michael Tautschnig (closes: #320024) and at least
+    partially #329547, test if nfsroot was created (closes: #317495), test
+    if mkisofs is available (closes: #334871), exist unless arch is i386
+    or amd64 (closes: #339098), check if $FAI_CONFIGDIR is valid
+    remove subroutine mhide amd module-hide, mkbimage is not needed any
+    more, use grub's stage2_eltorito feature mkisofs uses -no-emul-boot,
+    no floppy emulation needed, size is not limited any more to 2.88M
+  * install_packages: ignore packages ending with - when using -d
+    (closes: #334333), remove backtick evaluation (closes: #322157), add
+    -R to default aptitude call, add aptitude-r for download only mode,
+    add more warnings
+  * lib/create_ramdisk: make /etc/network/run/ifstate writable
+    (closes: #312128) 
+  * fai-mirror: add -i to egrep (closes: #312508), add option
+    DPkg::force-conflicts::=yes (closes: #328138), only aptitude can
+    install conflicting packages, test if $mirrordir starts with a slash
+    (closes: #328139), check if $FAI_CONFIGDIR is valid (closes: #334577)
+  * fai-do-scripts: do not execute S[0-9][0-9]* any more (closes: #310999)
+  * fcopy: add preinst support, ignore .svn dirs (closes: #297550), do
+    chroot before using getpwnam (closes: #283475), add option -U
+  * fai-guide.sgml: include README.disk_config into fai guide, minor
+    fixes, (closes: #332295, #332318, #332293, #332291)
+  * make-fai-nfsroot: use --one-file-system instead of -l (closes: #308806),
+    new test if ssh package is installed (closes: #322759), create
+    apt.conf.d file to support unsigned repositories, fail if debootstrap
+    return with error code (closes: #342120)
+  * subroutines: test if hooks are executable (closes: #338524), new stamp
+    file name when action is softupdate
+  * make-fai-bootfloppy: fix code for -i when using a relative path
+    (closes: #314551), add option -I (closes: #337271), create more space
+    on boot floppy (closes: #294593), add option -B
+  * FAIBASE/10-misc: with the new fai-kernels package we can call tune2fs
+    even when using a 2.6 kernel (closes: #307147)
+  * ftar: test if $single is set (closes: #340421)
+  * FAIBASE/30-interface: do not overwrite resolv.conf if it's a symlink
+    (closes: #305783)
+  * setup_harddisks: add i2o support (closes: #317797), add workaround for
+    udev behaviour
+  * GRUB/10-setup: use -U with fcopy, so grub's menu.lst will not be
+    overwritten during softupdate (closes: #313069, #314995)
+  * subroutines-linux: fix idempotent code (closes: #340422)
+  * fai: do not use color logo if $console was set, start udev if
+    available (closes: #334373), test if run as root
+  * lib/updatebase: mount /dev into chroot during installation if we are
+    running udev
+  * fai-chboot: read $NFSROOT from fai.conf, add nfsroot option to kernel
+    parameters, root-path can now be removed from dhcpd.conf
+  * add support for unsigned repositories
+  * LAST/50-misc: fix code that detect of a kernel is installed, now it
+    does not break if more than one kernel is installed
+  
+ -- Thomas Lange <lange at debian.org>  Tue, 13 Dec 2005 15:53:00 +0100
+
+fai (2.8.4) unstable; urgency=high
+
+  * fix important bug: remove non-US entry (closes: #310392)
+  * package_config: remove nonfree package t1-xfree86-nonfree from
+    examples (closes: #310705)
+
+ -- Thomas Lange <lange at debian.org>  Wed, 25 May 2005 13:59:39 +0200
+
+fai (2.8.3) unstable; urgency=high
+
+  * fix a serious bug, remove debconf support (closes: #309209), debconf
+    support may be included again after sarge
+  * fix important bug, do not delete files in /etc/fai (closes: #309707)
+  * control: remove dependency on debconf
+  * postinst, postrm: remove debconf code
+  * rules: do not call dh_installdebconf
+  * remove debian/config, debian/template
+  * remove files in debian/po: POTFILES.in de.po fr.po templates.pot
+  * fai.conf: set placeholder for installserver, since debconf will not
+    set it any more
+  * conf/make-fai-nfsroot.conf, conf/sources.list: use ftp.debian.org
+    instead of debconf's default values
+  * man/fai-chboot.8: minor document patch (closes: #309138, 309142)
+  * fai-guide.sgml: minor document patch, move section "For the impatient
+    user" to the front (closes: #309134, #309556) 
+  * README.build-sources: add memo to use -ICVS in the future
+
+ -- Thomas Lange <lange at debian.org>  Thu, 19 May 2005 15:54:18 +0200
+
+fai (2.8.2) unstable; urgency=high
+
+  * remove old unused scripts from cvs source
+  * updatebase: use mktemp for creating temp file, this closes a serious
+    security bug (closes: #307838)
+  * fai: create dir only during initial installation, fixes a critical bug
+    (closes: #307632)
+  * subroutines-linux: do not "mount --bind" when FAI_ROOT=/, closes
+    important bug (closes: #307631)
+
+ -- Thomas Lange <lange at debian.org>  Fri,  6 May 2005 09:23:34 +0200
+
+fai (2.8.1) unstable; urgency=low
+
+  * only minor bug fixes, no major changes to the code, but a lot of them
+  * make-fai-bootfloppy: add missing $ to variable (closes: #304824)
+  * install_packages: add missing aptitude-r call (closes: #305544), 
+    add $qopt and $devnull, used when install_packages is called with
+    verbose from fai-mirror
+  * fai-mirror: fix wrong path (closes: #304179), remove needless test if
+    mkinitrd-cd is available, add $qflag, return if $pkglist is empty, not
+    when $addpackages is empty
+  * fai: added $COLOR_FAI_LOGO, which is off when doing softupdate
+  * fai-cd: add test if mkinitrd-cd is available
+  * fai-savelog: set FAI_ACTION to noaction if undef (closes: #305283)
+  * savelog.LAST: add error message to global pattern
+  * make-fai-nfsroot.conf: remove --arch i386, since debootstrap now uses
+    dpkg --print-installation-architecture instead of another call which
+    needed gcc, change comment
+  * make-fai-nfsroot: split i386 and amd64 packages list, remove packages
+    from amd64 which are not available (closes: #306264)
+  * menu.lst/postinst: use BOOT_PARTITION instead of ROOT_PARTITION
+    (closes: #305861)
+  * install_packages.8: remove option -f
+  * make-fai-nfsroot.8: remove wrong information (closes: #304980)
+  * control: add grub to suggests
+  * rules: make hooks and postinst script executable
+  * FAIBASE/10-misc: do not call tune2fs when using 2.6 kernel. This may
+    hang the system
+  * fr.po: added french debconf templates (closes: #306232)
+  * de.po, templates.pot: remove fuzzy lines
+  * README.disk_config: add notes about boot option
+  * debian/postinst: replace sed -i with perl -pi -e since old sed does
+    not support -i
+  * fai-setup: change informational message
+  * fai-mount-disk: mount file systems read only
+  * 50-host-classes: move host specific class definitions to new script
+  * fai-guide.sgml: fix typos and other minor mistakes
+
+ -- Thomas Lange <lange at debian.org>  Sat, 30 Apr 2005 21:20:53 +0200
+
+fai (2.8) unstable; urgency=high
+
+  * remove ext2resize from $packages (closes: #303565)
+  * major rewrite of simple examples (closes: #290554)
+  * make-fai-nfsroot.8: add info about nfsroot location (closes: #303915)
+  * fai-guide.sgml: major update for new release
+  * setup_harddisks: add support for device names disk1 and disk2,
+    reformat some output, print some messages only if $verbose is set
+  * rcS_fai: renamed to fai, add manual page fai.8
+  * fai: add $rundir, remove unused dirs at the end, call set_disk_info
+    before task_defvar, add variable $DO_INIT_TASKS, add code for
+    softupdate support, rename rcS.log to fai.log, add copyright message
+    to usage(), add option -N --new, always test $DO_INIT_TASKS with -eq
+  * apt.conf: replace force-confnew with force-confdef
+  * make-fai-nfsroot: use dpkg --print-installation-architecture instead
+    off uname -m, add arch dependent package name to, remove "" for
+    matching * in KERNELPACKAGE, test if $KERNELPACKAGE is empty
+    $NFSROOT/var/tmp/packages.arch, use shadowconfig instead of pwconv
+  * make-fai-nfsroot.conf: comment FAI_LOCAL_REPOSITORY, set FAICLIENTS to
+    local class-C network, remove ext2resize until available again
+  * subroutines: add task softupdate, add support for softupdate, add
+    $DO_INIT_TASKS, minor changes in get_fai_cvs(), use swapoff -a for
+    disabling swap partitions, test $DO_INIT_TASKS always with -eq, use
+    /var/log/fai/FAI_CLASSES
+  * subroutines-linux: script prepare_apt is now updatebase, add support
+    for softupdates, add task_prepareapt, sliently skip task_chboot if
+    LOGUSER is undefined, $disklist now sorted, print setup_hardisks
+    output also to console
+  * install_packages: cleanup of multiple packages with different
+    install/remove operations, add installable(), check if a package is
+    listed in a package index and not only in the dpkg database, add
+    force-confdef and force-confold to apt-get, install_packages.conf
+    unused, remove -f, sub read_config_file
+  * fai-do-scripts: now executing scripts matching [0-9[0-9]*, S[0-9]*
+    also supported for backwards compatibility
+  * fai-mirror: add check if mkinitrd-cd and apt-move are installed, arch
+    dependent packages defined in make-fai-nfsroot, replace sed with bash
+    builtin, add $debdist, return if $addpackages is empty
+  * fai-chboot: change message
+  * load_keymap_consolechars: much simpler code
+  * create_ramdisk: create /tmp/var/run/fai
+  * fai.conf: installserver will be set by debconf, by default LOGUSER is
+    unset
+  * sources.list: insert MIRRORHOST which will be replaced by debconf data
+  * Makefile: install device2grub to new location, rename rcS_fai to fai
+  * control: add libapt-pkg-perl for install_packages, remove dependency
+    on nfs, because fai can also only be used for softupdate
+  * postrm: cleanup debconf data on purge
+  * postinst: use debconf
+  * rules: add dh_installdebconf call, remove chmod of rcS_fai
+  * utils/mkdebmirror: --ignore-missing-release --ignore-release-gpg
+
+ -- Thomas Lange <lange at debian.org>  Sat,  9 Apr 2005 23:43:27 +0200
+
+fai (2.7) unstable; urgency=high
+
+  * closes grave bug, make-fai-nfsroot.conf: replace raidtools2 with mdadm
+    (closes: #299952), move cfengine from $packages to $NFSROOT_PACKAGES 
+  * closes important bug, make-fai-nfsroot: use resolv.conf from install
+    server during creation of nfsroot (closes: #301230)
+  * rcS_fai: set classes before fai-class is called (closes: #301179), set
+    hostname if HOST was specified on the commandline
+  * fcopy: fix wrong variable name
+  * package_config/KERNEL_SOFT: replace `echo $kernelversion` in package
+    name with 2.6.8
+  * fai-guide.sgml: fix a lot of broken http links, add info for fai-cd
+  * install_packages: add setdownloadonly() and $opt_d
+  * conf/install_packages.conf removed
+  * fai-mirror: source make-fai-nfsroot.conf, add add_base_packages(),
+    allow - in class names, add option -a, call install_packages with -d,
+    add PKGCOMP for apt-move.conf, do not exit 9 if $FAI_DEBMIRROR is not
+    defined, log aptitudes actions to /dev/null
+  * fai-mirror.1: add option -a
+  * install_packages.8: add option -d
+  * add fai-cd script for creating a bootable FAI CD image (closes: #265444)
+  * add fai-cd.8 man page
+  * add conf/menu.lst: needed by fai-cd
+  * control: add mkinitrd-cd to Suggests, add Build-Depends-Indep on
+    debhelper greater version 3
+  * class/DEFAULT.var: use kernel-image-2.4-386 as default kernel package
+  * fai-savelog-ftp: remove $ENV{LOGREMOTEDIR} from mkdir since we just cd
+    to it
+  
+ -- Thomas Lange <lange at debian.org>  Fri, 25 Mar 2005 23:51:34 +0100
+
+fai (2.6.7) unstable; urgency=low
+
+  * add task debconf (closes: #136503)
+  * new script fai-debconf
+  * add manual page fai-debconf.1
+  * control: use nfs-kernel-server by default (closes: #293876)
+  * QUESTIONNAIRE: minor update
+  * packages_config/XFREE: remove some -dev packages
+  * packages_config/SERVER: remove symlinks
+  * packages_config/DEFAULT: add debconf-utils
+  * replace backticks with $()
+  * fai-do-scripts: use local variables, make it a bash script
+  * fai-guide.sgml: update for debconf support, add aptitude in
+    install_packages config
+  
+ -- Thomas Lange <lange at debian.org>  Thu, 10 Mar 2005 11:00:05 +0100
+
+fai (2.6.6) unstable; urgency=medium
+
+  * 06hwdetect.source: add comment, add class NVIDIA which is not currently
+    used, bug fix: correct SCSI detect 2.6 kernel, replace backticks with
+    $(), discard error messages from modprobe, enable dma mode for ide
+    devices (with fai CD it was not enabled)
+  * make-fai-nfsroot: use "" when testing variables, add link for
+    discover, remove resolv.conf created by debootstrap (closes: #281264),
+    create list of all packages in base.tgz, add packages for x86_64,
+    remove unneeded files in $FSROOT/etc/fai
+  * ftar: bug fix do not do recursive removal if $target/$dir is /
+  * fai-guide.sgml: fix typos (closes: #287150), add info about
+    /files/packages/ (closes: #290359)
+  * add task_savelog to die() (closes: #290526)
+  * make-fai-bootfloppy: bug fix: support /media directory, choose last
+    installed kernel if more than one kernel is installed in nfsroot
+  * setup_harddisks: bug fix: redefined mountpoint are too often reported,
+    allow space before primary and logical keyword
+  * create_ramdisk: bug fix: make directory for discover
+  * fai-setup: typo in variable name (closes: #289271), reload nfs server
+    instead of restart, read make-fai-nfsroot.conf, use variable
+    FAICLIENTS
+  * fai-class: bug fix: option -T hangs the script, make it a bash script,
+    replace backticks `` with $(), bad variable name in testclass()
+  * share/subroutines: bug fix: cd to / so umount -a will not fail too
+    often, kill sshd before rebooting, umount $target/proc before
+    umounting all otger file systems, copy FAI_CLASSES variables.sh
+    disk_var.sh to $target/var/log/fai
+  * fai-chboot: bug fix: do not fail on subnet IP addresses, test if host
+    lookup is possible before calling $h->name (closes: #290007)
+  * install_packages: add option -f, add command{pending},
+    command{dpkgc}, print max number of packages only in verbose mode
+  * install_packages.8: add option -f, add info about
+    install_packages.conf
+  * new config file: install_packages.conf, used for fai-mirror(1)
+  * rcS_fai: remount / with noatime, set variables if booting from CD, set
+    hostname to $HOST it was unset, remove unused variable, minor code
+    cleanup
+  * DEFAULT/S01: add copying of /etc/modules
+  * DEFAULT/S10: add message where grub writes boot record
+  * class/01alias: add class FAICD if running from fai CD, add classes for
+    host gnomehost (used by fai-cd)
+  * package_config/DEMO: replace install with aptitude
+  * make-fai-nfsroot.conf: add variable FAICLIENTS, remove package dpkg-dev
+  * script/LAST: enable shadow passwords for passwd and group in examples,
+    eject cdrom when running from fai CD
+  * task_sysinfo: call hwinfo if available
+  * fai-savelog: do not save remotely if $LOGSERVER is not set
+  * new command fai-mirror and manual page fai-mirror.1
+  * .../XF86CXonfig-4/DEFAULT: change HorizSync, use pc105 keyboard model
+  * .../XF86CXonfig-4/MATROX: removed because DEFAULT works now
+  
+ -- Thomas Lange <lange at debian.org>  Fri, 21 Jan 2005 04:24:26 +0100
+
+fai (2.6.5) unstable; urgency=medium
+
+  * install_packages: bug fix. Do not remove package names which are
+    search patterns for aptitude, read /etc/fai/install_packages.conf if
+    it exists 
+  * hooks/savelog.LAST: add patterns that will be ignored
+  * fcopy: add support for svn and arch, add option -I, use variable
+    $FCOPY_IGNOREDIRS if set
+  * fcopy.8: add option -I
+
+ -- Thomas Lange <lange at debian.org>  Thu, 11 Nov 2004 15:14:08 +0100
+
+fai (2.6.4) unstable; urgency=medium
+
+  * add missing Beowulf examples
+  * fai-guide.sgml: fix error in link
+  * fai-start-stop-daemon: add short options, because so some init.d
+    scripts use them
+  * rcS_fai: do not use -t when remounting
+  * make-fai-nfsroot: print error when $KERNELPACKAGE is not found, add a
+    package for alpha architecture
+  * share/subroutines: do not dump variable $HOME and $PWD to variables.sh
+  * doc/QUESTIONNAIRE: typos, add example for answer
+  * install_packages: use warn instead of print for warning and verbose
+    messages, add aptitude support
+  * Fai.pm: add () to subroutine calls
+  * prerm: do not exit when nfs server reload fails (closes: #279024)
+  * setup_harddisks: add $devdisklist to call of sfdisk (closes: #276033)
+  * preparte_apt: divert programs before calling apt-get update
+  * subroutines-linux: redirect stdin of install_packages unless in debug
+    mode (closes: #264727)
+
+ -- Thomas Lange <lange at debian.org>  Mon,  8 Nov 2004 14:38:58 +0100
+
+fai (2.6.3) unstable; urgency=high
+
+  * subroutines: remove $rootpw from variables.sh (closes: #270871)
+  * update to kernel 2.4.27
+  * make-fai-nfsroot: force link creation of ifstate (closes: #270463),
+    use /etc/shadow in $NFSROOT
+  * make-fai-makefsroot.conf: add xfsprogs and xfsdump packages, adjust
+    size, install with chmod 0600 (closes: #270666, #271113)
+  * DEFAULT/S10: removed: add auto to /etc/modules
+  * class/DEFAULT.var: use single quotes instead of double quotes,
+    $kappend contains kernel parameters, new default kernel package
+    kernel-image-2.4.27-1-386
+  * scripts/DEFAULT/S20: remove unused action
+  * packages_config/DEFAULT: add iproute to NETTOOLS
+  * make-fai-nfsroot.8: add info about make-fai-nfsroot.conf,
+    add option -K which first removes all kernels from nfsroot
+    (make-fai-bootlfoppy is broken if multiple kernels are in the nfsroot)
+  * fai-setup: add option -e which does not set up nfs environment, which
+    may hang some production systems for a while
+  * fai-setup.8: add info for new option
+  * Makefile: install make-fai-nfsroot.conf with 0600
+
+ -- Thomas Lange <lange at debian.org>  Mon, 13 Sep 2004 18:40:36 +0200
+
+fai (2.6.2) unstable; urgency=high
+
+  * install_packages: fix broken taskinst action, workaround for new
+    tasksel behaviour
+  * DEFAULT/S10: fix broken grub entry for FAI_BOOTPART when two kernels
+    are in the nfsroot
+  * fai-chboot: add option -e the opposite of -r, uses nearly the same code
+
+ -- Thomas Lange <lange at debian.org>  Thu, 26 Aug 2004 20:09:15 +0200
+
+fai (2.6.1) unstable; urgency=medium
+
+  * catnc() greps through more than one file
+  * changlog messages of fai-setup moved from 2.5.2 to 2.6
+  * hooks/savelog.LAST: add package names which include the string "error"
+    as ignorepatterns
+  * make-fai-nfsroot.conf: add portmap again, since nis setup needs it
+  * make-fai-nfsroot: add option -k which installs a new kernel for the
+    nfsroot (closes: #256187), /root/.profile sources variables.sh, test
+    if $NFSROOT/prco/self exists before umount, kernel_install() includes
+    all code for installing the kernel, create dir $NFSROOT/var/state only
+    when not already existing, call umount_dirs and reset trap exit for
+    normal finishing script
+  * control: recommends dhcp3-server (closes: #263260), update to
+    standards 3.6.1, remove sp from build-depends
+  * rcsfai.var is not needed any more
+  * share/subroutines: do not dump readonly variables to variables.sh
+  * faireboot: make it a bash script, source variables.sh, source
+    subroutines, send message to faimond
+  * fai-divert: do not execute if dpkg-divert is not available
+  * install_pacakges: add support for tasksel remove, set default number
+    of packages from 4711 to 99
+  * package_config/COMPILE: replace task c-dev by list of packages names
+  * prepare_apt: make diversion of invoke-rc.d
+  * rules: call dh_clean after make clean
+  * prerm: test if $nfsserver is empty (closes: #263906)
+  * NETWORK/S40: remove /etc/hosts from fcopy list
+  * DEFAULT/S20: add async to export options
+  * fai-savelog: define $HOSTNAME to output of command hostname
+  * subroutines-linux: task_chboot() use `hostname` instead of $HOSTNAME,
+    sndmon() use $sndhostname instead of $HOSTNAME
+  * remove doc/README.package_problems
+  * fai-guide.sgml: add hint about dhcpd/nfsroot (closes: #264486), fix
+    typos
+
+ -- Thomas Lange <lange at debian.org>  Mon,  9 Aug 2004 14:02:13 +0200
+
+fai (2.6) unstable; urgency=low
+
+  * fai-setup: fix hostname detection when hostname includes a dash -,
+    pass all fai-setup options to make-fai-nfsroot (closes: #255830)
+  * fai.conf: move make-fai-nfsroot specific variables to make-fai-nfsroot.conf
+  * fix typo in lib/get-boot-info (closes: #242739, #239405)
+  * fix link in fai-guide.sgml (closes: #237794)
+  * fix typo in make-fai-bootfloppy.8 (closes: #238608)
+  * make-fai-bootfloppy: change lilo labels in (closes: #248955),
+    check if -s option is IP-address or hostname, new path for stage
+    files, remove install= line for lilo.conf, newer lilo does not need
+    boot-menu.b, added support for old an new lilo
+  * make-fai-nfsroot: add package dmidecode for some archs, add
+    module-init-tools, libapt-pkg-perl, smartmontools, usbutils, lvm2,
+    raidtools2, hwinfo, remove portmap package, jove to nfsroot, do not
+    copy bootsector, use mkelf-linux,
+    new code for creating timezone and localtime (closes: #201440), always
+    show $NFSROOT when copying verbosely, insert newline before adding
+    $FAI_LOCAL_REPOSITORY to sources.list, warning if $FAI_SOURCES_LIST is
+    used, use new make-fai-nfsroot.conf file, divert discover-modprobe,
+    add -q to depmod, create var/state dir, add subroutine fdivert(),
+    use fdivert instead ov ln or mv commands
+  * create_ramdisk: use tmpfs instead of shm, create dir for discover
+  * fcopy: -i always exists with 0
+  * rcS_fai: if a file /.nocolorlogo exists, do not enable colored
+    logo and let scroll region unchanged
+  * 06hwdetect.source: new call of discover (closes: #248532), be silent
+    when loading modules, use pipe instead of exec for find, mount usbfs
+    after loading an usb module, add $videodrv to additional.var, load
+    different modules when using a 2.4 or 2.6 kernel
+   * 11modules.source: moved into 06hwdetect.source
+  * lib/task_sysinfo: first call discover, then load modules using
+    discover, call smarctl for each disk, call lsusb, print partition
+    table with parted
+  * fai-divert: create dummy script only when dpkg-divert will succeeds
+  * fai-savelog: copy LOGDIR recursively, add remote log method none,
+    add -xdev to find
+  * subroutines: use /proc/uptime to determine installation time, use $()
+    instead of backticks, set terror when error occurs, add catnc(),
+    report FAI_FLAGS in one line, send message to faimond when starting a
+    hook
+  * subroutines-linux: set terror if error, add sndmon TASKERROR, do not
+    copy kernel image and initrd to install server, remove echo command
+    when defining kernel append parameters as variables
+  * faimond: always flush output
+  * fai-chboot: add option -o, special treatment of hostname default, also
+    list default config file when using -l, die with error message if
+    hostname is unknown, remove path from program name
+  * install_packages: add option -L, calling system with array should be
+    more efficient, new code for detecting unknown package names uses
+    AptPkg, add subroutine mkpackagelist(), remove path from program name
+  * bootsector, bootsector.8 removed
+  * class/LAST.var: removed because $hdparm is not needed any more
+  * class/70partition: remove definition of class FAI_BOOTPART
+  * class/01alias: remove unimportant examles, remove catnc definition,
+    remove beowulf example
+  * DEFAULT/S01: remove copying of bootsector, remove our local stuff
+  * scripts/BOOT: grub-install does not probe floppy drive, use bash,
+    replace backtics with $()
+  * hooks/instsoft.SERVER not needed any more
+  * hooks/savelog.LAST: add more messages to ignore
+  * disk_config/SMALL_IDE: remove partition /fai-boot, make / and /var
+    bigger, /usr smaller
+  * package_config/*: adjust package names to sarge distribution
+  * S40: remove NISLPRCLIENT and bootptab stuff
+  * examples/etc/sources.list: remove proposed updates lines
+  * mkdebmirror: mirror woody and sarge in one directory
+  * new FAQ
+  * THANKS: juergen added
+
+ -- Thomas Lange <lange at debian.org>  Mon, 26 Jul 2004 17:22:44 +0200
+
+fai (2.5.4) unstable; urgency=low
+
+  * DEFAULT/S01,S20: add async option to export lines
+  * fai-guide.sgml: add info how to boot a SUN Sparc, add URL for Sparc
+  * make-fai-nfsroot: add gnu-efi and silo to arch package lists, add
+    sparc64 arch, ppc arch uses vmlinux not vmlinuz
+  * make-fai-bootfloppy: create and use device.map for grub_floppy
+    (closes: #233018), remove unused ip entry for fixed ip addresses,
+    create iso9660 iso image with option -i
+  * make-fai-bootfloppy.8: add option -i and an example for creating a
+    cdrom image
+  * rcS_fai: add prcopyleft() and fstart(), use mkfifo and tee instead of
+    bash special >(), mount sysfs if available
+  * doc/README.disk_config: add info about lazyformat
+  * THANKS: added holger
+  
+ -- Thomas Lange <lange at debian.org>  Thu, 26 Feb 2004 17:07:31 +0100
+
+fai (2.5.3) unstable; urgency=low
+
+  * make-fai-bootfloppy: call grub in chroot environment, so correct libc
+    is used, add option c and F, DHCP is now default boot protocol, be
+    more verbose
+  * make-fai-nfsroot: add option c which sets $cfdir (closes: #219824)
+    add variable nfssize, remove package strace, check if $NFSROOT is set,
+    mkdir $RUNDIR is not need any more, use $cfdir instead of fixed
+    /etc/fai, do not copy fai-chboot to nfsroot, call certain commands in
+    a LC_ALL=C environment, add more verbose messages, new options for
+    mknbi-linux call (closes: #181393), test if FAI_SOURCES_LIST is
+    defined or a sources.list file exists, be verbose when copying
+    important files if option -v is set
+    depmod -a ... || true so it does not stop the whole system
+  * debian/control: replace netboot package with mknbi
+  * debian/dirs: add var/run/fai, remove unused directory utils
+  * debian/prerm: check if $NFSROOT is set, sleep 2 before removing nfsroot
+  * man/make-fai-bootfloppy.8: add new options F and c
+  * man/make-fai-nfsroot.8: add new option c
+  * lib/task_sysinfo: show ide disk geometry
+    remove detect call
+    most text reformated, because subroutine definition removed
+  * doc/Makefile: remove some new tempfiles, add "|| true" to rm so it
+    does not complain
+  * fai-chboot: add option -S, complain when host names are missing for
+    option -r
+  * fai.conf: add packages to the exclude list for debootstrap
+    new name for KERNELPACKAGE
+    add comment how to use NFSROOT_ETC_HOSTS (closes: #219433)
+    remove FAI_SOURCES_LIST examples, use sources.list instead
+    disable FAI_LOCAL_REPOSITORY by default
+    put important variables to the top
+  * examples/etc/sources.list: new file, that shows examples of different
+    access method to the Debian mirror
+  * fai-guide.sgml: describe new handling of sources.list, add manref to
+    make-fai-nfsroot, new line for tftpd in inetd.conf, add info on use
+    without DNS
+  * class/06hwdetect.source: modprobe ide-detect needed for 2.4.24 kernel,
+    remove ide-probe-mod, add isa-pnp
+  * lib/get-boot-info: new code to extract ip parameters, fix problems
+    when one parameter is missing
+  * share/subroutines: islinux() not needed any more, task_chboot: always
+    copy new kernel image to /boot/fai/$HOSTNAME-localboot
+  * apt.conf: replace values yes with true
+  * rcS_fai: new code for task action pipe at the end, new mount option
+    for remounting /dev/root, copyright has one line less
+  * examples/etc/dhcpd.conf: new example for a local 192.168.1 subnet, add
+    nfs mount options to root-path
+  * VERSION: default is kernel 2.4.24
+  * chkdebnames: most parts rewritten
+  * setup_harddisks: typos
+  
+ -- Thomas Lange <lange at debian.org>  Wed,  4 Feb 2004 14:42:40 +0100
+
+fai (2.5.2) unstable; urgency=low
+
+  * rcS_fai: print copyright message in red, set scroll region, add
+    actimeo for nfs mounts
+  * fai.conf: add exim4 packages to exlude list
+  * make-fai-nfsroot: add netcat to nfsroot; remove libdetect0 from
+    package list (closes: #219420), copy preferences from /etc/fai
+    (closes: #219824), use apt-get dist-upgrade instead of upgrade,
+    do not create base.tgz in $NFSROOT/.. and then move file
+  * setup_harddisks: add -f tp mkfs.xfs option (closes: #219439)
+  * faimond, faimond.8 added
+  * subroutines-linux: add sndmon subroutine, try to connect faimond, on
+    success, enable monitor feature, test if $ret is empty, make it a bash
+    script, show nc output only when debugging
+  * fai-guide.sgml: typo in URL
+  * class/01alias: use other IP-addresses for exmaples
+  * lib/fai-mount-disk: extend regex to support devfs names
+    (closes: #218541)
+  * scripts/DEFAULT/S01: create S61hdparm if $hdparm is not empty,
+    set cdromdevice to SCSI if available, add code for lprng setup if
+    NISLPRCLIENT and LPD
+  * class/LAST.var: do not set a default value for FAI_ACTION, change in
+    comment
+  * add postrm file to remove all files when purging
+  * subroutines: add sndmon messages, script should be bash script, change
+    debug code in ifclass
+  * install_packages: remove pinning info before checking for misspelt
+    package name, usage() points to the man page
+  * fai-setup: chown of /boot/fai
+  * utils/softupdate, lib/prepare_apt: use dist-upgrade
+  * debian/compat created and debian/conffiles removed
+  * scripts/DEFAULT1/S20: add noatime,actimeo=900 options, add linux logo
+    to login messages
+  * sunos/makefile: add fai-savelog to solaris tarball
+  * hooks/savelog.LAST: added "unexpected IO-APIC" to ignore pattern
+  * Fai.pm: test if /var/adm/messages exists
+  * lib/task_sysinfo: add dmidecode call, add sfdisk -d call, change fdisk
+    call
+  
+ -- Thomas Lange <lange at debian.org>  Tue,  6 Jan 2004 15:20:10 +0100
+
+fai (2.5.1) unstable; urgency=low
+
+  * share/subroutines: use $SECONDS instead of date +%s
+  * fcopy: add usage info for -M
+  * add chapter "advanced FAI" to fai guide
+  * dhcclient-perl: add new names to mapping table
+  * lib/create_ramdisk: start devfsd if needed
+  * share/subroutines-linux: task_chboot should return, not exit; copy
+    initrd.img to install server if needed for the kernel
+  * make-fai-nfsroot: add $NFSROOT_ETC_HOST before calling apt-get
+    upgrade; remove mkdir of fai_config
+  * package_config/DEFAULT: add nfs-common for all
+  * examples/simple/scripts/DEFAULT/S01: add -n to head command (closes: #205547)
+  * sunos/scripts/SUNOS/S05: add -t to expand
+  * sunos/bin/newfs:chown -> chmod
+  * make-fai-bootfloppy: use perl one liner to get IP and host name, call
+    grub executable from nfsroot
+  * fai-guide.sgml: fix typos (closes: #204763)
+  * package_config/DEFAULT: always install nscd package for speedup
+  * Makefile: remove mv of NETWORK1; add variable libfiles
+  * rcS_fai,fai-setup: add async to mount and exports options
+
+ -- Thomas Lange <lange at debian.org>  Fri, 10 Oct 2003 14:58:16 +0200
+
+fai (2.5) unstable; urgency=low
+
+  * add script fai-chboot
+  * add script fai-savelog-ftp
+  * add vaiables to fai.conf: FAI_LOGPROTO LOGSERVER LOGPASSWD; used by
+    fai-savelog-ftp, localhost is default for $installserver
+  * make-fai-nfsroot: add option -f, change to #! /bin/bash, copy
+    resolv.conf to $NFSROOT, add libnet-perl, trap errors, add bad_exit()
+  * make-fai-bootfloppy: bug fix, add root=/dev/nfs (closes: #198568),
+    remove ip=both for fixed ip-address, change to !# /bin/bash
+  * make-fai-bootfloppy.8: add example with fixed IP address
+  * changes in package_config, added XFREE class
+  * install_packages: add force-yes to apt-get install, remove warnings
+    from apt-cache output, limit number of packages used at once using
+    $MAXPACKAGES
+  * bug fix: /proc/cmdline info is trashed when reading a long kernel
+    command line
+  * make-fai-nfsroot: create package list that depends on architecure,
+    make symlink for syslogd
+  * scripts/BOOT: noew code for generating grub entries, add grub entry
+    for memtest; add entries for re-installation
+  * scripts/DEFAULT1/S01: do never fsck ext3 partitions; add -M to some
+    fcopy calls; add user demo; use fcopy for /etc/kernel-img.conf
+  * scripts/DEFAULT1/S20: enable tcp connections for X server for CS_KOELN  
+  * fcopy: add option -M and -b; add variables FCOPY_LASTLOG and
+    FCOPY_UPDATELOG; remove substring from an ewarn call
+  * subroutines: append $FAI_ACTION to file $rcsfaivar; faiend must not
+    reboot for SunOS
+  * subroutines-linux: add support for fai-chboot
+  * hook faiend.LAST renamed to savelog.LAST
+  * setup_harddisks: add XFS filesystem support, add sfdisk environment
+    variable
+  * fai-savelog: make a bash script; use -exec instead of xargs because of
+    sunos version of xargs
+  * fai-class: remove comment lines also in the file $HOSTNAME
+  * class/{dom,kueppers}: add NOSECURETTY
+  * lib/get-boot-info: print warning message if no boot protocol was
+    detected, add network info to boot.log if booting from floppy with
+    fixed IP address
+  * chkdebnames: bug in regex fixed
+  * lib/create_resolv_conf: use resolv.conf from installserver if $DOMAIN
+    is not defined
+  * lib/task_sysinfo: call programm sysinfo if available
+  * scripts/NETWORK1/S40: copy /etc/network/interfaces /etc/hosts /etc/networks
+    using fcopy, add -i to fcopy calls
+  * scripts/DEFAULT1/S10: create etc/hostname only if fcopy fails, add
+    password protection to grub menu
+  * class/01alias: use classes from file demo if hostname is demohost; add
+    catnc(); use catnc instead of cat
+  * class/11modules.source: now uses code from DEFAULT.mod
+  * examples now live in /usr/share/doc/examples{simple,advanced}
+  * utils move back to doc/examples/utils directory
+  * utils/rshall: add exclude function
+  * class/06hwdetect.source tries to detect video card
+  * Makefile: do not create symlinks (closes: #195377), new directories
+    for examples
+  * rcS_fai: compute and print installation time in seconds
+  * dhcpd.conf: remove unused commands
+      
+ -- Thomas Lange <lange at debian.org>  Wed,  6 Aug 2003 16:02:26 +0200
+
+fai (2.4.1) unstable; urgency=low
+
+  * set correct year in fai guide
+  * dhcp3 support
+  * make-fai-bootfloppy: force ext2 when mounting floppy, blank first
+    sector
+  * make-fai-nfsroot: FAI_BOOT determines which boot protocol to set up,
+    fix ownership of  $NFSROOT/root/.ssh/authorized_keys (closes: #183989)
+  * use ext3 in most disk_config samples
+  * Makefile: do not copy executable twice
+  * minor changes to packages_config/AUDIO
+  * install_packages: call "apt-get clean" to remove unused package files
+  * fai.conf: add FAI_BOOT, add SERVERINTERFACE, add example how to access
+    a mirror created by mkdebmirror via HTTP 
+  * S20: bug fix, move inserting $rootpw from GERMAN to any section
+  * fai-class: add . to PATH; test operator == replaced by -eq
+  * DEFAULT/S01: new location for bootsector executable
+  * dhclient-perl: use short hostname
+  * new script fai-do-scripts, contains the do_script() subroutine and
+    task_configure code
+  * QUESTIONAIRE: added questions
+  
+ -- Thomas Lange <lange at debian.org>  Thu,  3 Apr 2003 16:57:12 +0200
+
+fai (2.4) unstable; urgency=low
+
+  * not alles changes in templates/* are listed here, there are to many
+  * use command fai-class to define classes, fai-class writes status of
+    every script to status.log
+  * make variables local or unset them after use, unset function
+    definitions after use
+  * add config files for XFree86 4.1
+  * many changes in the package_config files
+  * bootsector: do not use dpkg to get hardware architecture, add man page
+  * a lot of spelling mistakes corrected. Thanks Era! (closes: # 155735)
+  * control: correct name for Debian distribution (closes: #150887)
+  * new templates: hooks/partition.kueppers.source, hooks/faiend.LAST
+    package_config/WWWKIOSK, class/WWWKIOSK.var, package_config/paeffgen
+  * make-fai-nfsroot: add -l to tar when creating base.tgz (closes: #151173),
+    add noatime to mount, new mknbi-linux options, check for existence of
+    mknbi-linux (closes: #167900), replace $UID with `id -u`, do not call
+    rdev, remove packages that are already installed by debootstrap, new
+    option for mknbi-linux, always do setup for dhcp and bootp, write PATH
+    to /root/.profile, correct location for syslog.conf, copy sources.list
+    from /etc/fai if available, add diversion for discover, add rsync, ssh
+    to nfsroot, do not die when mknbi-linux is missing, do not create
+    device nodes (closes: #174844)
+  * class/70partition: bug fix. Use the same file as setup_harddisks to
+    determine classes which depend on partitions
+  * scripts/*: convert some shell code to cfengine code, do not use fcopy
+    if only a few lines has to be changed
+  * scripts/BOOT: echo each kernel module to a seperate line in, add
+    supoprt for kernel using initrd, use fcopy for lilo.conf and menu.lst,
+    /etc/modules, lilo.conf can also boot the old kernel, add initrd
+    option when using grub
+  * scripts/DEFAULT1/S20: use declaration directories, add WWWKIOS entries
+  * scripts/LAST: add call: apt-get -f install, copy sources.list
+  * scripts/USB removed, now made in S20
+  * scripts/FAI_BOOTPART: missing $target added, remove rdev call
+  * share/subroutines*: better regex for matching disks in /proc/partitions,
+    task_sysinfo, prepare_apt, add link last to last action performed, new
+    variable $LOGSERVER, list_disks move to a external script, disable
+    debugging output in ifclass(), write exit status of scripts and hook
+    to status.log and stdout, create_resolv_conf now an external script,
+    write exit status of hooks to status.log, do not define $revclasses,
+    save variables to variables.sh, subroutine task unsets the definition
+    of the executed task after its execution, source hooks/subroutines now
+    in fai_setup, remove task_backup, move load_keymap_consolechars to
+    rcS_fai
+  * share/subroutines-linux: remove diskandsize(), disk_info now called
+    set_disk_info() which calls externel script 
+  * task_instsoft(): mount --bind /fai /tmp/target/fai so packages in
+    /fai/files/packages can be installed using apt-get
+  * new script disk-info prints a list of all disks and their sizes
+  * new script get-boot-info contains subroutines for getting info via
+    BOOTP or DHCP, also detects network devices
+  * DEFAULT/S01: install $addpackages with one dpkg call, installation of
+    default kernel creates symlinks in /, make /root accessable only by
+    root, use fcopy -r to copy all dot files for the root account, do not
+    copy sources.list
+  * ftar: conditional rm -rf, echange in error message
+  * test if mknbi-linux is available (closes: #167900)
+  * make-fai-bootfloppy: add grub support, code reorganized and split into
+    more subroutines, rmdir lost+found and copy fewer files to get more
+    space on the floppy, replace $UID with `id -u`, create a generic boot
+    floppy independant of the boot protocol, use one image with multiple
+    append parameters, new options -v, -d, -l, -g
+  * bug fix: hooks can now skip its task again
+  * NFS file systems are also mounted with noatime.
+  * rcS_fai: create var/run/sshd directory, /usr/local/{bin,sbin} at the
+    very beginning of PATH, add /usr/lib/fai to PATH, PATH is defined
+    before doing anything else, create_ramdisk is an extern script, new
+    options for remounting /, remove some unused variables
+  * task_sysinfo now a separate script; add lsmod call, new test if
+    executables are available is using which, move log file from kudzu to
+    $LOGDIR
+    * adddivert, mkdivert, rmalldivert, rmdivert moved to the new script
+    fai-divert
+  * fai-divert: be quiet unless debug is set
+  * mount_local_disks, umount_local_disks, fstab_mount move to new script
+    fai-mount-disk 
+  * Fai.pm and subroutines* are moved from lib/ moved to share/
+  * Fai.pm: call disk-info to get size of all disks
+  * fai-setup: ssh-keygen needs option -t (closes: #156947), test if
+    nfsserver is set
+  * fai.conf: correct line containing proposed-updates, new variable
+    FAI_LOCAL_REPOSITORY, new directory for debian mirror, add
+    architecture to debootstrap options, move some nfsroot packages to
+    make-fai-nfsroot script, add $FAI_LOCATION, remove FAI_SHAREDIR
+  * setup_harddisks: allow more that 3 primary partitions, new regex for
+    matching disks and partitions, write less info to stdout, do not write
+    info to stdout which is written to a separate file, name of partition
+    table changed from hda.sfdisk to partition.hda
+  * add sources.list in conf, it's used when FAI_SOURCES_LIST in undefined
+  * fai_modules_off: add block-major-{104,105}
+  * remove debian/undocumented
+  * install_packages: add option -l, only print the list of packages,
+    add option -h, -t does not executes the commands, support for classes
+    listed after command, change in echo strings, add option to manual
+  * disk_config/: make /fai-boot partition larger, CS_KOELN use more
+    flexible values for partitions sizes
+  * add suffix -386 to name of kernel-image package
+  * save_log_*(): do not create loops in symlinks, moved to external
+    script fai-savelog
+  * apt.conf: add option force-confdef to dpkg call
+  * 06hwdetect script loads SCSI and IDE modules and prints /proc/scsi
+    info, less messages in verbose mode, detect SCSI devices correctly
+  * move mount2dir to lib directory, echo different messages for verbose
+    and debug flags
+  * fcopy bug fix: option -r does not work correctly, when no matching
+    file for a class is found, do not exit with error, add option -i and
+    -B, use $LOGDIR, set $ROOTCMD for postinst scripts
+  * templates/package_config: use nfs-kernel-server
+  * debian/rules: use dh_installman to install manual pages
+  * ATA33.var no longer needed, no tuning via hdparm in *.var
+  * lots of updates and additions to the manual
+  
+ -- Thomas Lange <lange at debian.org>  Thu, 13 Feb 2003 11:45:29 +0100
+
+fai (2.3.4) unstable; urgency=low
+
+  * default name for fai kernel-image has changed
+
+ -- Thomas Lange <lange at debian.org>  Thu, 16 May 2002 14:42:00 +0200
+
+fai (2.3.3) unstable; urgency=medium
+
+  * enable use strict in perl scripts
+  * remove some potato specific code
+  * typo fixed (closes: #143272)
+  * add some packages to SERVER
+  * copy id_dsa* and id_rsa* files in make-fai-nfsroot
+  * debian/rules uses DH_COMPAT=3
+  * add packages to AUDIO, changes in SERVER
+  * potato specific code removed
+  * faireboot kills syslogd before booting
+  * change symlink of rcS_fai (closes: #146430)
+  * print warning before removing nfsroot
+  * do not compress pdf files in /usr/share/doc/
+
+ -- Thomas Lange <lange at debian.org>  Thu, 16 May 2002 09:27:15 +0200
+
+fai (2.3.2) unstable; urgency=low
+
+  * bug fix: THISLOG is unused variable
+  * added save_log_*(): only remove files (-type f added)
+  * load net-pf-1 kernel module (unix socket)
+  * minor changes in package_config files
+  * added script class/S03hwdetect.source
+  * dhclient-perl: dhcp use host_name
+  * faireboot: use rmalldivert for removing diversions
+  * $divertlist not used any more; use dpkg-divert --list
+  * setup_harddisks writes list of swap devices; they are enables using swapon
+  
+ -- Thomas Lange <lange at debian.org>  Mon, 29 Apr 2002 19:47:39 +0200
+
+fai (2.3.1) unstable; urgency=low
+
+  * bug fix in make-fai-bootfloppy, fcopy
+  * first letter in description now uppercase (closes: #142017)
+  * add option -m to make-fai-bootfloppy
+  * save keymap to boottime.kmap.gz
+  * add many comments to shell scripts
+  * copy $loguserhome/.ssh/*.pub files to $NFSROOT/root/.ssh
+  * packages from $addpackages are also installed to the system if
+    they exist in $FAI/files/packages/
+  * minor changes in package_config files
+  * move task_confdir() to subroutines-linux
+  * added create_resolv_conf(); code removed from task_confdir
+  * jobsrunning() subroutine for linux and solaris added
+  * faireboot: source fai.conf and subroutines-$OS_TYPE
+  * subroutines-linux: additional way to determine all ethernet devices
+  * move some packages from $NFSROOT_PACKAGES into make-fai-nfsroot
+  * add more .ssh/ files to nfsroot
+  * $FAI_SUBDIR renamed to $FAI_SHAREDIR
+  * rcS_fai: add $osname
+  * write some variabel definitions to $rcsfaivar (used for remote logins)
+    
+ -- Thomas Lange <lange at debian.org>  Tue, 16 Apr 2002 13:30:04 +0200
+
+fai (2.3) unstable; urgency=low
+
+  * default configurations are for Debian 3.0
+  * add auto stanza to /etc/network/interfaces (closes: #114627)
+  * now depends on debootstrap (closes: #128457)
+  * set DEBIAN_FRONTEND to "noninteractive" (closes: #131855)
+  * Fai.pm now copied to new location if woody in use (closes: #125839)
+  * package upgrade does not remove nfsroot (closes: #123463)
+  * many files: use $FAI instead of fixes /fai, config file moved to
+    from /etc/fai.conf to /etc/fai/fai.conf
+  * store log files to $LOGDIR (default to /tmp/fai), can be set in fai.conf
+  * read also subroutines-$OS_TYPE file
+  * fai.conf: moved to /etc/fai/fai.conf
+    variables removed: FAI_ARCH, UTC (now in class/*.var), KERNELVERSION
+    variables added: FAI, FAI_DEBOOTSTRAP_OPTS
+  * make-fai-nfsroot sets up pxelinux environment
+    automaticly determine kernel version; added get_kernel_version(),
+    copies /etc/fai/.cvspass to nfsroot, can now write the floppy image to
+    a file
+    added call_with_stamp subroutine, for easy creation of stamps
+    Tue Jan 29 20:19:27 CST 2002 -- Chad Walstrom <chad at debian.org>
+    Added support to run script as a recovery operation.  This is a
+    glue-script; we may as well provide the ability to fix problems and
+    continue.  Changes include:
+       - Adding a RUNDIR environment variable
+       - A command line option "-r" for recover operations
+       - logic tests and stampfiles to appropriate function calls
+    Checked for existance of character file dev/boot255 before calling mknod.
+    Checked for existance of $NFSROOT/proc/modules file before calling
+    umount $NFSROOT/proc
+    Recursively copies contents of /etc/fai/ directory (good if using CVS)
+    Install $NFSROOT_PACKAGES in a second pass, to sidestep conflicts
+    (e.g. so that ssh may replace rsh-client)
+    Don't set up $LOGUSER's home directory if that variable is undefined
+    add variable FAI_DEBOOTSTRAP_OPTS
+  * conf/fai_modules_off: more modules turned off
+  * call openvt with full shell path (closes: #134641)
+  * hooks are also skipped if task is skipped
+  * hooks that end in .source are sourced
+  * class/*.mod file can now define variables
+  * add ADAPTEC.mod file
+  * apt/conf: set Assume-Yes "true" so apt-get (and tasksel) is noninteractive
+  * lib/subroutines: /dev/ida/ and /dev/rd/ support in
+    subroutine:umount_local_disks, added $netdevices_up, use $tfsab
+    instead of fstab (for solaris support), /fai is now $FAI, mount shm
+    file system if available, otherwise use normal ramdisk, strip comment lines
+    when defining classes via scripts, added subroutine do_script,
+    do_scriptss calls every script class/<classname>/S[0-9]* when class is
+    not a file, execute all S[0-9]* scripts in a directory
+    /fai/scripts/$class/, skip all comment lines when definig classes
+    task_partition() call setup_harddisks only if no disk_var.sh exists
+    defclass also sources all scripts class/S*.source
+    add subroutines adddivert(), rmalldivert(); task_finish calls
+    rmalldivert, task_sysinfo calls kudzu; save_log*() -maxdepth not
+    needed for find, save_log*() now uses date and time for directory name;
+    /tmp/fai now $LOGDIR, can be set in fai.conf; new cvs co code
+  * templates/scripts: change NET and NETWORK examples; now called S10,
+    S40 and located in directory /fai/scripts/NETWORK/
+    BASE and DEFAULT moved to DEFAULT/S20 and DEFAULT/S01
+  * setup_harddisk: raid support for /devc/rd, /dev/ida and cciss driver
+    for Compaqs Smart Array Controllers, called with -d
+  * doc/Makefile: detect if anything is really to do
+  * use gzip -dc instead of zcat
+  * make-fai-bootfloppy: do not copy /boot/System.map to floppy, new
+    option -s
+  * added prtnetgr; change netgroup example and script all_hosts to use it
+  * fcopy: added debug message if executing postinst, ignore CVS
+    directories, use File::Find, now sets envionment variables $target and
+    $FAI_ROOT, bug fix in -d option, new options -L and -P
+  * KERNELVERSION not needed in fai.conf, now automaticly determined in
+    make-fai-* scripts
+  * FAI_FILES removed
+  * Files added: THANKS, preinst, prtnetgr, pxelinux.cfg
+  * Manual pages added fai-setup, install_packages, make-fai-bootfloppy,
+    make-fai-nfroot
+  * add use stict pragma for perl scripts
+  * add auto.master and auto.scratch config for kernel automounter
+  * mkdebmirror: use passive ftp mode
+  * added autofs to package_CONFIG/BEOWULF
+  * debian/prerm: do nothing when upgrading package
+  * scripts/fai-setup: determine loguserhome earlier (closes: #136851)
+  * new standards version 3.5.6
+  
+ -- Thomas Lange <lange at debian.org>  Tue,  9 Apr 2002 18:29:15 +0200
+
+fai (2.2.3) unstable; urgency=low
+
+  * added ATOMCLIENT in disk_config
+  * setup_harddisks detects harddisk even if no valid partition table is
+    available
+  * added dosfstools to nfsroot
+  * added .rhosts for ATOMCLIENTS
+  * added detect, discover and lsdev to sysinfo
+  * make-fai-nfsroot: now ash compatible (closes: #117431)
+    clean apt cache before creating base.tgz, make
+    liloconf silent, verbose output can be redirected to a file
+    call mknbi only for kernels using BOOTP, added sysutils package
+  * scripts/DEFAULT: chmod 1777 the defined scratch partition
+  * wake on LAN section added to fai guide
+  * reiserfs patch added to setup_harddisks
+  * nfs-user-server support for woody
+  * DEFAULT: scratch directories are writeable for all users
+  * utils moved from doc directory to /usr/share/fai
+  * install_packages: check all package names, remove unknown packages
+    from install list; PRELOAD support for url of type file:
+  * dpkg-divert is quiet unles verbose is set
+  * make diversion for broken liloconfig (closes: #113906)
+  * added class NOGETTY
+  * install_packages: add code for command PACKAGES hold
+  
+ -- Thomas Lange <lange at debian.org>  Thu,  8 Nov 2001 17:01:02 +0100
+
+fai (2.2.2) unstable; urgency=low
+
+  * bug fix in get_dhcp_info()
+  * added jmon to BEOWULF
+  
+ -- Thomas Lange <lange at debian.org>  Wed, 10 Oct 2001 10:52:35 +0200
+
+fai (2.2.1) unstable; urgency=low
+
+  * bugs in mkdebmirror fixed
+  * replace compat from nsswitch.conf templates (closes: #113902)
+  * FAI_FLAGS can contain comma or space separatedd list of flags
+  * echo device before BOOTP request
+  * all_hosts uses netgroup allhosts
+  
+ -- Thomas Lange <lange at debian.org>  Fri,  5 Oct 2001 17:19:14 +0200
+
+fai (2.2) unstable; urgency=low
+
+  * fix lilo bug in make-fai-bootfloppy
+  * user can define their own action using FAI_ACTION and
+    creating a command /fai/hooks/$FAI_ACTION
+  * rcS_fai rearranged; move a lot of subroutines into subroutines
+  * hooks can force rcS_fai to skip the default task
+  * timeout for bootpc can be set in rcS_fai
+  * new subroutine ether_info sets variable $ethers
+  * unused subroutine myyes removed
+  * prepare-apt.log renamed to updatebase.log
+  * task_sysinfo only probes available disks
+  * install_packages: support for new task packages using tasksel
+  * get_bootp_info() and get_dhcp_info() uses multiple network interfaces
+    via variable $netdevices
+  * layout of local Debian mirror for non-US changed
+  * mkdebmirror: non-US has new location, minor bugs removed
+  * rmdivert moves distrib.dpkg-new files
+  * new chapter about installing a Beowulf cluster
+  * bug in list_disks() fixed
+  * diskless class is automaticly defined, improved diskless hook
+  * package nfs-common added to nfsroot for lockd, statd
+  * support for additional variable definitions and classes
+  * new utilities: all_hosts, rshall and softupdate
+  * new examples for Beowulf cluster: atoms, ATOMCLIENT, BEOWULF
+  * defvar and devclass are now called before task_action
+  * bug fix: fcopy down not convert from octal when using file-modes
+  * all file in /files/root/ use file-modes
+  * tlink can show symlink of a host or all file in /boot/fai
+  * new class NOSECURETTY, NOTCPD
+  
+ -- Thomas Lange <lange at debian.org>  Fri, 14 Sep 2001 14:35:49 +0200
+
+fai (2.1) unstable; urgency=low
+
+  * user visible changes are now reported in NEWS file
+  * setup_harddisk: do not check if root partition is in first 8GB, do not
+    check if it's a primary partition
+  * make-fai-nfsroot: uses debbootstrap if FAI_DEBOOTSTRAP is
+    defined (closes: #100914)
+    use /etc/apt/sources.list is FAI_SOURCES_LIST is undefined
+  * call some commands with prefix LC_ALL=C, so diffrent locale does
+    not change the output
+  * ftar: do not call tar with option I, j or z, use pipe instead
+  * rcS_fai: added hook support, use all ntpserver for ntpdate, always
+    extract base.tgz, no version number in base.tgz; read_config() removed;
+    move some task from fai_init to fai_setup to get their output;
+    create etc/hosts with fqdn in target directory; $revclasses contains
+    classes in reversed order
+  * new flag createtv; controls if ctrl-c will reboot or give a shell and
+    if two additional terminals will be available
+  * debhelper compatability level now 2
+  * woody support: using debootstrap, different package lists
+  * added class DISKLESS
+  * subroutine disk_info rewritten, ignores cdrom
+  * fai-setup: do not generate ssh key if already existing
+  * cat <<EOF calls corrected
+  * mkdebmirror now mirrors also testing and unstable by default
+  * grub support in scripts/BOOT and scripts/FAI_BOOTPART
+  * new utility chkdebnames check debian package names
+  * new script device2grub convert normal device names to grub device names
+    
+ -- Thomas Lange <lange at debian.org>  Fri, 20 Jul 2001 11:55:29 +0200
+
+fai (2.0.2) unstable; urgency=low
+
+  * typo in ftp Debian mirror fixed
+  * corrected wrong cvs tag, some more little changes
+
+ -- Thomas Lange <lange at debian.org>  Thu, 28 Jun 2001 14:11:23 +0200
+
+fai (2.0.1) unstable; urgency=low
+
+  * Default Debian mirror access now via ftp. This can take much time to
+    download the required packages. (closes: #101596)
+  * Check if LOGUSER is defined, (closes: #101620)
+  * wget now recommends, (closes: #101594)
+  * Use ntpdate if a ntp server is defined (tag nt in bootptab),
+    (closes: #101899) 
+  * DEFAULT script writes fqdn and short hostname into etc/hosts,
+    (closes: #101820)
+  * Bug fix. Check if imggen executable is available.
+  
+ -- Thomas Lange <lange at debian.org>  Thu, 28 Jun 2001 13:33:33 +0200
+
+fai (2.0) unstable; urgency=low
+
+  * first upload to Debian archive
+  * kernel-2.2.19 support
+  * order of classes now (with increasing priority):
+    DEFAULT, <other classes>, $HOSTNAME, LAST
+  * architecture is now also a class (see S01alias.sh)
+  * class/*.source renamed to class/*.var, because they define variables
+  * new description of all classes
+  * $moduleslist is the list of modules that will be loaded by the new system
+  * names of examples changed to make them more comprehensible
+  * FAI_PACKAGEDIR now FAI_DEBMIRROR
+  * new fcopy script for copying files with classes
+  * new ftar script for extracting tar files with classes
+  * manual pages for fcopy, ftar
+  * converted many cfengine scripts to shell scripts
+  * several classes and scripts removed and rearranged
+  * S90partitions.pl replaces the old shell version
+  * add FAI_BOOTPART class and scripts
+  * klogd, syslogd running during installation
+  * make-fai-bootfloppy can take additional parameters for the kernel and
+    supports multiple network interface cards
+  * kernel append parameters define variables in rcS_fai
+  * added subroutines ifclass, rwmount
+  * new command bootsector can enable, disable or list magic number of
+    boot sector
+  * make many variables local
+  * better debugging of shell scripts
+  * remote login has all subroutines available
+  * faireboot -s saves log files to install server
+  * sfdisk call removed from subroutines and Fai.pm, since it's not
+    portable; unfortunately setup_hardisk still using it
+  * new mount2dir command; this task is removed from setup_hardisk
+  * files in package_config can use dpkg --get-selections format
+  * redundant packages in package_config/COMPILE removed
+  * PRELOADRM feature for package_config
+  * comments in files in package_config/ are now everything after a #, not
+    only at the beginning of a line
+  * lvm not in nfsroot by default, grub now included
+  * access from install clients to server can be done via rsh/rcp or
+    ssh/scp (see fai.conf)
+  * modprobe displays less errors
+  * templates now stored in /usr/share/fai
+  * all release timestamp in this changelog until version 1.4.2 are
+    wrong; they indicate the time when I started hacking the next version;
+    these are the correct release dates: 
+    Jun 20  2000 fai_1.1beta2.tar.gz
+    Jul 11  2000 fai_1.2.0beta1.tar.gz
+    Oct 26  2000 fai_1.3.0test1.tar.gz
+    Nov  6  2000 fai_1.3.0test2.tar.gz
+    Nov 23  2000 fai_1.4.0.tar.gz
+    Dec  7  2000 fai_1.4.1.tar.gz
+    Dec 12  2000 fai_1.4.2.tar.gz
+
+ -- Thomas Lange <lange at debian.org>  Tue, 15 May 2001 14:28:31 +0200
+
+fai (1.4.2) unstable; urgency=low
+
+  * add wget to suggests list
+  * xviddetect called for FAI_ACTION=sysinfo
+  * fai.conf: added missing / in ftp definition of FAI_SOURCES_LIST
+  * added parted to nfsroot and package_config/MINI_SOFT
+  * FAI_KEYMAP files can also be located in /fai/files
+  * added subroutine load_keymap_consolechar (was included in rcS_fai)
+    keymap now called correctly
+  * the little FAI banner is now printed on startup
+  * variable hdparm tunes your hard disks and creates rcS.d script
+  
+ -- Thomas Lange <lange at debian.org>  Mon, 11 Dec 2000 16:36:31 +0100
+
+fai (1.4.1) unstable; urgency=low
+
+  * swap order of class ALL and hostname
+  * CLASS ALL renamed to DEFAULT
+  * templates/class/S*.source files renamed
+  * scripts in class/ reorganized. First *.{sh,pl) are executed, then
+    $class.source are sourced for all defined classes
+  * install kernels removed, now included in package fai-kernels
+  * hdparm available in nfsroot, sysinfo prints hparm -i
+  * classs/ATA33.source can tune harddisk during installation
+  * class DEBIAN_DEVEL commented out, because this software package list
+    mostly segfaults dpkg
+  * base?_?.tgz now included in nfsroot; BASETGZ not needed any more
+  * bug fixed: setup_harddisks don't mount preserved partitions if mount
+    point is not in root directory
+  * bug fixed: no dns support during chroot in make-fai-nfsroot
+    
+ -- Thomas Lange <lange at debian.org>  Wed, 29 Nov 2000 11:34:41 +0100
+
+fai (1.4.0) unstable; urgency=low
+
+  * faireboot is faster and more reliable
+  * package depends on nfs-server
+  * keymap created by shell script ALL (uses $FAI_KEYMAP)
+  * mk3comimage removed (uses non free software), now netboot is used
+  * first version of the FAI Guide included
+  * use dpkg-divert to fake some programs (solves many problems)
+  * yes pipes <CR> to apt-get during installation
+  * all definitions from global.conf are moved to fai.conf
+  * make-fai-nfs now uses chroot when calling apt-get
+    so nfsroot must not use the same Debian distribution as the server
+  * $MNTPOINT is mount point for Debian mirror
+  * postinst tasks are moved to fai-setup script
+  * $UTC, $FAI_CONFIGDIR added to fai.conf
+  * bug fixed: loopback device was not set up
+  
+ -- Thomas Lange <lange at debian.org>  Mon,  6 Nov 2000 12:20:00 +0100
+
+fai (1.3.0test2) unstable; urgency=low
+
+  * loopback device is set up during installation
+  * create resolv.conf via script RESOLV instead of using cfengine
+  * printers are defined in class/ not in cfengine script
+  * mount nfs directories using rsize=8192
+  * bug fixed: make-fai-nfsroot removes /boot/*-$KERNELVERSION
+
+ -- Thomas Lange <lange at informatik.uni-koeln.de>  Fri,  3 Nov 2000 10:26:03 +0100
+
+fai (1.3.0test1) unstable; urgency=low
+
+  * kernel in nfsroot is now build with kernel-package (make-kpkg)
+  * installkernel now supports loadable modules
+  * class/S05modules.sh can load modules (example global.mod)
+  * add script make-fai-bootfloppy
+  * client's timezone during installation is now the same as on server
+  * FAI_ACTION sysinfo now mounts all local disk and searches for fstab
+  * add support for expect scripts
+  * add nfs-kernel-server support
+  * do not create account fai if it already exists (e.g when using NIS)
+  * new format for keymap and consolefont definition
+  
+ -- Thomas Lange <lange at informatik.uni-koeln.de>  Mon,  9 Oct 2000 18:08:02 +0200
+
+fai (1.2.0beta1) unstable; urgency=low
+
+  * two virtual terminals available (press alt-F2 or alt-F3)
+
+  * make-fai-nfsroot removes pcmcia-cs
+    installs additionals packages: lvm raidtool2 ext2resize sshd dhcp-lient
+    flag verbose controls output level
+    nfsroot is created without any interaction
+    base2_2.tgz is fetched via wget if it's not found in /tmp
+
+  * new start-stop-daemon script instead of symlink to fake it
+  
+  * configuration for kernel 2.2.17
+  
+  * start sshd during installation for remote access;
+    add "sshd" to FAI_FLAGS to enable this
+    remote reboot possible via: ssh -l root hostname faireboot
+  
+  * additional dhcp support available (bootp is still the default)
+    
+  * cvs repository available
+    
+ -- Thomas Lange <lange at informatik.uni-koeln.de>  Fri, 30 Jun 2000 13:41:13 +0200
+
+fai (1.1beta2) unstable; urgency=low
+
+  * PRELOAD feature, faireboot added
+
+ -- Thomas Lange <lange at informatik.uni-koeln.de>  Tue, 20 Jun 2000 16:29:14 +0200
+
+fai (1.1beta1) unstable; urgency=low
+
+  * Initial Release.
+
+ -- Thomas Lange <lange at informatik.uni-koeln.de>  Wed,  7 Jun 2000 11:16:23 +0200

Added: branches/lhm/debian/compat
===================================================================
--- branches/lhm/debian/compat	                        (rev 0)
+++ branches/lhm/debian/compat	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1 @@
+4

Added: branches/lhm/debian/control
===================================================================
--- branches/lhm/debian/control	                        (rev 0)
+++ branches/lhm/debian/control	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,95 @@
+Source: fai
+Section: lhm/admin
+Priority: extra
+Maintainer: Thomas Lange <lange at debian.org>
+Standards-Version: 3.8.0
+Build-Depends-Indep: debiandoc-sgml, tetex-bin, tetex-extra, gs
+Build-Depends: debhelper (>= 4.1.16)
+Vcs-Svn: svn://svn.debian.org/svn/fai/trunk
+Vcs-Browser: http://svn.debian.org/wsvn/fai
+Homepage: http://www.informatik.uni-koeln.de/fai
+
+Package: fai-client
+Architecture: all
+Section: lhm/admin
+Depends: perl, file, libapt-pkg-perl, libparse-recdescent-perl
+Recommends: debconf-utils, cfengine2
+Suggests: ntfsprogs, dmsetup, cryptsetup
+Conflicts: fai, fai-kernels
+Replaces: fai
+Homepage: http://www.informatik.uni-koeln.de/fai
+Description: Fully Automatic Installation client package
+ FAI is a non-interactive system to install, customize and manage
+ Linux systems and software configurations on computers as well as
+ virtual machines and chroot environments, from small networks to
+ large infrastructures and clusters.
+ .
+ This is the client package for FAI. It contains the parts necessary
+ to run the softupdate functionality on already installed systems, and
+ is needed for the dirinstall functionality and others on a FAI server.
+
+Package: fai-doc
+Architecture: all
+Section: lhm/doc
+Conflicts: fai
+Homepage: http://www.informatik.uni-koeln.de/fai
+Description: Documentation for FAI
+ FAI is a non-interactive system to install, customize and manage
+ Linux systems and software configurations on computers as well as
+ virtual machines and chroot environments, from small networks to
+ large infrastructures and clusters.
+ .
+ This is the documentation for FAI in various formats.
+
+Package: fai-server
+Architecture: all
+Section: lhm/admin
+Depends: fai-client, debootstrap
+Recommends: nfs-kernel-server, dhcp3-server | bootp, tftpd-hpa | tftpd, openssh-server, openssh-client, syslinux-common, openbsd-inetd | inet-superserver
+Suggests: debmirror, apt-move, genisoimage, grub, aptitude, perl-tk, libproc-daemon-perl
+Conflicts: fai
+Replaces: fai
+Homepage: http://www.informatik.uni-koeln.de/fai
+Description: Fully Automatic Installation server package
+ FAI is a non-interactive system to install, customize and manage
+ Linux systems and software configurations on computers as well as
+ virtual machines and chroot environments, from small networks to
+ large infrastructures and clusters.
+ .
+ It's a tool for mass unattended Linux installation. You can take one
+ or more virgin systems, turn on the power, and after a few minutes,
+ the systems are installed, and completely configured to your exact
+ needs, without any interaction necessary.
+ .
+ This package is needed for setting up a FAI install server for network
+ installations, for running the dirinstall in a chroot environment, and
+ to build installation CD/DVD's and USB sticks.
+
+Package: fai-quickstart
+Architecture: all
+Section: lhm/admin
+Depends: fai-server, fai-doc, dhcp3-server, nfs-kernel-server, syslinux-common, tftpd-hpa, apt-move, genisoimage, openbsd-inetd | inet-superserver
+Homepage: http://www.informatik.uni-koeln.de/fai
+Description: Fully Automatic Installation quickstart package
+ FAI is a non-interactive system to install, customize and manage
+ Linux systems and software configurations on computers as well as
+ virtual machines and chroot environments, from small networks to
+ large infrastructures and clusters.
+ This package setups an install server with some basic
+ examples. It should be removed when creating your own config space. 
+
+Package: fai-nfsroot
+Architecture: all
+Section: lhm/admin
+Depends: fai-client, initramfs-tools
+Recommends: live-initramfs
+Conflicts: fai, fai-kernels
+Homepage: http://www.informatik.uni-koeln.de/fai
+Description: Fully Automatic Installation nfsroot package
+ FAI is a non-interactive system to install, customize and manage
+ Linux systems and software configurations on computers as well as
+ virtual machines and chroot environments, from small networks to
+ large infrastructures and clusters.
+ .
+ This package contains the software that is only needed in
+ the FAI nfsroot. Do not install this package on a normal machine.

Added: branches/lhm/debian/copyright
===================================================================
--- branches/lhm/debian/copyright	                        (rev 0)
+++ branches/lhm/debian/copyright	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,33 @@
+This is the Debian GNU/Linux package fai
+	Fully Automatic Installation
+written by Thomas Lange <lange at informatik.uni-koeln.de>
+
+Copyright (C) 1999-2008  Thomas Lange
+
+Major contributions Copyright by:
+	Mattias Gaertner	gaertner at informatik.uni-koeln.de
+	Henning Glawe		glaweh at physik.fu-berlin.de
+	Christian Kern		kernch at in.tum.de
+	Michael Tautschnig	mt at debian.org
+
+
+The newest sources can be retrieved via this command
+  svn co svn://svn.debian.org/svn/fai/trunk fai
+or viewed at
+  http://svn.debian.org/wsvn/fai
+
+  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 with
+  the Debian GNU/Linux distribution in file /usr/share/common-licenses/GPL;
+  if not, write to the Free Software Foundation, Inc., 51 Franklin St,
+  Fifth Floor, Boston, MA 02110-1301 USA or look on the World Wide Web
+  at http://www.gnu.org/copyleft/gpl.html.

Added: branches/lhm/debian/docs
===================================================================
--- branches/lhm/debian/docs	                        (rev 0)
+++ branches/lhm/debian/docs	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,4 @@
+README
+THANKS
+doc/FAQ
+doc/QUESTIONNAIRE

Added: branches/lhm/debian/fai-client.dirs
===================================================================
--- branches/lhm/debian/fai-client.dirs	                        (rev 0)
+++ branches/lhm/debian/fai-client.dirs	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,3 @@
+var/run/fai
+usr/lib/fai
+usr/share/doc/fai-client

Added: branches/lhm/debian/fai-client.install
===================================================================
--- branches/lhm/debian/fai-client.install	                        (rev 0)
+++ branches/lhm/debian/fai-client.install	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,26 @@
+etc/fai/fai.conf
+usr/lib/fai/check_status
+usr/lib/fai/fai-savelog
+usr/lib/fai/fai-savelog-ftp
+usr/lib/fai/get-boot-info
+usr/lib/fai/disk-info
+usr/lib/fai/list_disks
+usr/lib/fai/subroutines
+usr/lib/fai/subroutines-linux
+usr/lib/fai/updatebase
+usr/lib/fai/prcopyleft
+usr/lib/fai/get-config-dir*
+usr/lib/fai/fai-divert
+usr/bin/device2grub
+usr/bin/fai-class
+usr/bin/fai-debconf
+usr/bin/fai-do-scripts
+usr/bin/ainsl
+usr/sbin/fai
+usr/sbin/fcopy
+usr/sbin/ftar
+usr/sbin/install_packages
+usr/sbin/setup_harddisks
+usr/sbin/setup-storage
+usr/sbin/fai-statoverride
+usr/share/fai/setup-storage

Added: branches/lhm/debian/fai-client.manpages
===================================================================
--- branches/lhm/debian/fai-client.manpages	                        (rev 0)
+++ branches/lhm/debian/fai-client.manpages	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,10 @@
+debian/tmp/man/fai.8
+debian/tmp/man/fcopy.8
+debian/tmp/man/ftar.8
+debian/tmp/man/install_packages.8
+debian/tmp/man/fai-class.1
+debian/tmp/man/fai-debconf.1
+debian/tmp/man/fai-do-scripts.1
+debian/tmp/man/ainsl.1
+debian/tmp/man/setup-storage.8
+debian/tmp/man/fai-statoverride.8

Added: branches/lhm/debian/fai-client.postrm
===================================================================
--- branches/lhm/debian/fai-client.postrm	                        (rev 0)
+++ branches/lhm/debian/fai-client.postrm	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,13 @@
+#! /bin/sh
+
+set -e
+
+case "$1" in
+    purge)
+	rm -rf /var/run/fai
+        ;;
+esac
+
+#DEBHELPER#
+
+exit 0

Added: branches/lhm/debian/fai-doc.dirs
===================================================================
--- branches/lhm/debian/fai-doc.dirs	                        (rev 0)
+++ branches/lhm/debian/fai-doc.dirs	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1 @@
+usr/share/doc/fai-doc/examples/utils

Added: branches/lhm/debian/fai-doc.doc-base.package
===================================================================
--- branches/lhm/debian/fai-doc.doc-base.package	                        (rev 0)
+++ branches/lhm/debian/fai-doc.doc-base.package	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,19 @@
+Document: fai-doc
+Title: Debian Fully Automatic Installation Guide
+Author: Thomas Lange
+Abstract: FAI is a system for the fully automatic installation of
+ Debian GNU/Linux. 
+Section: Debian
+
+Format: debiandoc-sgml
+Files: /usr/share/doc/fai-doc/fai-guide.sgml.gz
+
+Format: postscript
+Files: /usr/share/doc/fai-doc/fai-guide.ps.gz
+
+Format: text
+Files: /usr/share/doc/fai-doc/fai-guide.txt.gz
+
+Format: HTML
+Index: /usr/share/doc/fai-doc/fai-guide.html/index.html
+Files: /usr/share/doc/fai-doc/fai-guide.html/*.html

Added: branches/lhm/debian/fai-nfsroot.dirs
===================================================================
--- branches/lhm/debian/fai-nfsroot.dirs	                        (rev 0)
+++ branches/lhm/debian/fai-nfsroot.dirs	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,5 @@
+etc/fai
+etc/dhcp3
+etc/init.d
+etc/apt/apt.conf.d
+usr/lib/fai

Added: branches/lhm/debian/fai-nfsroot.install
===================================================================
--- branches/lhm/debian/fai-nfsroot.install	                        (rev 0)
+++ branches/lhm/debian/fai-nfsroot.install	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,14 @@
+usr/sbin/faireboot
+usr/sbin/faishutdown
+usr/bin/policy-rc.d.fai
+usr/lib/fai/dhclient-perl
+usr/lib/fai/create_resolv_conf
+usr/lib/fai/load_keymap_consolechars
+usr/lib/fai/fai-mount-disk
+usr/lib/fai/mount2dir
+usr/lib/fai/task_sysinfo
+etc/dhcp3/dhclient-fai-script
+etc/dhcp3/dhclient-fai.conf
+etc/apt/apt.conf.d/90fai
+etc/init.d/fai-abort
+etc/modutils/fai_modules_off

Added: branches/lhm/debian/fai-nfsroot.postinst
===================================================================
--- branches/lhm/debian/fai-nfsroot.postinst	                        (rev 0)
+++ branches/lhm/debian/fai-nfsroot.postinst	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,12 @@
+#!/bin/sh -e
+
+case "$1" in
+    configure)
+	update-alternatives --install /usr/sbin/policy-rc.d policy-rc.d \
+	    /usr/bin/policy-rc.d.fai 100
+    update-rc.d fai-abort start 01 2 . >/dev/null
+esac
+
+#DEBHELPER#
+
+exit 0


Property changes on: branches/lhm/debian/fai-nfsroot.postinst
___________________________________________________________________
Added: svn:executable
   + 

Added: branches/lhm/debian/fai-nfsroot.postrm
===================================================================
--- branches/lhm/debian/fai-nfsroot.postrm	                        (rev 0)
+++ branches/lhm/debian/fai-nfsroot.postrm	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,16 @@
+#!/bin/sh -e
+
+case "$1" in
+    remove)
+	rm /etc/init.d/rcS
+	dpkg-divert --package fai-nfsroot --remove --rename /etc/init.d/rcS
+	;;
+
+    purge)
+	update-rc.d fai-abort remove > /dev/null
+	;;
+esac
+
+#DEBHELPER#
+
+exit 0


Property changes on: branches/lhm/debian/fai-nfsroot.postrm
___________________________________________________________________
Added: svn:executable
   + 

Added: branches/lhm/debian/fai-nfsroot.preinst
===================================================================
--- branches/lhm/debian/fai-nfsroot.preinst	                        (rev 0)
+++ branches/lhm/debian/fai-nfsroot.preinst	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,12 @@
+#!/bin/sh -e
+
+if [ ! -f /.THIS_IS_THE_FAI_NFSROOT ]; then
+    echo "ERROR: The package fai-nfsroot can only be installed inside the nfsroot."
+    exit 1
+fi
+
+dpkg-divert --package fai-nfsroot --add --rename /etc/init.d/rcS
+
+#DEBHELPER#
+
+exit 0


Property changes on: branches/lhm/debian/fai-nfsroot.preinst
___________________________________________________________________
Added: svn:executable
   + 

Added: branches/lhm/debian/fai-nfsroot.prerm
===================================================================
--- branches/lhm/debian/fai-nfsroot.prerm	                        (rev 0)
+++ branches/lhm/debian/fai-nfsroot.prerm	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,11 @@
+#!/bin/sh -e
+
+case "$1" in
+    remove|deconfigure|failed-upgrade)
+	update-alternatives --remove policy-rc.d /usr/bin/policy-rc.d.fai
+        ;;
+esac
+
+#DEBHELPER#
+
+exit 0


Property changes on: branches/lhm/debian/fai-nfsroot.prerm
___________________________________________________________________
Added: svn:executable
   + 

Added: branches/lhm/debian/fai-quickstart.dirs
===================================================================
--- branches/lhm/debian/fai-quickstart.dirs	                        (rev 0)
+++ branches/lhm/debian/fai-quickstart.dirs	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1 @@
+usr/share/lintian/overrides

Added: branches/lhm/debian/fai-quickstart.links
===================================================================
--- branches/lhm/debian/fai-quickstart.links	                        (rev 0)
+++ branches/lhm/debian/fai-quickstart.links	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1 @@
+usr/share/doc/fai-client usr/share/doc/fai-quickstart

Added: branches/lhm/debian/fai-quickstart.lintian
===================================================================
--- branches/lhm/debian/fai-quickstart.lintian	                        (rev 0)
+++ branches/lhm/debian/fai-quickstart.lintian	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,3 @@
+# lintian can't check dependency the right way. fai-quickstart depends
+# on fai-server which depends on fai-client
+fai-quickstart binary: usr-share-doc-symlink-without-dependency fai-client

Added: branches/lhm/debian/fai-quickstart.postinst
===================================================================
--- branches/lhm/debian/fai-quickstart.postinst	                        (rev 0)
+++ branches/lhm/debian/fai-quickstart.postinst	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,40 @@
+#! /bin/sh
+
+set -e
+
+# summary of how this script can be called:
+#        * <postinst> `configure' <most-recently-configured-version>
+#        * <old-postinst> `abort-upgrade' <new version>
+#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+#          <new-version>
+#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+#          <failed-install-package> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+#
+
+case "$1" in
+    configure)
+	. /etc/fai/fai.conf
+	if [ ! -d $FAI_CONFIGDIR/class ]; then
+	    mkdir -p $FAI_CONFIGDIR
+	    cp -a /usr/share/doc/fai-doc/examples/simple/* $FAI_CONFIGDIR
+	    echo "Simple examples copied to config space $FAI_CONFIGDIR."
+	fi
+    ;;
+
+    abort-upgrade|abort-remove|abort-deconfigure)
+
+    ;;
+
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+
+#DEBHELPER#
+
+exit 0

Added: branches/lhm/debian/fai-quickstart.prerm
===================================================================
--- branches/lhm/debian/fai-quickstart.prerm	                        (rev 0)
+++ branches/lhm/debian/fai-quickstart.prerm	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,31 @@
+#! /bin/sh
+
+set -e
+
+case "$1" in
+    purge)
+        . /etc/fai/fai.conf
+	if [ -z "$FAI_CONFIGDIR" ]; then
+	    echo "\$FAI_CONFIGDIR is not defined. Can't remove it."
+	else
+	    echo -n "Shall I do rm -rf $FAI_CONFIGDIR? " ; read answer
+	    case $answer in
+		y*|Y*)
+		    rm -rf $FAI_CONFIGDIR ;;
+		*)
+		    echo "$FAI_CONFIGDIR left untouched." ;;
+	    esac
+	fi
+        ;;
+
+    remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) ;;
+
+    *)
+        echo "postrm called with unknown argument \`$1'" >&2
+        exit 1
+
+esac
+
+#DEBHELPER#
+
+exit 0

Added: branches/lhm/debian/fai-server.dirs
===================================================================
--- branches/lhm/debian/fai-server.dirs	                        (rev 0)
+++ branches/lhm/debian/fai-server.dirs	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,6 @@
+var/run/fai/make-fai-nfsroot
+var/log/fai
+etc/fai/apt
+usr/bin
+usr/sbin
+usr/share/fai/pixmaps

Added: branches/lhm/debian/fai-server.install
===================================================================
--- branches/lhm/debian/fai-server.install	                        (rev 0)
+++ branches/lhm/debian/fai-server.install	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,13 @@
+sbin/fai-start-stop-daemon
+usr/bin/faimond-gui
+usr/sbin/fai-cd
+usr/sbin/fai-chboot
+usr/sbin/fai-setup
+usr/sbin/faimond
+usr/sbin/make-fai-nfsroot
+usr/bin/fai-mirror
+usr/share/fai/pixmaps/*
+etc/fai/menu.lst
+etc/fai/NFSROOT
+etc/fai/apt/sources.list
+etc/fai/make-fai-nfsroot.conf

Added: branches/lhm/debian/fai-server.links
===================================================================
--- branches/lhm/debian/fai-server.links	                        (rev 0)
+++ branches/lhm/debian/fai-server.links	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1 @@
+usr/share/doc/fai-client usr/share/doc/fai-server 

Added: branches/lhm/debian/fai-server.manpages
===================================================================
--- branches/lhm/debian/fai-server.manpages	                        (rev 0)
+++ branches/lhm/debian/fai-server.manpages	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,7 @@
+debian/tmp/man/fai-cd.8
+debian/tmp/man/fai-chboot.8
+debian/tmp/man/fai-mirror.1
+debian/tmp/man/fai-setup.8
+debian/tmp/man/faimond.8
+debian/tmp/man/faimond-gui.1
+debian/tmp/man/make-fai-nfsroot.8

Added: branches/lhm/debian/fai-server.postinst
===================================================================
--- branches/lhm/debian/fai-server.postinst	                        (rev 0)
+++ branches/lhm/debian/fai-server.postinst	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,56 @@
+#! /bin/sh
+
+# $Id $
+#*********************************************************************
+# postinst -- setup fai
+#
+# This script is part of FAI (Fully Automatic Installation)
+# Copyright (c) 2000-2006 by Thomas Lange, Universitaet zu Koeln
+#*********************************************************************
+#
+# see: dh_installdeb(1)
+
+set -e
+
+
+# summary of how this script can be called:
+#        * <postinst> `configure' <most-recently-configured-version>
+#        * <old-postinst> `abort-upgrade' <new version>
+#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+#          <new-version>
+#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+#          <failed-install-package> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see /usr/share/doc/packaging-manual/
+#
+# quoting from the policy:
+#     Any necessary prompting should almost always be confined to the
+#     post-installation script, and should be protected with a conditional
+#     so that unnecessary prompting doesn't happen if a package's
+#     installation fails and the `postinst' is called with `abort-upgrade',
+#     `abort-remove' or `abort-deconfigure'.
+
+case "$1" in
+    configure)
+
+        echo "You might want to edit fai.conf and make-fai-nfsroot.conf in /etc/fai or"
+	echo "go with the defaults. You should edit /etc/fai/apt/sources.list"
+	echo "for faster access to a package repository."
+        ;;
+
+    abort-upgrade|abort-remove|abort-deconfigure)
+
+    ;;
+
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 0
+    ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0

Added: branches/lhm/debian/fai-server.postrm
===================================================================
--- branches/lhm/debian/fai-server.postrm	                        (rev 0)
+++ branches/lhm/debian/fai-server.postrm	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,32 @@
+#! /bin/sh
+
+# postrm script for fai
+
+
+set -e
+
+case "$1" in
+    purge)
+	rm -rf /var/run/fai/make-fai-nfsroot
+	echo "WARNING: removing NFSROOT $NFSROOT"
+	rm -rf $NFSROOT || true
+
+        ;;
+
+    remove)
+	;;
+
+    upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) ;;
+
+    *)
+        echo "postrm called with unknown argument \`$1'" >&2
+        exit 1
+
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0

Added: branches/lhm/debian/fai-server.preinst
===================================================================
--- branches/lhm/debian/fai-server.preinst	                        (rev 0)
+++ branches/lhm/debian/fai-server.preinst	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,36 @@
+#! /bin/sh
+# preinst script for fai-server
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <new-preinst> `install'
+#        * <new-preinst> `install' <old-version>
+#        * <new-preinst> `upgrade' <old-version>
+#        * <old-preinst> `abort-upgrade' <new-version>
+#
+# For details see /usr/share/doc/packaging-manual/
+
+case "$1" in
+    upgrade)   ;;
+
+    abort-upgrade)    ;;
+
+    install) ;;
+
+    *)
+        echo "preinst called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
+
+

Added: branches/lhm/debian/fai-server.prerm
===================================================================
--- branches/lhm/debian/fai-server.prerm	                        (rev 0)
+++ branches/lhm/debian/fai-server.prerm	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,65 @@
+#! /bin/sh
+
+# $Id: fai-server.prerm 3675 2006-07-24 15:12:07Z lange $
+#
+# prerm script for fai
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <prerm> `remove'
+#        * <old-prerm> `upgrade' <new-version>
+#        * <new-prerm> `failed-upgrade' <old-version>
+#        * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
+#        * <deconfigured's-prerm> `deconfigure' `in-favour'
+#          <package-being-installed> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see /usr/share/doc/packaging-manual/
+
+# nothing to do during upgrade
+case "$1" in
+    upgrade) exit 0 ;;
+esac
+
+. /etc/fai/fai.conf
+. /etc/fai/make-fai-nfsroot.conf
+
+test -f /etc/init.d/nfs-kernel-server && nfsserver=nfs-kernel-server
+test -f /etc/init.d/nfs-user-server && nfsserver=nfs-user-server
+
+case "$1" in
+    upgrade) exit 0 ;;
+
+    remove|deconfigure)
+
+	if [ -z "$NFSROOT" ]; then
+	    echo "\$NFSROOT is not set. Please check your settings in fai.conf."
+	    exit 4
+	fi
+
+	perl -ni.bak -e "print unless m#^$FAI_CONFIGDIR\s|^$NFSROOT\s#" /etc/exports
+	[ -n "$nfsserver" ] && /etc/init.d/$nfsserver reload || true
+
+	rmdir $FAI_CONFIGDIR || true
+
+	[ -f /home/$LOGUSER/.account_created_by_fai_package ] && userdel -r $LOGUSER
+
+        ;;
+    failed-upgrade)
+        ;;
+    *)
+        echo "prerm called with unknown argument \`$1'" >&2
+        exit 0
+    ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
+
+

Added: branches/lhm/debian/rules
===================================================================
--- branches/lhm/debian/rules	                        (rev 0)
+++ branches/lhm/debian/rules	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,71 @@
+#!/usr/bin/make -f
+
+DESTDIR=`pwd`/debian/tmp
+DOCDIR=`pwd`/debian/fai-doc/usr/share/doc/fai-doc
+
+# we never want CVS and subversion files in our packages
+export DH_ALWAYS_EXCLUDE=CVS:.svn
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+include VERSION
+
+build: build-stamp
+build-stamp:
+	dh_testdir
+
+# Add here commands to compile the package.
+	$(MAKE) all
+
+	touch build-stamp
+
+clean:
+	dh_testdir
+#	dh_testroot
+	rm -f build-stamp
+# Add here commands to clean up after the build process.
+	$(MAKE) clean
+	dh_clean
+
+install: build
+	dh_testdir
+	dh_testroot
+	dh_clean -k
+	dh_installdirs
+# Add here commands to install the package into debian/fai.
+	$(MAKE) install
+
+# Build architecture-independent files here.
+binary-indep: build install
+	dh_testdir
+	dh_testroot
+#	dh_installdebconf	
+	dh_installdocs -Nfai-server -Nfai-quickstart
+#	dh_installexamples
+#	dh_installmenu
+	dh_installman
+	dh_install --sourcedir=debian/tmp
+#	dh_installinfo
+	dh_link
+	dh_installchangelogs 
+	dh_compress -Xexamples -X.pdf
+	dh_fixperms -X make-fai-nfsroot.conf
+	chmod a+rx ${DOCDIR}/examples/*/class/[0-9][0-9]*
+	chmod -R a+rx ${DOCDIR}/examples/*/scripts/*
+	chmod a+rx ${DOCDIR}/examples/*/hooks/*
+	find ${DOCDIR}/examples/*/files -name postinst | xargs chmod a+x
+	chmod a+rx ${DOCDIR}/examples/utils/*
+	perl -pi -e 's/FAIVERSIONSTRING/$(VERSIONSTRING)/' $(shell pwd)/debian/fai-client/usr/share/doc/fai-client/README
+	cp `pwd`/debian/fai-quickstart.lintian $(shell pwd)/debian/fai-quickstart/usr/share/lintian/overrides/fai-quickstart
+# You may want to make some executables suid here.
+	dh_installdeb
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+# Build architecture-dependent files here.
+binary-arch: build install
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install


Property changes on: branches/lhm/debian/rules
___________________________________________________________________
Added: svn:executable
   + 

Added: branches/lhm/doc/FAQ
===================================================================
--- branches/lhm/doc/FAQ	                        (rev 0)
+++ branches/lhm/doc/FAQ	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,47 @@
+Sat, 11 Mar 2006 17:19:05 +0100
+
+This is a very short FAQ. Please get involved and feel free to send patches after
+your questions have been answered on the FAI mailing list!
+
+Q: I'm new to FAI. How should I start ?
+
+A: Read the FAI guide and this FAQ. Start with the simple examples
+   FAI_CONFIGDIR. Install the stable distribution on your first clients! (See
+   next question.)
+
+Q: I try to install testing or sid (unstable) and something goes wrong.
+
+A: testing and sid change every day. So it's possible that your problems are
+   solved today or tomorrow. You should try again. It's recommendable to use a
+   local mirror and freeze it when you found a working install. But we also
+   recommend to use stable and local backport repositories whenever possible.
+
+Q: Where do I find the FAI mailing list ?
+
+A: There is a section "Mailing list" on the FAI homepage at
+   http://www.informatik.Uni-Koeln.DE/fai/
+   Please use your favorite search engine to search for your questions before
+   posting to the list!
+   Also don't post complete logs. Most times it's sufficient to describe the
+   setup (which version of fai, which version of debian on the fai server and
+   which version to be installed with fai) and to post the part of the log(s)
+   where the error occurs. Or provide logfiles on a webserver and post a link.
+
+Q: Is there an online FAI FAQ ?
+
+A: No, but we have a FAI Wiki. http://faiwiki.informatik.uni-koeln.de/
+
+Q: I cannot login via ssh to my install client(s) anymore. It used to work but
+   stopped working suddenly.
+
+   Example:
+   > ssh root at demohost
+   @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+   @    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
+   @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+   IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
+
+A: After you have reinstalled FAI on your server a new ssh host key is
+   generated. This also happens when you call "fai-setup" or "make-fai-nfsroot".
+   Remove the relevant line from ~/.ssh/known_hosts and try again.
+

Added: branches/lhm/doc/Makefile
===================================================================
--- branches/lhm/doc/Makefile	                        (rev 0)
+++ branches/lhm/doc/Makefile	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,45 @@
+docname = fai-guide
+fdocname = $(docname).sgml
+MISC_DOC = classes_description.txt links.html changelog.old
+
+%.html: %.sgml
+	debiandoc2html $<
+
+%.pdf: %.sgml
+	debiandoc2latexpdf $<
+
+%.ps: %.sgml
+	debiandoc2latexps $<
+
+%.txt: %.sgml
+	debiandoc2text $<
+
+postscript: fai-guide.ps
+
+pdf: fai-guide.pdf
+
+html: fai-guide.html
+
+dvi: test
+	debiandoc2latexdvi $(fdocname)
+
+text: fai-guide.txt
+
+test:
+	nsgmls -wall -E20 -gues $(fdocname)
+
+clean:
+	rm -rf $(docname).txt $(docname).dvi $(docname).pdf $(docname).html $(docname).sasp* *~ $(docname).texinfo $(docname).ps $(docname).out $(docname).tpt $(docname).tex
+	rm -f body.tmp head.tmp thb*.png *.log
+
+print: dvi
+	dvips -f $(docname) | lpr
+
+install:
+	rm -f $(docname).tpt $(docname).out
+	cp -dRp $(docname)* $(DOCDIR)
+	cp -p $(MISC_DOC) $(DOCDIR)
+
+all: test pdf text html postscript
+
+.PHONY: all dvi text html pdf test clean print postscript

Added: branches/lhm/doc/QUESTIONNAIRE
===================================================================
--- branches/lhm/doc/QUESTIONNAIRE	                        (rev 0)
+++ branches/lhm/doc/QUESTIONNAIRE	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,67 @@
+FAI QUESTIONNAIRE 
+-----------------
+
+http://www.informatik.uni-koeln.de/fai/questionnaire
+last edited: june 11, 2008
+
+I'm very interested in your experiences with fai, bug reports, new ideas,...
+Please send this questionnaire to 
+
+       fai at informatik.uni-koeln.de
+
+All replies to this questionnaire are available at
+http://www.informatik.uni-koeln.de/fai/q-answers.html
+
+thanks in advance Thomas Lange
+
+----------------------------------------------------------------
+
+How many hosts have you installed using fai? 
+Which version of fai are you using? 
+Which version are you using as your install kernel? 
+      (eg.: plain Debian kernel)
+      (eg.: custom build kernel 2.6)
+
+Which types of hosts are you installing with fai?
+      (eg.: desktops, cluster nodes, notebooks, web server, mail server,...)
+
+How do you boot your hosts?
+            from floppy: 
+       via network card:
+   type of network card:
+           using FAI-CD:
+	 from USB stick:
+	          BOOTP:
+              PXE, DHCP:
+
+Does the default install kernel recognize all your hardware?
+Which drivers are missing?
+
+Do you manage your configuration space under version control?
+
+How big is your config space (Mbytes, # of files)? 
+cd <to your config space> (/usr/local/share/fai by default)
+du -sh
+find ! -type d | grep -v svn|grep -v cvs|wc -l
+
+How many files do you have in ../config/files?
+find files ! -type d | grep -v svn|grep -v cvs|wc -l
+
+What is the business of your company/organization (please add name and link)?
+
+You can also add some words, how you are using FAI in your company.
+Additional comments:
+
+
+Do you have some nice pictures of your installation? 
+
+I would like to mention your name or email address and your company's
+name on the FAI web page where I like to collect all questionnaires of
+the FAI users.
+
+May I publish your name?
+May I publish your email (it will be obfuscated to fool the spamers)?
+May I publish the name of your company?
+May I publish your pictures?
+
+----------------------------------------------------------------

Added: branches/lhm/doc/changelog.old
===================================================================
--- branches/lhm/doc/changelog.old	                        (rev 0)
+++ branches/lhm/doc/changelog.old	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,95 @@
+this was a changelog/NEWS file before FAI was a real Debian package
+since fai-1.1beta3: please look at the changelog file
+
+--------------------------------------------------
+fai-1.1beta2: june 20, 2000
+
+- script faireboot for easy rebooting
+- package_config can now preload a file before installing a package
+  (useful for realplayer, fai,..)
+- install_packages called in different ways depending on FAI_FLAGS
+  (verbose,debug) for better debugging
+- a "mini howto" on the creation of a FAI Boot Floppy doc/fai-boot-floppy.txt
+- S24 echoes NONIS if no nisdomain is defined
+- allways call the new lilo ${target}/sbin/lilo
+- apt-get upgrade before installation of packages
+- define_classes is called when FAI_ACTION is sysinfo
+- two configuration examples: faiserver and faiclient01
+- Class renamed: MAINTAINER -> DEBIAN_DEVEL
+- start-stop-daemon is now faked in a better way
+- fai.pl renamed to Fai.pm, new location
+- use make-fai-nfsroot if you do not want to mount /usr from a server (default)
+- some tests which nfs server you are using; only the user space
+  nfs-server is supported until now
+- testsize (Fai.pm) tests if lower < size <= upper
+- blocksize of harddisk will now be determined in Fai.pm (not fixed to 512 bytes)
+--------------------------------------------------
+fai-1.1beta1:
+
+- examples that are not used are now put into the subdirectory example
+- metapackages are used for software selection (package names task-*)
+- now using lprng instead of lpd (lpd always started daemon during installation)
+- class REBOOT removed. reboot can now be set via FAI_FLAGS (T172) or
+  in class/S*.source
+- base2_X.tgz can now be retrieved via ftp and http using wget
+- NO second reboot is needed! S99finish.sh is obsolete
+- using the tools from kernel-package, now it's easy to create and
+  install a kernel and his modules for a host. /fai/files/boot and
+  /fai/files/modules not used any more, because we have a Debian
+  package for the kernel
+- FAI now has serveral actions. If you only want some hardware
+  information, you can get it without installing anything. See bootp
+  tag $T171 or $FAI_ACTION (thanks to Thomas Gebhardt for this idea)
+- a lot of cfengine actions are now unnecessarily, because there's a
+  finer selection of software (e.g. rstat-client, rstatd). Former these
+  services must be disabled in inetd.conf
+- resolv.conf is used during installation
+- the full location of /usr is now defined in fai.conf
+- new options for setup_harddisk (-X -m)
+- totally new rewritten install_packages.pl
+- call lilo from $target; it's version must match with files in /boot
+- if the correct amount of memory is not detected, you can define it
+  in $liloappend
+- a lot of software packages are gone, renamed, new or better one
+  available so files in package_config also had changed (e.g. now lprng
+  instead of lpd)
+- timezone is now a variable, not fixed in cfengine
+- you can now load a different keytable (e.g. german keyboard)
+--------------------------------------------------
+FAI 1.0.1: january 19, 2000
+
+- setup_harddispk.pl now calculates partition sizes more exactly, it
+  checks all filesystems before mounting them (setup_harddisk.pl)
+  It also mounts filesystems read-only if they should be
+  preserved. Ignore error messages (read-only filesystem) when
+  extracting base2_1.tgz. This is a feature, not a bug.
+  It can handle different output of old and new sfdisk executables.
+
+- the link name to the (tftp) image for booting from local disk is now
+  specified with $TFTPLINK; previously it was always a link to the
+  file clusterimage (rcS,class/S*.source)
+
+- if host is in class MBR, lilo will write the master boot record
+  (mbr) otherwise, mbr will be left intact and only the boot sector of
+  the root partition is written (scripts/BOOT)
+
+- class LAST is now always the last class (S99last.sh)
+
+- S99var.source now S91var.source; variable definition depending on
+  hosts should be defined after S91* (e.g. S99kueppers.sh)
+
+- start-stop-daemon is disabled during installation (rcS)
+
+- rcS is now a bash script, and trap also starts a bash (formerly sh
+  script), the quit signal (ctrl-\) also calls trap
+
+- BOOTP tag T172 holds a space separated list of flags which will be
+  set to 1 inside rcS (verbose, debug are now used)
+
+- installkernel now supports Adaptec AIC7xxx based SCSI controllers
+
+- Thomas Renard has done some work on FAI for Red Hat RPM Systems
+  http://www.netcologne.de/~nc-renardth/fai/
+
+- doc/links.html is a file which contains all important links, so you
+  can easily click and jump to these pages

Added: branches/lhm/doc/classes_description.txt
===================================================================
--- branches/lhm/doc/classes_description.txt	                        (rev 0)
+++ branches/lhm/doc/classes_description.txt	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,64 @@
+Description of the classes		Tue, 10 Jan 2006 18:02:19 +0100
+--------------------------
+
+If you want to find all files (except hostnames) that are classes try:
+   find /srv/fai/config -type f | egrep '/[[:upper:][:digit:]_]+$'
+
+In cfengine scripts you can find class names using:
+   egrep -r '[[:upper:][:digit:]_]+::' /srv/fai/config
+
+Shell scripts are using the commad ifclass. So use:
+   egrep -r 'ifclass[[:space:]]+[[:upper:][:digit:]_]+' /srv/fai/config
+
+
+Class name       used in  Description
+----------------------------------------------------
+	       CHVDPSF A	  
+
+DHCPC		   PS     do network configuration using dhcp-client
+
+GERMAN		   P	  packages for the german environment
+
+XFREE		   P      packages for xfree server, fonts,...
+
+LILO		    S	  create lilo.conf, install lilo
+
+GRUB		    S	  install and configure grub
+
+FAI_BOOTPART	    S     add fai boot menu to lilo.conf or grub's menu.lst
+
+LAST		    S 	  remove backup files of cfengine, link /tmp
+			  if necessary, add nfs location of debian
+			  mirror to fstab 
+
+FAIBASE	       C V PS     minimal software list, configure base stuff
+			  (TODO: describe in more detail)
+
+FAISERVER      DESFP	  setup install server with DHCP, TFTP,
+			  partial mirror, call fai-setup during
+			  first boot
+
+DEMO               PS	  more demo packages, add account demo (pw: fai)
+
+NOMBR		    S     install boot loader into root partition (not into MBR)
+
+Explanation of "used in":
+-------------------------
+C = /fai/class/
+V = used for *.var in /fai/class
+D = /fai/disk_config/
+E = /fai/debconf/
+P = /fai/package_config/
+S = /fai/scripts/
+F = /fai/files/ (used by fcopy)
+A = auto class (defined by a script)
+H = /fai/hooks
+
+The following classes should always be defined:
+
+LAST, DEFAULT (are defined by default)
+BOOT and maybe MBR
+
+Some classes depends on another class. For example, the class NTP is used
+in the script NETWORK. So both classes must be defined if the ntp
+configuration should be created.

Added: branches/lhm/doc/common.ent
===================================================================
--- branches/lhm/doc/common.ent	                        (rev 0)
+++ branches/lhm/doc/common.ent	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,44 @@
+<!-- volatile information -->
+
+<!-- standard information -->
+<!entity fsf-addr "Free Software Foundation,
+  Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA">
+<!entity file-GPL "<file>/usr/share/common-licenses/GPL</file>">
+
+<!entity nfsrootsize "390MB">
+<!entity mirrorsize "22.0GB">
+<!entity fc "<file>fai.conf</file>">
+<!entity mfnc "<file>make-fai-nfsroot.conf</file>">
+
+<!--
+     URLs, Debian
+  -->
+<!entity dgl "Debian GNU/Linux">
+<!entity faiwww "http://www.informatik.uni-koeln.de/fai">
+<!entity faidownload "&faiwww/download">
+
+<!entity www-debian-org "www.debian.org">
+<!entity ftp-debian-org "ftp.debian.org">
+
+<!-- 
+     URLs, non-debbin
+  -->
+<!entity url-gnu-manifesto "http://www.gnu.org/gnu/manifesto.html">
+<!entity url-gpl "http://www.gnu.org/copyleft/gpl.html">
+
+<!-- Keep this comment at the end of the file
+Local variables:
+mode: sgml
+sgml-omittag:t
+sgml-shorttag:t
+sgml-minimize-attributes:nil
+sgml-always-quote-attributes:t
+sgml-indent-step:2
+sgml-indent-data:nil
+sgml-parent-document:nil
+sgml-exposed-tags:nil
+sgml-declaration:nil
+sgml-local-catalogs:nil
+sgml-local-ecat-files:nil
+End:
+-->

Added: branches/lhm/doc/entities/bootexample.sgml
===================================================================
--- branches/lhm/doc/entities/bootexample.sgml	                        (rev 0)
+++ branches/lhm/doc/entities/bootexample.sgml	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,97 @@
+<example>
+Managed PC Boot Agent (MBA) v4.00
+.
+.
+Pre-boot eXecution Environment (PXE) v2.00
+.
+.
+DHCP MAC ADDR: 00 04 75 74 6E 4A
+DHCP.../
+CLIENT IP: 192.168.1.12 MASK: 255.255.255.0  DHCP IP: 192.168.1.250
+GATEWAY IP: 192.168.1.254
+
+PXELINUX 3.71 (Debian-2008-09-06)  Copyright (C) 1994-2008 H. Peter Anvin
+UNDI data segment at:   0009D740
+UNDI data segment size: 3284
+UNDI code segment at:   00090000
+UNDI code segment size: 24C0
+PXE entry point found (we hope) at 9D74:00F6
+My Ip address seems to be C0A801C0 192.168.1.12
+ip=192.168.1.12:192.168.1.250:192.168.1.254:255.255.255.0
+TFTP prefix:
+Trying to load pxelinux.cfg/01-00-04-75-74-6e-4a
+Trying to load pxelinux.cfg/C0A801C0
+Loading vmlinuz-2.6.26-1-486.....................Ready.
+Loading initrd.img-2.6.26-1-486..................................
+Ready
+Uncompressing Linux... OK, booting the Kernel.
+Linux version 2.6.26-1-486 (Debian 2.6.26-4)
+.
+.
+Done.
+Mounting root file system.....
+eth0: link up
+RPC: Registered upd transport module.
+RPC: Registered tcp transport module.
+aufs 20080714
+.
+.
+Begin: Running /scripts/live-premount ... done.
+IP-Config: eth0 hardware address 00:0c:29:c9:81:38 mtu 1500 DHCP RARP
+IP-Config: eth0 guessed broadcast address 192.168.1.255
+IP-Config: eth0 complete (from 192.168.1.250):
+ address: 192.168.1.12   broadcast: 192.168.1.255  netmask: 255.255.255.0
+ gateway: 192.168.1.254  dns0     : 192.168.1.250  dns1   : 192.168.8.9
+ host   : demohost
+ domain : informatik.uni-koeln.de
+ rootserver: 192.168.1.250 rootpath: 
+ filename  : pxelinux.0
+Begin: Trying netboot from 192.168.1.250:/srv/fai/nfsroot ...
+Begin: Trying nfsmount -o nolock -o ro 192.168.1.250:/srv/fai/nfsroot /live/image ...
+.
+.
+          -------------------------------------------------
+                Fully Automatic Installation  -  FAI
+
+            FAI 3.2.10, 09 Sep 2008  Copyright (c) 1999-2008
+            Thomas Lange  &lt;lange at informatik.uni-koeln.de&gt;
+          -------------------------------------------------
+
+Calling task_confdir
+Kernel parameters: initrd=initrd.img-2.6.26-1-486 ip=dhcp root=/dev/nfs nfsroot=/srv/fai/nfsroot \
+ boot=live FAI_FLAGS=verbose,sshd,createvt FAI_ACTION=install \
+ FAI_CONFIG_SRC=nfs://kueppers/srv/fai/config BOOT_IMAGE=vmlinuz-2.6.26-1-486 
+Reading /var/log/fai/current/boot.log
+FAI_FLAGS: verbose sshd createvt
+Configuration space kueppers:/srv/fai/config mounted to /var/lib/fai/config
+Can't connect to monserver on kueppers port 4711. Monitoring disabled.
+Calling task_setup
+FAI_FLAGS: verbose sshd createvt
+rdate: connect: Connection refused
+21 Aug 14:26:53 ntpdate[3279]: step time server 134.95.4.129 offset 548.691554 sec
+Press ctrl-c to interrupt FAI and to get a shell
+Calling task_defclass
+/usr/bin/fai-class: Defining classes.
+Executing /var/lib/fai/config/class/10-base-classes.
+10-base-classes      OK.
+Executing /var/lib/fai/config/class/20-hwdetect.source.
+.
+.
+50-host-classes      OK.
+List of all classes: DEFAULT LINUX I386 FAIBASE DHCPC DEMO GRUB demohost LAST
+Calling task_defvar
+Executing FAIBASE.var
+++ FAI_ALLOW_UNSIGNED=1
+++ CONSOLEFONT=
+++ KEYMAP=us-latin1
+++ UTC=yes
+++ TIMEZONE=Europe/Berlin
+++ ROOTPW='$1$kBnWcO.E$djxB128U7dMkrltJHPf6d1'
+++ MODULESLIST='usbkbd ehci-hcd ohci-hcd uhci-hcd usbhid psmouse'
+++ STOP_ON_ERROR=700
+++ USE_SETUP_STORAGE=1
+Loading keymap(s) us-latin1 ...done.
+Calling task_action
+FAI_ACTION: install
+Performing FAI installation. All data may be overwritten!
+</example>

Added: branches/lhm/doc/entities/bootlog.sgml
===================================================================
--- branches/lhm/doc/entities/bootlog.sgml	                        (rev 0)
+++ branches/lhm/doc/entities/bootlog.sgml	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,18 @@
+<example>
+# cat /tmp/fai/boot.log
+
+netdevices_all="eth0"
+netdevices_up="eth0"
+netdevices="eth0"
+BROADCAST='192.168.1.255'
+DOMAIN='localdomain'
+DNSSRVS='192.168.1.1'
+DNSSRVS_1='192.168.1.1'
+HOSTNAME='demohost'
+IPADDR='192.168.1.12'
+NETWORK='192.168.1.0'
+GATEWAYS='192.168.1.250'
+GATEWAYS_1='192.168.1.250'
+SERVER='faiserver'
+NETMASK='255.255.255.0'
+</example>

Added: branches/lhm/doc/entities/faisetup.sgml
===================================================================
--- branches/lhm/doc/entities/faisetup.sgml	                        (rev 0)
+++ branches/lhm/doc/entities/faisetup.sgml	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,42 @@
+<example>
+faiserver[~]# fai-setup
+Creating FAI nfsroot in /srv/fai/nfsroot/live/filesystem.dir.
+By default it needs more than &nfsrootsize MBytes disk space.
+This may take a long time.
+Creating base system using debootstrap version 1.0.10
+Calling debootstrap lenny /srv/fai/nfsroot/live/filesystem.dir http://ftp.debian.org/debian
+Creating base.tgz
+Upgrading /srv/fai/nfsroot/live/filesystem.dir
+install_packages: reading config files from directory /etc/fai
+Adding additional packages to /srv/fai/nfsroot/live/filesystem.dir:
+nfs-common fai-nfsroot module-init-tools dhcp3-client ssh rdate lshw portmap bootpc rsync lftp less dump reiserfsprogs e2fsprogs usbutils hwinfo psmisc pciutils hdparm smartmontools parted mdadm lvm2 dnsutils ntpdate dosfstools cvs jove xfsprogs xfsdump procinfo dialog discover mdetect console-tools console-common expect iproute udev subversion cfengine2 libapt-pkg-perl grub lilo read-edid linux-image-486 aufs-modules-2.6-486 
+.
+.
+`/etc/fai/NFSROOT' -> `/srv/fai/nfsroot/live/filesystem.dir/etc/fai/NFSROOT'
+`/etc/fai/apt' -> `/srv/fai/nfsroot/live/filesystem.dir/etc/fai/apt'
+`/etc/fai/apt/sources.list' -> `/srv/fai/nfsroot/live/filesystem.dir/etc/fai/apt/sources.list'
+`/etc/fai/fai.conf' -> `/srv/fai/nfsroot/live/filesystem.dir/etc/fai/fai.conf'
+`/etc/fai/make-fai-nfsroot.conf' -> `/srv/fai/nfsroot/live/filesystem.dir/etc/fai/make-fai-nfsroot.conf'
+`/etc/fai/menu.lst' -> `/srv/fai/nfsroot/live/filesystem.dir/etc/fai/menu.lst'
+Shadow passwords are now on.
+Removing `local diversion of /usr/sbin/update-initramfs to /usr/sbin/update-initramfs.distrib'
+update-initramfs: Generating /boot/initrd.img-2.6.26-1-486
+W: mdadm: unchecked configuration file: /etc/mdadm/mdadm.conf
+W: mdadm: please read /usr/share/doc/mdadm/README.upgrading-2.5.3.gz .
+W: mdadm: no arrays defined in configuration file.
+`/srv/fai/nfsroot/live/filesystem.dir/boot/vmlinuz-2.6.26-1-486' -> `/srv/tftp/fai/vmlinuz-2.6.26-1-486'
+`/srv/fai/nfsroot/live/filesystem.dir/boot/initrd.img-2.6.26-1-486' -> `/srv/tftp/fai/initrd.img-2.6.26-1-486'
+DHCP environment prepared. If you want to use it, you have to enable the dhcpd and the tftp-hpa daemon.
+Removing `local diversion of /sbin/discover-modprobe to /sbin/discover-modprobe.distrib'
+make-fai-nfsroot finished properly.   <= *
+Adding line to /etc/exports: /srv/fai/config 134.95.9.149/255.255.255.0(async,ro,no_subtree_check)
+Adding line to /etc/exports: /srv/fai/nfsroot 134.95.9.149/255.255.255.0(async,ro,no_subtree_check,no_root_squash)
+Log file written to /var/log/fai/make-fai-nfsroot.log
+Re-exporting directories for NFS kernel daemon....
+
+   You have no FAI configuration space yet. Copy the simple examples with:
+   cp -a /usr/share/doc/fai-doc/examples/simple/* /srv/fai/config
+   Then change the configuration files to meet your local needs.
+
+FAI setup finished.                   <= *
+</example>

Added: branches/lhm/doc/fai-guide.sgml
===================================================================
--- branches/lhm/doc/fai-guide.sgml	                        (rev 0)
+++ branches/lhm/doc/fai-guide.sgml	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,2946 @@
+<!DOCTYPE debiandoc PUBLIC "-//DebianDoc//DTD DebianDoc//EN" [
+  <!-- include version information so we don't have to hard code it
+       within the document -->
+  <!-- common, language independent entities -->
+  <!entity % commondata SYSTEM "common.ent" > %commondata;
+  <!-- SVN revision of this document -->
+  <!entity svn-rev "$Id: fai-guide.sgml 5229 2008-12-17 01:56:45Z lange $">
+
+<!entity faiver "3.2.14">
+<!entity faiverdate "28 Oct 2008">
+
+<!entity version "2.8.4">
+<!entity date    "17 dec 2008">
+
+<!entity faisetup           system "entities/faisetup.sgml">
+<!entity bootexample        system "entities/bootexample.sgml">
+<!entity bootlog            system "entities/bootlog.sgml">
+
+]>
+
+
+<debiandoc>
+<book>
+      <title>FAI Guide (Fully Automatic Installation)
+
+      <author>Thomas Lange <email>lange at informatik.uni-koeln.de</email>
+      <version>FAI Guide version &version;, &date; for FAI package version &faiver;
+
+<abstract>
+FAI is a non-interactive system to install, customize and manage
+Linux systems and software configurations on computers as well as
+virtual machines and chroot environments, from small networks to
+large infrastructures and clusters.
+
+This manual describes the fully automatic installation package for
+Debian GNU/Linux. This includes the installation of the package, planning and
+creating of the configuration and how to deal with errors.
+
+<copyright>
+<copyrightsummary>
+Copyright &copy; 2000-2008 Thomas Lange
+</copyrightsummary>
+<copyrightsummary>
+Copyright &copy; 2005 Henning Glawe
+</copyrightsummary>
+	<p>
+This manual is free software; you may 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, or (at your option) any
+later version.
+	<p>
+This is distributed in the hope that it will be useful, but
+<em>without any warranty</em>; without even the implied warranty of
+merchantability or fitness for a particular purpose. See the GNU
+General Public License for more details.
+	<p>
+A copy of the GNU General Public License is available as &file-GPL; in
+the &dgl; distribution or on the World Wide Web at <url id="&url-gpl;"
+	name="the GNU website">. You can also obtain it by 
+writing to the &fsf-addr;.
+
+<toc detail="sect2">
+
+<chapt id="intro">Introduction<p>
+<!--MT: general comments: 
+  - dirinstall is only mentioned at the end
+  - mailinglists, IRC channel should be mentioned
+  - ULRs should be http://www. ... or only www. ..., but please be consistent
+  - Variables $VARNAME or VARNAME only? Be consistent.
+-->
+<sect id="availability">Availability<p>
+<!--MT: put Motivation before Availability-->
+The homepage of FAI is <url id="&faiwww;">. There's a wiki for FAI
+available at <httpsite>faiwiki.informatik.uni-koeln.de</httpsite>.
+There you will find all information about FAI, for example the mailing
+list archives. The FAI packages are also available from
+<url id="&faidownload;">. They are also available from
+all Debian mirrors. To access the newest versions of the FAI packages,
+you can add the following line to your <file>/etc/apt/sources.list</file> file.
+
+<example>deb http://www.informatik.uni-koeln.de/fai/download lenny koeln</example>
+
+User visible changes are listed in <file>/usr/share/doc/fai-doc/NEWS.Debian.gz</file>.
+<p> Send any comments to
+<email>fai at informatik.uni-koeln.de</email>. You should use the
+Debian bug tracking system (BTS)
+<url id="http://&www-debian-org;/Bugs/"> for reporting errors.
+<p>
+You can access the subversion repository containing the newest developer
+version of FAI from a Unix shell using the
+following commands.
+<example>
+# svn co svn://svn.debian.org/svn/fai/trunk fai
+</example>
+
+You can also use the web interface for the subversion repository at:
+<httpsite>svn.debian.org/</httpsite><httppath>wsvn/fai/</httppath>.
+<p>
+Now read this manual, then enjoy the fully automatic installation and
+your saved time.
+
+
+<sect id="motivation">Motivation<p> Have you ever performed identical
+installations of an operating system several times?  Would you like to
+be able to install a Linux cluster with dozens of nodes single
+handedly?
+
+<p>
+Repeating the same task again and again is boring -- and will surely
+lead to errors. Also a whole lot of time could be saved if the
+installations were done automatically. An installation process with
+manual interaction does not scale. But clusters have the habit of
+growing over the years. Think long-term rather than planning just a
+few months into the future.
+
+<p>
+In 1999, I had to perform an installation of a Linux cluster with one
+server and 16 clients. Since I had much experience doing automatic
+installations of Solaris operating systems on SUN SPARC hardware, the
+idea to build an automatic installation for Debian was born. Solaris
+has an automatic installation feature called JumpStart<footnote> <p>
+Solaris 8 Advanced Installation Guide at
+<httpsite>docs.sun.com</httpsite></p> </footnote>. In conjunction
+with the auto-install scripts from Casper Dik<footnote><p><url
+id="ftp://ftp.wins.uva.nl:/pub/solaris/auto-install/"></p> </footnote>,
+I could save a lot of time not only for every new SUN computer, but
+also for re-installation of existing workstations. For example, I had
+to build a temporary LAN with four SUN workstations for a conference,
+which lasted only a few days. I took these workstations out of our normal
+research network and set up a new installation for the conference.
+When it was over, I simply integrated the workstations back into the
+research network, rebooted just once, and after half an hour,
+everything was up and running as before. The configuration of all
+workstations was exactly the same as before the conference, because
+everything was performed by the same installation process. I also used
+the automatic installation for reinstalling a workstation after a
+damaged hard disk had been replaced. It took two weeks until I
+received the new hard disk but only a few minutes after the new disk
+was installed, the workstation was running as before. And this is why
+I chose to adapt this technique to a PC cluster running Linux.
+
+
+
+<sect id="overview">Overview and concepts<p>
+<p>
+
+FAI is a non-interactive system to install, customize and manage
+Linux systems and software configurations on computers as well as
+virtual machines and chroot environments, from small networks to
+large infrastructures and clusters. You can take one or more virgin
+PCs, turn on the power and after a few minutes Linux is installed,
+configured and running on the whole cluster, without any interaction
+necessary. Thus, it's a scalable method for installing and updating a
+cluster unattended with little effort involved. FAI uses the &dgl;
+distribution and a collection of shell and Perl scripts for the
+installation process. Changes to the configuration files of the
+operating system can be made by cfengine, shell, Perl and expect scripts.
+
+<p>
+FAI's target group are system administrators who have to install
+Linux onto one or even hundreds of computers. Because it's a general
+purpose installation tool, it can be used for installing a Beowulf
+cluster, a rendering farm or a Linux laboratory or a classroom. Also
+large-scale Linux networks with different hardware or different installation
+requirements are easy to establish using FAI. But don't forget to plan
+your installation. <ref id="plan"> has some useful hints for this topic.
+<p>
+First, some terms used in this manual are described.
+
+<taglist>
+	  <tag> install server : <item> <p>The host where the package
+	  <tt>fai-server</tt> is installed. It provides several services and data for
+	  all install clients. In the examples of this manual this
+	  host is called <tt>faiserver</tt>.
+
+	  <tag>install client : <item> A host which will be installed using
+	  FAI and a configuration provided by the install server. Also called
+	  client for short. In this manual, the example hosts are
+	  called <tt>demohost, nucleus, atom01, atom02,...</tt></p> </item>
+	  <tag> configuration : <item> The details of how the installation
+	  of the clients should be performed. All configuration data
+	  is stored in a certain directory structure and is also
+	  called configuration space or config space for short. It
+	  includes information about:
+<list>
+		<item> <p>Hard disk layout</p> </item>
+		<item> <p>Local file systems, their types, mount points
+		and mount options</p> </item>
+		<item> <p>Software packages</p>	</item>
+		<item> <p>Keyboard layout, time zone, NIS,
+		Xorg configuration, remote file systems, user accounts,
+		printers ...</p>	</item>
+</list>
+	  <tag> nfsroot : <item> A file system located on the install
+	  server. It's the complete file system for the install
+	  clients during the installation process. All clients share the
+	  same nfsroot, which they mount read only.</item>
+</taglist>
+
+<sect id="work">How does FAI work?<p> 
+
+The install client which will be installed using FAI, is
+booted via network card or from CD or USB stick. It gets an IP address and
+boots a Linux kernel which mounts its root file system via NFS from the install
+server. After the kernel is loaded, the FAI startup script
+performs the automatic installation which doesn't need any
+interaction. First, the hard disks will be partitioned, file systems are
+created and then software packages are installed. After that, the new
+installed operating system is configured to your local needs using
+some scripts. Finally the new operating system will be booted from the local
+disk.
+<p>
+The details of how to install the computer (the configuration) are
+stored in the configuration space on the install server. Configuration
+files are shared among groups of computers if they are similar using the
+class concept. So you need not create a configuration for every new
+host. Hence, FAI is a scalable method to install a big cluster with a
+great number of nodes.
+
+<p>
+FAI can also be used as a network rescue system. You can boot your
+computer, but it will not perform an installation. Instead it will run a
+fully functional &dgl; without using the local hard disks. Then you can
+do a remote login and backup or restore a disk partition, check a file system,
+inspect the hardware or do any other task.
+
+<!--MT: here the class concept should be described, move the entire section
+here.-->
+
+<sect id="features">Features<p> 
+<!--MT: Full stop after each item or not? Be consistent.-->
+<list>
+	    <item> <p>A fully automated installation can be performed.</p> </item>
+	    <item> <p>Very quick unattended installation</p> </item>
+	    <item> <p>Update of running systems without re-installation</p> </item>
+	    <item> <p>Hosts can boot from network card, CD, USB stick.</p> </item>
+	    <item> <p>Easy creation of the CD and USB stick</p> </item>
+	    <item> <p>PXE with DHCP and BOOTP boot methods are supported.</p> </item>
+	    <item> <p>Lilo and grub support</p> </item>
+	    <item> <p>ReiserFS, ext3 and XFS file system support</p> </item>
+	    <item> <p>Software RAID and LVM support</p> </item>
+	    <item> <p>Automatic hardware detection</p> </item>
+	    <item> <p>Remote login via ssh during installation process
+	    possible.</p> </item>
+	    <item> <p>Two additional virtual terminals available
+	    during installation</p> </item>
+	    <item> <p>All similar configurations are shared among
+	    all install clients.</p> </item>
+	    <item> <p>Log files for all installations are saved to the installation server.</p> </item>
+	    <item> <p>Shell, Perl, expect and cfengine scripts are
+	    supported for the configuration setup.</p> </item>
+	    <item> <p>Access to a Debian mirror via NFS, FTP or HTTP</p> </item>
+	    <item> <p>Can be used as a rescue system.</p> </item>
+	    <item> <p>Flexible system through easy class concept </p> </item>
+<!-- 	    <item> <p>Predefined Beowulf classes included </p> </item> -->
+	    <item> <p>Diskless client support</p> </item>
+	    <item> <p>Easily add your own functions via hooks.</p> </item>
+	    <item> <p>Easily change the default behavior via hooks.</p> </item>
+      <!--MT: SVN/CVS config management, softupdate, dirinstall-->
+</list>
+
+<chapt id=impatient>Quickstart - For the impatient user<p>
+
+So, you do not like to read the whole manual? You like to try an
+installation without reading the manual? OK. Here's how to succeed in
+a few minutes.
+
+<list>
+   <item><p>Install the package <tt>fai-quickstart</tt> (see
+<ref id="faisetup"> on your install server).</p></item>
+   <item><p>Edit &fc;, run fai-setup -v and read its output.</p></item>
+   
+<item><p>
+Install the simple examples into the configuration space:
+<p><tt>cp -a /usr/share/doc/fai-doc/examples/simple/* /srv/fai/config/</tt>
+</p></item>
+
+<item><p>Get the MAC address of your demo host.</p></item>
+  <item><p>Add your host (try to name it <tt>demohost</tt>)
+  to <file>dhcpd.conf</file> and <file>/etc/hosts</file> (=your DNS) on the FAI server.</p></item>
+<item><p>When using PXE, tell the install client to boot the install
+  kernel and perform an installation during the next boot by calling
+  <example>fai-chboot -IFv demohost</example> on the install server.
+</p></item>
+<item><p>If you want to try FAI without setting up a PXE+DNS+DHCP-environment:
+put the host names into <file>/etc/hosts</file> inside the nfsroot at
+<file>/srv/fai/nfsroot</file> and use
+a CD/DVD to boot the client.
+<item><p>Boot your demo host and enjoy the fully automatic installation.</p></item>
+<item><p>If the installation has finished successfully, the computer should boot a
+small Debian system. You can login as user <tt>demo</tt> or <tt>root</tt> with password <tt>fai</tt>.</p></item>
+
+</list>
+But now don't forget to read chapters <ref id="plan">, <ref id="instprocess"> and <ref id="config">!
+
+<chapt id="inst">Installing FAI
+<sect id="requirements">Requirements<p> 
+<!--MT: split this section to mark the specific requirments:
+  - boot media
+  - source of the root file system
+  - config source
+-->
+
+The following items are required for an installation via FAI.
+
+<taglist>
+	  <tag>A computer: </tag><item> The computer must have a
+	  network interface card<footnote>If you install from USB
+	  stick or CD you do not need a network
+	  card</footnote>. Unless a diskless installation
+	  should be performed a local hard disk is also needed. No floppy disk,
+	  CD-ROM, keyboard or graphics adapter is needed.</item>
+
+	  <tag>DHCP or BOOTP server: </tag><item> <p> 
+The clients need one of these daemons to obtain boot information.</item>
+
+	  <tag>TFTP server:<item> The TFTP daemon is used for
+	  transferring the kernel to the clients. It's only needed when
+	  booting from network card with a boot PROM.</item>
+	  <tag>NFS-Root:<item> It is a directory which contains the whole
+	  file system for the install clients during installation. It
+	  must be exported via NFS, so the install clients can mount
+	  it. It will
+	  be created during the setup of the FAI package and is also
+	  called <strong>nfsroot</strong>.</item>
+	  <tag>Debian mirror:<item> Access to a Debian
+	  mirror is needed. A local mirror of all Debian packages or
+	  an <manref name="apt-proxy" section="8"> is recommended if
+	  you install several computers.</item>
+	  <tag>Configuration space:<item> This directory tree, which
+	  contains the configuration data, is mounted via NFS by
+	  default. But you can also get this directory from a revision
+	  control system like CVS, subversion or Git.
+	</taglist>
+<p>
+The NFS server will be enabled automatically when
+installing the <tt>fai-server</tt> package.
+<p>
+
+
+<sect id="debian-mirror">How to create a local Debian mirror<p> 
+<!--MT: move this section near the end of the chapter, it's not as important-->
+
+The script <prgn>mkdebmirror</prgn> <footnote> You can find the script in
+ <p><file>/usr/share/doc/fai-doc/examples/utils/</file>.</p> </footnote> can be used
+ for creating your own local Debian mirror. This script uses the
+ script <manref name="debmirror" section="1">. A partial Debian mirror only for i386 architecture for
+ Debian 5.0 (aka lenny) without the source packages needs about
+ &mirrorsize of disk space. Accessing the mirror via HTTP will be the
+ default way in most cases. To see more output from the
+ script call <tt>mkdebmirror -v</tt>. A root account is not
+ necessary to create and maintain the Debian mirror.
+<p>
+You can use the command <manref name="fai-mirror" section="1"> for
+creating a partial mirror that only contains the software
+packages that are used in the classes in your configuration
+space. A partial mirror containing all package for the simple
+examples from the package fai-doc will only need about 300MB of disk
+space.
+
+To use HTTP access to the local Debian mirror, install a web server
+and create a symlink to the local directory where your mirror
+is located:
+
+<example># apt-get install apache2
+# ln -s /files/scratch/debmirror /var/www/debmirror
+</example>
+
+Create a file <manref name="sources.list" section="5"> in
+<file>/etc/fai/apt</file> which gives access to your Debian mirror. An
+example can be found in
+<file>/usr/share/doc/fai-doc/examples/etc</file>. Also add the IP-address
+of the HTTP server to the variable <var>NFSROOT_ETC_HOSTS</var> in
+&mfnc; when the install clients have no DNS access.
+<!--MT: some link to a signing howto would be nice-->
+
+<sect id=faisetup> Setting up FAI<p>
+
+To setup a FAI install server you need at least the packages
+<tt>fai-server</tt> and <tt>fai-doc</tt>. The package
+<tt>fai-quickstart</tt> contains dependencies on all required packages
+for an install server. Do not install the package <tt>fai-nfsroot</tt>
+on a normal system. This package can only be installed inside the nfsroot.
+
+If you would like to install all packages that are useful
+for a FAI install server, use the following command
+
+<p><example>
+# aptitude install fai-quickstart
+Reading Package Lists... Done
+Building Dependency Tree       
+Reading extended state information      
+Initializing package states... Done
+Reading task descriptions... Done  
+
+The following NEW packages will be installed:
+  apt-move{a} dhcp3-server{a} fai-doc{a} fai-quickstart fai-server{a}
+  genisoimage{a} inetutils-inetd{a} nfs-kernel-server{a} 
+  openssh-server{a} syslinux-common{a} tftpd-hpa{a} 
+0 packages upgraded, 11 newly installed, 0 to remove and 0 not upgraded.
+Need to get 2593kB of archives. After unpacking 8561kB will be used.
+Do you want to continue? [Y/n/?] 
+</example><p>
+
+<p>The configuration for the FAI package (not the configuration data
+for the install clients) is defined in &fc;. Definitions that are only
+used for creating the nfsroot are located in &mfnc;. Edit these files before calling
+<prgn>fai-setup</prgn>. These are important variables in &mfnc;:
+
+<taglist>
+	    <tag><var>FAI_DEBOOTSTRAP</var></tag>
+	    <item>
+	  <p>For building the nfsroot there's the command called
+	  <manref name="debootstrap" section="8">. It needs
+	  the location of a Debian mirror and the name of the distribution
+	  (etch, lenny, sid) for which the basic Debian
+	  system should be built.
+	    </p> </item>
+
+	    <tag><var>NFSROOT_ETC_HOSTS</var></tag>
+	    <item>
+	      <p>If you use HTTP or FTP access to the Debain mirror,
+	      add its IP-address and the name to this
+	      variable. For a Beowulf master node, add the name and
+	      IP-address of both networks to it. This variable is not
+	      needed when the clients have access to a DNS server.</p>
+	    </item>
+	  </taglist>
+
+<p>
+
+These are important variables in &fc;:
+<taglist>
+
+	    <tag><var>FAI_CONFIG_SRC</var></tag>
+	    <item> <p>This variables described how to access the
+	    configuration space on the install clients. It's an Universal Resource
+	    Identifier (URI) even it may not always comply to the
+	    official schemes. <!--MT: not so important... See
+	    <httpsite>en.wikipedia.org</httpsite><httppath>/wiki/URI_scheme</httppath>
+	    for details.--> <p>
+     Currently supported methods are: 
+
+    <taglist>
+		  <tag><var>nfs://host/path/to/exported/config</var></tag>
+		  <item> <p>The config space is mounted from host via NFS.</p></item>
+
+		  <tag><var>cvs[+ssh]://user at host/path/to/cvsroot
+		  module[=tag]</var></tag> 
+		  <item> <p>The config space is received from a cvs checkout.</p></item>
+
+		  <tag><var>svn://user@host/svnpath</var></tag>
+		  <item> <p>The config space checked out from a
+		  subversion repository. Also supported are svn+file,
+		  svn+http, svn+ssh, svn+https and checkouts without a user
+		  name.</p></item>
+
+		  <tag><var>git://host/path</var></tag>
+		  <item> <p>The config space checked out from a
+		  git repository, host can be empty. Also supported is git+http.</p></item>
+    </taglist>
+
+	  If <var>FAI_CONFIG_SRC</var> is undefined in &fc, then the
+	  default is to use an NFS mount from the fai install server
+	  onto the install client. It's the same as
+	  <tt>nfs://`hostname`/$FAI_CONFIGDIR</tt> with the host name
+	  determined on the install server. Remember that this directory
+	  must be exported to all install clients, so that all files
+	  can be read by root. </p></item>
+
+
+	    <tag><var>FAI_DEBMIRROR</var></tag>
+	    <item>
+	      <p> If you have NFS access to your local Debian mirror,
+	      specify the remote file system. It will be mounted to
+	      <var>$MNTPOINT</var>, which must also be defined. It's
+	      not needed if you use access via FTP or HTTP.</p>
+	      </item>
+	  </taglist><p>
+
+
+The content of <file>/etc/fai/apt/sources.list</file> and <var>FAI_DEBMIRROR</var>
+are used by the install server and also by the clients. If your
+install server has multiple network cards and different host names for
+each card (as for a Beowulf server), use the install
+server name which is known by the install clients.<p>
+
+FAI uses <manref name="debootstrap" section="8"> and  <manref name="apt-get" section="8"> to create the nfsroot 
+file system in <file>/srv/fai/nfsroot</file>. It needs about
+&nfsrootsize; of free disk space. After editing &fc; and &mfnc; call
+<prgn>fai-setup</prgn>.
+
+<!--MT: smaller font, if possible-->
+&faisetup;
+
+<p>
+A complete example of <file>fai-setup.log</file> is available on the FAI web page.
+It's important that you find both lines that are marked with an
+asterisk in your output. Otherwise something went wrong. If you'll get a lot of blank
+lines, it's likely that you are using <tt>konsole</tt>, the X terminal
+emulation for KDE which has a bug. Try again using <tt>xterm</tt>.
+<!--MT: this problem should be debugged-->
+<p>
+The warning messages from dpkg about dependency problems can be ignored.
+If you have problems running fai-setup, they usually stem from 
+<manref name="make-fai-nfsroot" section="8">. 
+Adding '-v' gives you a more verbose output which may help you 
+pinpoint the error. The output is written to <file>/var/log/fai/make-fai-nfsroot.log</file>.
+It may help to enter the chroot environment manually
+<example>
+sudo chroot /srv/fai/nfsroot/live/filesystem.dir
+</example>
+The setup routine adds some lines to <file>/etc/exports</file> to export
+the nfsroot and the configuration space to all hosts that belong to
+the netgroup <em>faiclients</em>. If you already export a parent directory
+of these directories, you may comment out these lines, since the kernel NFS
+server has problems exporting a directory and one of its
+subdirectories with different options.
+
+All install clients must belong to this netgroup,
+in order to mount these directories successfully. Netgroups are
+defined in <file>/etc/netgroup</file> or in the corresponding NIS
+map. An example for the netgroup file can be found in
+<file>/usr/share/doc/fai-doc/examples/etc/netgroup</file>. For more
+information, read the manual pages <manref name="netgroup"
+section="5"> and the NIS HOWTO. After changing the netgroups, the NFS
+server has to reload its configuration. Use the following
+command:
+
+<example>
+faiserver# /etc/init.d/nfs-kernel-server reload
+</example>
+
+<p>
+The setup also creates the account <tt>fai</tt> (defined by <var>$LOGUSER</var>)
+if not already available. So you can add a user before calling <manref
+name="fai-setup" section="8"> using the command
+<manref name="adduser" section="8"> and use this as your local account
+for saving log files. The log
+files of all install clients are saved to the home directory of this
+account. If you boot from network card, you should change the primary
+group of this account, so this account has write permissions to
+<file>/srv/tftp/fai</file> in order to change the symbolic links to the kernel
+image which is booted by a client.
+<!--MT: the log files - which ones? Give a little explanation here-->
+
+
+<p>
+After that, FAI is installed successfully on your server, but has no
+configuration for the install clients. Start with the examples from
+<tt> /usr/share/doc/fai-doc/examples/simple/</tt> using the copy command above
+and read <ref id="config">. Before you can set up a DHCP or BOOTP
+daemon, you should collect some network information of all your
+install clients. This is described in section <ref id="mac">.
+<p>
+When you make changes to &fc;, &mfnc; the nfsroot has to be rebuilt by calling <manref
+name="make-fai-nfsroot" section="8">. If you only like to install a new kernel to
+the nfsroot add the flags <tt>-k</tt> or <tt>-K</tt> to
+<tt>make-fai-nfsroot</tt>. This will not recreate your nfsroot, but
+only updates your kernel and kernel modules inside the nfsroot or add
+additional packages into the nfsroot.
+
+<sect1 id=troublefaisetup> Troubleshooting the setup<p>
+
+The setup of FAI adds the <tt>fai</tt> account, exports file systems and calls
+<manref name="make-fai-nfsroot" section="8">. If you call
+<tt>make-fai-nfsroot -v</tt> you
+will see more messages. When using a local Debian mirror, it's
+important that the install server can mount this directory via
+NFS. If this mount fails, check <file>/etc/exports</file> and <file>/etc/netgroup</file>.
+
+
+<chapt id="booting">Preparing booting <p> 
+
+Before booting the client for the first time, you have to choose which medium you
+use for booting. Normally, you will configure the computer
+to boot via network card. The preferred method for booting is using
+PXE. PXE is the Preboot Execution Environment which most modern network cards support.
+Also booting from CD-ROM or from an USB stick is easy to set up.
+
+<sect id="nicboot">Enabling PXE on a 3Com network card with boot PROM
+<p>
+If you have a 3Com network card that is equipped with a boot ROM by
+Lanworks Technologies or already includes the DynamicAccess Managed PC
+Boot Agent (MBA) software<footnote> <p><httpsite>support.3com.com/</httpsite>
+<httppath>infodeli/tools/nic/mba.htm</httppath></p></footnote>, you
+can enter the MBA setup by typing <tt>Ctrl+Alt+B</tt> during boot. The
+setup should look like this:
+
+<!--MT: smaller font, if possible-->
+<example>
+Managed PC Boot Agent (MBA) v4.00
+(C) Copyright 1999 Lanworks Technologies Co. a subsidiary of 3Com Corporation
+All rights reserved.
+===============================================================================
+                            Configuration
+
+Boot Method:                PXE
+
+Default Boot:               Network
+Local Boot:                 Enabled
+Config Message:             Enabled
+Message Timeout:            3 Seconds
+Boot Failure Prompt:        Wait for timeout
+===============================================================================
+  Use cursor keys to edit: Up/Down change field, Left/Right change value
+  ESC to quit, F9 restore previous settings, F10 to save
+</example>
+
+Set the boot method to <tt>PXE</tt> (do not use RPL or BOOTP) and
+enable local boot in this 
+menu. So the first boot device will be the network card using PXE, and
+the second should be the local hard disk. This has to be configured in
+the BIOS of your computer. 
+
+<sect id="pxeboot">Booting from network card with a PXE conforming boot ROM<p>
+Most modern bootable network cards support the PXE boot environment.
+Some network cards (e.g. on notebooks) have a fixed
+boot configuration, so they can only use the PXE boot protocol. This requires a PXE
+Linux boot loader and a special version of the <tt>TFTP</tt> daemon,
+which is available in the Debian package <package>tftpd-hpa</package>.
+
+First install following additional needed packages:
+
+<example>
+# apt-get install dhcp3-server syslinux-common tftpd-hpa
+</example>
+
+Then set up the DHCP daemon. A sample configuration file can be
+found in <file>/usr/share/doc/fai-doc/examples/etc/dhcpd.conf</file>. Copy
+this file to <file>/etc/dhcp3/dhcpd.conf</file>.
+Then enable the special tftp daemon
+using this line in file <file>/etc/inetd.conf</file>: 
+<example>
+tftp dgram udp wait root /usr/sbin/in.tftpd in.tftpd -s /srv/tftp/fai
+</example>
+
+The install client then loads the pxelinux boot loader which receives
+its configuration via TFTP from a file in the directory
+<file>/srv/tftp/fai/pxelinux.cfg</file> (defined by the variable
+<var>TFTPROOT</var> in &mfnc;). Using the command <manref
+name="fai-chboot" section="8"> you can 
+define which kernel will be loaded by the PXE Linux loader and
+which additional parameters are passed to this kernel. You should
+read the manual pages, which give you some good examples.
+<!--MT: $TFTPROOT only tells FAI where the tftpd directory is found, but what
+you are saying here rather refers to the entry in inetd.conf-->
+
+See <file>/usr/share/doc/syslinux/pxelinux.doc</file> for more detailed
+information.
+
+<sect id="bootfloppy">Creating a boot floppy
+<p>
+
+If your network card can't boot by itself, you can create a small
+ boot floppy that uses etherboot, which
+will provide the PXE feature for your network card. So you can
+use DHCP and TFTP to get the install kernel that was created with
+<manref name="mknbi-linux" section="8">.  A lot of ethernet cards
+support booting via ethernet if a special boot EPROM is inserted or
+booted from floppy provided by <httpsite>rom-o-matic.net/</httpsite>. In
+depth documentation about booting via ethernet may be found at
+<httpsite>www.etherboot.org</httpsite>.
+
+
+<sect id="cdboot">Booting from a CD-ROM<p>
+
+It's possible to perform an automatic installation from CD-ROM without
+an install server. The CD-ROM contains all data needed for the
+installation. The command <manref name="fai-cd" section="8"> puts the
+nfsroot, the configuration space and a subset of the Debian mirror
+onto a CD-ROM. The partial mirror is created using the command
+<manref name="fai-mirror" section="1"> which contains all packages
+that are used by the classes used in your configuration space.
+
+A sample ISO image is available at
+<httpsite>www.informatik.uni-koeln.de</httpsite><httppath>/fai/fai-cd/</httppath>.
+
+<sect id="usbboot">Booting from USB stick<p>
+
+Using the command <manref name="fai-cd" section="8"> you can also
+create a bootable USB stick. First format your stick with an ext2 file
+system (ext3 makes no sense on flash memory devices). Then mount it.
+After that call:
+<tt>fai-cd -m /path/to/mirror -u /path/to/mounted/stick</tt>
+Then unmount the USB stick.
+
+The USB stick must be formatted with an ext2 file system. VFAT is not
+yet tested. Currently the file system that will be written onto the
+stick is not compressed.
+
+<sect id="mac">Collecting Ethernet addresses<p>
+
+Now it's time to boot your install clients for the first time. They
+will fail to boot completely, because no BOOTP or DHCP daemon is running yet or
+recognizes the hosts. But you can use this first boot attempt to
+easily collect all Ethernet addresses of the network cards.
+<p>
+
+You have to collect all Ethernet (MAC) addresses of the install clients
+and assign a host name and IP address to each client. To collect 
+ all MAC addresses, now boot all your install clients. While the
+install clients are booting, they send broadcast packets to the LAN. You
+can log the MAC addresses of these hosts by running the following
+command simultaneously on the server:
+
+<example># tcpdump -qtel broadcast and port bootpc >/tmp/mac.list</example>
+
+<p>
+After the hosts have been sent some broadcast packets (they will fail
+to boot because <prgn>bootpd</prgn> isn't running or does not recognize the MAC
+address yet) abort <prgn>tcpdump</prgn> by typing <tt>ctrl-c</tt>. You get a list
+of all unique MAC addresses with these commands:
+
+<example># perl -ane 'print "\U$F[0]\n"' /tmp/mac.lis|sort|uniq</example>
+
+After that, you only have to assign these MAC addresses to host names
+and IP addresses (<file>/etc/ethers</file> and <file>/etc/hosts</file>
+or corresponding NIS maps). With this information you can configure
+your <prgn>BOOTP</prgn> or <prgn>DHCP</prgn> daemon (see the section
+<ref id="bootptab">). I recommend to write the MAC addresses (last
+three bytes will suffice if you have network cards from the same
+vendor) and the host name in the front of each chassis.
+
+<sect id=bootptab>Configuration of the BOOTP daemon<p>
+You should only use this method if you can't use a DHCP server, since
+it's easier to create and manage the configuration for DHCP.
+An example configuration for the BOOTP daemon can be found in
+<file>/usr/share/doc/fai-doc/examples/etc/bootptab</file>.
+
+<example>
+# /etc/bootptab example for FAI
+# replace FAISERVER with the name of your install server
+
+.faiglobal:\
+ :ms=1024:\
+ :hd=/srv/tftp/fai:\
+ :hn:bs=auto:\
+ :rp=/srv/fai/nfsroot:
+
+.failocal:\
+ :tc=.faiglobal:\
+ :sa=FAISERVER:\
+ :ts=FAISERVER:\
+ :sm=255.255.255.0:\
+ :gw=134.95.9.254:\
+ :dn=informatik.uni-koeln.de:\
+ :ds=134.95.9.136,134.95.100.209,134.95.100.208,134.95.140.208:\
+ :nt=time.rrz.uni-koeln.de,time2.rrz.uni-koeln.de:
+
+# now one entry for each install client
+demohost:ha=0x00105A240012:bf=demohost:tc=.failocal:T172="verbose sshd createvt debug":
+ant01:ha=0x00105A000000:bf=ant01:tc=.failocal:T172="sshd":
+</example>
+<!--MT: break the lines of the host entries as well-->
+
+Insert one entry for each install client at the end of this file as
+done for the hosts <em>demohost</em> and <em>ant01</em>. Replace the string
+<tt>FAISERVER</tt> with the name of your install server. If the
+install server has multiple network cards and host names, use the host
+name of the network card to which the install clients are
+connected. Then adjust the other network tags (<tt>sm, gw, dn,
+ds</tt>) to your local needs.
+
+<taglist>
+ <tag>sm:</tag> <item>  <p>Subnet mask</p> </item>
+ <tag>gw:</tag> <item>  <p>Default gateway / router</p> </item>
+ <tag>dn:</tag> <item>  <p>Domain name</p> </item>
+ <tag>ds:</tag> <item>  <p>List of DNS server. The
+ <file>/etc/resolv.conf</file> file will be created using this list
+ of DNS servers and the domain name.
+ <tag>T172:</tag> <item>  <p>List of <var>FAI_FLAGS</var>;
+ e.g. verbose, debug, reboot, createvt, sshd</p> </item>
+ </taglist>
+
+The tag for time servers (<tt>nt</tt>) are
+optional. Tags with prefix <tt>T</tt> (starting from T170) are generic
+tags which are used to transfer some FAI specific data to the
+clients<footnote>T170=FAI_LOCATION (now defined in
+<file>fai.conf</file>) and T171=FAI_ACTION. You can define theses
+variables in a class/*.var script. But for backward compatibility, you
+can define theses variables also from a BOOTP or DHCP
+server.</footnote>
+
+The list of <var>FAI_FLAGS</var> can be space or comma
+separated. <var>FAI_FLAGS</var> in <file>bootptab</file> must be
+separated by whitespace. If you define <var>FAI_FLAGS</var> as
+an additional kernel parameter, the flags must be separated with a
+comma.
+If you do not have full control over the BOOTP or DHCP daemon (because
+this service is managed by a central service group) you can also
+define the variable <var>FAI_ACTION</var> in
+the <file>$FAI/class/*.var</file> scripts.
+
+When you have created your <file>bootptab</file> file, you have to
+enable the BOOTP daemon once. It's installed but Debian does not enable it
+by default. Edit <file>/etc/inetd.conf</file> and remove the comment
+(the hash) in the line containing <tt>#bootps</tt>. Then tell
+<prgn>inetd</prgn> to reload its configuration.
+
+<example># /etc/init.d/inetd reload</example>
+
+The BOOTP daemon automatically reloads the configuration file if any changes are
+made to it. The daemon for DHCP must always be manually restarted
+after changes to the configuration file are made.
+
+<p>
+Now it's time to boot all install clients again!
+FAI can perform several actions when the client is booting. This action
+is defined in the variable <var>FAI_ACTION</var>.
+Be very careful if you set <var>FAI_ACTION </var> to
+<em>install</em>. This can destroy all your data on the install
+client, indeed most time it should do this ;-). It's recommended to change this only
+on a per-client base in the BOOTP configuration. Do not change it in
+the section <tt>.failocal</tt> in <file>/etc/bootptab</file>, which
+is a definition for all clients.
+
+<sect1 id=troublebootp>Troubleshooting BOOTP daemon<p>
+The BOOTP daemon can also be started in debug mode if it is not
+enabled in <file>inetd.conf</file>:
+<example># bootpd -d7</example>
+
+<sect id="bootdhcp">Configuration of the DHCP daemon <p>
+An example for <manref name="dhcpd.conf" section="5"> is available in
+<file>/usr/share/doc/fai-doc/examples/etc/dhcpd.conf</file>, which is working with
+version 3.x of the DHCP daemon. Start using this example
+and look at all options used therein. The only FAI specific
+information inside this configuration file is to set <tt>filename</tt> to
+<tt>pxelinux.0</tt> and to set <tt>next-server</tt> and
+<tt>server-name</tt>. All other information is only network related
+data, which is used in almost all DHCP configurations.
+ 
+If you make any changes
+to the DHCP daemon configuration, you must restart the daemon.
+<example># /etc/init.d/dhcp3-server restart</example>
+By default, the DHCP daemon
+writes its log files to <file>/var/log/daemon.log</file>.
+The command <manref name="fai-chboot" section="8"> is used for creating a per host
+configuration for the pxelinux environment.
+
+
+<sect id="bootmesg">Boot messages <p>
+
+When booting from network card with PXE you will see:
+
+&bootexample;
+
+When the copyright message of FAI is shown, the install client has mounted
+the nfsroot<footnote> <p><file>/srv/fai/nfsroot</file> from the
+install server</p> </footnote> to the clients' root directory. This is
+the whole file system for the client at this moment. 
+
+After <tt>task_confdir</tt> is executed, the configuration space is
+mounted or received from a CVS repository.
+
+Before the installation is started (<var>FAI_ACTION=install</var>) the computer
+beeps three times. So, be careful when you hear three beeps
+but you do not want to perform an installation!
+
+<sect1 id=booterror>Troubleshooting the boot messages<p>
+
+This is the error message you will see, when your network card is
+working, but the install server does not export the configuration
+space directory to the install clients, mostly a problem of missing
+permissions on the server side.
+<example>
+Begin: Mounting root file system... ...
+eth0: link up
+
+BusyBox v1.10.2 (Debian 1:1.10.2-1) Built-in shell (ash)
+Enter 'help' for a list of built-in commands.
+/bin/sh: can't access tty: job control turned off
+(initramfs)
+</example>
+You will get a shell prompt and can look at the log files, for
+examples <file>/live.log</file> or <file>/tmp/net-eth0.conf</file>.
+<p>
+Use the following command on the install server to see which directories are exported
+from the install server (named faiserver):
+<example>showmount -e faiserver</example>
+
+<p>
+
+The following error message indicates that your install client doesn't
+get an answer from a DHCP server. Check your cables or start the
+<manref name="dhcpd" section="8"> daemon with the debug flag enabled.
+<example>
+PXE-E51: No DHCP or BOOTP offers received
+Network boot aborted
+</example>
+
+These are the messages when you are using the BOOTP method and no
+BOOTP server replies.
+<example>
+Sending BOOTP requests ........ timed out!
+IP-Config: Retrying forever (NFS root)...
+</example>
+
+If you get the following error message, the install kernel could not
+detect your network card, for example because of a missing driver:
+<example>
+Begin: Mounting root file system... ...
+Kernel panic - not syncing: Attempted to kill init!
+</example>
+Check the initrd in the nfsroot if the kernel driver of your network
+card is included there.
+
+<sect id="sysinfo">Collecting other system information 
+<p>
+
+Now the clients have booted with <var>FAI_ACTION</var> set to <em>sysinfo</em>. Type
+<tt>ctrl-c</tt> to get a shell or use <tt>Alt-F2</tt> or
+<tt>Alt-F3</tt> and you will get another console terminal, if you have added <tt>createvt</tt>
+to <var>FAI_FLAGS</var>.
+
+Remote login is available via the secure shell if <tt>sshd</tt> is
+added to <var>FAI_FLAGS</var>. The encrypted password is set with the
+variable <var>FAI_ROOTPW</var> in &mfnc; and defaults to "fai". You can
+create the encrypted password using <manref name="mkpasswd"
+section="1"> and use the <manref name="crypt" section="3"> or md5 algorithm. This 
+is only the root password during the installation process, not for the
+new installed system. You can also log in without a password when
+using <var> SSH_IDENTITY</var>. To log in from your server to the
+install client (named demohost in this example) use:
+
+<example>> ssh root at demohost
+Warning: Permanently added 'demohost,134.95.9.200' to the list of known hosts.
+root at demohost's password: 
+</example>
+
+
+You now have a running Linux system on the install client
+without using the local hard disk. Use this as a rescue system if
+your local disk is damaged or the computer can't boot properly from
+hard disk. You will get a shell and you can execute various commands
+(<prgn>dmesg</prgn>, <prgn>lsmod</prgn>, <prgn>df</prgn>,
+<prgn>lspci</prgn>, ...). Look at the log file in
+<file>/tmp/fai</file>. There you can find much information about the boot
+process.
+
+All log files from <file>/tmp/fai</file> are also written to the
+<var>$LOGSERVER</var> (if not defined: the server defined by
+<var>$SERVER</var> from <tt>get-boot-info</tt>) into the
+directory <tt>~fai/demohost/sysinfo/</tt><footnote>More general:
+<tt>~$LOGUSER/$HOSTNAME/$FAI_ACTION/</tt>. Two additional symbolic
+links are created. The symlink <file>last</file> points to the log
+directory of the last fai action performed. The symlinks
+<file>last-install</file> and <file>last-sysinfo</file> point to the
+directory with of the last corresponding action.
+<!--MT: I think it should be <tt>~$LOGUSER/$HOSTNAME/$FAI_ACTION-`DATE`/</tt>-->
+
+Examples of the log
+files can be found on the FAI homepage.
+</footnote>
+
+<p>
+FAI mounts all file systems it finds on
+the local disks read only. It also tells you on which partition a file
+<file>/etc/fstab</file> exists. When only one file system table is found, the
+partitions are mounted according to this information. Here's an
+example:
+<example>
+demohost:~# df
+Filesystem      1K-blocks      Used Available Use% Mounted on
+rootfs            4099064    414088   3645296  11% /
+udev                10240        76     10164   1% /dev
+192.168.1.250:/srv/fai/nfsroot
+                  3905600    410976   3454944  11% /live/image
+aufs              4099064    414088   3645296  11% /
+tmpfs              193464         0    193416   0% /live
+tmpfs              193464      3112    190352   2% /live/cow
+faiserver:/srv/fai/config
+                  3905600    410976   3454944  11% /var/lib/fai/config
+/dev/sda1          241116     74519    154149  33% /target
+/dev/sda9         4364212    139888   4179988   4% /target/home
+/dev/sda7          553376     16840    536536   4% /target/tmp
+/dev/sda8         2221628    275936   1832840  14% /target/usr
+/dev/sda6          577096    172924    374856  32% /target/var
+aufs               193464      2376    191243   2% /target/dev
+</example>
+
+<strong>This method can be used as a rescue environment!</strong> In the
+future it will be possible to make backups or restore data to existing
+file systems. If you need a file system with read-write access use the
+<prgn>rwmount</prgn> command:
+
+<example>demohost:~# rwmount /target/home</example> 
+
+<sect id=checkbootp>Checking parameters from BOOTP and DHCP servers<p>
+
+If the install client boots with action <em>sysinfo</em>, you can also
+check if all information from the BOOTP or DHCP daemons are received
+correctly. The received information is written to
+<file>/tmp/fai/boot.log</file>. An example of the result of a DHCP
+request can be found in <ref id="s1">.
+
+
+<sect id=reboot>Rebooting the computer<p>
+At any time you can reboot the computer using the command
+<prgn>faireboot</prgn>, also if logged in from remote. If the
+installation hasn't finished, use <tt>faireboot -s</tt>, so the log
+files are also copied to the install server.
+
+<chapt id=instprocess>Overview of the installation sequence<p>
+
+The following tasks are performed during an installation after the Linux kernel
+has booted on the install clients.
+
+<enumlist>
+	    <item> <p>Set up FAI </p> </item>
+	    <item> <p>Define classes</p> </item>
+	    <item> <p>Define variables</p> </item>
+	    <item> <p>Partition local disks</p> </item>
+	    <item> <p>Create and mount local file systems</p> </item>
+	    <item> <p>Install software packages</p> </item>
+	    <item> <p>Call site specific configuration scripts</p> </item>
+	    <item> <p>Save log files</p> </item>
+	    <item> <p>Reboot the new installed system</p> </item>
+	  </enumlist>
+    <!--MT: debconf, update base missing-->
+
+You can also define additional programs or scripts
+which will be run on particular
+occasions. They are called <tt>hooks</tt>. Hooks can add additional
+functions to the installation process or replace the default subtasks
+of FAI. So it's very easy to
+customize the whole installation process. Hooks are explained in
+detail in <ref id="hooks">.
+
+<p>
+The installation time is determined by the amount of software but also
+by the speed of the processor and hard disk. Here are some sample
+times. All install clients have a 100Mbit network card installed.
+Using a 10 Mbit LAN does not decrease the installation time
+considerably, so the network will not be the bottleneck when
+installing several clients simultaneously.
+
+<example>
+Athlon XP1600+    , 896MB,SCSI disk,   1 GB software  6 min
+AMD-K7  500MHz    , 320MB, IDE disk, 780 MB software 12 min
+PentiumPro 200MHz , 128MB, IDE disk, 800 MB software 28 min
+Pentium III 850MHz, 256MB, IDE disk, 820 MB software 10 min
+Pentium III 850MHz, 256MB, IDE disk, 180 MB software  3 min
+</example>
+
+
+<sect id=faimond>Monitoring the installation<p>
+You can monitor the installation of all install clients with the
+command <manref name="faimond" section="8">. All clients check if this
+daemon is running on the install server (or the machine defined by the variable
+<var>monserver</var>. Then, a message is sent when a task starts and
+ends. The fai monitor daemon prints this messages to standard
+output. There's also a graphical frontend available, called
+<prgn>faimond-gui</prgn>.
+
+
+<sect id=bootkernel>Booting the kernel<p>
+The install client receives and loads the kernel and initial RAM disk. The kernel
+boots up and load the RAM disk. It does some hardware detection and
+then tries to figure where the root file system is located. When
+booting from network, this is determined by parameters from additional
+kernel parameters (<tt>root=/dev/nfs</tt> and
+<tt>nfsroot=/srv/fai/nfsroot</tt>). When booting from CD-ROM or USB
+stick the kernel 
+and initial RAM disk probes removable devices and tries to figure out
+where the root file system is located. This may also be a compressed
+file system (using squashfs).
+
+After the root file system is mounted read only, it is made writable
+by mounting a RAM disk via aufs (another unionfs) on top of it. So it's possible for
+programms or daemons to write to files inside a read only mounted file system.
+We are using the package <manref name="live-initramfs" section="7"> to
+mount the nfsroot and to make this file system writable using aufs. The package
+<tt>live-initramfs</tt> is only needed inside the nfsroot and adds
+some initramfs hooks.
+
+
+<sect id=isetup>Set up FAI<p>
+<!--MT: CVS, SVN missing-->
+
+After the install client has booted, only the script
+<file>/usr/sbin/fai</file><footnote><p>Since the root file system on
+the clients is mounted via NFS, <prgn>fai</prgn> is located in
+<file>/srv/fai/nfsroot/live/filesystem.dir/usr/sbin</file> on the install server.</p>
+</footnote> is executed. This is the main script which controls the
+sequence of tasks for FAI. No other scripts in
+<file>/etc/init.d/</file> are executed.
+<p>
+Additional parameters are received from the BOOTP or DHCP
+daemon and the configuration space is
+made available via the configured method (an NFS mount by default) from the install server to <file>$FAI</file>. The
+setup is finished after additional virtual terminals are created and
+the secure shell daemon for remote access is started on demand.
+
+<sect id=iclass>Defining classes, variables and loading kernel modules<p>
+
+Now the script <manref name="fai-class" section="1"> is used to define
+classes. Therefore several scripts in <file>$FAI/class/</file> are
+executed to define classes. All scripts matching <tt>[0-9][0-9]*</tt>
+(they start with two digits)
+are executed in alphabetical order. Every word that these scripts
+print to the standard output are interpreted as class names. 
+Scripts ending in <tt>.source</tt>
+are sourced, so they can define new classes by adding these classes to
+the variable <var>newclasses</var> (see <file>20-hwdetect.source</file> for an
+<!--MT: 20-hwdetect.source does not really use newclasses-->
+example). The output of these scripts is ignored.
+These classes are defined for the
+install client. You can also say this client belongs to these
+classes. A class is defined or undefined and has no value. Only
+defined classes are of interest for an install client. The description
+of all classes can be found in
+<file>/usr/share/doc/fai-doc/classes_description.txt</file>. It is
+advisable to document the job a new class performs. Then, this
+documentation is the base for composing the whole configuration from classes.
+The scripts <prgn>20-hwdetect.source</prgn> loads kernel modules on
+demand.
+The complete description of all these scripts can be found in <ref id="cscripts">.
+
+<p>
+After defining the classes, every file matching <tt>*.var</tt> with a
+prefix which matches a defined class is executed to define variables.
+There, you should define the variable <var>FAI_ACTION</var> and
+others. By default, <var>FAI_ACTION</var> is defined via the command
+<manref name="fai-chboot" section="8">.
+
+
+<sect id=ipartition>Partitioning local disks, creating file systems<p>
+
+For disk partitioning exactly one disk configuration file from
+<file>$FAI/disk_config</file> is selected using classes. This file
+describes how all the local disks will be partitioned, where
+file systems should be created (and their types like ext2, ext3,
+reiserfs), and how they are mounted. It's also possible to preserve
+the disk layout or to preserve the data on certain partitions. 
+
+The old tool for partitioning the hard disks is called
+<prgn>setup_harddisks</prgn>, which uses <prgn>sfdisk</prgn>. The
+format of the configuration file is described in <ref id="diskconfig">.
+With FAI 3.2.8 a new partitioning tool called <manref
+name="setup-storage" section="8"> was added to FAI. It uses <manref
+name="parted" section="8"> for editing the partition table and now has
+support for software RAID and LVM. This tool
+uses a slightly different format for the configuration files in
+<file>disk_config</file>. Read the manual page for a detailed
+description of the new format. The variable <tt>USE_SETUP_STORAGE</tt>
+now determines which tool to use. When set to 1 it uses the new tool
+which is now defined in <file>FAIBASE.var</file> by default.
+
+<p>During the installation process all local file systems are mounted
+relative to <file>/target</file>. For example
+<file>/target/home</file> will become <file>/home</file> in the
+new installed system.
+
+<sect id=ipackages>Installing software packages<p>
+
+When local file systems are created, they are all empty (except for
+preserved partitions). Now the Debian base system and all requested
+software packages are installed on the new file systems. First the
+base archive is unpacked, then the command
+<manref name="install_packages" section="8"> installs all packages using <manref
+name="apt-get" section="8"> or <manref name="aptitude" section="1">
+without any manual interaction needed. If a packages requires another
+package, both commands resolve this dependency by installing the
+required package.
+<p>
+
+Classes are also used when selecting the configuration files in
+<file>$FAI/package_config/</file> for software installation. The
+format of the configuration files is described in <ref
+id="packageconfig">.
+
+<sect id=icscripts>Site specific configuration<p>
+
+After all requested software packages are installed, the system is
+nearly ready to go. But not all default configurations of the software
+packages will meet your site-specific needs. So you can call arbitrary
+scripts which adjust the system configuration. Therefore scripts which
+match a class name in <file>$FAI/scripts</file> will be executed. If
+<file>$FAI/scripts/</file><var>classname/</var> is a directory, all
+scripts that match <tt>[0-9][0-9]*</tt> in this directory are executed. So
+it is possible to have several scripts of different types (shell,
+cfengine, ...) to be executed for one class. FAI comes with some
+examples for these scripts, but you can write your own Bourne, bash,
+Perl, cfengine or expect scripts.
+<p>
+More information about these scripts are described in <ref id="cscripts">.
+
+<sect id=isavelog>Save log files<p>
+
+When all installation tasks are finished, the log files are written to
+<tt>/var/log/fai/$HOSTNAME/install/</tt> <footnote>
+<p><file>/var/log/fai/localhost/install/</file> is a link to this
+directory.</p> </footnote> on the new system and to the account on the
+install server if <var>$LOGUSER</var> is defined in &fc;. It is also
+possible to specify another host as log saving destination through
+the variable <var>$LOGSERVER</var>. If <var>LOGSERVER</var> is not
+defined, FAI uses the variable <var>SERVER</var> which is only defined
+during an initial installation (by get-boot-info). Make sure to set
+<var>LOGSERVER</var> in a <tt>class/*.var</tt> script if you are using
+the action <tt>softupdate</tt>.
+
+ Additionally, two symlinks will
+be created to indicated the last directory written to.
+By default log files will be copied to the log server using scp.
+
+<p>
+You can use other methods to save logs to the remote server. The currently
+selected method is defined by the <var>$FAI_LOGPROTO</var> variable in 
+file &fc;:
+<taglist>
+ <tag>rsh</tag> <item><p>Use the rcp command to copy the log files to
+ the log server.</p></item>
+
+ <tag>ftp</tag><item><p>
+  This option saves logs to the remote FTP server defined by the
+  <var>$LOGSERVER</var> variable (<var>$SERVER</var> value is used if
+  not set). Connection to the FTP server is done as user
+  <var>$LOGUSER</var> using password <var>$LOGPASSWD</var>.  The FTP
+  server log directory is defined in <var>$LOGREMOTEDIR</var>. These
+  variables are also defined in file &fc;. You need write access for
+  the <var>$LOGREMOTEDIR</var> on the FTP server.</p>
+
+  <p> All files in the directory <tt>/tmp/fai</tt> are copied to the
+  FTP server following this example:
+  <tt>ftp://<var>$LOGUSER</var>:<var>$LOGPASSWD</var>@<var>$LOGSERVER</var>/<var>$LOGREMOTEDIR</var>/</tt>.</p>
+  </item>
+ <tag>none</tag> <item><p>Don't save the log file to the install server.</p></item>
+</taglist>
+</p>
+
+<sect id=ireboot>Reboot the new installed system<p>
+
+At last the system is automatically rebooted if "reboot" was added to
+<var>FAI_FLAGS</var>. Normally this should boot the new installed
+system from its second boot device, the local hard disk. To skip
+booting from network card, you can use the command <manref
+name="fai-chboot" section="8"> to enable localboot.
+
+<chapt id=plan>Plan your installation, and FAI installs your plans<p>
+<p>
+Before starting your installation, you should spend a lot of time in
+planning your installation. When you're happy with your installation
+concept, FAI can do all the boring, repetitive tasks to turn your plans
+into reality. FAI can't do good installations if your concept is
+imperfect or lacks some important details. Start planning the
+installation by answering the following
+questions:
+
+<taglist>
+  <tag></tag> <item> <p>Will I create a Beowulf cluster, or do I
+  have to install some desktop machines?</p> </item>
+  <tag></tag> <item> <p>What does my LAN topology look like?</p> </item>
+  <tag></tag> <item> <p>Do I have uniform hardware?
+  Will the hardware stay uniform in the future?</p> </item>
+  <tag></tag> <item> <p>Does the hardware need a special kernel?</p> </item>
+  <tag></tag> <item> <p>How should the hosts be named?</p> </item>
+  <tag></tag> <item> <p>How should the local hard disks be partitioned?</p> </item>
+  <tag></tag> <item> <p>Which applications will be run by the users?</p> </item>
+  <tag></tag> <item> <p>Do the users need a queueing system?</p> </item>
+  <!--MT: what is a queueing system?-->
+  <tag></tag> <item> <p>What software should be installed?</p> </item>
+  <tag></tag> <item> <p>Which daemons should be started, and what
+  should the configuration for these look like?</p> </item>
+  <tag></tag> <item> <p>Which remote file systems should be mounted?</p> </item>
+  <tag></tag> <item> <p>How should backups be performed?</p> </item>
+  <tag></tag> <item> <p>Do you have sufficient power supply?</p> </item>
+  <!--MT: not a problem of using FAI-->
+  <tag></tag> <item> <p>How much heat do the cluster nodes produce and how are
+  they cooled?</p> </item>
+  <!--MT: not a problem of using FAI-->
+</taglist>
+
+You also have to think about user accounts, printers, a mail system, cron jobs,
+graphic cards, dual boot, NIS, NTP, timezone, keyboard layout,
+exporting and mounting directories via NFS and many other things. So,
+there's a lot to do before starting an installation. And remember
+that knowledge is power, and it's up to you to use it. Installation
+and administration is a process, not a product. FAI can't do things
+you don't tell it to do.
+<p>
+But you need not start from scratch. Look at all files and scripts
+in the configuration space. There are a lot of things you can use for
+your own installation.
+
+A good paper with more aspects of building an infrastructure is
+<url id="http://www.infrastructures.org/papers/bootstrap/">
+"Bootstrapping an Infrastructure".
+
+<chapt id=config>Installation details<p>
+
+<sect id=c3>The configuration space<p>
+
+The configuration is the collection of information about how exactly to
+install a computer. The central configuration space for all install
+clients is located on the install server in <file>/srv/fai/config</file>
+and its subdirectories. This will be mounted by the install clients to
+<file>/var/lib/fai/config</file>. It's also possible to receive all the
+configuration data from a <manref name="cvs" section="1">,
+subversion (<manref name="svn" section="1">) or Git (<manref name="git" section="1">) repository.
+The following subdirectories are present and include
+several files:
+
+<taglist>
+	  <tag><tt>class/</tt></tag> <item> <p>Scripts and files to
+	   define classes and variables and to load kernel modules.</p> </item>
+
+	  <tag><tt>disk_config/</tt></tag> <item> <p>Configuration
+	  files for disk partitioning and file system creation.</p> </item>
+
+	  <tag><tt>debconf/</tt></tag> <item> <p>This directory holds
+	  all <manref name="debconf" section="8"> data. The format is
+	  the same that is used by <manref name="debconf-set-selections"
+	  section="8">.</p> </item>
+
+	  <tag><tt>package_config/</tt></tag> <item> <p>File with
+	   lists of software
+	  packages to be installed or removed.</p> </item>
+
+	  <tag><tt>scripts/</tt></tag> <item> <p>Script for local site
+	   customization.</p> </item>
+
+	  <tag><tt>files/</tt></tag> <item> <p>Files used by
+	  customization scripts. 
+	   Most files are located in a subtree structure
+	   which reflects the ordinary directory tree. For example, the
+	   templates for <file>nsswitch.conf</file> are located in
+	   <file>$FAI/files/etc/nsswitch.conf</file> and are named
+	  according to the classes that they should match:
+	  <file>$FAI/files/etc/nsswitch.conf/NIS</file> is the version
+	  of <file>/etc/nsswitch.conf</file> to use for the NIS class.
+          Note that the
+	  contents of the files directory are not automatically copied
+	  to the target machine, rather they must be explicitly
+	  copied by customization scripts using the <manref
+	  name="fcopy" section="8"> command.</p> </item>
+
+	  <tag><tt>files/packages/</tt></tag> <item> <p>
+THE USE OF THIS DIRECTORY IS NOW OBSOLETE.
+</p> </item>
+
+	  <tag><tt>basefiles/</tt></tag> <item> <p> Normally the file
+<file>/var/tmp/base.tgz</file> is extracted on the install client after
+the new file systems are created and before package are
+installed. This is a minimal base image, created right after calling
+debootstrap during the make-fai-nfsroot process on the install
+server. If you want to install another distribution than the nfsroot
+is, you can put a tar file into the subdirectory
+<file>basefiles/</file> and name it after a class. Then the command
+<manref name="ftar" section="8"> is used to extract the tar file based
+on the classes defined. This is done in task <tt>extrbase</tt>.
+</p>
+</item>
+
+	  <tag><tt>hooks/</tt></tag> <item> <p>Hooks are user defined
+	  programs or scripts, which are called during the
+	  installation process. The can extend or replace the default tasks.</p> </item>
+</taglist>
+
+The main installation command <manref name="fai" section="8"> uses all these
+subdirectories in the order listed except for hooks. The FAI package
+contains examples 
+for all these configuration scripts and files in
+<file>/usr/share/doc/fai-doc/examples</file>. Copy the configuration examples
+to the configuration space and start an installation. These files need
+not belong to the root account. You can change their ownership and
+then edit the configuration with a normal user account.
+
+<example>
+# cp -a /usr/share/doc/fai-doc/examples/simple/* /srv/fai/config
+# chown -R fai /srv/fai/config
+</example>
+
+These files contain simple configuration for some example
+hosts. Depending on the host name used, your computer will be
+configured as follows:
+
+<taglist>  
+   <tag>demohost</tag>  <item> <p>A machine which needs only a small
+   hard disk. This machine is configured with network (as DHCP
+   client), and an account demo is created.<p>
+
+   <tag>gnomehost</tag>  <item> <p>A GNOME desktop is installed, and
+   the account demo is created. <p>
+
+   <tag>other host names</tag>  <item> Hosts with other host name will
+   most notably use the classes FAIBASE, DHCPC and GRUB.<p>
+
+</taglist>
+Start looking at these examples and study them. Then change or add
+things to these examples. But don't forget to plan your own
+installation!
+
+<sect id=tasks>The default tasks<p>
+
+After the kernel has booted, it mounts the root file system via NFS
+from the install server and <manref name="init" section="8"> starts the script
+<file>/usr/sbin/fai</file>. This script controls the
+sequence of the installation. No other scripts in
+<file>/etc/init.d/</file> are used.
+<p>
+
+The installation script uses many subroutines, which are defined in
+<file>/usr/share/fai/subroutines</file>, and an operating system specific
+file <footnote><file>/usr/share/fai/subroutines-linux</file> for Linux.</footnote>.
+All important tasks of the
+installation are called via the subroutine <tt>task</tt>
+appended by the name of the task as an option (e.g. <tt>task
+instsoft</tt>). The subroutine <tt>task</tt> calls hooks with prefix
+<em>name</em> if available and then calls the default task (defined as
+<tt>task_<em>name</em></tt> in <file>subroutines</file>). The default
+task and its hooks can be skipped on demand by using the subroutine
+<tt>skiptask()</tt>.<p>
+
+Now follows the description of all default tasks, listed in the order
+they are executed.
+<taglist>
+
+      <tag>confdir</tag> <item><p>The kernel appended parameters define
+variables, the syslog and kernel log daemon are started. The list of
+network devices is stored in <var>$netdevices</var>. Then additional
+parameters are fetched from a DHCP or BOOTP server and also
+additional variables
+are defined. The DNS resolver configuration file is created. 
+<p>
+The location of the configuration space is defined by the variable
+<var>$FAI_CONFIG_SRC</var>. You can use NFS, cvs, svn or git to access the
+configuration space. See section <ref id="isetup"> for how to set the variable.
+<!--MT: there is no info about that at id="isetup"-->
+<!--MT: config is also mounted/checked out in this task-->
+<p>
+After that, the file
+<file>$FAI/hooks/subroutines</file> is sourced if it exists. Using
+this file, you can define your own subroutines or override the
+definition of FAI's subroutines.
+
+    <tag>setup</tag> <item><p>This task sets the system time, all
+      <var>FAI_FLAGS</var> are defined and two additional virtual
+      terminals are opened on demand. A secure shell daemon is started
+      on demand for remote logins.
+
+     <tag>defclass</tag> <item><p>Calls <manref name="fai-class"
+      section="1"> to define classes using scripts and
+      files in <file>$FAI/class</file> and classes from
+      <file>/tmp/fai/additional-classes</file>.</p> </item>
+
+     <tag>defvar</tag> <item><p>Sources all files
+      <file>$FAI/class/*.var</file> for every defined class. If a hook
+      has written some variable definitions to the file
+      <file>/tmp/fai/additional.var</file>, this file is also
+      sourced.</p></item>
+
+      <tag>action</tag> <item><p>Depending on the value of
+      <var>$FAI_ACTION</var> this subroutine decides which action FAI
+      should perform. The default available actions are:
+      <tt>sysinfo</tt>, <tt>install</tt> and <tt>softupdate</tt>.
+      If <var>$FAI_ACTION</var>
+      has another value, a user defined action is called if a file
+      <file>$FAI/hooks/$FAI_ACTION</file> exists. So you
+      can easily define your own actions.<p>
+
+
+      <tag>sysinfo</tag> <item><p>Called when no installation is
+      performed but the action is <tt>sysinfo</tt>. It shows information
+      about the detected hardware and mounts the local hard disks read
+      only to <file>/target/<var>partitionname</var></file> or with regard to a
+      <file>fstab</file> file found inside a partition. Log files are
+      stored to the install server.</p> </item> 
+
+     <tag>install</tag> <item><p>This task controls the installation
+     sequence. You will hear three beeps before the installation
+     starts. The major work is to call other tasks and to save the
+     output to <file>/tmp/fai/fai.log</file>. If you have any problems
+     during installation, look at all files in
+     <file>/tmp/fai/</file>. You can find examples of the log files
+     for some hosts in the download directory of the FAI homepage.</p>
+     </item>
+
+     <tag>softupdate</tag> <item>This task, executed inside a running 
+     system via the <manref name="fai" section="8"> command line interface, performs a softupdate.
+     See chapter <ref id=softupdate> for details. </item>
+
+     <tag>partition</tag> <item><p>Calls <prgn>setup_harddisk</prgn>
+      or <prgn>setup-storage</prgn>
+      to partition the hard disks and to create file systems. The task writes variable
+      definitions for the root and boot partition and device (<var>$ROOT_PARTITION,
+      $BOOT_PARTITION, $BOOT_DEVICE</var>) to
+      <file>/tmp/fai/disk_var.sh</file> and creates an <file>fstab</file> file.</p></item>
+      <tag>mountdisks</tag> <item><p>Mounts the created partitions
+      according to the created <file>/tmp/fai/fstab</file> file relative to
+      <var>$FAI_ROOT</var>.</p> </item>
+
+      <tag>extrbase</tag> <item><p>Extracts a minimal system after
+      that a chroot can be made into it. By default the base tar file
+      <file>/var/tmp/base.tgz</file> will be extracted. The command
+      <tt>ftar -1v -s $FAI/basefiles /</tt> is used for unpacking a
+      different tar file depending on classes defined. This can be
+      used for installing different Linux distributions than the one
+      used for creating the nfsroot. The default file
+      <file>base.tgz</file> is a snapshot of a basic Debian system created
+      by <manref name="debootstrap" section="8"></p> </item>
+
+      <tag>mirror</tag> <item><p>If a local Debian mirror is accessed via NFS
+      (when <var>$FAI_DEBMIRROR</var> is defined), this directory will
+      be mounted to <var>$MNTPOINT</var>.</p> </item>
+
+      <tag>debconf</tag> <item><p>Calls <manref name="fai-debconf"
+      section="8"> to set the values for the debconf database.</p> </item>
+
+      <tag>prepareapt</tag> <item><p>Set up resolv.conf and some
+      other files, for the next task updatebase.</p> </item>
+
+      <tag>updatebase</tag> <item><p>Updates the base packages of the
+      new system and updates the list of
+      available packages. It also fakes some commands (called diversions) inside
+      the new installed system using <manref name="dpkg-divert"
+      section="8">.</p>
+      </item>
+
+      <tag>instsoft</tag> <item><p>Installs the desired software
+      packages using class files in
+      <file>$FAI/package_config/</file>.</p> </item>
+
+	<tag>configure</tag> <item><p>Calls scripts in
+      <file>$FAI/scripts/</file> and its subdirectories for every
+      defined class.</p> </item>
+
+      <tag>finish</tag> <item><p>Unmounts all file systems in the
+      new installed system and removes diversions of files
+      using the command <prgn>fai-divert</prgn>.</p></item>
+
+      <tag>chboot</tag> <item><p>Changes the PXE configuration for a
+      host on the install
+      server which indicates which kernel image to load on the next
+      boot from network card via TFTP. Therefore the
+      <manref name="fai-chboot" section="8"> command is executed
+      remotely on the install server.</p> </item>
+
+      <tag>savelog</tag> <item><p>Saves log files to local disk and to
+      the account <var>$LOGUSER</var> on <var>$LOGSERVER</var> (defaults to
+      the install server). Currently the file <file>error.log</file>
+      will not be copied to the log server.</p> </item>
+      <!--MT: why is error.log not copied?-->
+
+      <tag>faiend</tag> <item><p>Wait for background jobs to finish
+      (e.g. emacs compiling lisp files) and automatically reboots the install
+      clients or waits for manual input before reboot.</p> </item>
+ </taglist>
+
+
+<sect id=s1>The setup routines of the install clients<p>
+
+After the subroutine <prgn>fai_init</prgn> has done some basic
+initialization (create RAM disk, read <file>fai.conf</file> and all
+subroutines definitions, set path, print copyright notice), the setup
+continues by calling the task <tt>confdir</tt> and the task
+<tt>setup</tt>. The command <prgn>get-boot-info</prgn> is called to
+get all information from the BOOTP or DHCP server. This command writes
+the file <file>/tmp/fai/boot.log</file>, which then is sourced to
+define the corresponding global variables. This is an example for this
+log file when using a DHCP server.
+
+&bootlog;
+
+Additional information is passed via the kernel command line or read
+from &fc;. When booting with PXE, command line parameters are created using <manref
+name="fai-chboot" section="8">. 
+
+If you do not boot from network card but from CD-ROM or USB stick, you
+may also give network parameters to the kernel via the kernel command
+line. Two interesting parameters are
+
+ <example>nfsroot=[&lt;server-ip&gt;:]&lt;root-dir&gt;[,&lt;nfs-options&gt;]</example>
+
+ <example>ip=&lt;client-ip&gt;:&lt;server-ip&gt;:&lt;gw-ip&gt;:&lt;netmask&gt;:&lt;hostname&gt;:&lt;device&gt;:&lt;autoconf&gt;</example>
+Those parameters are described in the documentation of the Linux
+kernel sources in <file>/usr/src/linux/Documentation/nfsroot.txt</file>. 
+
+The variable <var>$FAI_FLAGS</var>
+contains a space separated list of flags. The following flags are
+known:
+<taglist>
+ <tag>verbose</tag> <item> <p>Create verbose output during
+ installation. This should always be the first flag, so consecutive
+ definitions of flags will be verbosely displayed.</p> </item>
+
+ <tag>debug</tag> <item> <p>Create debug output. No unattended
+ installation is performed. During package installation you have to
+ answer all questions of the postinstall scripts on the
+ client's console. A lot of debug information will be printed
+ out. This flag is only useful for FAI developers.</p> </item>
+
+ <tag>sshd</tag> <item> <p>Start the ssh daemon to enable remote
+ logins.</p> </item>
+
+  <tag>createvt</tag> <item> <p>Create two virtual terminals and
+  execute a bash if <tt>ctrl-c</tt> is typed in the console
+  terminal. The additional terminals can be accessed by typing
+  <tt>Alt-F2</tt> or <tt>Alt-F3</tt>. Otherwise no terminals are
+  available and typing <tt>ctrl-c</tt> will reboot the install
+  client. Setting this flag is useful for debugging. If you want an
+  installation which should not be interruptible, do not set this
+  flag.</p> </item>
+
+ <tag>reboot</tag> <item> <p>Reboot the install client after installation
+ is finished without typing RETURN on the console. This is only useful if you can
+ change the boot image or boot device automatically or your assembly robot
+ can remove the boot floppy via remote control :-)
+ Currently this should only be used when
+ booting from network card.</p> </item>
+</taglist>
+
+
+<sect id=classc> The class concept<p>
+<!--MT: as marked above, this section should be put in chapter 1-->
+
+Classes determine which configuration file to choose from a list of
+available templates. Classes are used in all further tasks of the
+installation. To determine which config file to use, an install
+client searches the list of defined classes and uses all
+configuration files that match a class name. It's also possible to use
+only the configuration file with the highest priority since the order
+of classes define the priority from low to high. There are some
+predefined classes (DEFAULT, LAST and the host name), but classes can
+also be listed in a file or defined dynamically by scripts. So it's
+easy to define a class depending on the subnet information or on some
+hardware that is available on the install client.
+<p>
+The idea of using classes in general and using certain files matching
+a class name for a configuration is adopted from the installation
+scripts by Casper Dik for Solaris. This technique proved to be very
+useful for the SUN workstations, so I also use it for the fully
+automatic installation of Linux. One simple and very efficient feature
+of Casper's scripts is to call a command with all files (or on the
+first one) whose file
+names are also a class. The following loop implements this function
+in pseudo shell code:
+
+<example>
+   for class in $all_classes; do
+   if [ -r $config_dir/$class ]; then
+      your_command $config_dir/$class
+      # exit if only the first matching file is needed
+   fi
+   done
+</example>
+Therefore it is possible to add a new file to
+the configuration without changing the script. This is because the
+loop automatically detects new configuration files that should be
+used. Unfortunately cfengine does not support this nice feature, so
+all classes being used in cfengine also need to be specified inside
+the cfengine scripts. Classes are very important for the fully
+automatic installation. If a client belongs to class <tt>A</tt>, we
+say the class <tt>A</tt> is defined. A class has no value, it is just
+defined or undefined. Within scripts, the variable <var>$classes</var>
+holds a space separated list with the names of all defined classes.
+Classes determine how the installation is performed. For example, an
+install client can be configured to become an FTP server by just adding
+the class <tt>FTP</tt> to it.
+
+Mostly a configuration is created by only changing or appending the
+classes to which a client belongs, making the installation of a new
+client very easy. Thus no additional information needs to be added to
+the configuration files if the existing classes suffice for your needs.
+There are different possibilities to define classes:
+<enumlist>
+     <item><p>Some default classes are defined for every host:
+     DEFAULT, LAST and its host name.</p> </item>
+     <item><p>Classes may be listed within a file.</p> </item>
+     <item><p>Classes may be defined by scripts.</p> </item>
+ </enumlist>
+
+The last option is a very nice feature, since these scripts will
+define classes automatically. For example, several classes are
+defined only if certain hardware is identified. We use Perl and shell
+scripts to define classes. All names of classes, except the host name,
+are written in uppercase. They must not contain a hyphen, a hash or a
+dot, but may contain underscores. A description of all classes can be
+found in <file>/usr/share/doc/fai-doc/classes_description.txt</file>.
+<p>
+
+host names should rarely be used for the configuration files in the
+configuration space. Instead, a class should be defined and
+then added for a given host. This is because most of the time the
+configuration data is not specific for one host, but can be shared
+among several hosts.
+
+<sect id=s2> Defining classes<p>
+
+The task <em>defclass</em> calls the script <manref
+name="fai-class" section="1"> to define classes. Therefore, scripts
+matching <tt>[0-9][0-9]*</tt> in <tt>$FAI/class</tt> are
+executed. Additionally, a file with the host name may contain a list of
+classes. 
+For more information on defining class, read the manual pages for <manref
+name="fai-class" section="1">. <p>
+
+The list of all defined classes is stored in the variable
+<var>$classes</var> and saved to
+<file>/tmp/fai/FAI_CLASSES</file>. The list of all classes is
+transferred to <prgn>cfengine</prgn>, so it can use them too. The
+script <file>10-base-classes</file> (below is a stripped version) is used to
+define classes depending on the host name. First this script defines
+the class with the name of the hardware architecture in uppercase
+letters. 
+<example>
+# cat 10-base-classes
+
+# echo architecture and OS name in upper case. Do NOT remove these two lines
+uname -s | tr '[:lower:]' '[:upper:]'
+dpkg --print-installation-architecture | tr /a-z/ /A-Z/
+
+[ -f /etc/RUNNING_FROM_FAICD ] && echo "FAICD"
+
+# use a list of classes for our demo machine
+case $HOSTNAME in
+    demohost)
+        echo "FAIBASE GRUB DHCPC DEMO" ;;
+    gnomehost)
+        echo "FAIBASE GRUB DHCPC DEMO XORG GNOME";;
+    *)
+        echo "FAIBASE GRUB DHCPC" ;;
+esac
+</example>
+
+The script <tt>20-hwdetect.source</tt> uses the default Debian commands
+to detect hardware and to load some kernel modules. If
+some specific hardware is found, it can also define a new class for it.
+You can find messages from modprobe in <file>/tmp/fai/kernel.log</file> and
+on the fourth console terminal by pressing <tt>Alt-F4</tt>.<p>
+
+<sect id=classvariables> Defining variables<p>
+
+The task <tt>defvar</tt> defines the variables for the install
+client. Variables are defined by scripts in
+<tt>class/*.var</tt>. All global variables can be set in
+<file>DEFAULT.var</file>. For certain groups of hosts use a class file
+or for a single host use the file
+<var>$HOSTNAME</var><tt>.var</tt>. Also here, it's useful to study all
+the examples.
+
+The following variables are used in the examples and may also be useful
+for your installation:
+
+<taglist>
+   <tag>FAI_ACTION</tag> <item> <p>Set the action fai should
+   perform. Normally this is done by <manref name="fai-chboot"
+  section="8">. If you can't use this command and are not using a
+   BOOTP server, define it in the script <file>LAST.var</file>.
+
+   <tag>CONSOLEFONT</tag> <item> <p>Is the font which is loaded during
+   installation by <manref name="consolechars" section="8">.</p> </item>
+
+   <tag>KEYMAP</tag> <item> <p>Defines the keyboard map files in
+   <file>/usr/share/keymaps</file> and <file>$FAI/files</file>. You
+   need not specify the complete path, since this file will be located
+   automatically.</p> </item>
+
+   <tag>ROOTPW</tag> <item> <p>The encrypted root password for the new
+   system. You can use <manref name="crypt" section="3"> or md5
+   encryption for the password.</p> </item>
+
+   <tag>UTC</tag> <item> <p>Set hardware clock to UTC if
+   <tt>$UTC=yes</tt>. Otherwise set clock to local time. See <manref
+   name="clock" section="8"> for more information.</p> </item>
+
+   <tag>TIMEZONE</tag> <item> <p>Is the file relative to
+   <file>/usr/share/zoneinfo/</file> which indicates your time
+   zone.</p> </item>
+
+   <tag>MODULESLIST</tag> <item> <p>Can be a multi line
+   definition. List of modules (including kernel parameters) which are
+   loaded during boot of the new system (written to /etc/modules).</p>
+   </item>
+
+   <tag>USE_SETUP_STORAGE</tag> <item> <p>If set to one (the default
+   when using the class <tt>FAIBASE</tt> the new partitioning tool <manref
+   name="setup-storage" section="8"> will be used. Otherwise the old 
+   <prgn>setup_harddisks</prgn> program is used.</p>
+   </item>
+
+</taglist>
+
+<sect id=diskconfig>Hard disk configuration<p> 
+This section describes the old format of the configuration files in <tt>disk_config</tt>.
+Read the manual page of <manref name="setup-storage" section="8"> for a detailed
+description of the new format.
+<p>
+
+The script <prgn>setup_harddisks</prgn> partitions and formats
+the local disks. It uses all configuration files in
+<file>$FAI/disk_config/</file> which are also defined as classes.
+Lines beginning with # are comments. The config file
+<file>$FAI/disk_config/FAIBASE</file> is a generic description for
+one hard disk (IDE or SCSI), which most installations should be able to adapt. If you
+can't partition your hard disk using this script <footnote><p>Currently
+this script uses the command <tt>sfdisk(8)</tt>, which isn't available
+on SUN SPARC, IA64 and PowerPC.</p> </footnote>, use a hook instead. The hook should
+write the new partition table, create the file systems and create the
+files <file>/tmp/fai/fstab</file> and <file>/tmp/fai/disk_var.sh</file>, which
+contains definitions of boot and root partitions.
+
+<p>
+The following example is a configuration for the first IDE disk <tt>disk1</tt>
+and for the second SCSI disk <tt>disk2</tt> The numbering of the disks comes
+from the order in <file>/proc/partitions</file>.
+
+<example>
+# &lt;type&gt; &lt;mount point&gt; &lt;size in MB&gt; [mount options]  [;extra options]
+
+disk_config disk1
+
+primary   /          200        defaults,errors=remount-ro
+logical   /home      100-300
+logical   /scratch1  10-        defaults,nosuid ; -i 15000 -m 0
+
+
+disk_config disk2
+
+primary   /tmp       300-500    rw                ;ext2
+primary   /backup    preserve2  rw
+logical   swap       50-100
+logical   /scratch2  100-300    rw                ;-m 30
+logical   -          preserve7
+logical   /var       100                          ;-j
+logical   /var/tmp   preserve9                    ;format
+primary   /tmp/mytmp -300
+</example>
+
+Every disk configuration starts with the command <tt>disk_config</tt>
+followed by <tt>diskX</tt> where <tt>X</tt> is the number of the HDD. The
+Linux device names <file>/dev/hda</file> and <file>/dev/sda</file>
+correspond to <tt>disk1</tt>, <tt>disk2</tt> corresponds to
+<file>/dev/hdb</file> and <file>/dev/sdb</file> and so on.
+<p>
+After <tt>disk_config</tt> one line containing the type, mount point
+and size is added for each partition on the hard disk. Mount options
+and additional parameters for <prgn>mke2fs</prgn> -- separated from
+the mount options by a semicolon -- can be added.
+
+<taglist>
+  <tag>Type</tag> <item> <p>There are two types of partitions: primary
+  and logical. Primary partitions are bootable, but there is a maximum
+  of four primary partitions on each disk. The Linux root file system
+  must be of this type.
+  <p>
+  All other partitions are called logical. Because logical partitions
+  are gathered internally in one big primary partition, only three
+  primary partitions can be used if logical partitions are defined.
+  Normally only one primary partition for the root file system is
+  created and all others are logical, like <tt>disk1</tt> in the example above.
+
+  <tag>Mount point</tag> <item> <p> The mount point is the full path
+  (beginning with a slash) for the file system. The value <tt>swap</tt>
+  defines a Linux swap partition.  Both types will be automatically
+  added to <file>/etc/fstab</file>.  A dash (<tt>-</tt>) indicates that
+  the partition will not be mounted and can be used for other types of
+  file systems (FAT, NTFS, UFS, MINIX, ...)
+
+  <tag>Size</tag> <item> <p> This is the size of the partition in
+  megabytes. This value is rounded up to fit to a cylinder
+  number. There are several ways of defining the size:
+  <example>
+	"200" means about 200MB, no more no less
+	"100-300" sets a 100MB minimum and a 300MB maximum
+	"10-" sets a minimum of 10MB and a maximum of the disk size
+	"-300" sets a minimum of 1MB and a 300MB maximum
+  </example>
+  <p>
+  By default, a new file system (currently of type ext2 or swap) will be
+  created, and all data on the partition is lost.  The meaning of
+  <tt>preserve&lt;no&gt;</tt> will be described later.
+  <p>
+  Calculating the partition size:
+  If an interval is defined for several partition sizes, the script
+  maximizes the values by preserving the ratio between them.
+
+
+  <tag>Mount options</tag> <item> <p>The mount options will be copied
+  to <file>/etc/fstab</file>. An empty field sets the option to
+  <tt>defaults</tt> (see <manref name="mount" section="8">).
+
+
+  <tag>Extra options</tag> <item> <p>The last field is a space
+  separated extra options list. The following options are known:
+  <example>
+boot         : Make this partition the boot-partition (the
+               Linux root file system is the default).
+-i &lt;bytes&gt;   : bytes per inode (ext2/3 only)
+-m &lt;blocks&gt;  : reserved blocks percentage (ext2/3 only)
+-j           : Create the file system with an ext3 journal.
+-c           : Check for bad blocks.
+ext2         : Flag as ext2 instead of auto in /etc/fstab.
+ext3         : Flag as ext3 instead of auto in /etc/fstab.
+swap         : swap partition
+dosfat16     : DOS 16 bit FAT file system
+winfat32     : Win95 FAT32 file system
+reiser       : Create a ReiserFS file system, not an ext2.
+xfs          : XFS
+format       : Always format even if preserve is specified.
+writable     : Mounts a preserved partition writable.
+lazyformat   : Do not format if partition has not moved.
+  </example>
+  <p>
+  The order of the extra options is not relevant. For more information
+  see <manref name="mke2fs" section="8">.
+  <p>
+  Thus, we have the following interactions between <tt>-j</tt>,
+  <tt>ext2</tt> and <tt>ext3</tt> :
+  <example>
+&lt;no option&gt; : An ext2 fs flagged as auto in the fstab
+-j          : An ext3 fs flagged as auto in the fstab.
+ext2        : An ext2 fs flagged as ext2 in the fstab.
+-j ext2     : An ext3 fs flagged as ext2 in the fstab.
+-j ext3     : An ext3 fs flagged as ext3 in the fstab.
+ext3        : An ext2 fs flagged as ext3 in the fstab. !!BAD!!
+  </example>
+  <p>
+  Using <tt>auto</tt> in the fstab for ext3 file systems enables a
+  non-ext3-enabled kernel or tool to cope with these partitions.
+</taglist>
+
+<p>
+It is possible to preserve the size and even the existing
+data on a partition. To preserve only the
+partition size, the number of the partition must be unchanged and the
+size must be specified as <tt>preserve&lt;no&gt;</tt> The number
+<tt>&lt;no&gt;</tt> is the device number (as in <file>/dev/hda&lt;no&gt;</file>,
+or see the output of <prgn>df</prgn>) of the partition. Primary partitions
+are numbered from one to four, the numbers for logical partitions
+begin at five.
+<p>
+Problems were reported (February 2003) when using more than two primary
+partitions and trying to preserve a logical partition. If you have
+this problem, try to use only two primary partitions.
+<p>
+In the following example, the partition numbers (= device number) are also
+shown for disk <tt>disk2</tt>:
+
+<example>
+primary   /tmp        300-500     #  1
+primary   /backup     preserve2   #  2
+logical   swap        50-100      # (3)   5
+logical   /scratch2   100-300     # (3)   6
+logical   -           preserve7   # (3)   7
+logical   /var        100         # (3)   8
+logical   /var/tmp    preserve9   # (3)   9
+primary   /tmp/mytmp  -300        #  4
+</example>
+
+<p>
+The first two partitions are of type primary, so they get the numbers
+1 and 2. The logical partitions start at 5 and the last gets number
+9. All logical partitions define the primary partition 3, but this
+number is not used. So if you want to preserve <file>/dev/hda7</file>
+you have to insert a minimum of two logical partitions before it.
+
+<p>
+Lazyformating partitions is another method to preserve partitions
+after they were formatted once. This is useful to design systems
+which can be reinstalled without loosing data on partitions like
+<file>/home</file> or <file>/var/log</file> or
+<file>/var/lib/mysql</file> or whatever. You can even lazyformat
+the swap partition to gain a minor installation speed improvement
+after the first installation!
+
+<p>
+If you have a separate <file>/boot</file> partition, you must add the
+extra option <tt>boot</tt> to make it your boot partition. Otherwise
+your system will not be bootable. By default (if no boot option was
+specified) the root partition (<file>/</file>) will become the boot
+partition. <prgn>setup_harddisks</prgn> will write some variables
+containing the information about boot partition and boot device to
+<file>/tmp/fai/disk_var.sh</file>.
+<!--MT: I think you did not say how to preserve data-->
+
+<sect id=packageconfig>Software package configuration<p>
+<!--MT: This section is pretty much a chaos:
+  - which commands belong to which package tools
+  - you say something about PRELOADRM and PRELOAD commands, but give no example
+    and don't list them otherwise
+-->
+The script <manref name="install_packages" section="8"> installs the selected software
+packages. It uses all configuration files in <file>$FAI/package_config</file>
+whose file name matches a defined class. The syntax is very
+simple.
+
+<example>
+# an example package class
+
+PACKAGES taskinst
+german 
+
+PACKAGES aptitude
+adduser netstd ae
+less passwd
+
+PACKAGES remove
+gpm xdm
+
+PACKAGES aptitude GRUB
+lilo- grub
+
+PACKAGES dselect-upgrade
+ddd                     install
+a2ps                    install
+</example>
+
+Comments are starting with a hash (#) and are ending at the end of
+the line. Every command begins with the word <tt>PACKAGES</tt>
+followed by a command name. The command defines which command will be
+used to install the packages named after this command. The list of all
+available commands can be listed using <tt>install_packages -H</tt>.
+Supported package tools are: <tt>aptitude, apt-get, smart, y2pmsh,
+yast, yum, urpm, rpm</tt>
+
+<taglist>
+<tag>hold:</tag> <item> <p>Put a package on hold. This package will
+not be handled by dpkg, e.g not upgraded.</p> </item>
+
+<tag>install:</tag> <item> <p>Install all packages that are specified
+in the following lines. If a hyphen is appended to the package name
+   (with no intervening space), the package will be removed, not
+   installed. All package names are checked for misspellings. 
+Any package which does not exist, will be removed from the list of
+packages to install. So be careful not to misspell any package names.</p> </item>
+
+<tag>remove:</tag> <item> <p>Remove all packages that are specified in
+the following lines. Append a + to the package name if the package
+should be installed.</p> </item>
+
+<tag>taskinst:</tag> <item> <p>Install all packages belonging to the
+tasks that are specified in the following lines using <manref
+name="tasksel" section="1">. You can also use <tt>aptitude</tt> for
+installing tasks.</p> </item>
+
+<tag>aptitude:</tag> <item> <p>Install all packages with
+the command <prgn>aptitude</prgn>. This will be the default in the future
+and may replace apt-get and taskinst. Aptitude can also install task
+packages.</p> </item>
+
+<tag>aptitude-r:</tag> <item> <p>Same as aptitude with option
+<tt>--with-recommends</tt>.
+
+<tag>unpack:</tag> <item> <p>Download package and unpack only. Do not
+configure the package.
+
+<tag>dselect-upgrade</tag> <item> <p> Set package selections using the
+following lines and install or remove the packages specified. These
+lines are the output of the command <tt>dpkg --get-selections</tt>.
+</taglist>
+
+
+Multiple lines with lists of space separated names of packages follow
+the PACKAGES lines. All dependencies are resolved. Packages with
+suffix <tt>-</tt> (eg. <tt>lilo-</tt>) will be removed instead of
+installed. The order of the packages is of no matter.
+If you like to install packages from another release than the default,
+you can append the release name to the package name like in
+<tt>openoffice.org/etch-backports</tt>. You can also specify a certain
+version like <tt>apt=0.3.1</tt>. More information on these features
+are described in <manref name="aptitude" section="8">.
+<p>
+
+A line which contains the <tt>PRELOADRM</tt> commands, downloads a
+file using <manref name="wget" section="1"> into a directory before
+installing the packages. Using the <tt>file:</tt> URL, this file is copied
+from <var>$FAI_ROOT</var> to the download directory.
+For example the package
+<prgn>realplayer</prgn> needs an archive to install the software, so
+this archive is downloaded to the directory <file>/root</file>. After
+installing the packages this file will be removed. If the file
+shouldn't be removed, use the command <tt>PRELOAD</tt> instead.
+
+<p>
+It's possible to append a list of class names after the command for
+apt-get. So this <tt>PACKAGE</tt> command will only be executed when
+the corresponding class is defined. So you can combine many small
+files into the file DEFAULT. WARNING! Use this feature only
+in the file DEFAULT to keep everything simple. See this file for some
+examples.
+
+<p>
+If you want to remove a package name from a certain class was part of
+this class before, you should not remove the package name from the
+class file, but instead append a dash (-) to it. This will make sure
+that the package is remove during a softupdate on hosts which were
+installed using the old class definition which included this package name.
+
+
+<p>
+If you specify a package that does not exist this package will be
+removed from the installation list when the command <tt>install</tt>
+is used.
+
+<sect id=cscripts>Scripts in <tt>$FAI/scripts</tt><p>
+
+The default set of scripts in <file>$FAI/scripts</file> is only an example. But
+they should do a reasonable job for your installation. You can edit them
+or add new scripts to match your local needs.
+<p>
+The command <manref name="fai-do-scripts" section="1"> is called to
+execute all scripts in this directory. If a directory with a class
+name exists, all scripts matching <file>[0-9][0-9]*</file> are executed in
+alphabetical order. So it's possible to use scripts of different
+languages (shell, cfengine, Perl,..) for one class.
+
+<sect1 id=shell>Shell scripts<p>
+
+Most scripts are Bourne shell scripts. Shell scripts are useful if the
+configuration task only needs to call some shell commands or create a
+file from scratch. In order not to write many short scripts, it's
+possible to distinguish classes within a script using the command
+<tt>ifclass</tt>. For copying files with classes, use the command
+<manref name="fcopy" section="8">. If you want to extract an archive
+using classes, use <manref name="ftar" section="8">.
+But now have a look at the scripts and see what they are doing.
+
+<sect1 id=perl>Perl scripts<p>
+Currently no Perl script are used in the simple examples for modifying the system
+configuration.
+
+<sect1 id=expect>Expect scripts<p>
+Currently no expect scripts are used in the simple examples for modifying the system
+configuration.
+
+<sect1 id=cfengine>Cfengine scripts<p>
+
+Cfengine has a rich set of functions to edit existing configuration
+files, e.g <tt>LocateLineMatching, ReplaceAll, InsertLine,
+AppendIfNoSuchLine, HashCommentLinesContaining</tt>. But it can't
+handle variables which are undefined. If a variable is undefined,
+the whole cfengine script will abort. Study the examples that are
+included in the fai package.
+
+More information can be found in the manual page <manref
+name="cfengine" section="8"> or at the cfengine homepage
+<httpsite>www.cfengine.org</httpsite>.
+
+
+<sect id=changeboot>Changing the boot device<p>
+
+Changing the boot sequence is normally done in the BIOS setup. But
+you can't change the BIOS from a running Linux system as far as I
+know. If you know how to perform this, please send me an email. But there's
+another way of swapping the boot device of a running Linux system.
+<!--MT: recently, there has been some discussion on linux-fai, add a link to the
+archives-->
+<p>
+So, normally the boot sequence of the BIOS will remain unchanged and
+your computer should always boot first from its network card and the
+second boot device should be the local disk. Then, it will
+get an install kernel image from the install server, when an
+installation should be performed, or we can tell pxelinux to boot from
+local disk. This is done using <manref name="fai-chboot" section="8">.
+
+Here is how to set up a 3Com network card as first boot device.
+Enable LAN as first boot device in the BIOS.
+
+<example>
+Boot From LAN First: Enabled
+Boot Sequence      : C only
+</example>
+
+Then enter the MBA setup of the 3Com network card and change it as follows:
+<example>
+Default Boot           Local
+Local Boot             Enabled
+Message Timeout        3 Seconds
+Boot Failure Prompt    Wait for timeout
+Boot Failure           Next boot device
+</example>
+
+This will enable the first IDE hard disk as second boot device after
+the network card.
+
+<sect id=hooks>Hooks<p>
+
+Hooks let you specify functions or programs which are run at certain
+steps of the installation process. Before a default task is called,
+FAI searches for existing hooks for this task and executes them. As you
+might expect, classes are also used when calling hooks. Hooks are
+executed for every defined class. You only have to create the hook
+with the name for the desired class and it will be used. 
+If several hooks for a task exists, they are called in the order
+defined by the classes.
+If <tt>debug</tt> is included in <var>$FAI_FLAG</var> the option
+<tt>-d</tt> is passed to all hooks, so you can debug your own hooks.
+If some default tasks should be skipped, use the subroutine
+<tt>skiptask</tt> and a list of default tasks as parameters. The
+example <file>partition.DISKLESS</file> skips some default tasks.
+<p>
+
+
+The directory <file>$FAI/hooks/</file> contains all hooks. The file
+name of a hook consists of a task name as a prefix and a class name,
+separated by a dot. The prefix describes the time when the hook is
+called, if the class is defined for the install client. For example,
+the hook <file>partition.DISKLESS</file> is called for every client
+belonging to the class <tt>DISKLESS</tt> before the local disks would
+be partitioned. If it should become a diskless client, this hook
+can mount remote file systems via NFS and create a <tt>/tmp/fai/fstab</tt>.
+After that, the installation process will not try to partition and
+format a local hard disk, because a file <file>/tmp/fai/fstab</file>
+already exists.
+<p>
+A hook of the form <tt>hookprefix.classname</tt>  can't define
+variables for the installation script, because it's a subprocess. But
+you can use any binary executable or any script you wrote. Hooks that
+have the suffix <tt>.source</tt> (e.g. <file>partition.DEFAULT.source</file>) must
+be Bourne shell scripts and are sourced. So it's possible to
+redefine variables for the installation scripts.
+<p>
+
+In the first part of FAI, all hooks with prefix <tt>confdir</tt> are called.
+Since the configuration directory <file>$FAI</file> is mounted in the
+default task <tt>confdir</tt>, the hooks for this task are the only
+hooks located in <var>$nfsroot</var><file>$FAI/hooks</file> on the
+install server. All other hooks are found in
+<file>$FAI_CONFIGDIR/hooks</file> on the install server.
+<!--MT: what about softupdate?-->
+
+All hooks that are called before classes are defined can only use the
+following classes: <tt>DEFAULT $HOSTNAME LAST</tt>. If a hook for
+class <tt>DEFAULT</tt> should only be called if no hook for class
+<var>$HOSTNAME</var> is available, insert these lines to the default
+hook:
+
+<example>
+hookexample.DEFAULT:
+
+#! /bin/sh
+
+# skip DEFAULT hook if a hook for $HOSTNAME exists
+scriptname=$(basename $0 .DEFAULT)
+[-f $FAI/hooks/$scriptname.$HOSTNAME ] && exit
+# here follows the actions for class DEFAULT
+.
+.
+</example>
+
+
+<p> Some examples for what hooks could be used:
+
+<list>
+<item> <p>Use <prgn>ssh</prgn> in the very beginning to verify that
+you mounted the configuration from the correct server and not a
+possible spoofing host.</p></item>
+
+<item> <p>Do not mount the configuration directory, instead get a
+compressed archive via HTTP and extract it into a
+new RAM disk, then redefine <var>$FAI_LOCATION</var>.</p></item>
+
+<item> <p>Load kernel modules before classes are defined
+in <file>$FAI/class</file>. </p></item>
+
+<item> <p>Send an email to the administrator if the installation is finished.</p></item>
+
+<item> <p>Install a diskless client and skip local disk
+partitioning. See <file>hooks/partition.DISKLESS</file>.</p></item>
+
+<item> <p>Partition the hard disk on an IA64 system, which needs a
+special partition table type that must be created with <manref
+name="parted" section="8">.</p></item>
+</list>
+
+<sect id=errors>Looking for errors<p>
+If the client can't successfully boot from the network card, use
+<manref name="tcpdump" section="8"> to look for Ethernet packets
+between the install server and the client. Search also for entries in
+several log files made by <manref name="tftpd" section="8">,
+<manref name="dhcpd3" section="8"> or <manref name="bootpd" section="8">:
+
+<example>egrep "tftpd|bootpd|dhcpd" /var/log/*</example>
+
+If the installation process finishes, the hook
+<file>savelog.LAST.source</file> searches all log files for common errors and
+writes them to the file <file>error.log</file>. So, you should first
+look into this file for errors. Also the file <file>status.log</file>
+give you the exit code of the last command executed in a script. To be
+sure, you should look for errors in all log files.<p>
+
+Sometimes the installation seems to stop, but often there's only a
+postinstall script of a software package that requires manual input
+from the console. Change to another virtual terminal and look which
+process is running  with tools like <manref name="top" section="1"> and <manref
+name="pstree" section="1">. You can add <tt>debug</tt> to
+<tt>FAI_FLAGS</tt> to make the installation process show all output
+from the postinst scripts on the console and get its input also from the
+console. Don't hesitate to send an email to the mailing list or to
+<email>fai at informatik.uni-koeln.de</email> if you have any
+questions. Sample log files from successfully installed computers are
+available on the FAI homepage.
+
+<chapt id=beowulf>How to build a Beowulf cluster using FAI<p>
+<!--MT: I did not read this chapter-->
+
+This chapter describes the details about building a Beowulf
+cluster using &dgl; and FAI. This chapter was written for FAI
+version 2.x for Debian woody and was not yet updated. The example
+configuration files were removed from the fai packages after FAI 2.8.4.
+
+For more information about the Beowulf
+concept look at <httpsite>www.beowulf.org</httpsite>. 
+
+<sect id=beoplan> Planning the Beowulf setup<p>
+
+The example of a Beowulf cluster consists of one master node and 25
+clients. A big rack was assembled which all the cases were put into. A
+keyboard and a monitor, which are connected to the master server
+most of the time, were also put into the rack. But since we have very long
+cables for a monitor and a keyboard, they can also be connected to all
+nodes if something has to be changed in the BIOS, or when looking for
+errors when a node does not boot. Power supply is another topic you
+have to think about. Don't connect many nodes to one power cord and
+one outlet. Distribute them among several breakout boxes and outlets.
+And what about the heat emission? A dozen nodes in a small room can
+create too much heat, so you will need an air conditioner. Will the
+power supplies of each node go to stand-by mode or are all nodes
+turned on simultaneously after a power failure?
+
+<p>
+All computers in this example are connected to a Fast Ethernet switch. The master node
+(or master server) is called <em>nucleus</em>. It has two network
+cards. One for the connection to the external Internet, one for the
+connection to the internal cluster network. If connected from the
+external Internet, it's called <em>nucleus</em>, but the cluster nodes
+access the master node with the name <em>atom00</em>, which is a name
+for the second network interface. The master server is also the
+install server for the computing nodes. A local Debian mirror will be
+installed on the local hard disk. The home directories of all user
+accounts are also located on the master server. It will be exported via
+NFS to all computing nodes. NIS will be used to distribute account,
+host, and printer information to all nodes.
+
+<p>
+All client nodes <em>atom01</em> to <em>atom25</em> are connected via
+the switch with the second interface card of the master node. They can
+only connect to the other nodes or the master, but can't communicate
+to any host outside their cluster network. So, all services (NTP, DNS,
+NIS, NFS, ...) must be available on the master server. I chose the class C
+network address <em>192.168.42.0</em> for building the local Beowulf
+cluster network. You can replace the subnet 42 with any other number
+you like. If you have more than 253 computing nodes, choose a class A
+network address (10.X.X.X).
+
+<p>
+In the phase of preparing the installation, you have to boot the first
+install client many times, until there's no fault in your configuration
+scripts. Therefore you should have physical access to the master
+server and one client node. So, connect both computers to a switch
+box, so one keyboard and monitor can be shared among both.
+
+<sect id=master> Set up the master server<p>
+
+The master server will be installed by hand if it is your first
+computer installed with Debian. If you already have a host running
+Debian, you can also install the master server via FAI. Create a
+partition on <file>/files/scratch/debmirror</file> for the local
+Debian mirror with more than &mirrorsize; GB space available.
+
+<sect1 id=beonetworkmaster> Set up the network<p>
+
+Add the following lines for the second network card to
+<file>/etc/network/interfaces</file>:
+<example>
+# Beowulf cluster connection
+auto eth1
+iface eth1 inet static
+address 192.168.42.250
+netmask 255.255.255.0
+broadcast 192.168.42.255
+</example>
+
+Add the IP addresses for the client nodes. The FAI package has an
+example for this <file>/etc/hosts</file> file:
+<example>
+# create these entries with the Perl one liner
+# perl -e 'for (1..25) {printf "192.168.42.%s atom%02s\n",$_,$_;}'
+
+# Beowulf nodes
+# atom00 is the master server
+192.168.42.250 atom00
+192.168.42.1 atom01
+192.168.42.2 atom02
+</example>
+
+You can give the internal Beowulf network a name when you add this
+line to <file>/etc/networks</file>:
+<example>beowcluster 192.168.42.0</example>
+
+
+Activate the second network interface with: <tt>/etc/init.d/networking start</tt>.
+
+<sect1 id=beonis> Setting up NIS<p>
+
+Add a normal user account <var>tom</var> which is the person who edits
+the configuration space and manages the local Debian mirror:
+<example># adduser tom
+# addgroup linuxadmin
+</example>
+
+This user should also be in the group <var>linuxadmin</var>.
+<example>
+# adduser tom linuxadmin
+</example>
+
+First set the NIS domainname name by creating the file
+<file>/etc/defaultdomain</file> and call <manref name="domainname" section="8">.
+To initialize the master server as NIS server call <tt>/usr/lib/yp/ypinit -m</tt>.
+Also edit <file>/etc/default/nis</file> so the host becomes a NIS
+master server.
+Then, copy the file <file>netgroup</file> from the examples directory
+to <file>/etc</file> and edit other files there. Adjust access to the
+NIS service.
+
+<example># cat /etc/ypserv.securenets
+# Always allow access for localhost
+255.0.0.0       127.0.0.0
+# This line gives access to the Beowulf cluster
+255.255.255.0 192.168.42.0
+</example>
+
+Rebuild the NIS maps:
+<example># cd /var/yp; make</example>
+
+You will find much more information about NIS in the
+<file>NIS-HOWTO</file> document.
+
+<sect1 id=beomirror> Create a local Debian mirror<p>
+
+Now the user <var>tom</var> can create a local Debian mirror on
+<file>/files/scratch/debmirror</file> using
+<prgn>mkdebmirror</prgn>. You can add the option <tt>--debug</tt> to
+see which files are received. This will
+need about &mirrorsize; GB disk space for Debian 3.0 (aka woody). Export this
+directory to the netgroup <tt>@faiclients</tt> read only.
+Here's the line for <file>/etc/exports</file>
+<p><tt>/files/scratch/debmirror *(ro)</tt>
+
+<sect1 id=fai1> Install FAI package on the master server<p>
+
+Add the following packages to the install server:
+<example>nucleus:/# apt-get install ntp tftpd-hpa dhcp3-server \
+nfs-kernel-server etherwake fai
+nucleus:/# tasksel -q -n install dns-server
+nucleus:/# apt-get dselect-upgrade
+</example>
+Configure NTP so that the master server will have the correct system time.
+
+<p>
+It's very important to use the internal network name <var>atom00</var>
+ for the master server (not the external name <var>nucleus</var>) in
+ <file>/etc/dhcp3/dhcpd.conf</file> and &mfnc;. Replace
+ the strings FAISERVER with <tt>atom00</tt> and uncomment the following line in &mfnc;
+ so the Beowulf nodes can use the name for connecting to their master server.
+<example>
+NFSROOT_ETC_HOSTS="192.168.42.250 atom00"
+</example>
+
+<sect1 id=bootp1> Prepare network booting<p>
+
+Set up the install server daemon as described in <ref
+id="pxeboot">. If you will have many cluster nodes (more than about
+10) and you will use <tt>rsh</tt> in &fc; raise the number of connects
+per minute to some services in <file>inetd.conf</file>:
+<example>
+shell stream tcp  nowait.300  root /usr/sbin/tcpd /usr/sbin/in.rshd
+login stream tcp  nowait.300  root /usr/sbin/tcpd /usr/sbin/in.rlogind
+</example>
+
+The user <var>tom</var> should have permission to create the
+symlinks for booting via network card, so change the group and add
+some utilities.
+
+<example># chgrp -R linuxadmin /srv/tftp/fai; chmod -R g+rwx /srv/tftp/fai
+# cp /usr/share/doc/fai-doc/examples/utils/* /usr/local/bin
+</example>
+
+Now, the user <var>tom</var> sets the boot image for the first beowulf
+node.
+<example>fai-chboot -IFv atom01</example>
+
+Now boot the first client node for the first
+time. Then start to adjust the configuration for your client
+nodes. Don't forget to build the kernel for the cluster nodes using
+<manref name="make-kpkg" section="8"> and store it in <file>/srv/fai/config/files/packages</file>.
+
+<sect id=beotools> Tools for Beowulf clusters<p>
+
+The following tools are useful for a Beowulf cluster:
+
+<taglist>
+	  <tag> all_hosts <item> <p>Print a list of all hosts, print
+	  only the hosts which respond to a ping or the hosts which
+	  do not respond. The complete list of hosts is defined by the
+	  netgroup <tt>allhosts</tt>. Look at
+	  <file>/usr/share/doc/fai-doc/examples/etc/netgroup</file> for an
+	  example.</p></item>
+
+	<tag>rshall<item><p>Execute a command on all hosts which are
+	up via rsh. Uses <prgn>all_hosts</prgn> to get the list of all
+	hosts up. You can also use the <manref name="dsh" section="1">
+	command (dancer's shell, or distributed shell).
+
+	<tag>rup<item><p> The command <manref name="rup" section="1">
+	shows briefly the CPU load of every host.
+
+	<tag>clusterssh<item><p> The package clusterssh allows you to
+	control multiple ssh or rsh sessions at the same time.
+
+</taglist>
+These are some common tools for a cluster environment:
+
+<taglist>
+  <tag>rgang</tag> <item> <p>For a huge cluster try
+  <prgn>rgang</prgn>. It's is a tool which executes commands on or
+  distributes files to many nodes. It uses an algorithm to build a
+  tree-like structure to allow the distribution processing time to
+  scale very well to 1000 or more nodes (available at
+  <httpsite>fermitools.fnal.gov/</httpsite>
+  <httppath>abstracts/rgang/abstract.html</httppath>). </p></item>
+
+  <tag>jmon</tag><item><p>For observing the resources of all
+  clients (CPU, memory, swap,...)  you can use <manref
+  name="jmon" section="1"> which installs a simple daemon on
+  every cluster node. </item>
+
+  <tag>ganglia</tag><item><p>This toolkit is very good for monitoring
+   your cluster with a nice web frontend. Available at
+   <httpsite>ganglia.sourceforge.net/</httpsite> </p> </item>
+
+</taglist>
+
+<sect id=wol> Wake on LAN with 3Com network cards<p>
+
+Wake on LAN is a very nice feature to power on a computer without
+having physical access to it. By sending a special ethernet packet to
+the network card, the computer will be turned on. The following things
+have to be done, to use the wake on LAN (WOL) feature.<p>
+
+<enumlist>
+<item><p>Connect the network card to the Wake-On-LAN connector on the
+motherboard using a 3 pin cable.</p></item>
+ <item><p>My ASUS K7M motherboard has a jumper called
+<tt>Vaux (3VSBSLT)</tt> which allows to select the voltage supplied to add-in
+PCI cards. Set it to <tt>Add 3VSB</tt> (3 Volt stand by).</p></item>
+<item><p>Turn on the wake on LAN feature in BIOS</p></item>
+<item><p>For a 3Com card using the 3c59x driver you must enable the
+WOL feature using the kernel module option <tt>enable_wol</tt>.
+</enumlist>
+
+To wake up a computer use the command <manref name="ether-wake" section="8">.
+Additional information is available from
+<httpsite>www.scyld.com/</httpsite><httppath>expert/wake-on-lan.html</httppath>.
+
+<chapt id=arch>FAI on other architectures and distributions<p>
+If you want to use FAI on other architectures than i386 or amd64 you might need
+to take care of some things yourself.
+
+These are things that may have to be changed on other architectures:
+
+<taglist>
+   <tag> Boot loader: <item> <p> There are scripts for setting up
+ <manref name="lilo" section="8"> and <manref name="grub" section="8">. Here you may
+   add support for your specific boot loader.
+</taglist>
+
+If you want to serve multiple nfsroot directories on one FAI server,
+you need to create specific config directories in <file>/etc</file>
+for fai, like <file>/etc/fai-sarge</file> and
+<file>/etc/fai-etch</file>. Then you need to set the
+<var>NFSROOT</var> variables to different directories and run
+<tt>make-fai-nfsroot -c /etc/fai-sarge</tt>.
+
+<sect id=powerpc>FAI on PowerPC<p>
+There's some stuff on <httpsite>www.layer-acht.org</httpsite><httppath>/fai</httppath>. 
+Most notably there are hooks for partitioning and config-files to 
+setup bootloaders for oldworld and newworld. 
+
+<sect id=ia64>FAI on IA64<p>
+There's one big IA64 Beowulf cluster running which was installed with
+FAI. Only the partitioning part has to be replaced by a short script,
+since sfdisk is not available on IA64. This should not be need any
+more since the patitioning tool <manref name="setup-storage"
+section="8"> works on all architectures, were parted is supported.
+
+<sect id=odists>FAI for Ubuntu, Suse, Redhat and Gentoo<p>
+All FAI packages are available in Ubuntu and are used by a large
+number of people since many version. 
+
+Many people are interested in FAI for other (mostly RPM based) Linux
+distributions. I made some research and it should not be much work to
+implement it. But I need more help to implement it. If you are
+interested and would like to help me, please send an email to
+<email>fai at informatik.uni-koeln.de</email>.
+
+A brief description how to install SLES9 with FAI is available at
+<httpsite>www.sourcecode.de</httpsite><httppath>/install_sles_with_fai</httppath>.
+
+There are also some information in the faiwiki.
+
+<sect id=sparc>FAI on SUN SPARC hardware running Linux<p>
+
+Although FAI is architecture independent, there are some packages which
+are only available for certain architectures (e.g. silo, sparc-utils).
+
+SUN SPARC computers can boot from their boot prompt. To boot a SUN
+use: <example>boot net:dhcp - ip=::::::dhcp</example>
+
+
+You have to convert the kernel image from ELF format to a.out
+format. Use the program <prgn>elftoaout</prgn> (mentioned in
+the FAQ). The symlink to the kernel image to be booted is not the host
+name. Look at the FAQ at
+<httpsite>www.ultralinux.org</httpsite> for more information
+and <httpsite>www.sparc-boot.org/</httpsite>.
+.
+
+A success report is available at
+<httpsite>www.opossum.ch/</httpsite><httppath>fai/</httppath>.
+
+<sect id=solaris>FAI for Solaris<p>
+FAI has also been ported for use with SUN Solaris OS installations
+in cooperation with Solaris jumpstart. This was done using FAI 2.8.4
+and Solaris 9. Get the FAI sources from FAI 2.8.4 and change to the
+<file>sunos</file> directory. There
+you can call <tt>make</tt> which creates the tarball
+<file>/tmp/fai-solaris.tar.gz</file>. You have to read the file
+<file>README.sunos</file> and have some knowledge about Solaris
+jumpstart. The Solaris support was removed in FAI 2.9.
+<p>
+The file format of the configuration files in <file>disk_config</file> and
+<file>package_config</file> are different than those for Linux.
+
+<chapt id=advanced>Advanced FAI<p>
+
+<sect id="dirinstall">Installing into a mounted directory for chroot and virtualization<p>
+If you have some chroot environments to install, or a virtualization environment where 
+you neither can nor want to run a normal Debian Installer in to
+get to a working system (for example, Xen guest domains), there is the 
+FAI action <tt>dirinstall</tt>.
+
+By calling 
+<example>fai &lt;options&gt; dirinstall &lt;target-directory&gt;</example>
+and using either the option <tt>-c &lt;classes&gt;</tt> or
+<tt>-N</tt> you get a FAI installation, without the partitioning
+action, right into the target directory. The host name for the target
+installation can be specified using <tt>-u &lt;host-name&gt;</tt>
+
+This, for example, can be used to combine FAI with the tool <tt>xen-tools</tt>, which 
+helps you to build Xen guest domains. <tt>xen-tools</tt> are very nice for 
+generating configuration files and block devices for new guests based on simple
+commands and/or configuration files,  but they can only assign one role per installation
+for customization.
+FAI-users need and want more, as they are used to have the class system.
+They get them even in xen-tools installations, by using the following code as
+a xen-tools role script:
+
+<example>
+#!/bin/sh
+TARGET=$1
+CMD="fai -N  -v -u ${hostname} dirinstall $TARGET"
+echo running $CMD
+$CMD
+</example>
+
+Then, you will want to set the variable <example>install=0</example> in the xen-tools config for
+that host(in previous versions of xen-tools, this was <tt>no-install=1</tt>).
+
+<sect id=softupdate>Using FAI for updates
+<p>FAI is even usable for system updates, using the same configuration
+as if initially installing. System update means updating the running
+system without doing a re-installation. An updated client will almost
+look like a newly installed machine, though all local data is
+preserved (except of course newer configuration files introduced in
+the FAI config).</p>
+
+<sect1 id=aboutsoftupdate>How does a softupdate work?
+<p>Softupdate use the same configuration files as a new FAI installation. They
+even use the default FAI commands, so they behave <em>nearly</em> in
+the same way as an installation, though some things are different:
+<list>
+	<item>By default the old list of classes (created during the
+	initial installation) is used, so <prgn>fai-class</prgn>
+	is not called to define a new list of classes. This can be
+	changed by calling <tt>fai -N softupdate</tt>.</item>
+  <!--MT: Is this still the current behavior?-->
+	<item>No partitioning and file system creation is performed.</item>
+	<item>The basesytem isn't bootstrapped.</item>
+	<item>FAI skips tasks only useful when installing, such as setting up
+		a keymap or starting special daemons.</item>
+	<item>FAI doesn't prevent software packages to (re-)start daemons.</item>
+	<item>FAI doesn't reboot at the end of a softupdate.</item>
+</list>
+Except these changes, things are the same as when installing a new computer: 
+<enumlist>
+	<item>Define classes (by default use old list) and variables.</item>
+	<item>Update the installed packages.</item>
+	<item>Install new software.</item>
+	<item>Call configuration scripts.</item>
+	<item>Save the logfiles.</item>
+</enumlist>
+</sect1>
+
+<sect1 id=runsoftupdate>How to run a softupdate
+<p>As softupdate use the same infrastructure as a FAI installation, you even
+start them by using the same command <manref name="fai" section="8"> which is used for
+installation:
+	<example>
+		/usr/sbin/fai softupdate
+	</example>
+starts a softupdate.
+
+If you want to use softupdate on a system not installed with fai, 
+the first time you need to run fai with the -N switch: <tt>fai -N softupdate</tt> - see <manref name="fai" section="8"> for details.
+
+Make sure to set the variable <var>LOGSERVER</var> (done in a <tt>class/*.var</tt>
+file) if fai should save the log files to a remote machine.
+</p>
+
+<sect2 id=startsoftupdate>How to do mass softupdates
+<p>Probably you don't want to run to each client and start a softupdate there
+locally, so a mechanism to start an update there has to be thought of.</p>
+
+<sect3 id=cronsoftupdate>Cron
+<p>One possible solution is to use crontab entries on the clients to start an
+update, but in big installations you have to consider including a random-delay
+mechanism, because too many updates at the same time may produce too much
+traffic on your network.</p>
+
+<sect3 id=remotesoftupdate>Starting a softupdate remotely
+<p>If you want more control when exactly a softupdate is run on the clients
+and maybe want to monitor it while it is running, you can install remote root
+login mechanisms on your clients, preferably using ssh in connection with a
+authorized key for root logins.</p>
+<p>Tools like <tt>clusterssh</tt> allow you to login onto a group of clients at
+once and run <tt>/usr/sbin/fai softupdate</tt> there, while the results can be
+seen immediately in the terminals started for each host.</p>
+</sect2>
+</sect1>
+
+<sect1 id=confsoftupdate>How to write a configuration suitable for softupdate
+<p>When you want to do softupdate, you have to be even more careful when
+writing your configuration: it has to be <strong>idempotent</strong>, i.e. 
+running all the scripts twice should result in the same system configuration
+as running them once. Some things to keep an eye on:
+<list>
+	<item><em>Never</em> blindly append to files:
+		<example>
+			echo $SOMETHING >> /etc/fstab
+		</example>
+		is almost certainly wrong. Either check manually if the
+		line already exists <strong>before</strong> appending
+		or use the command <manref name="ainsl"
+		section="1">. This has a similar function to
+		cfengine's <tt>AppendIfNoSuchLine</tt> statement 
+		</item>
+
+	<item>Make use of FAI's environment variables to determine what to do in
+		your configuration scripts! Some of the most important ones:
+		<taglist>
+			<tag><var>FAI_ROOT</var></tag>
+				<item>points to the client's rootdir.
+					In case of softupdate: <tt>/</tt></item>
+			<tag><var>ROOTCMD</var></tag>
+				<item>contains a command for <tt>chrooting</tt>
+					into the client. This is empty when doing
+					softupdate (as <tt>/</tt> is already our
+					root...).</item>
+			<tag><var>FAI_ACTION</var></tag>
+				<item>contains the currently executed action:
+					<taglist>
+						<tag><tt>install</tt></tag>
+							<item>when installing.</item>
+						<tag><tt>softupdate</tt></tag>
+							<item>when updating</item>
+					</taglist>
+		</taglist>
+
+	<item>Restart daemons if needed: most daemons only read their
+		configuration when starting; if you modify it, you need to
+		make them reload it using
+		<example>
+			$ROOTCMD invoke-rc.d $somedaemon reload
+		</example>
+		or even restart them
+		<example>
+			$ROOTCMD invoke-rc.d $somedaemon restart
+		</example>
+		when the configuration for <tt>$somedaemon</tt> has been
+		changed<footnote>You can for example use <manref
+		name="fcopy" section="8">'s
+		<tt>postinst</tt> script support for doing this; if other
+		things than <tt>fcopy</tt> modify your conffiles, you have to
+		keep track of the changes yourself.</footnote>.
+		</item>
+
+	<item>Other things like scheduling a reboot if a new kernel is installed</item>
+</list></p>
+</sect1>
+
+<sect1 id=localconfsoftupdate>What if there are locally changed conffiles?
+<p><strong>Short: there shouldn't be any!</strong></p>
+<p><strong>Long: </strong> <em>if</em> you are using FAI <tt>softupdate</tt> to
+update client's configuration, you shouldn't do any local changes on
+the install clients, because they may be lost while updating. Backup
+copies are done by fcopy only on the local disk (by default, they are
+written to the same directory as the original file, with
+<tt>.pre_fcopy</tt> appended); if you want to save them together with
+the logfiles,
+	<example>
+		FAI_BACKUPDIR=$LOGDIR/backup
+	</example>
+in <tt>class/DEFAULT.var</tt> will do the job.</p>
+
+<sect2 id=detectlocalchanges>How to detect locally changed files?
+<p>If you are playing with local configuration changes <em>despite all the warnings
+contained in this section</em>, there must be a way to check what has been
+changed locally. A simple approach would be to use <tt>debsums -e</tt>,
+but this method fails miserably if you modify conffiles in your FAI scripts,
+because it only checks against the version contained in the Debian package. A
+better proposal is to setup/abuse <tt>tripwire</tt> or <tt>integrit</tt> to scan
+for local changes and notify you about them.</p>
+</sect2>
+
+</sect1>
+</sect>
+</chapt>
+
+<chapt id=hints>Various hints<p>
+
+<p>
+This chapter has various hints which may not always be explained in great
+detail.
+<p>
+To generate a md5 hash for the password use this
+<tt>echo "yoursecrectpassword" | mkpasswd -Hmd5 -s</tt>
+<p>
+When using HTTP access to a Debian mirror, the local <tt>/var</tt>
+partition on all install clients must be big enough to keep the
+downloaded Debian packages. Do not try with less than 250 Mbytes
+unless you know why. You can limit the number of packages installed at
+a time with the variable <var>$MAXPACKAGES</var>.
+<p>
+You can shorten some scripts by using one single fcopy
+command <tt>fcopy -r /</tt>.
+<p>
+If you rebuild  the nfsroot, you will create a new ssh host key inside
+the nfsroot. Then logging in to an install client may fail, because
+the host key changes. You can use this:
+
+<example>
+ssh -o StrictHostKeyChecking=no root at installclient
+</example>
+
+
+You can also delete the host entry on your install client in your
+<tt>~/.ssh/known_hosts</tt> file by unsing the <tt>ssh-keygen -R</tt>
+command.
+
+
+You can calculate the IP subnet address (which is used in
+&mfnc; for the variable <var>FAICLIENTS</var> by using
+the nice tool ipcalc. Following example gives you the notation for a
+class C network (16) when the server netork interface has the IP address
+123.45.6.123
+<example>
+ ipcalc -nb 123.45.6.123 16|grep Network:
+</example>
+
+You can merge two directories which contain configuration
+information, if one is a global one, and the other a local one. We use
+it to merge the templates from the FAI package, and our local
+configuration, which contains encrypted passwords and other
+information that should not be readable by others. 
+If you remove a file in your local configuration, do not forget to
+remove this file also in the configuration space, otherwise it will
+still be used.
+<p>
+After calling <prgn>set-disk-info</prgn>, a list of all local hard disks is
+stored in <var>$disklist</var> and <var>$device_size</var>
+contains a list of disk devices and their sizes.
+<p>
+
+
+Use <prgn>fai-divert -a</prgn> if a postinst script calls a
+configuration program, e.g. the postinst script for package apache calls
+apacheconfig, which needs manual input. You can fake the configuration
+program so the installation can be fully automatic. But don't forget
+to use <prgn>fai-divert -R</prgn> to remove all faked scripts.
+
+<p>
+During the installation you can execute commands
+inside the newly installed system in a chroot environment by using <tt>chroot /target</tt>
+or just <tt>$ROOTCMD</tt> followed by the command you want to call; for
+example <tt>$ROOTCMD dpkg -l</tt> shows the packages installed on
+the new system.
+<p>
+
+<!--MT: has been said already
+The only task which has to be done manually for new hardware is to
+assign the MAC address to a host name and to an IP address, and to define
+classes for this host if the existing configuration files are not generic
+enough to deal with this new host.
+<p>
+There's a tradeoff between writing a few large configuration scripts,
+or many short scripts, one for each class. Large scripts can
+distinguish classes by using case statements, the <tt>ifclass</tt>
+test or with class mechanisms for <tt>cfengine</tt> scripts.
+<p>
+-->
+If your computer can't boot from the network card, you do not always need to boot
+from floppy. Add  the class
+<tt>FAI_BOOTPART</tt> and FAI will automatically create a
+lilo or grub entry for
+booting the FAI bootfloppy from this partition. So you can start the
+re-installation without a boot floppy. This will also make the test
+phase shorter, since booting from hard disk is much  faster than booting
+from floppy. You can also set a password for this boot menu.
+<p>
+
+<sect id=difai>Using FAI after an Installation with the Debian-Installer<p>
+On <httpsite>www.layer-acht.org</httpsite><httppath>/fai</httppath> you 
+will find an example how to fully automatically install a system using the Debian 
+Installer (d-i) in conjunction with FAI's new softupdate (see <ref id=softupdate>). 
+
+</book>
+</debiandoc>
+
+<!-- Keep this comment at the end of the file
+Local variables:
+mode: sgml
+sgml-omittag:t
+sgml-shorttag:t
+sgml-minimize-attributes:nil
+sgml-always-quote-attributes:t
+sgml-indent-step:2
+sgml-indent-data:nil
+sgml-parent-document:nil
+sgml-exposed-tags:nil
+sgml-declaration:nil
+sgml-local-catalogs:nil
+sgml-local-ecat-files:nil
+End:
+-->

Added: branches/lhm/doc/links.html
===================================================================
--- branches/lhm/doc/links.html	                        (rev 0)
+++ branches/lhm/doc/links.html	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,68 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+   <meta name="GENERATOR" content="Mozilla/4.51 [en] (X11; I; SunOS 5.6 sun4u) [Netscape]">
+</head>
+<body>
+<H2>FAI links</H2>
+<br>
+<ul>
+
+<li>
+Debian: <a href="http://www.debian.org">www.debian.org</a></li>
+
+<li>
+Conrad Lawes (Conrad_Lawes at 3com.com) from 3Com's Lanworks division has
+build the tool <A HREF="download/imggen">imggen </A> to make netboot
+images bootable for 3Com network cards. 
+The <A HREF="http://www.ltsp.org/documentation/">Linux Terminal Server Project</A>
+has more information.
+<li>
+Bootstrapping an Infratructure: <a href="http://www.infrastructures.org/papers/bootstrap">www.infrastructures.org/papers/bootstrap</a></li>
+
+<li>
+cfengine: <a href="http://www.cfengine.org">www.cfengine.org</a></li>
+
+<li>
+Solaris 8 Advanced Installation Guide: <a href="http://docs.sun.com">docs.sun.com</a></li>
+
+<li>
+Solaris auto-install scripts from Casper Dik:
+<a href="ftp://ftp.wins.uva.nl:/pub/solaris/auto-install/install.tar.gz">ftp.wins.uva.nl:/pub/solaris/auto-install/install.tar.gz</a></li>
+
+<!-- http://www.science.uva.nl/pub/solaris/auto-install/ -->
+
+
+<li> General Wake-on-LAN information: <A HREF="http://www.scyld.com/expert/wake-on-lan.html">http://www.scyld.com/expert/wake-on-lan.html</A>
+
+<li>
+PXE: <a href="http://developer.intel.com/ial/WfM/wfmspecs.htm">developer.intel.com/ial/WfM/wfmspecs.htm</a></li>
+
+<li>
+Thomas Renard has done some work to port FAI for Red Hat RPM System (very old):
+<a href="http://www.netcologne.de/~nc-renardth/fai/">www.netcologne.de/~nc-renardth/fai/</a></li>
+<li>
+Drivers for 3com network cards: <a href="http://support.3com.com/infodeli/tools/nic/linux.htm">support.3com.com/infodeli/tools/nic/linux.htm</a></li>
+
+<li> Cluster Computing Info Centre: <A HREF=http://www.buyya.com/cluster>http://www.buyya.com/cluster</A>  
+
+<li> Slides and notes on building a Beowulf cluster: <A HREF="http://www.oslo.sintef.no/am/vskoler/2001/notes/talk.pdf">http://www.oslo.sintef.no/am/vskoler/2001/notes/talk.pdf</A>
+
+
+<li> Some notes how to build a system using FAI: <A HREF="http://tuovi.cern.ch/~ajt/docs/fai_demo.html">http://tuovi.cern.ch/~ajt/docs/fai_demo.html
+</A>
+
+<li> Documentation of the HIP Hirmu cluster: <A HREF="http://wikihip.cern.ch/twiki/bin/view/Cluster/FullyAutomaticInstall">http://wikihip.cern.ch/twiki/bin/view/Cluster/FullyAutomaticInstall
+</A>
+
+
+<li> FAI on linux for SUN Sparc: <A HREF="http://www.opossum.ch/fai/">http://www.opossum.ch/fai/</A>
+
+<li> A nice HOWTO for FAI on SUN Sparc: <A HREF="http://toolbox.rutgers.edu/~amurphy/fai">http://toolbox.rutgers.edu/~amurphy/fai</A>
+
+<li> Hints for FAI on PowerPC: <a href=http://www.layer-acht.org/fai>http://www.layer-acht.org/fai</a>
+</ul>
+<br>&nbsp;
+</body>
+</html>

Added: branches/lhm/doc/pixmaps.svg
===================================================================
--- branches/lhm/doc/pixmaps.svg	                        (rev 0)
+++ branches/lhm/doc/pixmaps.svg	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,1137 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://web.resource.org/cc/"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="200.09448"
+   height="200.36221"
+   id="svg2"
+   sodipodi:version="0.32"
+   inkscape:version="0.45"
+   sodipodi:docbase="/home/jerkeby/devel/faimond"
+   sodipodi:docname="pixmaps.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape"
+   version="1.0"
+   sodipodi:modified="TRUE">
+  <defs
+     id="defs4">
+    <linearGradient
+       id="linearGradient3523">
+      <stop
+         style="stop-color:#76716f;stop-opacity:1;"
+         offset="0"
+         id="stop3525" />
+      <stop
+         style="stop-color:#000000;stop-opacity:0"
+         offset="1"
+         id="stop3527" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       id="linearGradient3262">
+      <stop
+         style="stop-color:#000000;stop-opacity:1;"
+         offset="0"
+         id="stop3264" />
+      <stop
+         style="stop-color:#000000;stop-opacity:0;"
+         offset="1"
+         id="stop3266" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       id="linearGradient5173">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop5175" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop5177" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient5155">
+      <stop
+         style="stop-color:#003f15;stop-opacity:1;"
+         offset="0"
+         id="stop5157" />
+      <stop
+         id="stop5161"
+         offset="0.5"
+         style="stop-color:#37c500;stop-opacity:1;" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop5159" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient3545">
+      <stop
+         id="stop3547"
+         offset="0"
+         style="stop-color:#000000;stop-opacity:1;" />
+      <stop
+         id="stop3549"
+         offset="1"
+         style="stop-color:#000000;stop-opacity:0" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient3515">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop3517" />
+      <stop
+         style="stop-color:#000000;stop-opacity:0"
+         offset="1"
+         id="stop3519" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient3496">
+      <stop
+         id="stop3498"
+         offset="0"
+         style="stop-color:#ffffff;stop-opacity:1;" />
+      <stop
+         id="stop3500"
+         offset="1"
+         style="stop-color:#ffffff;stop-opacity:0;" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient3477">
+      <stop
+         style="stop-color:#000000;stop-opacity:1;"
+         offset="0"
+         id="stop3479" />
+      <stop
+         id="stop3543"
+         offset="0.5"
+         style="stop-color:#000000;stop-opacity:0.49803922;" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop3481" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3545"
+       id="linearGradient3483"
+       x1="131.65155"
+       y1="79.802452"
+       x2="131.48323"
+       y2="59.683605"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.2937063,0,0,1,60.601894,0.2142854)" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3496"
+       id="linearGradient3529"
+       x1="95.543297"
+       y1="72.434685"
+       x2="95.469437"
+       y2="30.044283"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1.0042552,0,0,1,-0.4900172,0)" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3496"
+       id="linearGradient3533"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1.0042552,0,0,1,34.108139,5.0512132e-2)"
+       x1="95.543297"
+       y1="72.434685"
+       x2="95.469437"
+       y2="30.044283" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3496"
+       id="linearGradient3537"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1.0042552,0,0,1,68.958399,7.0815732e-2)"
+       x1="95.543297"
+       y1="72.434685"
+       x2="95.469437"
+       y2="30.044283" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3545"
+       id="linearGradient3553"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.2937063,0,0,1,95.226386,0.4562389)"
+       x1="131.65155"
+       y1="79.802452"
+       x2="131.48323"
+       y2="59.683605" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3545"
+       id="linearGradient3557"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.2937063,0,0,1,130.07664,0.2037029)"
+       x1="131.65155"
+       y1="79.802452"
+       x2="131.48323"
+       y2="59.683605" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3545"
+       id="linearGradient3630"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.2937063,0,0,1,60.244757,32.500007)"
+       x1="131.65155"
+       y1="79.802452"
+       x2="131.48323"
+       y2="59.683605" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3496"
+       id="linearGradient3634"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1.0085104,0,0,1.1048092,-1.263694,27.41782)"
+       x1="95.543297"
+       y1="72.434685"
+       x2="95.469437"
+       y2="30.044283" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3496"
+       id="linearGradient3654"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1.0042552,0,0,1,34.152955,31.805462)"
+       x1="95.543297"
+       y1="72.434685"
+       x2="95.469437"
+       y2="30.044283" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3545"
+       id="linearGradient3658"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.2937063,0,0,0.9882353,95.244755,33.380746)"
+       x1="131.65155"
+       y1="79.802452"
+       x2="131.48323"
+       y2="59.683605" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3496"
+       id="linearGradient3668"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1.0042552,0,0,1,69.100054,30.263754)"
+       x1="95.543297"
+       y1="72.434685"
+       x2="95.469437"
+       y2="30.044283" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3545"
+       id="linearGradient3672"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.2937063,0,0,0.9882353,130.24476,31.759585)"
+       x1="131.65155"
+       y1="79.802452"
+       x2="131.48323"
+       y2="59.683605" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient5155"
+       id="linearGradient5145"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(-4.3120993e-2,0.1445367,-0.1467237,-4.3773449e-2,113.79297,16.991553)"
+       x1="663.31812"
+       y1="107.56815"
+       x2="503.37726"
+       y2="158.34564" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient5155"
+       id="linearGradient5153"
+       x1="76.854782"
+       y1="99.407867"
+       x2="75.099998"
+       y2="83.687363"
+       gradientUnits="userSpaceOnUse" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3545"
+       id="radialGradient5169"
+       cx="56.114594"
+       cy="84.46965"
+       fx="56.114594"
+       fy="84.46965"
+       r="11.954593"
+       gradientTransform="matrix(-1.5487036,-0.8473626,0.3334696,-0.6094742,128.91193,195.95811)"
+       gradientUnits="userSpaceOnUse" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient5173"
+       id="linearGradient5179"
+       x1="74.392166"
+       y1="86.946312"
+       x2="69.907143"
+       y2="90.018211"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.9347472,0.3553139,-0.3553139,0.9347472,37.169508,-15.150332)" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3496"
+       id="linearGradient5183"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1.0042552,0,0,1,-35.647403,32.244595)"
+       x1="95.543297"
+       y1="72.434685"
+       x2="95.469437"
+       y2="30.044283" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3545"
+       id="linearGradient5187"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.2937063,0,0,1,25.244761,32.500011)"
+       x1="131.65155"
+       y1="79.802452"
+       x2="131.48323"
+       y2="59.683605" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3545"
+       id="linearGradient2239"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.2937063,0,0,1,25.244762,67.500015)"
+       x1="131.65155"
+       y1="79.802452"
+       x2="131.48323"
+       y2="59.683605" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3496"
+       id="linearGradient2243"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1.0042552,0,0,1,-35.647403,67.137455)"
+       x1="95.543297"
+       y1="72.434685"
+       x2="95.469437"
+       y2="30.044283" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient5155"
+       id="linearGradient2249"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(-4.3120993e-2,0.1445367,-0.1467237,-4.3773449e-2,114.19805,52.268582)"
+       x1="663.31812"
+       y1="107.56815"
+       x2="503.37726"
+       y2="158.34564" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient5173"
+       id="linearGradient2253"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.9347472,0.3553139,-0.3553139,0.9347472,37.574584,20.126697)"
+       x1="74.392166"
+       y1="86.946312"
+       x2="69.907143"
+       y2="90.018211" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3545"
+       id="radialGradient2257"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(-1.5120501,-0.9111589,0.3585758,-0.5950497,124.55347,234.14819)"
+       cx="56.114594"
+       cy="84.46965"
+       fx="56.114594"
+       fy="84.46965"
+       r="11.954593" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3545"
+       id="radialGradient3238"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(-1.5120501,-0.9111589,0.3585758,-0.5950497,159.55347,234.14819)"
+       cx="56.114594"
+       cy="84.46965"
+       fx="56.114594"
+       fy="84.46965"
+       r="11.954593" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient5155"
+       id="linearGradient3240"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(-4.3120993e-2,0.1445367,-0.1467237,-4.3773449e-2,149.19805,52.268581)"
+       x1="663.31812"
+       y1="107.56815"
+       x2="503.37726"
+       y2="158.34564" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient5155"
+       id="linearGradient3242"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="translate(35.405076,35.277027)"
+       x1="76.854782"
+       y1="99.407867"
+       x2="75.099998"
+       y2="83.687363" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient5173"
+       id="linearGradient3244"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.9347472,0.3553139,-0.3553139,0.9347472,72.574585,20.126696)"
+       x1="74.392166"
+       y1="86.946312"
+       x2="69.907143"
+       y2="90.018211" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3545"
+       id="linearGradient3248"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.2937063,0,0,1,60.244766,67.500011)"
+       x1="131.65155"
+       y1="79.802452"
+       x2="131.48323"
+       y2="59.683605" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3496"
+       id="linearGradient3260"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1.0042552,0,0,1,-0.8470458,67.055463)"
+       x1="95.543297"
+       y1="72.434685"
+       x2="95.469437"
+       y2="30.044283" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3262"
+       id="linearGradient3268"
+       x1="71.725212"
+       y1="137.18341"
+       x2="61.615475"
+       y2="126.47744"
+       gradientUnits="userSpaceOnUse" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3523"
+       id="linearGradient2550"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.2966433,0,0,0.5270588,94.729355,90.905438)"
+       x1="131.65155"
+       y1="68.933052"
+       x2="131.78522"
+       y2="46.250366" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3496"
+       id="linearGradient2552"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1.0042552,0,0,0.4141839,59.152961,113.72742)"
+       x1="94.640762"
+       y1="79.032967"
+       x2="94.818581"
+       y2="54.765705" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3523"
+       id="linearGradient3535"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.9763969,0,0,0.5252322,-32.128012,126.04218)"
+       x1="131.65155"
+       y1="68.933052"
+       x2="131.78522"
+       y2="46.250366" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3496"
+       id="linearGradient3538"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(3.336928,0,0,0.5148583,-235.25155,124.24507)"
+       x1="95.543297"
+       y1="79.371407"
+       x2="95.504555"
+       y2="54.765682" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3496"
+       id="linearGradient2259"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1.0042552,0,0,1,69.289455,67.074323)"
+       x1="95.543297"
+       y1="72.434685"
+       x2="95.469437"
+       y2="30.044283" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3545"
+       id="linearGradient2267"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.2937063,0,0,0.9882353,130.24475,68.443924)"
+       x1="131.65155"
+       y1="79.802452"
+       x2="131.48323"
+       y2="59.683605" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3545"
+       id="linearGradient3249"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.2937063,0,0,0.9882353,130.24475,103.64867)"
+       x1="131.65155"
+       y1="79.802452"
+       x2="131.48323"
+       y2="59.683605" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3496"
+       id="linearGradient3253"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1.0042552,0,0,1,69.08473,102.22675)"
+       x1="95.543297"
+       y1="72.434685"
+       x2="95.469437"
+       y2="30.044283" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3523"
+       id="linearGradient3287"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.2966433,0,0,0.5270588,94.729355,90.905438)"
+       x1="131.65155"
+       y1="68.933052"
+       x2="131.78522"
+       y2="46.250366" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3545"
+       id="linearGradient3289"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.2937063,0,0,0.9882353,130.24475,103.64867)"
+       x1="131.65155"
+       y1="79.802452"
+       x2="131.48323"
+       y2="59.683605" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3496"
+       id="linearGradient3291"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1.0042552,0,0,1,69.08473,102.22675)"
+       x1="95.543297"
+       y1="72.434685"
+       x2="95.469437"
+       y2="30.044283" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3496"
+       id="linearGradient3294"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1.0042552,0,0,1,34.084726,67.226747)"
+       x1="95.543297"
+       y1="72.434685"
+       x2="95.469437"
+       y2="30.044283" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3545"
+       id="linearGradient3297"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.2937063,0,0,0.9882353,95.244746,68.648667)"
+       x1="131.65155"
+       y1="79.802452"
+       x2="131.48323"
+       y2="59.683605" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3545"
+       id="linearGradient3308"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.2937063,0,0,0.9882353,95.24475,68.633367)"
+       x1="131.65155"
+       y1="79.802452"
+       x2="131.48323"
+       y2="59.683605" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3545"
+       id="linearGradient3324"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.2937063,0,0,0.9882353,130.24475,68.443924)"
+       x1="131.65155"
+       y1="79.802452"
+       x2="131.48323"
+       y2="59.683605" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3496"
+       id="linearGradient3326"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1.0042552,0,0,1,69.289455,67.074323)"
+       x1="95.543297"
+       y1="72.434685"
+       x2="95.469437"
+       y2="30.044283" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3496"
+       id="linearGradient3329"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1.0042552,0,0,1,69.289455,67.074323)"
+       x1="95.543297"
+       y1="72.434685"
+       x2="95.469437"
+       y2="30.044283" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3545"
+       id="linearGradient3332"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.2937063,0,0,0.9882353,130.24475,68.443924)"
+       x1="131.65155"
+       y1="79.802452"
+       x2="131.48323"
+       y2="59.683605" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3496"
+       id="linearGradient3343"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1.0042552,0,0,1,69.060447,102.29342)"
+       x1="95.543297"
+       y1="72.434685"
+       x2="95.469437"
+       y2="30.044283" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3545"
+       id="linearGradient3349"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.2937063,0,0,0.9882353,119.70903,81.112933)"
+       x1="131.65155"
+       y1="79.802452"
+       x2="131.48323"
+       y2="59.683605" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3545"
+       id="linearGradient3352"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.2937063,0,0,0.9882353,130.24475,103.64866)"
+       x1="131.65155"
+       y1="79.802452"
+       x2="131.48323"
+       y2="59.683605" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     gridtolerance="10000"
+     guidetolerance="10"
+     objecttolerance="10"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="11.2"
+     inkscape:cx="154.57266"
+     inkscape:cy="71.357553"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer5"
+     inkscape:window-width="1014"
+     inkscape:window-height="718"
+     inkscape:window-x="10"
+     inkscape:window-y="50"
+     showgrid="true"
+     showguides="true"
+     inkscape:guide-bbox="true" />
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:groupmode="layer"
+     id="layer5"
+     inkscape:label="pixmaps"
+     style="display:inline">
+    <rect
+       style="opacity:1;fill:#6cb85a;fill-opacity:1;stroke:#000000;stroke-width:0.228571;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:3.20000005;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+       id="rect3586"
+       width="30.000433"
+       height="30.243076"
+       x="154.88528"
+       y="75.476501"
+       ry="3.7359097"
+       inkscape:export-filename="/home/jerkeby/devel/faimond/ok3d.png"
+       inkscape:export-xdpi="148.86365"
+       inkscape:export-ydpi="148.86365" />
+    <rect
+       style="fill:#3c8baa;fill-opacity:1;stroke:#000000;stroke-width:0.22722755;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:3.20000005;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+       id="rect3580"
+       width="30.001776"
+       height="29.887272"
+       x="84.999107"
+       y="77.361298"
+       ry="3.6919572"
+       inkscape:export-filename="/home/jerkeby/devel/faimond/beg3d.png"
+       inkscape:export-xdpi="90"
+       inkscape:export-ydpi="90" />
+    <g
+       id="g3618"
+       transform="translate(-10.763703,-0.8065722)"
+       inkscape:export-filename="/home/jerkeby/devel/faimond/beg3d.png"
+       inkscape:export-xdpi="90"
+       inkscape:export-ydpi="90">
+      <path
+         sodipodi:nodetypes="ccc"
+         id="path3608"
+         d="M 111.85,85.083644 L 119.58417,93.125478 L 111.86819,100.51218"
+         style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:5.19999981;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+      <path
+         sodipodi:nodetypes="ccc"
+         id="path3610"
+         d="M 100.50433,92.888217 L 116.4,92.962183 L 116.4,92.962183"
+         style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:5.19999981;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+    </g>
+    <rect
+       style="fill:#942a2a;fill-opacity:0.99215686;stroke:#000000;stroke-width:0.228571;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:3.20000005;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+       id="rect3584"
+       width="30.000433"
+       height="30.243076"
+       x="119.99979"
+       y="77.004822"
+       ry="3.7359097"
+       inkscape:export-filename="/home/jerkeby/devel/faimond/fail3d.png"
+       inkscape:export-xdpi="148.86365"
+       inkscape:export-ydpi="148.86365" />
+    <path
+       style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:5.19999981;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       d="M 127.58929,99.86218 L 142.5,85.040754"
+       id="path3638"
+       sodipodi:nodetypes="cc"
+       inkscape:export-filename="/home/jerkeby/devel/faimond/fail3d.png"
+       inkscape:export-xdpi="148.86365"
+       inkscape:export-ydpi="148.86365" />
+    <path
+       style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:5.19999981;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       d="M 127.67857,84.951469 L 142.41071,99.951466"
+       id="path3640"
+       sodipodi:nodetypes="cc"
+       inkscape:export-filename="/home/jerkeby/devel/faimond/fail3d.png"
+       inkscape:export-xdpi="148.86365"
+       inkscape:export-ydpi="148.86365" />
+    <path
+       style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:5.19999981;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       d="M 177.11202,85.189462 L 168.66092,99.762183 L 163.61016,94.711421"
+       id="path3664"
+       sodipodi:nodetypes="ccc"
+       inkscape:export-filename="/home/jerkeby/devel/faimond/ok3d.png"
+       inkscape:export-xdpi="148.86365"
+       inkscape:export-ydpi="148.86365" />
+    <rect
+       style="fill:#c6c5aa;fill-opacity:1;stroke:#000000;stroke-width:0.22722755;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:3.20000005;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:inline"
+       id="rect3694"
+       width="30.001776"
+       height="29.887272"
+       x="50.113613"
+       y="77.361298"
+       ry="3.6919572"
+       inkscape:export-filename="/home/jerkeby/devel/faimond/host3d.png"
+       inkscape:export-xdpi="148.86365"
+       inkscape:export-ydpi="148.86365" />
+    <path
+       style="fill:url(#radialGradient5169);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline"
+       d="M 50.541945,83.070919 L 52.206566,83.44608 L 54.123987,84.121524 L 56.803249,85.275263 L 59.032948,86.523129 L 60.304018,87.541216 L 62.262229,89.414082 L 63.606323,91.421738 L 64.44078,93.328285 L 64.822368,95.466503 L 61.924143,96.024341 L 70.043559,103.00966 L 74.45113,93.15704 L 71.895677,93.414705 L 71.760553,91.680524 L 71.321241,89.899551 L 70.597962,88.305292 L 69.47776,86.560168 L 68.060717,84.911786 L 66.939687,83.801436 L 65.638206,82.807877"
+       id="path5163"
+       sodipodi:nodetypes="ccccccccccccccccccccc"
+       inkscape:export-filename="/home/jerkeby/devel/faimond/host3d.png"
+       inkscape:export-xdpi="148.86365"
+       inkscape:export-ydpi="148.86365" />
+    <path
+       style="fill:url(#linearGradient5145);fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient5153);stroke-width:0.2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline"
+       d="M 51.090815,82.625225 L 52.755436,83.000386 L 54.672857,83.67583 L 57.352119,84.829569 L 59.581818,86.077435 L 60.852888,87.095522 L 62.811099,88.968388 L 64.155193,90.976044 L 64.98965,92.882591 L 65.371238,95.020809 L 62.473013,95.578647 L 70.592429,102.56395 L 75,92.711346 L 72.444547,92.969011 L 72.309423,91.23483 L 71.870111,89.453857 L 71.146832,87.859598 L 70.02663,86.114474 L 68.609587,84.466092 L 67.488557,83.355742 L 66.187076,82.362183"
+       id="path5143"
+       sodipodi:nodetypes="ccccccccccccccccccccc"
+       inkscape:export-filename="/home/jerkeby/devel/faimond/host3d.png"
+       inkscape:export-xdpi="148.86365"
+       inkscape:export-ydpi="148.86365" />
+    <path
+       style="fill:none;fill-rule:evenodd;stroke:url(#linearGradient5179);stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:2.10000014;stroke-dasharray:none;stroke-opacity:1"
+       d="M 69.243069,86.222942 L 69.243069,86.222942 C 69.243069,86.222942 70.105448,87.045057 70.649533,88.352725 C 71.181979,89.632422 71.286438,89.99417 71.598043,91.23496 C 71.909649,92.47575 71.904096,93.752089 71.904096,93.752089 L 74.090363,93.455715 L 70.914765,100.19038"
+       id="path5171"
+       sodipodi:nodetypes="czzcccc"
+       inkscape:export-filename="/home/jerkeby/devel/faimond/host3d.png"
+       inkscape:export-xdpi="148.86365"
+       inkscape:export-ydpi="148.86365" />
+    <rect
+       style="fill:#bfcbe6;fill-opacity:1;stroke:#000000;stroke-width:0.22722755;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:3.20000005;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:inline"
+       id="rect2228"
+       width="30.001776"
+       height="29.887272"
+       x="49.884609"
+       y="112.4758"
+       ry="3.6919572"
+       inkscape:export-filename="/home/jerkeby/devel/faimond/host3d.png"
+       inkscape:export-xdpi="148.86365"
+       inkscape:export-ydpi="148.86365" />
+    <path
+       style="opacity:0.4623656;fill:url(#radialGradient2257);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline"
+       d="M 50.955625,118.09346 L 52.603167,118.53765 L 54.490778,119.29241 L 57.119639,120.55678 L 59.295404,121.89648 L 60.522949,122.96665 L 62.40142,124.91948 L 63.66069,126.9814 L 64.414979,128.92106 L 64.707139,131.07331 L 61.788187,131.50991 L 69.609483,138.82748 L 74.42377,129.16708 L 71.859801,129.31804 L 71.797054,127.57974 L 71.432335,125.782 L 70.776114,124.15898 L 69.729602,122.3687 L 68.382475,120.66271 L 67.308686,119.50662 L 66.049735,118.45969"
+       id="path2255"
+       sodipodi:nodetypes="ccccccccccccccccccccc"
+       inkscape:export-filename="/home/jerkeby/devel/faimond/host3d.png"
+       inkscape:export-xdpi="148.86365"
+       inkscape:export-ydpi="148.86365" />
+    <path
+       id="Swirl"
+       style="fill:#a7053f"
+       d="M 70.626349,122.02284 C 70.337809,119.81109 65.252631,120.29496 65.252631,120.29496 C 65.252631,120.29496 66.738561,120.46528 67.52459,120.67503 C 61.501572,123.0248 62.619641,126.48057 62.619641,126.48057 C 62.619641,126.48057 62.150871,126.44607 61.537678,125.99671 C 67.560689,135.6036 73.583707,129.90157 73.944451,129.59077 C 80.869195,119.74209 73.114922,114.45492 72.718072,114.24763 C 63.557473,110.58456 57.498364,115.73344 57.498364,115.73344 C 57.498364,115.73344 57.462258,115.18058 57.7147,114.38564 C 50.032639,123.99252 54.577113,134.18678 54.577113,134.18678 C 54.577113,134.18678 54.93758,133.49563 55.190021,133.18455 C 62.331101,143.06774 69.688802,141.06328 69.688802,141.06328 C 69.733999,141.12353 67.416565,141.13256 66.767273,140.51041 C 66.767273,140.51041 69.544386,139.78476 71.059021,138.50623 C 57.137612,144.31177 54.577113,126.27328 54.577113,125.8932 C 54.973686,126.1695 55.514667,126.61886 55.514667,126.61886 C 55.514667,126.61886 53.639281,117.87591 66.3707,114.8005 C 66.3707,114.8005 65.324558,115.90623 65.288737,116.4246 C 65.288737,116.4246 75.783732,113.34918 75.314962,123.16309 C 75.314962,123.16309 75.515377,131.6897 68.291569,130.25618 C 60.170012,128.45409 63.088704,120.08766 70.626349,122.02284 z "
+       inkscape:export-filename="/home/jerkeby/devel/faimond/host3d.png"
+       inkscape:export-xdpi="148.86365"
+       inkscape:export-ydpi="148.86365" />
+    <path
+       style="fill:url(#linearGradient2249);fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient3268);stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline"
+       d="M 51.495891,117.90229 L 53.160512,118.27746 L 55.077933,118.9529 L 57.757195,120.10664 L 59.986894,121.3545 L 61.257964,122.37259 L 63.216175,124.24546 L 64.560269,126.25311 L 65.394726,128.15966 L 65.776314,130.29788 L 62.878089,130.85572 L 70.997505,137.84102 L 75.405076,127.98842 L 72.849623,128.24608 L 72.714499,126.5119 L 72.275187,124.73093 L 71.551908,123.13667 L 70.431706,121.39154 L 69.014663,119.74316 L 67.893633,118.63281 L 66.592152,117.63925"
+       id="path2245"
+       sodipodi:nodetypes="ccccccccccccccccccccc"
+       inkscape:export-filename="/home/jerkeby/devel/faimond/host3d.png"
+       inkscape:export-xdpi="148.86365"
+       inkscape:export-ydpi="148.86365" />
+    <path
+       style="fill:none;fill-rule:evenodd;stroke:url(#linearGradient2253);stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:2.10000014;stroke-dasharray:none;stroke-opacity:1;display:inline"
+       d="M 69.648145,121.50001 L 69.648145,121.50001 C 69.648145,121.50001 70.510524,122.32213 71.054609,123.62979 C 71.587055,124.90949 71.691514,125.27124 72.003119,126.51203 C 72.314725,127.75282 72.309172,129.02916 72.309172,129.02916 L 74.495439,128.73278 L 71.319841,135.46745"
+       id="path2247"
+       sodipodi:nodetypes="czzcccc"
+       inkscape:export-filename="/home/jerkeby/devel/faimond/host3d.png"
+       inkscape:export-xdpi="148.86365"
+       inkscape:export-ydpi="148.86365" />
+    <rect
+       style="fill:#bfcbe6;fill-opacity:1;stroke:#000000;stroke-width:0.22722755;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:3.20000005;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:inline"
+       id="rect3228"
+       width="30.001776"
+       height="29.887272"
+       x="84.884613"
+       y="112.4758"
+       ry="3.6919572"
+       inkscape:export-filename="/home/jerkeby/devel/faimond/host3d.png"
+       inkscape:export-xdpi="148.86365"
+       inkscape:export-ydpi="148.86365" />
+    <path
+       id="path3232"
+       style="fill:#a7053f;display:inline"
+       d="M 105.62635,122.02284 C 105.33781,119.81109 100.25263,120.29496 100.25263,120.29496 C 100.25263,120.29496 101.73856,120.46528 102.52459,120.67503 C 96.501573,123.0248 97.619642,126.48057 97.619642,126.48057 C 97.619642,126.48057 97.150872,126.44607 96.537679,125.99671 C 102.56069,135.6036 108.58371,129.90157 108.94445,129.59077 C 115.8692,119.74209 108.11492,114.45492 107.71807,114.24763 C 98.557474,110.58456 92.498365,115.73344 92.498365,115.73344 C 92.498365,115.73344 92.462259,115.18058 92.714701,114.38564 C 85.03264,123.99252 89.577114,134.18678 89.577114,134.18678 C 89.577114,134.18678 89.937581,133.49563 90.190022,133.18455 C 97.331102,143.06774 104.6888,141.06328 104.6888,141.06328 C 104.734,141.12353 102.41657,141.13256 101.76727,140.51041 C 101.76727,140.51041 104.54439,139.78476 106.05902,138.50623 C 92.137613,144.31177 89.577114,126.27328 89.577114,125.8932 C 89.973687,126.1695 90.514668,126.61886 90.514668,126.61886 C 90.514668,126.61886 88.639282,117.87591 101.3707,114.8005 C 101.3707,114.8005 100.32456,115.90623 100.28874,116.4246 C 100.28874,116.4246 110.78373,113.34918 110.31496,123.16309 C 110.31496,123.16309 110.51538,131.6897 103.29157,130.25618 C 95.170013,128.45409 98.088705,120.08766 105.62635,122.02284 z "
+       inkscape:export-filename="/home/jerkeby/devel/faimond/host3d.png"
+       inkscape:export-xdpi="148.86365"
+       inkscape:export-ydpi="148.86365" />
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="58.822266"
+       y="50.192291"
+       id="text3306"><tspan
+         sodipodi:role="line"
+         id="tspan3308"
+         x="58.822266"
+         y="50.192291">Pixmaps for faimond</tspan></text>
+    <rect
+       style="opacity:1;fill:#d8802f;fill-opacity:1;stroke:#000000;stroke-width:0.228571;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:3.20000005;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:inline"
+       id="rect2261"
+       width="30.000433"
+       height="30.243076"
+       x="155.11429"
+       y="112.2574"
+       ry="3.7359097"
+       inkscape:export-filename="/home/jerkeby/devel/faimond/minor3d.png"
+       inkscape:export-xdpi="148.86365"
+       inkscape:export-ydpi="148.86365" />
+    <rect
+       style="fill:#f1da3b;fill-opacity:1;stroke:#000000;stroke-width:0.228571;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:3.20000005;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:inline"
+       id="rect3242"
+       width="30.000433"
+       height="30.243076"
+       x="119.88528"
+       y="112.4765"
+       ry="3.7359097"
+       inkscape:export-filename="/home/jerkeby/devel/faimond/warning3d.png"
+       inkscape:export-xdpi="148.86365"
+       inkscape:export-ydpi="148.86365" />
+    <g
+       style="display:inline"
+       id="g3259"
+       transform="translate(-35.000004,-37.946431)"
+       inkscape:export-filename="/home/jerkeby/devel/faimond/warning3d.png"
+       inkscape:export-xdpi="148.86365"
+       inkscape:export-ydpi="148.86365">
+      <path
+         id="path3255"
+         d="M 170,155.36221 C 170,160.36221 170,165.36221 170,170.36221"
+         style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:4.83300018;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+      <path
+         sodipodi:nodetypes="cc"
+         id="path3257"
+         d="M 170,175.36221 C 170,173.69555 170,173.10031 170,171.43364"
+         style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:4.83300018;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+    </g>
+    <path
+       sodipodi:type="arc"
+       style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:4.83300018;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:inline"
+       id="path3238"
+       sodipodi:cx="169.70563"
+       sodipodi:cy="129.90407"
+       sodipodi:rx="7.5761442"
+       sodipodi:ry="8.7125654"
+       d="M 177.28177 129.90407 A 7.5761442 8.7125654 0 1 1  162.12948,129.90407 A 7.5761442 8.7125654 0 1 1  177.28177 129.90407 z"
+       transform="translate(0.2870522,-1.6709557)" />
+    <rect
+       style="opacity:1;fill:#8c9166;fill-opacity:1;stroke:#000000;stroke-width:0.228571;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:3.20000005;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:inline"
+       id="rect3337"
+       width="30.000433"
+       height="30.243076"
+       x="154.88528"
+       y="147.4765"
+       ry="3.7359097"
+       inkscape:export-filename="/home/jerkeby/devel/faimond/ok3d.png"
+       inkscape:export-xdpi="148.86365"
+       inkscape:export-ydpi="148.86365" />
+    <path
+       sodipodi:type="arc"
+       style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:4.83300018;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:4.833, 4.833;stroke-dashoffset:0;stroke-opacity:1;display:inline"
+       id="path3339"
+       sodipodi:cx="169.70563"
+       sodipodi:cy="129.90407"
+       sodipodi:rx="7.5761442"
+       sodipodi:ry="7.9089942"
+       d="M 177.28177 129.90407 A 7.5761442 7.9089942 0 1 1  162.12948,129.90407 A 7.5761442 7.9089942 0 1 1  177.28177 129.90407 z"
+       transform="matrix(0.7853925,0.6189981,-0.6189981,0.7853925,117.00387,-44.511944)" />
+  </g>
+  <g
+     inkscape:groupmode="layer"
+     id="layer2"
+     inkscape:label="shadow"
+     style="display:inline"
+     sodipodi:insensitive="true">
+    <rect
+       style="opacity:1;fill:url(#linearGradient3630);fill-opacity:1;stroke:none;stroke-width:1.829;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:3.20000005;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.98360656"
+       id="rect3628"
+       width="30.000004"
+       height="30.357143"
+       x="85"
+       y="77.005035"
+       ry="3.7500002"
+       inkscape:export-filename="/home/jerkeby/devel/faimond/beg3d.png"
+       inkscape:export-xdpi="90"
+       inkscape:export-ydpi="90" />
+    <rect
+       style="opacity:1;fill:url(#linearGradient3658);fill-opacity:1;stroke:none;stroke-width:1.829;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:3.20000005;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.98360656"
+       id="rect3656"
+       width="30.000004"
+       height="30"
+       x="120"
+       y="77.362183"
+       ry="3.7058825"
+       inkscape:export-filename="/home/jerkeby/devel/faimond/fail3d.png"
+       inkscape:export-xdpi="148.86365"
+       inkscape:export-ydpi="148.86365" />
+    <rect
+       style="opacity:1;fill:url(#linearGradient3672);fill-opacity:1;stroke:none;stroke-width:1.829;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:3.20000005;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.98360656"
+       id="rect3670"
+       width="30.000004"
+       height="30"
+       x="155"
+       y="75.741013"
+       ry="3.7058825"
+       inkscape:export-filename="/home/jerkeby/devel/faimond/ok3d.png"
+       inkscape:export-xdpi="148.86365"
+       inkscape:export-ydpi="148.86365" />
+    <rect
+       style="opacity:1;fill:url(#linearGradient5187);fill-opacity:1;stroke:none;stroke-width:1.829;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:3.20000005;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.98360656"
+       id="rect5185"
+       width="30.000004"
+       height="30.357143"
+       x="50"
+       y="77.005035"
+       ry="3.7500002" />
+    <rect
+       style="opacity:1;fill:url(#linearGradient2239);fill-opacity:1;stroke:none;stroke-width:1.829;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:3.20000005;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.98360656"
+       id="rect2237"
+       width="30.000004"
+       height="30.357143"
+       x="50"
+       y="112.00504"
+       ry="3.7500002" />
+    <rect
+       style="opacity:1;fill:url(#linearGradient3248);fill-opacity:1;stroke:none;stroke-width:1.829;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:3.20000005;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.98360656"
+       id="rect3246"
+       width="30.000004"
+       height="30.357143"
+       x="85"
+       y="112.00504"
+       ry="3.7500002" />
+    <rect
+       style="fill:url(#linearGradient3308);fill-opacity:1;stroke:none;stroke-width:1.829;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:3.20000005;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.98360656;display:inline"
+       id="rect3247"
+       width="30.000004"
+       height="30"
+       x="120"
+       y="112.61475"
+       ry="3.7058825"
+       inkscape:export-filename="/home/jerkeby/devel/faimond/ok3d.png"
+       inkscape:export-xdpi="148.86365"
+       inkscape:export-ydpi="148.86365" />
+    <rect
+       style="fill:url(#linearGradient3332);fill-opacity:1;stroke:none;stroke-width:1.829;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:3.20000005;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.98360656;display:inline"
+       id="rect2265"
+       width="30.000004"
+       height="30"
+       x="155"
+       y="112.42535"
+       ry="3.7058825"
+       inkscape:export-filename="/home/jerkeby/devel/faimond/ok3d.png"
+       inkscape:export-xdpi="148.86365"
+       inkscape:export-ydpi="148.86365" />
+    <rect
+       style="fill:url(#linearGradient3352);fill-opacity:1;stroke:none;stroke-width:1.829;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:3.20000005;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.98360656;display:inline"
+       id="rect3347"
+       width="30.000004"
+       height="30"
+       x="155"
+       y="147.63005"
+       ry="3.7058825"
+       inkscape:export-filename="/home/jerkeby/devel/faimond/ok3d.png"
+       inkscape:export-xdpi="148.86365"
+       inkscape:export-ydpi="148.86365" />
+  </g>
+  <g
+     inkscape:groupmode="layer"
+     id="layer3"
+     inkscape:label="hilight1"
+     style="display:inline"
+     sodipodi:insensitive="true">
+    <path
+       style="fill:url(#linearGradient3634);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 85.075315,98.464483 C 85.075315,98.464483 87.463009,93.302863 92.843278,91.628824 C 98.223548,89.954785 102.34407,93.096688 107.85169,89.992741 C 113.3593,86.888793 114.87373,79.213036 114.87373,79.213036 C 114.87373,79.213036 114.49171,77.713376 113.09093,77.538997 C 111.56436,77.348959 89.914375,77.399494 89.914375,77.399494 C 89.972955,77.33532 87.054313,77.393831 85.966721,78.655023 C 84.879129,79.916216 84.947972,83.25863 84.947972,83.25863 L 85.075315,98.464483 z "
+       id="path3632"
+       sodipodi:nodetypes="czzczczcc"
+       inkscape:export-filename="/home/jerkeby/devel/faimond/beg3d.png"
+       inkscape:export-xdpi="90"
+       inkscape:export-ydpi="90" />
+    <path
+       style="fill:url(#linearGradient3654);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 120.12767,96.112186 C 120.12767,96.112186 122.50529,91.44023 127.86286,89.925001 C 133.22043,88.409772 137.32357,91.253614 142.80795,88.444127 C 148.29232,85.63464 149.80036,78.687054 149.80036,78.687054 C 149.80036,78.687054 149.41995,77.329661 148.02508,77.171825 C 146.50495,76.999815 124.94631,77.045556 124.94631,77.045556 C 125.00465,76.98747 122.09832,77.04043 121.01532,78.181978 C 119.93231,79.323526 120.00087,82.348857 120.00087,82.348857 L 120.12767,96.112186 z "
+       id="path3652"
+       sodipodi:nodetypes="czzczczcc"
+       inkscape:export-filename="/home/jerkeby/devel/faimond/fail3d.png"
+       inkscape:export-xdpi="148.86365"
+       inkscape:export-ydpi="148.86365" />
+    <path
+       style="fill:url(#linearGradient3668);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 155.07477,94.570478 C 155.07477,94.570478 157.45239,89.898522 162.80996,88.383293 C 168.16753,86.868064 172.27067,89.711906 177.75505,86.902419 C 183.23942,84.092932 184.74746,77.145346 184.74746,77.145346 C 184.74746,77.145346 184.36705,75.787953 182.97218,75.630117 C 181.45205,75.458107 159.89341,75.503848 159.89341,75.503848 C 159.95175,75.445762 157.04542,75.498722 155.96242,76.64027 C 154.87941,77.781818 154.94797,80.807149 154.94797,80.807149 L 155.07477,94.570478 z "
+       id="path3666"
+       sodipodi:nodetypes="czzczczcc"
+       inkscape:export-filename="/home/jerkeby/devel/faimond/ok3d.png"
+       inkscape:export-xdpi="148.86365"
+       inkscape:export-ydpi="148.86365" />
+    <path
+       style="fill:url(#linearGradient5183);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 50.327314,96.551319 C 50.327314,96.551319 52.704934,91.879363 58.062502,90.364134 C 63.42007,88.848905 67.52321,91.692747 73.00759,88.88326 C 78.49196,86.073773 80,79.126187 80,79.126187 C 80,79.126187 79.61959,77.768794 78.22472,77.610958 C 76.70459,77.438948 55.145956,77.484689 55.145956,77.484689 C 55.204289,77.426603 52.297962,77.479563 51.214959,78.621111 C 50.131956,79.762659 50.200508,82.78799 50.200508,82.78799 L 50.327314,96.551319 z "
+       id="path5181"
+       sodipodi:nodetypes="czzczczcc" />
+    <path
+       style="fill:url(#linearGradient2243);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 50.327314,131.44418 C 50.327314,131.44418 52.704934,126.77223 58.062502,125.257 C 63.42007,123.74177 67.52321,126.58561 73.00759,123.77612 C 78.49196,120.96664 80,114.01905 80,114.01905 C 80,114.01905 79.61959,112.66165 78.22472,112.50382 C 76.70459,112.33181 55.145956,112.37755 55.145956,112.37755 C 55.204289,112.31946 52.297962,112.37242 51.214959,113.51397 C 50.131956,114.65552 50.200508,117.68085 50.200508,117.68085 L 50.327314,131.44418 z "
+       id="path2241"
+       sodipodi:nodetypes="czzczczcc" />
+    <path
+       style="fill:url(#linearGradient3260);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 85.127672,131.36218 C 85.127672,131.36218 87.505292,126.69023 92.86286,125.175 C 98.220428,123.65977 102.32357,126.50361 107.80795,123.69412 C 113.29232,120.88464 114.80036,113.93705 114.80036,113.93705 C 114.80036,113.93705 114.41995,112.57965 113.02508,112.42182 C 111.50495,112.24981 89.946314,112.29555 89.946314,112.29555 C 90.004647,112.23746 87.09832,112.29042 86.015317,113.43197 C 84.932314,114.57352 85.000866,117.59885 85.000866,117.59885 L 85.127672,131.36218 z "
+       id="path3258"
+       sodipodi:nodetypes="czzczczcc" />
+    <g
+       id="g3283"
+       transform="translate(-70.032139,58.089284)">
+      <rect
+         inkscape:export-ydpi="148.86365"
+         inkscape:export-xdpi="148.86365"
+         inkscape:export-filename="/home/jerkeby/devel/faimond/action.png"
+         ry="2.2128096"
+         y="112.36096"
+         x="119.85903"
+         height="17.913221"
+         width="30.052937"
+         id="rect2542"
+         style="fill:#bfcbe6;fill-opacity:1;stroke:#000000;stroke-width:0.17606567;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:3.20000005;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:inline" />
+      <rect
+         inkscape:export-ydpi="148.86365"
+         inkscape:export-xdpi="148.86365"
+         inkscape:export-filename="/home/jerkeby/devel/faimond/action.png"
+         ry="0"
+         y="114.36221"
+         x="119.73214"
+         height="16"
+         width="30.299999"
+         id="rect2546"
+         style="opacity:1;fill:url(#linearGradient3287);fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:3.20000005;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:inline" />
+    </g>
+    <rect
+       style="fill:#bfcbe6;fill-opacity:1;stroke:#000000;stroke-width:0.219;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:3.20000005;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:inline"
+       id="rect3529"
+       width="99.346695"
+       height="17.770449"
+       x="50.337757"
+       y="147.43234"
+       ry="2.1951728"
+       inkscape:export-filename="/home/jerkeby/devel/faimond/hostname.png"
+       inkscape:export-xdpi="148.86365"
+       inkscape:export-ydpi="148.86365" />
+    <rect
+       style="opacity:1;fill:url(#linearGradient3535);fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:3.20000005;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:inline"
+       id="rect3531"
+       width="99.732002"
+       height="15.94455"
+       x="50.168243"
+       y="149.41766"
+       ry="0"
+       inkscape:export-filename="/home/jerkeby/devel/faimond/hostname.png"
+       inkscape:export-xdpi="148.86365"
+       inkscape:export-ydpi="148.86365" />
+    <path
+       style="fill:url(#linearGradient3294);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 120.05944,131.5335 C 120.05944,131.5335 122.43706,126.86154 127.79463,125.34631 C 133.1522,123.83109 137.25534,126.67493 142.73972,123.86544 C 148.22409,121.05595 149.73213,114.10837 149.73213,114.10837 C 149.73213,114.10837 149.35172,112.75097 147.95685,112.59314 C 146.43672,112.42113 124.87808,112.46687 124.87808,112.46687 C 124.93642,112.40878 122.03009,112.46174 120.94709,113.60329 C 119.86408,114.74484 119.93264,117.77017 119.93264,117.77017 L 120.05944,131.5335 z "
+       id="path3251"
+       sodipodi:nodetypes="czzczczcc"
+       inkscape:export-filename="/home/jerkeby/devel/faimond/ok3d.png"
+       inkscape:export-xdpi="148.86365"
+       inkscape:export-ydpi="148.86365" />
+    <path
+       style="fill:url(#linearGradient3329);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline"
+       d="M 155.26418,131.38108 C 155.26418,131.38108 157.6418,126.70912 162.99937,125.19389 C 168.35694,123.67867 172.46008,126.52251 177.94446,123.71302 C 183.42883,120.90353 184.93687,113.95595 184.93687,113.95595 C 184.93687,113.95595 184.55646,112.59855 183.16159,112.44072 C 181.64146,112.26871 160.08282,112.31445 160.08282,112.31445 C 160.14116,112.25636 157.23483,112.30932 156.15183,113.45087 C 155.06882,114.59242 155.13738,117.61775 155.13738,117.61775 L 155.26418,131.38108 z "
+       id="path2257"
+       sodipodi:nodetypes="czzczczcc"
+       inkscape:export-filename="/home/jerkeby/devel/faimond/ok3d.png"
+       inkscape:export-xdpi="148.86365"
+       inkscape:export-ydpi="148.86365" />
+    <path
+       style="fill:url(#linearGradient3343);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline"
+       d="M 155.03517,166.60018 C 155.03517,166.60018 157.41279,161.92822 162.77036,160.41299 C 168.12793,158.89777 172.23107,161.74161 177.71545,158.93212 C 183.19982,156.12263 184.70786,149.17505 184.70786,149.17505 C 184.70786,149.17505 184.32745,147.81765 182.93258,147.65982 C 181.41245,147.48781 159.85381,147.53355 159.85381,147.53355 C 159.91215,147.47546 157.00582,147.52842 155.92282,148.66997 C 154.83981,149.81152 154.90837,152.83685 154.90837,152.83685 L 155.03517,166.60018 z "
+       id="path3341"
+       sodipodi:nodetypes="czzczczcc"
+       inkscape:export-filename="/home/jerkeby/devel/faimond/ok3d.png"
+       inkscape:export-xdpi="148.86365"
+       inkscape:export-ydpi="148.86365" />
+  </g>
+</svg>

Added: branches/lhm/examples/etc/bootptab
===================================================================
--- branches/lhm/examples/etc/bootptab	                        (rev 0)
+++ branches/lhm/examples/etc/bootptab	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,43 @@
+# /etc/bootptab example for FAI
+# replace FAISERVER with the name of your install server
+
+.faiglobal:\
+	:ms=1024:\
+	:hd=/srv/tftp/fai:\
+	:hn:bs=auto:\
+	:rp=/srv/fai/nfsroot:
+
+# rp: the nfsroot on the install server
+# your local values
+#
+# sa: your tftp server (install server)
+# ts: your timeserver (time enabled in inetd.conf)
+# T170: location of FAI configuration directory. Not used any more here.
+# T171: FAI_ACTION. Not used any more here.
+# T172: FAI_FLAGS, e.g. verbose, debug, reboot, sshd
+# T173: reserved for future use
+# sm: subnet mask
+# gw: router/gateway address
+# dn: domainname
+# ds: list of nameservers
+
+# these are optional
+# ys: NIS server
+# yd: NIS domainname
+# nt: list of NTP servers
+
+.failocal:\
+	:tc=.faiglobal:\
+	:sa=FAISERVER:\
+	:ts=FAISERVER:\
+	:T172="sshd verbose createvt":\
+	:sm=255.255.255.0:\
+	:gw=134.95.9.254:\
+	:dn=informatik.uni-koeln.de:\
+	:ds=134.95.9.136,134.95.129.23,134.95.100.208,134.95.140.208:\
+	:ys=rubens:yd=informatik4711.YP:\
+	:nt=time.rrz.uni-koeln.de,time2.rrz.uni-koeln.de:
+
+# now one entry for each install client
+bigfoot:ha=0x00103B240012:bf=bigfoot:tc=.failocal:T172="verbose createvt sshd debug ":
+ant01:ha=0x00105A000000:bf=ant01:tc=.failocal:T172="sshd":

Added: branches/lhm/examples/etc/dhcpd.conf
===================================================================
--- branches/lhm/examples/etc/dhcpd.conf	                        (rev 0)
+++ branches/lhm/examples/etc/dhcpd.conf	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,22 @@
+# dhcpd.conf for fai
+# replace faiserver with the name of your install server
+
+deny unknown-clients;
+option dhcp-max-message-size 2048; 
+use-host-decl-names on;
+#always-reply-rfc1048 on;
+
+
+subnet 192.168.1.0 netmask 255.255.255.0 {
+   option routers 192.168.1.250;
+   option domain-name "beowulf";
+   option domain-name-servers 192.168.1.250;
+   option time-servers faiserver;
+   option ntp-servers faiserver;
+   server-name faiserver;
+   next-server faiserver;
+   filename "pxelinux.0";
+}
+
+# perl -ane ' {print "host atom {hardware ethernet $1;fixed-address atom}";}'
+host demohost {hardware ethernet 0:2:a3:b5:c5:41;fixed-address demohost;}

Added: branches/lhm/examples/etc/hosts
===================================================================
--- branches/lhm/examples/etc/hosts	                        (rev 0)
+++ branches/lhm/examples/etc/hosts	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,37 @@
+
+
+# the master server to the internet network
+123.123.123.123 nucleus
+
+# the master sever, Beowulf internal network
+192.168.42.250 atom00
+
+# create these entries with the perl one liner
+# perl -e 'for (1..25) {printf "192.168.42.%s atom%02s\n",$_,$_;}'
+#
+# the Beowulf cluster nodes
+192.168.42.1 atom01
+192.168.42.2 atom02
+192.168.42.3 atom03
+192.168.42.4 atom04
+192.168.42.5 atom05
+192.168.42.6 atom06
+192.168.42.7 atom07
+192.168.42.8 atom08
+192.168.42.9 atom09
+192.168.42.10 atom10
+192.168.42.11 atom11
+192.168.42.12 atom12
+192.168.42.13 atom13
+192.168.42.14 atom14
+192.168.42.15 atom15
+192.168.42.16 atom16
+192.168.42.17 atom17
+192.168.42.18 atom18
+192.168.42.19 atom19
+192.168.42.20 atom20
+192.168.42.21 atom21
+192.168.42.22 atom22
+192.168.42.23 atom23
+192.168.42.24 atom24
+192.168.42.25 atom25

Added: branches/lhm/examples/etc/netgroup
===================================================================
--- branches/lhm/examples/etc/netgroup	                        (rev 0)
+++ branches/lhm/examples/etc/netgroup	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,43 @@
+# permission for a list of hosts
+
+# the beowulf cluster
+nucleus (nucleus,,)
+atom00 (atom00,,)
+atom01 (atom01,,)
+atom02 (atom02,,)
+atom03 (atom03,,)
+atom04 (atom04,,)
+atom05 (atom05,,)
+atom06 (atom06,,)
+atom07 (atom07,,)
+atom08 (atom08,,)
+atom09 (atom09,,)
+atom10 (atom10,,)
+atom11 (atom11,,)
+atom12 (atom12,,)
+atom13 (atom13,,)
+atom14 (atom14,,)
+atom15 (atom15,,)
+atom16 (atom16,,)
+atom17 (atom17,,)
+atom18 (atom18,,)
+atom19 (atom19,,)
+atom20 (atom20,,)
+atom21 (atom21,,)
+atom22 (atom22,,)
+atom23 (atom23,,)
+atom24 (atom24,,)
+atom25 (atom25,,)
+
+atoms atom01 atom02 atom03 atom04 atom05 atom06 atom07 atom08 atom09 atom10 atom11 atom12 atom13 atom14 atom15 atom16 atom17 atom18 atom19 atom20 atom21 atom22 atom23 atom24 atom25
+
+# used for script all_hosts
+allhosts atom00 atoms
+
+beowulf atoms atom00 nucleus
+homeclients beowulf
+
+faiclients workstations beowulf
+
+# this definition grants permission for every host
+# faiclients (,,)

Added: branches/lhm/examples/etc/sources.list
===================================================================
--- branches/lhm/examples/etc/sources.list	                        (rev 0)
+++ branches/lhm/examples/etc/sources.list	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,23 @@
+# These are some examples for the sources.list file. Use only one
+# segment for your sources.list file. If these entries do not work,
+# try apt-setup(8) to create a working sources.list file.
+
+# replace SUITE by the name of the distribution (eg. woody, sarge, sid)
+# replace FTPSERVER or FAISERVER by the host name of your mirror server
+
+# ftp access, only a few mirrors are available for security packages
+deb ftp://FTPSERVER/debian SUITE main contrib non-free
+#deb ftp://FTPSERVER/debian SUITE-proposed-updates main contrib non-free
+deb ftp://security.debian.org/debian-security SUITE/updates main contrib non-free
+
+# http access to the Debian mirror on the faiserver. Its setup is
+# described in the fai guide.
+deb http://FAISERVER/debmirror/debian SUITE main contrib non-free
+#deb http://FAISERVER/debmirror/debian SUITE-proposed-updates main contrib non-free
+deb http://FAISERVER/debmirror/debian-security SUITE/updates main contrib non-free
+
+# nfs access (mirror created by mkdebmirror) 
+# don't forget to set FAI_DEBMIRROR and MNTPOINT in fai.conf
+deb file:/mnt2/debian SUITE main contrib non-free
+#deb file:/mnt2/debian SUITE-proposed-updates main contrib non-free
+deb file:/mnt2/debian-security SUITE/updates main contrib non-free

Added: branches/lhm/examples/simple/class/10-base-classes
===================================================================
--- branches/lhm/examples/simple/class/10-base-classes	                        (rev 0)
+++ branches/lhm/examples/simple/class/10-base-classes	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,8 @@
+#! /bin/bash
+
+# Echo architecture and OS name in uppercase. Do NOT remove these two lines.
+uname -s | tr '[:lower:]' '[:upper:]'
+[ -x "`which dpkg`" ] && dpkg --print-installation-architecture | tr a-z A-Z
+
+[ -f /etc/RUNNING_FROM_FAICD ] && echo "FAICD"
+exit 0


Property changes on: branches/lhm/examples/simple/class/10-base-classes
___________________________________________________________________
Added: svn:executable
   + 

Added: branches/lhm/examples/simple/class/20-hwdetect.source
===================================================================
--- branches/lhm/examples/simple/class/20-hwdetect.source	                        (rev 0)
+++ branches/lhm/examples/simple/class/20-hwdetect.source	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,48 @@
+#! /bin/bash
+
+# (c) Thomas Lange, 2002-2008, lange at informatik.uni-koeln.de
+
+# NOTE: Files named *.source will be evaluated, but their output ignored. Instead
+# the contents of $newclasses will be added to the list of defined classes.
+
+[ "$action" = "dirinstall" ] && return 0 # Do not execute when doing dirinstall
+
+echo 0 > /proc/sys/kernel/printk
+
+# load all IDE drivers
+
+# DMA does not work if we load all modules in drivers/ide, so only try pci modules
+mod=$(find /lib/modules/$(uname -r)/kernel/drivers/ide/pci -type f | sed 's/\.o$//' | sed 's/\.ko$//' | sed 's/.*\///')
+for i in $mod; do
+    modprobe $i 1>/dev/null 2>&1
+done
+# Booting from CD does not always enable DMA.
+for d in $( echo /proc/ide/hd[a-z] 2>/dev/null); do
+    [ -d $d ] && echo "using_dma:1" > $d/settings
+done
+
+# load additional kernel modules (from old 11modules.source)
+# this order should also enable DMA for all IDE drives
+kernelmodules="usbkbd ide-disk ide-cd"
+case $(uname -r) in
+    2.6*) kernelmodules="$kernelmodules ohci-hcd usbhid usbmouse ide-generic mptspi ata_piix dm-mod md-mod aes dm-crypt" ;;
+esac
+
+for mod in $kernelmodules; do
+    [ "$verbose" ] && echo loading kernel module $mod
+    modprobe -a $mod 1>/dev/null 2>&1
+done
+
+# let discover do most of the job
+#[ -x /sbin/discover-modprobe ] && /sbin/discover-modprobe
+
+# now we can mount the USB filesystem
+mount -t usbfs  usbfs /proc/bus/usb
+
+modprobe -a sd_mod sr_mod
+
+echo $printk > /proc/sys/kernel/printk
+
+set_disk_info  # calculate number of available disks
+save_dmesg     # save new boot messages (from loading modules)
+


Property changes on: branches/lhm/examples/simple/class/20-hwdetect.source
___________________________________________________________________
Added: svn:executable
   + 

Added: branches/lhm/examples/simple/class/50-host-classes
===================================================================
--- branches/lhm/examples/simple/class/50-host-classes	                        (rev 0)
+++ branches/lhm/examples/simple/class/50-host-classes	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,20 @@
+#! /bin/bash
+
+# assign classes hosts
+
+# use a list of classes for our demo machine
+case $HOSTNAME in
+    faiserver)
+	echo "FAIBASE DEMO FAISERVER" ;;
+    demohost)
+	echo "FAIBASE DHCPC DEMO" ;;
+    gnomehost)
+	echo "FAIBASE DHCPC DEMO XORG GNOME";;
+    atom*)
+	echo "FAIBASE DHCPC DEMO" ;;
+    *)
+	echo "FAIBASE DHCPC" ;;
+esac
+
+(ifclass I386 || ifclass AMD64) && echo GRUB 
+exit 0


Property changes on: branches/lhm/examples/simple/class/50-host-classes
___________________________________________________________________
Added: svn:executable
   + 

Added: branches/lhm/examples/simple/class/FAIBASE.var
===================================================================
--- branches/lhm/examples/simple/class/FAIBASE.var	                        (rev 0)
+++ branches/lhm/examples/simple/class/FAIBASE.var	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,27 @@
+# default values for installation. You can override them in your *.var files
+
+# allow installation of packages from unsigned repositories
+FAI_ALLOW_UNSIGNED=1
+
+CONSOLEFONT=
+KEYMAP=us-latin1
+
+# Set UTC=yes if your system clock is set to UTC (GMT), and UTC=no if not.
+UTC=yes
+TIMEZONE=Europe/Berlin
+
+# root password for the new installed linux system; md5 and crypt are possible
+# pw is "fai"
+ROOTPW='$1$kBnWcO.E$djxB128U7dMkrltJHPf6d1'
+
+# MODULESLIST contains modules that will be loaded by the new system,
+# not during installation these modules will be written to /etc/modules
+# If you need a module during installation, add it to $kernelmodules
+# in 20-hwdetect.source. But discover should do most of this job
+MODULESLIST="usbkbd ehci-hcd ohci-hcd uhci-hcd usbhid psmouse"
+
+# erros in tasks greater than this value will cause the installation to stop
+STOP_ON_ERROR=700
+
+# use the new partitioning tool
+USE_SETUP_STORAGE=1

Added: branches/lhm/examples/simple/class/GERMAN.var
===================================================================
--- branches/lhm/examples/simple/class/GERMAN.var	                        (rev 0)
+++ branches/lhm/examples/simple/class/GERMAN.var	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,2 @@
+# german environment
+KEYMAP=de-latin1-nodeadkeys

Added: branches/lhm/examples/simple/debconf/FAIBASE
===================================================================
--- branches/lhm/examples/simple/debconf/FAIBASE	                        (rev 0)
+++ branches/lhm/examples/simple/debconf/FAIBASE	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,9 @@
+passwd passwd/shadow boolean true
+exim4-config exim4/dc_eximconfig_configtype select local delivery only; not on a network
+locales locales/default_environment_locale select en_US.UTF-8
+locales locales/locales_to_be_generated multiselect en_US.UTF-8 UTF-8
+xserver-xorg xserver-xorg/config/inputdevice/keyboard/model string pc105
+xserver-xorg    xserver-xorg/autodetect_monitor         boolean false
+xserver-xorg    xserver-xorg/autodetect_keyboard        boolean true
+xserver-xorg    xserver-xorg/autodetect_mouse           boolean true
+xserver-xorg    xserver-xorg/autodetect_video_card      boolean true

Added: branches/lhm/examples/simple/debconf/FAISERVER
===================================================================
--- branches/lhm/examples/simple/debconf/FAISERVER	                        (rev 0)
+++ branches/lhm/examples/simple/debconf/FAISERVER	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,2 @@
+# Should the server be started by inetd?
+tftpd-hpa tftpd-hpa/use_inetd boolean false

Added: branches/lhm/examples/simple/debconf/GERMAN
===================================================================
--- branches/lhm/examples/simple/debconf/GERMAN	                        (rev 0)
+++ branches/lhm/examples/simple/debconf/GERMAN	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,3 @@
+locales locales/default_environment_locale select de_DE.UTF-8
+locales locales/locales_to_be_generated multiselect de_DE.UTF-8 UTF-8
+xserver-xorg xserver-xorg/config/inputdevice/keyboard/layout string de

Added: branches/lhm/examples/simple/disk_config/FAIBASE
===================================================================
--- branches/lhm/examples/simple/disk_config/FAIBASE	                        (rev 0)
+++ branches/lhm/examples/simple/disk_config/FAIBASE	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,12 @@
+# example of new config file for setup-storage
+#
+# <type> <mountpoint> <size>   <fs type> <mount options> <misc options>
+
+disk_config disk1 disklabel:msdos
+
+primary  /             250	  ext3   rw,errors=remount-ro
+logical  swap          200-1000   swap   rw                   
+logical  /var          600-1300   ext3   rw         createopts="-m 5" tuneopts="-c 0 -i 0"
+logical  /tmp          100-1G     ext3   rw         createopts="-m 0" tuneopts="-c 0 -i 0"
+logical  /usr          1G-8G      ext3   rw
+logical  /home         100-50%    ext3   rw,nosuid  createopts="-m 1" tuneopts="-c 0 -i 0"

Added: branches/lhm/examples/simple/disk_config/FAISERVER
===================================================================
--- branches/lhm/examples/simple/disk_config/FAISERVER	                        (rev 0)
+++ branches/lhm/examples/simple/disk_config/FAISERVER	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,13 @@
+# example of new config file for setup-storage
+#
+# <type> <mountpoint> <size>   <fs type> <mount options> <misc options>
+
+disk_config disk1 disklabel:msdos
+
+primary  /             300	  ext3   rw,errors=remount-ro
+logical  swap          200-1000   swap   rw                   
+logical  /var          600-1300   ext3   rw         createopts="-m15" tuneopts="-c 0 -i 0"
+logical  /tmp          100-1000   ext3   rw         createopts="-m 0" tuneopts="-c 0 -i 0"
+logical  /usr          1G-6G      ext3   rw
+logical  /home         100-       ext3   rw,nosuid  createopts="-m 1" tuneopts="-c 0 -i 0"
+logical  /srv          1G-50%     ext3   rw,nosuid  createopts="-m 1" tuneopts="-c 0 -i 0"

Added: branches/lhm/examples/simple/files/boot/grub/menu.lst/GRUB
===================================================================
--- branches/lhm/examples/simple/files/boot/grub/menu.lst/GRUB	                        (rev 0)
+++ branches/lhm/examples/simple/files/boot/grub/menu.lst/GRUB	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,43 @@
+#
+timeout 5
+default 0
+color cyan/blue white/blue
+
+### 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=#ROOT_PARTITION# ro 
+
+## default grub root device
+## e.g. groot=(hd0,0)
+# groot=#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
+
+

Added: branches/lhm/examples/simple/files/boot/grub/menu.lst/postinst
===================================================================
--- branches/lhm/examples/simple/files/boot/grub/menu.lst/postinst	                        (rev 0)
+++ branches/lhm/examples/simple/files/boot/grub/menu.lst/postinst	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,23 @@
+#! /bin/bash
+
+error=0 ; trap "error=$((error|1))" ERR
+
+set -a
+
+# during softupdate use this file
+[ -r $target/var/log/fai/disk_var.sh ] && . $target/var/log/fai/disk_var.sh
+
+# if class NOMBR is defined, write boot loader into root partition, not into mbr
+ifclass NOMBR && BOOT_DEVICE=$BOOT_PARTITION
+
+[ -z "$BOOT_DEVICE" ]    && exit 701
+[ -z "$BOOT_PARTITION" ] && exit 702
+
+grub-install --no-floppy --root-directory=$target $BOOT_DEVICE
+GROOT=$(device2grub $BOOT_PARTITION)
+perl -pi -e 's/#(\w+)#/$ENV{$1}/' $2
+$ROOTCMD /usr/sbin/update-grub
+echo "Grub installed on $BOOT_DEVICE on $GROOT"
+
+exit $error
+


Property changes on: branches/lhm/examples/simple/files/boot/grub/menu.lst/postinst
___________________________________________________________________
Added: svn:executable
   + 

Added: branches/lhm/examples/simple/files/etc/apache2/conf.d/FAISERVER
===================================================================
--- branches/lhm/examples/simple/files/etc/apache2/conf.d/FAISERVER	                        (rev 0)
+++ branches/lhm/examples/simple/files/etc/apache2/conf.d/FAISERVER	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,24 @@
+<Directory "/var/www/ganglia">
+    AllowOverride None
+    Options None
+    Order deny,allow
+    Deny from all
+    Allow from 192.168.1
+</Directory>
+
+<Directory "/var/www/debian">
+    AllowOverride None
+    Options None
+    Order deny,allow
+#    Deny from all
+    Allow from all
+</Directory>
+
+<Directory "/var/www/debian-security">
+    AllowOverride None
+    Options None
+    Order deny,allow
+#    Deny from all
+    Allow from all
+</Directory>
+

Added: branches/lhm/examples/simple/files/etc/apt-proxy/apt-proxy-v2.conf/FAISERVER
===================================================================
--- branches/lhm/examples/simple/files/etc/apt-proxy/apt-proxy-v2.conf/FAISERVER	                        (rev 0)
+++ branches/lhm/examples/simple/files/etc/apt-proxy/apt-proxy-v2.conf/FAISERVER	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,151 @@
+[DEFAULT]
+;; All times are in seconds, but you can add a suffix
+;; for minutes(m), hours(h) or days(d)
+
+;; Server IP to listen on
+;address = 192.168.0.254
+
+;; Server port to listen on
+port = 9999
+
+;; Control files (Packages/Sources/Contents) refresh rate
+;;
+;; Minimum time between attempts to refresh a file
+min_refresh_delay = 1h
+
+;; Minimum age of a file before attempting an update (NOT YET IMPLEMENTED)
+;min_age = 23h
+
+;; Uncomment to make apt-proxy continue downloading even if all
+;; clients disconnect.  This is probably not a good idea on a
+;; dial up line.
+;; complete_clientless_downloads = 1
+
+;; Debugging settings.
+;; for all debug information use this:
+;; debug = all:9
+debug = all:4 db:0
+
+;; Debugging remote python console
+;; Do not enable in an untrusted environment
+;telnet_port = 9998
+;telnet_user = apt-proxy
+;telnet_password = secret
+
+;; Network timeout when retrieving from backend servers
+timeout = 15
+
+;; Cache directory for apt-proxy
+cache_dir = /var/cache/apt-proxy
+
+;; Use passive FTP? (default=on)
+;passive_ftp = on
+
+;; Use HTTP proxy?
+;http_proxy = host:port
+
+;; Enable HTTP pipelining within apt-proxy (for test purposes)
+;disable_pipelining=0
+
+;;--------------------------------------------------------------
+;; Cache housekeeping
+
+;; Time to perform periodic housekeeping:
+;;  - delete files that have not been accessed in max_age
+;;  - scan cache directories and update internal tables
+cleanup_freq = 1d
+
+;; Maximum age of files before deletion from the cache (seconds)
+max_age = 120d
+
+;; Maximum number of versions of a .deb to keep per distribution
+max_versions = 3
+
+;; Add HTTP backends dynamicaly if not already defined? (default=on)
+;dynamic_backends = on
+
+;;---------------------------------------------------------------
+;;---------------------------------------------------------------
+;; Backend servers
+;;
+;; Place each server in its own [section]
+
+[debian]
+;; The main Debian archive
+;; You can override the default timeout like this:
+;timeout = 30
+
+;; Rsync server used to rsync the Packages file (NOT YET IMPLEMENTED)
+;;rsyncpackages = rsync://ftp.de.debian.org/debian
+
+;; Backend servers, in order of preference
+backends = 
+	http://ftp.de.debian.org/debian
+	http://ftp2.de.debian.org/debian
+	http://ftp.us.debian.org/debian
+	ftp://ftp.uk.debian.org/debian
+
+[debian-amd64]
+backends = 
+	http://ftp.de.debian.org/debian-amd64/debian
+	http://debian.csail.mit.edu/debian-amd64/debian
+	http://ftp2.de.debian.org/debian-amd64/debian
+	http://mirror.pacific.net.au/linux/debian-amd64/debian
+
+[debian-non-US]
+;; Debian debian-non-US archive
+;timeout will be the global value
+backends =
+	http://ftp.de.debian.org/debian-non-US
+	http://ftp.uk.debian.org/debian-non-US
+	ftp://ftp.uk.debian.org/debian
+	
+[security]
+;; Debian security archive
+backends = 
+	http://ftp2.de.debian.org/debian-security
+	ftp://security.debian.org/debian-security
+
+[ubuntu]
+;; Ubuntu archive
+backends = http://archive.ubuntu.com/ubuntu
+
+[ubuntu-security]
+;; Ubuntu security updates
+backends = http://security.ubuntu.com/ubuntu
+
+;[openoffice]
+;; OpenOffice.org packages
+;backends =
+;	http://ftp.freenet.de/pub/debian-openoffice
+;	http://ftp.sh.cvut.cz/MIRRORS/OpenOffice.deb
+;	http://borft.student.utwente.nl/debian
+	
+;[apt-proxy]
+;; Apt-proxy new versions
+;backends = http://apt-proxy.sourceforge.net/apt-proxy
+
+;[backports.org]
+;; backports.org
+;backends = http://backports.org/debian
+
+;[blackdown]
+;; Blackdown Java
+;backends = http://ftp.gwdg.de/pub/languages/java/linux/debian
+
+
+;[debian-people]
+;; people.debian.org
+;backends = http://people.debian.org
+
+;[emdebian]
+;; The Emdebian project
+;backends = http://emdebian.sourceforge.net/emdebian
+
+;[rsync]
+;; An example using an rsync server.  This is not recommended
+;; unless http is not available, becuause rsync is only more
+;; efficient for transferring uncompressed files and puts much
+;; more overhead on the server.  See the rsyncpacakges parameter 
+;; for a way of rsyncing just the Packages files.
+;backends = rsync://ftp.uk.debian.org/debian

Added: branches/lhm/examples/simple/files/etc/default/tftpd-hpa/FAISERVER
===================================================================
--- branches/lhm/examples/simple/files/etc/default/tftpd-hpa/FAISERVER	                        (rev 0)
+++ branches/lhm/examples/simple/files/etc/default/tftpd-hpa/FAISERVER	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,3 @@
+#Defaults for tftpd-hpa
+RUN_DAEMON="yes"
+OPTIONS="-l -s /srv/tftp"

Added: branches/lhm/examples/simple/files/etc/dhcp3/dhcpd.conf/FAISERVER
===================================================================
--- branches/lhm/examples/simple/files/etc/dhcp3/dhcpd.conf/FAISERVER	                        (rev 0)
+++ branches/lhm/examples/simple/files/etc/dhcp3/dhcpd.conf/FAISERVER	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,49 @@
+# dhcpd.conf for a fai install server
+# replace faiserver with the name of your install server
+
+deny unknown-clients;
+option dhcp-max-message-size 2048; 
+use-host-decl-names on;
+#always-reply-rfc1048 on;
+
+subnet 192.168.1.0 netmask 255.255.255.0 {
+   option routers 192.168.1.250;
+   option domain-name "fai";
+   option domain-name-servers 192.168.1.250;
+   option time-servers faiserver;
+   option ntp-servers faiserver;
+   server-name faiserver;
+   next-server faiserver;
+   filename "pxelinux.0";
+}
+
+# generate more lines with:
+
+# perl -e 'for (1..25) {printf "host atom%02s {hardware ethernet XXX:$_;fixed-address atom%02s;}\n",$_,$_;}'
+
+# replace 1:2:3:4:5:XX with the hardware addresses of your clients
+host atom01 {hardware ethernet 1:2:3:4:5:1;fixed-address atom01;}
+host atom02 {hardware ethernet 1:2:3:4:5:2;fixed-address atom02;}
+host atom03 {hardware ethernet 1:2:3:4:5:3;fixed-address atom03;}
+host atom04 {hardware ethernet 1:2:3:4:5:4;fixed-address atom04;}
+host atom05 {hardware ethernet 1:2:3:4:5:5;fixed-address atom05;}
+host atom06 {hardware ethernet 1:2:3:4:5:6;fixed-address atom06;}
+host atom07 {hardware ethernet 1:2:3:4:5:7;fixed-address atom07;}
+host atom08 {hardware ethernet 1:2:3:4:5:8;fixed-address atom08;}
+host atom09 {hardware ethernet 1:2:3:4:5:9;fixed-address atom09;}
+host atom10 {hardware ethernet 1:2:3:4:5:10;fixed-address atom10;}
+host atom11 {hardware ethernet 1:2:3:4:5:11;fixed-address atom11;}
+host atom12 {hardware ethernet 1:2:3:4:5:12;fixed-address atom12;}
+host atom13 {hardware ethernet 1:2:3:4:5:13;fixed-address atom13;}
+host atom14 {hardware ethernet 1:2:3:4:5:14;fixed-address atom14;}
+host atom15 {hardware ethernet 1:2:3:4:5:15;fixed-address atom15;}
+host atom16 {hardware ethernet 1:2:3:4:5:16;fixed-address atom16;}
+host atom17 {hardware ethernet 1:2:3:4:5:17;fixed-address atom17;}
+host atom18 {hardware ethernet 1:2:3:4:5:18;fixed-address atom18;}
+host atom19 {hardware ethernet 1:2:3:4:5:19;fixed-address atom19;}
+host atom20 {hardware ethernet 1:2:3:4:5:20;fixed-address atom20;}
+host atom21 {hardware ethernet 1:2:3:4:5:21;fixed-address atom21;}
+host atom22 {hardware ethernet 1:2:3:4:5:22;fixed-address atom22;}
+host atom23 {hardware ethernet 1:2:3:4:5:23;fixed-address atom23;}
+host atom24 {hardware ethernet 1:2:3:4:5:24;fixed-address atom24;}
+host atom25 {hardware ethernet 1:2:3:4:5:25;fixed-address atom25;}

Added: branches/lhm/examples/simple/files/etc/fai/apt/sources.list/FAISERVER
===================================================================
--- branches/lhm/examples/simple/files/etc/fai/apt/sources.list/FAISERVER	                        (rev 0)
+++ branches/lhm/examples/simple/files/etc/fai/apt/sources.list/FAISERVER	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,8 @@
+# via local partial mirror (was mirror on fai-cd)
+deb http://faiserver/debian lenny main 
+#deb http://faiserver/debian lenny/updates main
+#deb http://faiserver/debian-security lenny/updates main contrib non-free
+
+# via apt-proxy
+deb http://faiserver:9999/debian lenny main contrib non-free
+deb http://faiserver:9999/security lenny/updates main contrib non-free

Added: branches/lhm/examples/simple/files/etc/fai/fai.conf/FAISERVER
===================================================================
--- branches/lhm/examples/simple/files/etc/fai/fai.conf/FAISERVER	                        (rev 0)
+++ branches/lhm/examples/simple/files/etc/fai/fai.conf/FAISERVER	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,35 @@
+# $Id: fai.conf 3770 2006-08-07 12:08:51Z lange $
+
+# /etc/fai/fai.conf -- configuration for FAI (Fully Automatic Installation)
+
+# Access to Debian mirror via NFS mounted directory
+# If FAI_DEBMIRROR is defined, install clients mount it to $MNTPOINT
+#FAI_DEBMIRROR=yournfs debianmirror:/path/to/debianmirror
+
+# LOGUSER: an account on the install server which saves all log-files
+# and which can change the kernel that is booted via network.
+# Configure .rhosts for this account and PAM, so that root can log in
+# from all install clients without password. This account should have
+# write permissions for /srv/tftp/fai. For example, you can use write
+# permissions for the group linuxadm. chgrp linuxadm /srv/tftp/fai;chmod
+# g+w /srv/tftp/fai. If the variable is undefined, this feature is disabled.
+# Define it, to enable it, eg. LOGUSER=fai
+LOGUSER=fai
+
+# set protocol type for saving logs. Values: ssh, rsh, ftp
+FAI_LOGPROTO=rsh
+
+# the configuration space on the install server
+FAI_CONFIGDIR=/srv/fai/config
+
+# how to access the fai config space
+# default if undefined here: nfs://`hostname`/$FAI_CONFIGDIR
+#FAI_CONFIG_SRC=nfs://yourservername$FAI_CONFIGDIR
+
+# the following variables are read only for most users
+
+# mount point where the mirror will be mounted
+MNTPOINT=/media/mirror
+
+# the local configuration directory on the install client
+FAI=/var/lib/fai/config

Added: branches/lhm/examples/simple/files/etc/fai/make-fai-nfsroot.conf/FAISERVER
===================================================================
--- branches/lhm/examples/simple/files/etc/fai/make-fai-nfsroot.conf/FAISERVER	                        (rev 0)
+++ branches/lhm/examples/simple/files/etc/fai/make-fai-nfsroot.conf/FAISERVER	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,24 @@
+# these variables are only used by make-fai-nfsroot(8)
+# here you can use also variables defined in fai.conf
+
+# directory on the install server where the nfsroot for FAI is
+# created, approx size: 250MB, also defined in bootptab or dhcp.conf
+NFSROOT=/srv/fai/nfsroot
+
+# Add a line for mirrorhost and installserver when DNS is not available
+# on the clients. This line(s) will be added to $nfsroot/etc/hosts.
+NFSROOT_ETC_HOSTS="192.168.1.250 faiserver"
+
+FAI_DEBOOTSTRAP="lenny http://faiserver/debian"
+
+# the encrypted (with md5 or crypt) root password on all install clients during
+# installation process; used when log in via ssh; default pw is: fai
+FAI_ROOTPW='$1$kBnWcO.E$djxB128U7dMkrltJHPf6d1'
+
+# location of a identity.pub file; this user can log to the install
+# clients in as root without a password; only useful with FAI_FLAGS="sshd"
+#SSH_IDENTITY=/home/admin/.ssh/identity.pub
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# following lines should be read only for most of you
+
+FAI_DEBOOTSTRAP_OPTS="--exclude=dhcp-client,info"

Added: branches/lhm/examples/simple/files/etc/fai/menu.lst/FAISERVER
===================================================================
--- branches/lhm/examples/simple/files/etc/fai/menu.lst/FAISERVER	                        (rev 0)
+++ branches/lhm/examples/simple/files/etc/fai/menu.lst/FAISERVER	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,50 @@
+# grub menu.lst for fai-cd
+
+# Boot automatically after some secs.
+# timeout 15
+
+color light-gray/black light-gray/red
+default 6
+
+title |
+root (cd)
+title |
+title +------------------------------------------------------+
+root (cd)
+title |    FAI-CD (c) 2005, Thomas Lange, lange at debian.org   |
+root (cd)
+title | _VERSIONSTRING_ |
+root (cd)
+title +------------------------------------------------------+
+root (cd)
+title |
+root (cd)
+title |
+
+title Fully Automatic Installation - demohost (pw: installme)
+password installme
+#root (cd)
+kernel /boot/vmlinuz root=/dev/ram0 init=/linuxrc FAI_FLAGS="verbose,createvt,syslogd" FAI_ACTION=install ip=192.168.1.250::::faiserver::off rw
+initrd /boot/initrd.img
+
+title Fully Automatic Installation with GNOME (pw: installme)
+password installme
+root (cd)
+kernel /boot/vmlinuz root=/dev/ram0 init=/linuxrc FAI_FLAGS="verbose,createvt,syslogd" FAI_ACTION=install ip=192.168.1.1::::gnomehost::off rw
+initrd /boot/initrd.img
+
+title Fully Automatic Installation - faiserver (pw: installme)
+password installme
+#root (cd)
+kernel /boot/vmlinuz root=/dev/ram0 init=/linuxrc FAI_FLAGS="verbose,createvt,syslogd" FAI_ACTION=install ip=192.168.1.250::192.168.1.254:255.255.255.0:faiserver::off rw
+initrd /boot/initrd.img
+
+title FAI rescue system, no installation
+root (cd)
+kernel /boot/vmlinuz root=/dev/ram0 init=/linuxrc FAI_FLAGS="verbose,syslogd,createvt" FAI_ACTION=sysinfo ip=192.168.1.1::::demohost::off rw
+initrd /boot/initrd.img
+
+#title Boot vmlinuz from hda1
+#root (hd0,0)
+#kernel /vmlinuz root=/dev/hda1
+#initrd /initrd.img

Added: branches/lhm/examples/simple/files/etc/kernel-img.conf/DEFAULT
===================================================================
--- branches/lhm/examples/simple/files/etc/kernel-img.conf/DEFAULT	                        (rev 0)
+++ branches/lhm/examples/simple/files/etc/kernel-img.conf/DEFAULT	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,5 @@
+do_symlinks = Yes
+do_initrd = Yes
+silent_modules=yes
+clobber_modules=yes
+do_boot_enable=no

Added: branches/lhm/examples/simple/files/etc/motd/FAIBASE
===================================================================
--- branches/lhm/examples/simple/files/etc/motd/FAIBASE	                        (rev 0)
+++ branches/lhm/examples/simple/files/etc/motd/FAIBASE	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,4 @@
+
+
+Plan your installation, and FAI installs your plan.
+

Added: branches/lhm/examples/simple/files/etc/rc2.d/S99fai-setup/FAISERVER
===================================================================
--- branches/lhm/examples/simple/files/etc/rc2.d/S99fai-setup/FAISERVER	                        (rev 0)
+++ branches/lhm/examples/simple/files/etc/rc2.d/S99fai-setup/FAISERVER	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,29 @@
+#! /bin/bash
+
+# setup script that is only run once at boot time
+
+echo "Creating the nfsroot for FAI."
+
+. /etc/fai/fai.conf
+
+if [ ! -d "$FAI_CONFIGDIR/class" ]; then
+    mkdir -p $FAI_CONFIGDIR
+    cp -a /usr/share/doc/fai-doc/examples/simple/* $FAI_CONFIGDIR
+fi
+
+# setup network
+dhclient eth0  # connection to the outside world (hopefully)
+ifconfig eth0:1 192.168.1.250 # (fixed address of faiserver)
+/etc/init.d/nscd restart
+/etc/init.d/apache2 restart
+/etc/init.d/apt-proxy restart
+
+fai-setup -v 2>&1 | tee /var/log/fai-setup.log
+
+# create default pxelinux boot configuration (boot from local disk)
+fai-chboot -o default
+
+echo "Log files are saved to /var/log/fai-setup.log"
+
+# remove me
+rm $0


Property changes on: branches/lhm/examples/simple/files/etc/rc2.d/S99fai-setup/FAISERVER
___________________________________________________________________
Added: svn:executable
   + 

Added: branches/lhm/examples/simple/hooks/instsoft.FAIBASE
===================================================================
--- branches/lhm/examples/simple/hooks/instsoft.FAIBASE	                        (rev 0)
+++ branches/lhm/examples/simple/hooks/instsoft.FAIBASE	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,3 @@
+#! /bin/bash
+
+[ -s $target/etc/kernel-img.conf ] || fcopy -Bi /etc/kernel-img.conf


Property changes on: branches/lhm/examples/simple/hooks/instsoft.FAIBASE
___________________________________________________________________
Added: svn:executable
   + 

Added: branches/lhm/examples/simple/hooks/savelog.LAST.source
===================================================================
--- branches/lhm/examples/simple/hooks/savelog.LAST.source	                        (rev 0)
+++ branches/lhm/examples/simple/hooks/savelog.LAST.source	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,154 @@
+#! /bin/bash
+
+# parse all log files for error messages
+# print errors and warnings found to error.log
+# WARNING: This will only work with english error messages!
+
+errfile=$LOGDIR/error.log
+
+# Define grep patterns. Do not start or end with an empty line!
+globalerrorpatterns="error
+fail
+warn
+bad
+no space
+syntax
+Couldn't stat
+Cannot access
+is bigger than the limit
+did not exist
+non existent
+not found
+couldn't
+can't
+E: Sorry, broken packages
+operator expected
+ambiguous redirect
+No previous regular expression
+No such
+Device or resource busy
+unknown option
+[a-z]\+\.log:E: 
+No candidate version found
+segfault
+Couldn't find any package whose name or description matched
+cannot create
+The following packages have unmet dependencies"
+
+globalignorepatterns="[a-z]\+\.log:# 
+:+ error=0
+:+ trap error=
+task_error_func=
+STOP_ON_ERROR=
+courier-webadmin
+gstreamer0.10-plugins-bad
+ibwebadmin
+kernel-patch-badram
+kolab-webadmin
+kolabadmin
+gstreamer0.10-plugins-really-bad
+gsambad
+libad
+libtest-nowarnings-perl
+libtest-warn-perl
+libclass-errorhandler-perl
+zope-ploneerrorreporting
+libroxen-errormessage
+liberror-perl
+libgpg-error-dev
+libgpg-error0
+^fstab.\+errors=remount
+[RT]X packets:
+WARNING: unexpected IO-APIC
+warned about = ( )
+daemon.warn
+kern.warn
+rw,errors=
+Expect some cache
+no error
+failmsg
+RPC call returned error 101
+deverror.out
+(floppy), sector 0
+mount version older than kernel
+Can't locate module 
+Warning only 896MB will be used.
+hostname: Host name lookup failure
+I can't tell the difference.
+warning, not much extra random data, consider using the -rand option
+confC._FILE
+Warning: 3 database(s) sources
+were not found, (but were created)
+removing exim
+The home dir you specified already exists.
+No Rule for /usr/lib/ispell/default.hash.
+/usr/sbin/update-fonts-.\+: warning: absolute path
+hostname: Unknown server error
+EXT2-fs warning: checktime reached
+RPC: sendmsg returned error 101
+can't print them to stdout. Define these classes
+warning: downgrading
+suppress emacs errors
+echo Error: 
+Can't open dependencies file
+documents in /usr/doc are no longer supported
+if you have both a SCSI and an IDE CD-ROM
+Warning: /proc/ide/hd?/settings interface is obsolete, and will be removed soon
+Monitoring disabled
+Error: only one processor found.
+Error Recovery Strategy:
+sector 0 does not have an
+syslogin_perform_logout: logout() returned an error
+grub is not in an XFS filesystem.
+is harmless
+not updating .\+ font directory data.
+register_serial(): autoconfig failed
+Fontconfig error: Cannot load default config file
+asking for cache data failed
+However, I can not read the target:
+fai-kernels/modules.dep: No such file
+Warning: The partition table looks like it was made
+task_error_code=0
+^info: Trying to set 
+warning: /usr/lib/X11/fonts
+can't read /etc/udev/rules.d/z25_persistent-net.rules
+/cow': No such file or directory
+Dummy start-stop-daemon called
+cdrom: open failed."
+
+# add pattern on some conditions
+if [ -n $FAI_ALLOW_UNSIGNED ] ; then
+   globalignorepatterns="$globalignorepatterns
+WARNING: untrusted versions
+Ignoring these trust violations"
+fi
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Here you can define your own patterns. Put one pattern in a line,
+# do not create empty lines.
+myerrorpatterns="XXXXX"
+myignorepatterns="XXXXX"
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# The main routine
+errorpatterns="$globalerrorpatterns
+$myerrorpatterns"
+ignorepatterns="$globalignorepatterns
+$myignorepatterns"
+
+cd $LOGDIR || exit 3
+if [ -s $errfile ]; then
+    echo "Errorfile already exists. Aborting."
+    exit
+fi
+
+grep -i "$errorpatterns" *.log | grep -vi "$ignorepatterns" > $errfile
+if [ "$verbose" ]; then
+    egrep -v '^software.log:' $errfile > $LOGDIR/tempfile
+    mv $LOGDIR/tempfile $errfile
+fi
+
+if [ -s $errfile ]; then
+   echo "ERRORS found in log files. See $errfile"
+else
+   echo "Congratulations! No errors found in log files."
+   export flag_reboot=1
+fi


Property changes on: branches/lhm/examples/simple/hooks/savelog.LAST.source
___________________________________________________________________
Added: svn:executable
   + 

Added: branches/lhm/examples/simple/package_config/DEFAULT
===================================================================
--- branches/lhm/examples/simple/package_config/DEFAULT	                        (rev 0)
+++ branches/lhm/examples/simple/package_config/DEFAULT	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,20 @@
+PACKAGES aptitude I386
+linux-image-486
+memtest86+
+
+PACKAGES aptitude CHROOT
+linux-image-486-
+linux-image-amd64-
+
+PACKAGES aptitude AMD64
+linux-image-amd64
+memtest86+
+
+PACKAGES aptitude DHCPC
+dhcp3-client
+
+PACKAGES aptitude GRUB
+grub lilo-
+
+PACKAGES aptitude LILO
+lilo grub-

Added: branches/lhm/examples/simple/package_config/DEMO
===================================================================
--- branches/lhm/examples/simple/package_config/DEMO	                        (rev 0)
+++ branches/lhm/examples/simple/package_config/DEMO	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,10 @@
+# some packages we need on a demo machine
+
+PACKAGES aptitude
+fortune-mod fortunes
+rstat-client #rstatd
+rusers rusersd
+
+# only when also class XORG is defined
+PACKAGES aptitude XORG
+bb frozen-bubble xpenguins

Added: branches/lhm/examples/simple/package_config/FAIBASE
===================================================================
--- branches/lhm/examples/simple/package_config/FAIBASE	                        (rev 0)
+++ branches/lhm/examples/simple/package_config/FAIBASE	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,26 @@
+PACKAGES aptitude
+fai-client
+cfengine2
+cron
+debconf-utils
+discover
+file
+hdparm
+jove
+less
+linuxlogo
+nfs-common
+nscd
+rdate
+rsync
+rsh-client
+openssh-client openssh-server
+strace
+tcsh
+time
+procinfo
+exim4
+eject
+locales
+console-common
+pciutils usbutils

Added: branches/lhm/examples/simple/package_config/FAISERVER
===================================================================
--- branches/lhm/examples/simple/package_config/FAISERVER	                        (rev 0)
+++ branches/lhm/examples/simple/package_config/FAISERVER	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,14 @@
+PACKAGES aptitude
+fai-quickstart
+
+dhcp3-client
+debmirror tcpdump
+apache2
+genisoimage grub
+apt-proxy lftp
+
+PACKAGES aptitude I386
+syslinux
+
+PACKAGES aptitude AMD64
+syslinux

Added: branches/lhm/examples/simple/package_config/GERMAN
===================================================================
--- branches/lhm/examples/simple/package_config/GERMAN	                        (rev 0)
+++ branches/lhm/examples/simple/package_config/GERMAN	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,5 @@
+PACKAGES aptitude
+german
+
+PACKAGES aptitude GNOME
+iceweasel-l10n-de icedove-l10n-de

Added: branches/lhm/examples/simple/package_config/GNOME
===================================================================
--- branches/lhm/examples/simple/package_config/GNOME	                        (rev 0)
+++ branches/lhm/examples/simple/package_config/GNOME	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,17 @@
+PACKAGES aptitude
+
+iceweasel
+icedove
+iceweasel-gnome-support
+icedove-gnome-support
+menu gdm
+gnome-apt
+gnome-core
+desktop-base
+evince gconf-editor
+gnome-backgrounds gnome-about gnome-keyring gnome-menus
+gnome-netstatus-applet gnome-nettool gnome-power-manager
+gnome-screensaver gnome-system-monitor gnome-system-tools
+gnome-network-admin gnome-themes 
+gnome-utils gucharmap
+libgnomevfs2-bin libgnomevfs2-extra libgnome2-perl

Added: branches/lhm/examples/simple/package_config/XORG
===================================================================
--- branches/lhm/examples/simple/package_config/XORG	                        (rev 0)
+++ branches/lhm/examples/simple/package_config/XORG	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,6 @@
+PACKAGES aptitude
+xorg xserver-xorg-video-all xserver-xorg-input-all
+ttf-freefont
+xscreensaver
+xscreensaver-gl
+xterm

Added: branches/lhm/examples/simple/scripts/AMD64/99-discover-bug
===================================================================
--- branches/lhm/examples/simple/scripts/AMD64/99-discover-bug	                        (rev 0)
+++ branches/lhm/examples/simple/scripts/AMD64/99-discover-bug	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,14 @@
+#! /usr/sbin/cfagent -f
+
+# this is a workaround for bug #343338
+
+control:
+   any::
+   actionsequence = ( editfiles )
+   EditFileSize = ( 30000 )
+
+editfiles:
+   any::
+	{ ${target}/etc/discover-modprobe.conf
+	  ReplaceAll "^types=.*" With "types="
+	}


Property changes on: branches/lhm/examples/simple/scripts/AMD64/99-discover-bug
___________________________________________________________________
Added: svn:executable
   + 

Added: branches/lhm/examples/simple/scripts/DEMO/10-misc
===================================================================
--- branches/lhm/examples/simple/scripts/DEMO/10-misc	                        (rev 0)
+++ branches/lhm/examples/simple/scripts/DEMO/10-misc	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,14 @@
+#! /bin/bash
+
+# (c) Thomas Lange, 2001-2007, lange at debian.org
+
+ifclass XORG && {
+    fcopy -M /etc/X11/xorg.conf
+#    [ -n "$VIDEODRIVER" ] || VIDEODRIVER=vesa
+#    grep -q %%VIDEODRIVER%% $target/etc/X11/xorg.conf &&
+#    perl -pi.orig -pe "s/%%VIDEODRIVER%%/$VIDEODRIVER/" $target/etc/X11/xorg.conf
+}
+
+# add a demo user account
+$ROOTCMD adduser --disabled-login --gecos "fai demo user" demo
+echo "demo:$ROOTPW" | $ROOTCMD chpasswd --encrypted


Property changes on: branches/lhm/examples/simple/scripts/DEMO/10-misc
___________________________________________________________________
Added: svn:executable
   + 

Added: branches/lhm/examples/simple/scripts/DEMO/30-demo
===================================================================
--- branches/lhm/examples/simple/scripts/DEMO/30-demo	                        (rev 0)
+++ branches/lhm/examples/simple/scripts/DEMO/30-demo	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,20 @@
+#! /usr/sbin/cfagent -f
+
+control:
+   any::
+   actionsequence = ( files editfiles )
+   EditFileSize = ( 30000 )
+
+files:
+   any::
+
+# floppy and cdroms are accessible for all
+        ${target}/dev include=fd* mode=666   action=fixall r=1
+        ${target}/dev include=sr* mode=444   action=fixall r=1
+
+editfiles:
+   any::
+
+	{ ${target}/etc/init.d/sysklogd
+	  ReplaceAll "^SYSLOGD=.*" With 'SYSLOGD="-m 360"'
+	}


Property changes on: branches/lhm/examples/simple/scripts/DEMO/30-demo
___________________________________________________________________
Added: svn:executable
   + 

Added: branches/lhm/examples/simple/scripts/FAIBASE/10-misc
===================================================================
--- branches/lhm/examples/simple/scripts/FAIBASE/10-misc	                        (rev 0)
+++ branches/lhm/examples/simple/scripts/FAIBASE/10-misc	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,32 @@
+#! /bin/bash
+
+# (c) Thomas Lange, 2001-2008, lange at debian.org
+
+error=0 ; trap "error=$((error|1))" ERR
+
+# a list of modules which are loaded at boot time
+fcopy -i /etc/modules
+for module in $MODULESLIST; do
+    ainsl -a $target/etc/modules "^$module$"
+done
+
+fcopy /etc/hostname || echo $HOSTNAME     > $target/etc/hostname
+echo $TIMEZONE    > $target/etc/timezone
+ln -fs /usr/share/zoneinfo/${TIMEZONE} $target/etc/localtime
+
+fcopy -iM /etc/hosts /etc/motd
+
+# set root password
+echo "root:$ROOTPW" | $ROOTCMD chpasswd --encrypted
+# make /root accessible only by root
+chmod 0700 $target/root
+chown root:root $target/root
+# copy default dotfiles for root account
+fcopy -ir /root
+
+# create keyboard layout table
+$ROOTCMD bash -c "echo 'console-data console-data/keymap/full select $KEYMAP' | debconf-set-selections"
+$ROOTCMD install-keymap $KEYMAP || true
+# dumpkeys | gzip -9f >$target/etc/console/boottime.kmap.gz
+
+exit $error


Property changes on: branches/lhm/examples/simple/scripts/FAIBASE/10-misc
___________________________________________________________________
Added: svn:executable
   + 

Added: branches/lhm/examples/simple/scripts/FAIBASE/20-removable_media
===================================================================
--- branches/lhm/examples/simple/scripts/FAIBASE/20-removable_media	                        (rev 0)
+++ branches/lhm/examples/simple/scripts/FAIBASE/20-removable_media	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,27 @@
+#! /bin/bash
+
+# (c) Thomas Lange, 2006, lange at debian.org
+# create entries for removable media in fstab and directories in /media
+
+ainsl $target/etc/fstab "/dev/fd0  /media/floppy  auto  users,noauto 0 0"
+
+cdromlist() {
+    [ -f /proc/sys/dev/cdrom/info ] || return
+    devs=$(grep 'drive name:' /proc/sys/dev/cdrom/info | cut -d ":" -f 2)
+    for d in $devs; do
+	echo $d
+    done
+}
+
+fstabline () {
+    line=$(printf "%-15s %-15s %-7s %-15s %-7s %s\n" "$1" "$2" "$3" "$4" "$5" "$6")
+    ainsl $target/etc/fstab "$line"
+}
+
+i=0
+for cdrom in $(cdromlist | tac); do
+    [ $i -eq 0 ] && ln -s cdrom0 $target/media/cdrom
+    mkdir -p $target/media/cdrom$i
+    fstabline /dev/$cdrom /media/cdrom$i udf,iso9660 ro,user,noauto 0 0
+    i=$(($i + 1))
+done


Property changes on: branches/lhm/examples/simple/scripts/FAIBASE/20-removable_media
___________________________________________________________________
Added: svn:executable
   + 

Added: branches/lhm/examples/simple/scripts/FAIBASE/30-interface
===================================================================
--- branches/lhm/examples/simple/scripts/FAIBASE/30-interface	                        (rev 0)
+++ branches/lhm/examples/simple/scripts/FAIBASE/30-interface	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,33 @@
+#! /bin/bash
+
+error=0 ; trap "error=$((error|1))" ERR
+
+if ifclass DHCPC
+then
+    cat > $target/etc/network/interfaces <<-EOF
+	# generated by FAI
+	auto lo eth0
+	iface lo inet loopback
+	iface eth0 inet dhcp
+EOF
+else
+      [ -n "$IPADDR" ] && cat > $target/etc/network/interfaces <<-EOF
+	# generated by FAI
+	auto lo eth0
+	iface lo inet loopback
+	iface eth0 inet static
+	  address $IPADDR
+	  netmask $NETMASK
+	  broadcast $BROADCAST
+	  gateway $GATEWAYS
+EOF
+    [ -n "$NETWORK" ] && echo "localnet $NETWORK" > $target/etc/networks
+    [ -s /etc/resolv.conf ] && cp -p /etc/resolv.conf $target/etc
+    fcopy -i /etc/resolv.conf
+fi
+
+# here fcopy is mostly used, when installing a client for running in a
+# different subnet than during the installation  
+fcopy -iM /etc/network/interfaces /etc/networks
+
+exit $error


Property changes on: branches/lhm/examples/simple/scripts/FAIBASE/30-interface
___________________________________________________________________
Added: svn:executable
   + 

Added: branches/lhm/examples/simple/scripts/FAIBASE/40-misc
===================================================================
--- branches/lhm/examples/simple/scripts/FAIBASE/40-misc	                        (rev 0)
+++ branches/lhm/examples/simple/scripts/FAIBASE/40-misc	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,26 @@
+#! /usr/sbin/cfagent -f
+
+control:
+   any::
+   actionsequence = ( directories editfiles )
+   EditFileSize = ( 30000 )
+
+directories:
+   any::
+	${target}/tmp mode=1777 owner=0 group=0
+
+editfiles:
+   any::
+	{ ${target}/etc/mailname
+	  AutoCreate
+          AppendIfNoSuchLine "${HOSTNAME}"
+	}
+
+	{ ${target}/etc/default/rcS
+	  ReplaceAll "^UTC=.*" With "UTC=${UTC}"
+	}
+
+	{ ${target}/etc/inittab
+	  ReplaceAll "/sbin/getty 38400"
+		With "/sbin/getty -f /etc/issue.linuxlogo 38400"
+	}


Property changes on: branches/lhm/examples/simple/scripts/FAIBASE/40-misc
___________________________________________________________________
Added: svn:executable
   + 

Added: branches/lhm/examples/simple/scripts/FAISERVER/10-conffiles
===================================================================
--- branches/lhm/examples/simple/scripts/FAISERVER/10-conffiles	                        (rev 0)
+++ branches/lhm/examples/simple/scripts/FAISERVER/10-conffiles	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,14 @@
+#! /bin/bash
+
+fcopy -Bv /etc/dhcp3/dhcpd.conf /etc/default/tftpd-hpa # not needed /etc/apache2/conf.d
+fcopy -Bvr /etc/fai
+
+#/etc/fai/fai.conf /etc/fai/make-fai-nfsroot.conf
+fcopy /etc/apt-proxy/apt-proxy-v2.conf /etc/fai/apt/sources.list
+# use the same sources.list for the server itself and the clients
+cp -a $target/etc/fai/apt $target/etc/
+
+rm -f $target/etc/resolv.conf
+
+# create some host entries
+perl -e 'for (1..25) {printf "192.168.1.%s atom%02s\n",$_,$_;}' >> $target/etc/hosts


Property changes on: branches/lhm/examples/simple/scripts/FAISERVER/10-conffiles
___________________________________________________________________
Added: svn:executable
   + 

Added: branches/lhm/examples/simple/scripts/FAISERVER/20-copy-mirror
===================================================================
--- branches/lhm/examples/simple/scripts/FAISERVER/20-copy-mirror	                        (rev 0)
+++ branches/lhm/examples/simple/scripts/FAISERVER/20-copy-mirror	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,15 @@
+#! /bin/bash
+
+# TODO: if we install from network copy the package mirror via, e.g., wget
+
+[ -d /media/mirror ] || exit 0
+
+echo "Copying Debian mirror from CD to local disk. This may take some time."
+mkdir -p $target/var/www/debian
+cp -a /media/mirror/* $target/var/www/debian
+
+cd $target/var/www/debian/dists
+# this link can only work when lenny is released. For testing before the release use : ln -s testing lenny
+ln -s stable lenny
+
+fcopy -v /etc/rc2.d/S99fai-setup


Property changes on: branches/lhm/examples/simple/scripts/FAISERVER/20-copy-mirror
___________________________________________________________________
Added: svn:executable
   + 

Added: branches/lhm/examples/simple/scripts/GRUB/10-setup
===================================================================
--- branches/lhm/examples/simple/scripts/GRUB/10-setup	                        (rev 0)
+++ branches/lhm/examples/simple/scripts/GRUB/10-setup	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,8 @@
+#! /bin/bash
+
+error=0 ; trap "error=$((error|1))" ERR
+
+fcopy -Uv /boot/grub/menu.lst
+
+exit $error
+


Property changes on: branches/lhm/examples/simple/scripts/GRUB/10-setup
___________________________________________________________________
Added: svn:executable
   + 

Added: branches/lhm/examples/simple/scripts/LAST/50-misc
===================================================================
--- branches/lhm/examples/simple/scripts/LAST/50-misc	                        (rev 0)
+++ branches/lhm/examples/simple/scripts/LAST/50-misc	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,35 @@
+#! /bin/bash
+
+# copyright Thomas Lange 2001-2007, lange at debian.org
+
+error=0 ; trap "error=$((error|1))" ERR
+
+# remove backup files from cfengine
+dirs="root etc var"
+for path in $dirs; do
+    find $target/$path -maxdepth 20 -name \*.cfedited -o -name \*.cfsaved | xargs -r rm
+done
+
+[ "$FAI_DEBMIRROR" ] && 
+echo "#$FAI_DEBMIRROR $MNTPOINT nfs ro 0 0" >> $target/etc/fstab
+
+# set bios clock
+if [ $do_init_tasks -eq 1 ] ; then
+    case "$UTC" in
+       no|"") hwopt="--localtime" ;;
+       yes)   hwopt="--utc"       ;;
+    esac
+    $ROOTCMD hwclock $hwopt --systohc || true
+fi
+
+# Make sure everything is configured properly
+echo "Running \"apt-get -f install\" for the last time."
+$ROOTCMD apt-get -f install
+
+lskernels=$(echo $target/boot/vmlinu*)
+[ -f ${lskernels%% *} ] || echo "ERROR: No kernel was installed. Have a look at shell.log"
+# copy sources.list
+fcopy -i /etc/apt/sources.list
+
+exit $error
+


Property changes on: branches/lhm/examples/simple/scripts/LAST/50-misc
___________________________________________________________________
Added: svn:executable
   + 

Added: branches/lhm/examples/simple/scripts/LILO/20-create-liloconf
===================================================================
--- branches/lhm/examples/simple/scripts/LILO/20-create-liloconf	                        (rev 0)
+++ branches/lhm/examples/simple/scripts/LILO/20-create-liloconf	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,72 @@
+#! /bin/bash
+
+# copyright Thomas Lange 2001-2005, lange at debian.org
+# LILO support may be dropped in a future release
+
+FFLAGS=${FAI_FLAGS// /,}
+
+cd $target/boot && kernelversion=$(ls vmlinuz-*)
+
+# if class NOMBR is defined, write boot loader into root partition, not into mbr
+ifclass NOMBR && BOOT_DEVICE=$ROOT_PARTITION
+
+if ifclass LILO; then
+  fcopy /etc/lilo.conf || {
+    # if the installed kernel is using an initial ramdisk
+    if [ -L $target/initrd.img ]; then
+	initrdopt="initrd=/initrd.img"
+    fi
+    # write lilo.conf and install lilo to disk
+    echo "Creating lilo.conf for /vmlinuz"
+    cat > $target/etc/lilo.conf <<-EOF
+	boot=$BOOT_DEVICE
+	root=$ROOT_PARTITION
+	install=/boot/boot.b
+	map=/boot/map
+	vga=normal
+	delay=50
+
+	image=/vmlinuz
+	append="devfs=nomount $kappend"
+	$initrdopt
+	label=linux
+        read-only
+
+	image=/vmlinuz.old
+	label=linux.old
+	read-only
+	optional
+	$liloappend
+EOF
+  }
+fi
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ifclass FAI_BOOTPART && {
+
+    rev=`uname -r`
+    mkdir -p $target/fai-boot
+    cp -a /boot/vmlinuz-$rev $target/fai-boot
+
+    ifclass LILO && {
+    # write lilo.conf and install lilo to disk
+	echo "Add /fai-boot partition to lilo.conf"
+
+	cat >> $target/etc/lilo.conf <<-EOF
+	image=/fai-boot/boot/$kernelversion
+	$initrdopt
+	append="devfs=nomount"
+	label=FAI
+EOF
+	mkdir $target/fai-boot/etc
+	cp $target/etc/lilo.conf $target/fai-boot/etc
+    }
+
+}
+
+# now call lilo
+# you can also use this
+# $ROOTCMD lilo -v
+if ifclass LILO; then
+    $target/sbin/lilo -r $target
+fi


Property changes on: branches/lhm/examples/simple/scripts/LILO/20-create-liloconf
___________________________________________________________________
Added: svn:executable
   + 

Added: branches/lhm/fai_lhm_branch.ls
===================================================================
--- branches/lhm/fai_lhm_branch.ls	                        (rev 0)
+++ branches/lhm/fai_lhm_branch.ls	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,400 @@
+.:
+insgesamt 56
+drwx------ 3 ignaz.forster limux-users 4096 2009-08-03 16:35 bin
+drwx------ 3 ignaz.forster limux-users 4096 2009-09-22 10:06 conf
+drwx------ 3 ignaz.forster limux-users 4096 2009-10-28 14:24 debian
+drwx------ 4 ignaz.forster limux-users 4096 2009-08-03 16:35 doc
+drwx------ 5 ignaz.forster limux-users 4096 2009-08-03 16:35 examples
+-rw------- 1 ignaz.forster limux-users    0 2009-10-28 16:22 fai_lhm_branch.ls
+drwx------ 4 ignaz.forster limux-users 4096 2009-10-19 15:30 lib
+-rw------- 1 ignaz.forster limux-users 2108 2009-09-22 16:40 Makefile
+drwx------ 3 ignaz.forster limux-users 4096 2009-08-03 16:35 man
+drwx------ 3 ignaz.forster limux-users 4096 2009-08-03 16:35 pixmaps
+-rw------- 1 ignaz.forster limux-users 2374 2009-01-12 12:41 README
+-rw------- 1 ignaz.forster limux-users  247 2005-10-18 16:51 README.build-sources
+-rw------- 1 ignaz.forster limux-users 2234 2008-09-16 14:08 THANKS
+drwx------ 3 ignaz.forster limux-users 4096 2009-08-03 16:35 utils
+-rw------- 1 ignaz.forster limux-users  175 2008-08-29 17:04 VERSION
+
+./bin:
+insgesamt 248
+-rwx------ 1 ignaz.forster limux-users  4147 2008-06-18 06:30 ainsl
+-rwx------ 1 ignaz.forster limux-users   786 2007-06-11 14:26 device2grub
+-rwx------ 1 ignaz.forster limux-users    86 2006-06-09 14:50 dhclient-fai-script
+-rwx------ 1 ignaz.forster limux-users  9913 2009-09-22 16:40 fai
+-rwx------ 1 ignaz.forster limux-users 10218 2008-09-05 19:59 fai-cd
+-rwx------ 1 ignaz.forster limux-users 13258 2008-01-16 12:26 fai-chboot
+-rwx------ 1 ignaz.forster limux-users  5994 2009-09-22 16:40 fai-class
+-rwx------ 1 ignaz.forster limux-users  4292 2007-11-10 14:54 fai-debconf
+-rw------- 1 ignaz.forster limux-users  5677 2009-09-22 16:40 fai-do-scripts
+-rwx------ 1 ignaz.forster limux-users 11483 2008-12-09 13:15 fai-mirror
+-rwx------ 1 ignaz.forster limux-users  5545 2007-08-30 17:59 faimond
+-rwx------ 1 ignaz.forster limux-users  5530 2007-11-25 01:00 faimond-gui
+-rwx------ 1 ignaz.forster limux-users  1126 2009-09-22 16:40 faireboot
+-rw------- 1 ignaz.forster limux-users  7143 2008-06-19 09:35 fai-setup
+-rwx------ 1 ignaz.forster limux-users  1796 2007-11-10 14:55 fai-start-stop-daemon
+-rwx------ 1 ignaz.forster limux-users   491 2005-12-30 16:31 fai-statoverride
+-rwx------ 1 ignaz.forster limux-users 16028 2008-10-22 12:25 fcopy
+-rwx------ 1 ignaz.forster limux-users  4437 2008-06-16 14:29 ftar
+-rwx------ 1 ignaz.forster limux-users 16470 2009-09-22 16:40 install_packages
+-rwx------ 1 ignaz.forster limux-users 19475 2009-09-22 16:40 make-fai-nfsroot
+-rwx------ 1 ignaz.forster limux-users   130 2006-09-06 11:19 policy-rc.d.fai
+-rwx------ 1 ignaz.forster limux-users 42750 2009-09-22 16:40 setup_harddisks
+-rwx------ 1 ignaz.forster limux-users  7081 2008-12-22 14:52 setup-storage
+
+./conf:
+insgesamt 32
+-rw------- 1 ignaz.forster limux-users  485 2006-09-25 12:36 apt.conf
+-rw------- 1 ignaz.forster limux-users  327 2006-06-09 15:15 dhclient-fai.conf
+-rw------- 1 ignaz.forster limux-users 1638 2009-09-22 16:40 fai.conf
+-rw------- 1 ignaz.forster limux-users  550 2005-10-08 22:30 fai_modules_off
+-rw------- 1 ignaz.forster limux-users 1267 2008-09-05 18:37 make-fai-nfsroot.conf
+-rw------- 1 ignaz.forster limux-users 1402 2007-06-13 22:06 menu.lst
+-rw------- 1 ignaz.forster limux-users  931 2008-08-10 13:32 NFSROOT
+-rw------- 1 ignaz.forster limux-users  465 2008-08-09 13:32 sources.list
+
+./debian:
+insgesamt 264
+-rw------- 1 ignaz.forster limux-users 114176 2009-10-19 15:30 changelog
+-rw------- 1 ignaz.forster limux-users      2 2005-10-18 22:08 compat
+-rw------- 1 ignaz.forster limux-users   4054 2009-09-22 16:40 control
+-rw------- 1 ignaz.forster limux-users   1339 2008-08-10 11:33 copyright
+-rw------- 1 ignaz.forster limux-users     40 2006-09-13 13:37 docs
+-rw------- 1 ignaz.forster limux-users     49 2005-11-23 22:10 fai-client.dirs
+-rw------- 1 ignaz.forster limux-users    581 2008-06-12 13:59 fai-client.install
+-rw------- 1 ignaz.forster limux-users    276 2008-09-03 13:04 fai-client.manpages
+-rw------- 1 ignaz.forster limux-users    102 2008-09-06 10:21 fai-client.postrm
+-rw------- 1 ignaz.forster limux-users     37 2005-10-18 22:12 fai-doc.dirs
+-rw------- 1 ignaz.forster limux-users    511 2008-09-06 13:00 fai-doc.doc-base.package
+-rw------- 1 ignaz.forster limux-users     60 2007-08-21 10:20 fai-nfsroot.dirs
+-rw------- 1 ignaz.forster limux-users    365 2009-09-22 16:40 fai-nfsroot.install
+-rwx------ 1 ignaz.forster limux-users    219 2007-08-21 12:35 fai-nfsroot.postinst
+-rwx------ 1 ignaz.forster limux-users    216 2007-08-21 11:39 fai-nfsroot.postrm
+-rwx------ 1 ignaz.forster limux-users    243 2006-06-09 14:52 fai-nfsroot.preinst
+-rwx------ 1 ignaz.forster limux-users    170 2006-09-07 18:21 fai-nfsroot.prerm
+-rw------- 1 ignaz.forster limux-users     28 2008-08-11 18:11 fai-quickstart.dirs
+-rw------- 1 ignaz.forster limux-users     54 2005-10-12 13:28 fai-quickstart.links
+-rw------- 1 ignaz.forster limux-users    190 2008-08-11 18:21 fai-quickstart.lintian
+-rw------- 1 ignaz.forster limux-users    991 2007-06-23 23:12 fai-quickstart.postinst
+-rw------- 1 ignaz.forster limux-users    563 2005-11-11 14:46 fai-quickstart.prerm
+-rw------- 1 ignaz.forster limux-users     92 2007-11-12 18:51 fai-server.dirs
+-rw------- 1 ignaz.forster limux-users    276 2008-09-04 15:37 fai-server.install
+-rw------- 1 ignaz.forster limux-users     51 2005-10-12 12:03 fai-server.links
+-rw------- 1 ignaz.forster limux-users    195 2008-12-22 12:11 fai-server.manpages
+-rw------- 1 ignaz.forster limux-users   1732 2007-08-12 16:12 fai-server.postinst
+-rw------- 1 ignaz.forster limux-users    491 2007-08-12 16:12 fai-server.postrm
+-rw------- 1 ignaz.forster limux-users    663 2005-11-23 23:51 fai-server.preinst
+-rw------- 1 ignaz.forster limux-users   1552 2006-07-24 17:12 fai-server.prerm
+-rw------- 1 ignaz.forster limux-users  27711 2008-12-09 13:13 NEWS
+-rwx------ 1 ignaz.forster limux-users   1792 2008-09-05 20:51 rules
+
+./doc:
+insgesamt 228
+-rw------- 1 ignaz.forster limux-users   4550 2005-10-08 22:30 changelog.old
+-rw------- 1 ignaz.forster limux-users   1955 2008-12-09 13:13 classes_description.txt
+-rw------- 1 ignaz.forster limux-users   1127 2008-09-18 19:01 common.ent
+drwx------ 3 ignaz.forster limux-users   4096 2009-08-03 16:35 entities
+-rw------- 1 ignaz.forster limux-users 130012 2008-12-17 02:56 fai-guide.sgml
+-rw------- 1 ignaz.forster limux-users   2042 2006-03-11 17:19 FAQ
+-rw------- 1 ignaz.forster limux-users   2843 2008-12-17 02:36 links.html
+-rw------- 1 ignaz.forster limux-users    882 2006-09-27 15:49 Makefile
+-rw------- 1 ignaz.forster limux-users  53424 2007-09-14 22:58 pixmaps.svg
+-rw------- 1 ignaz.forster limux-users   2030 2008-06-11 14:55 QUESTIONNAIRE
+
+./doc/entities:
+insgesamt 12
+-rw------- 1 ignaz.forster limux-users 3426 2008-12-15 20:15 bootexample.sgml
+-rw------- 1 ignaz.forster limux-users  359 2007-08-21 13:54 bootlog.sgml
+-rw------- 1 ignaz.forster limux-users 2866 2008-09-25 13:26 faisetup.sgml
+
+./examples:
+insgesamt 8
+drwx------  3 ignaz.forster limux-users 4096 2009-08-03 16:35 etc
+drwx------ 10 ignaz.forster limux-users 4096 2009-08-03 16:35 simple
+
+./examples/etc:
+insgesamt 20
+-rw------- 1 ignaz.forster limux-users 1213 2006-07-11 21:47 bootptab
+-rw------- 1 ignaz.forster limux-users  643 2007-09-12 10:55 dhcpd.conf
+-rw------- 1 ignaz.forster limux-users  799 2005-10-08 22:30 hosts
+-rw------- 1 ignaz.forster limux-users  930 2005-10-08 22:30 netgroup
+-rw------- 1 ignaz.forster limux-users 1240 2005-12-10 18:34 sources.list
+
+./examples/simple:
+insgesamt 28
+drwx------  3 ignaz.forster limux-users 4096 2009-08-03 16:35 class
+drwx------  3 ignaz.forster limux-users 4096 2009-08-03 16:35 debconf
+drwx------  3 ignaz.forster limux-users 4096 2009-08-03 16:35 disk_config
+drwx------  5 ignaz.forster limux-users 4096 2009-08-03 16:35 files
+drwx------  3 ignaz.forster limux-users 4096 2009-08-03 16:35 hooks
+drwx------  3 ignaz.forster limux-users 4096 2009-08-03 16:35 package_config
+drwx------ 10 ignaz.forster limux-users 4096 2009-08-03 16:35 scripts
+
+./examples/simple/class:
+insgesamt 20
+-rwx------ 1 ignaz.forster limux-users  261 2007-06-14 22:49 10-base-classes
+-rwx------ 1 ignaz.forster limux-users 1573 2008-06-13 16:00 20-hwdetect.source
+-rwx------ 1 ignaz.forster limux-users  381 2007-02-07 17:10 50-host-classes
+-rw------- 1 ignaz.forster limux-users  924 2008-09-05 09:58 FAIBASE.var
+-rw------- 1 ignaz.forster limux-users   49 2006-09-05 14:39 GERMAN.var
+
+./examples/simple/debconf:
+insgesamt 12
+-rw------- 1 ignaz.forster limux-users 605 2007-07-09 16:33 FAIBASE
+-rw------- 1 ignaz.forster limux-users  85 2006-09-19 20:01 FAISERVER
+-rw------- 1 ignaz.forster limux-users 203 2006-09-22 17:28 GERMAN
+
+./examples/simple/disk_config:
+insgesamt 8
+-rw------- 1 ignaz.forster limux-users 594 2008-09-05 10:33 FAIBASE
+-rw------- 1 ignaz.forster limux-users 685 2008-09-05 10:36 FAISERVER
+
+./examples/simple/files:
+insgesamt 8
+drwx------  4 ignaz.forster limux-users 4096 2009-08-03 16:35 boot
+drwx------ 12 ignaz.forster limux-users 4096 2009-08-03 16:35 etc
+
+./examples/simple/files/boot:
+insgesamt 4
+drwx------ 4 ignaz.forster limux-users 4096 2009-08-03 16:35 grub
+
+./examples/simple/files/boot/grub:
+insgesamt 4
+drwx------ 3 ignaz.forster limux-users 4096 2009-08-03 16:35 menu.lst
+
+./examples/simple/files/boot/grub/menu.lst:
+insgesamt 8
+-rw------- 1 ignaz.forster limux-users 1024 2005-10-08 22:30 GRUB
+-rwx------ 1 ignaz.forster limux-users  606 2007-11-10 16:50 postinst
+
+./examples/simple/files/etc:
+insgesamt 36
+drwx------ 4 ignaz.forster limux-users 4096 2009-08-03 16:35 apache2
+drwx------ 4 ignaz.forster limux-users 4096 2009-08-03 16:35 apt-proxy
+drwx------ 4 ignaz.forster limux-users 4096 2009-08-03 16:35 default
+drwx------ 4 ignaz.forster limux-users 4096 2009-08-03 16:35 dhcp3
+drwx------ 8 ignaz.forster limux-users 4096 2009-08-03 16:35 fai
+drwx------ 3 ignaz.forster limux-users 4096 2009-08-03 16:35 kernel-img.conf
+drwx------ 3 ignaz.forster limux-users 4096 2009-08-03 16:35 motd
+drwx------ 4 ignaz.forster limux-users 4096 2009-08-03 16:35 rc2.d
+drwx------ 4 ignaz.forster limux-users 4096 2009-08-03 16:35 X11
+
+./examples/simple/files/etc/apache2:
+insgesamt 4
+drwx------ 3 ignaz.forster limux-users 4096 2009-08-03 16:35 conf.d
+
+./examples/simple/files/etc/apache2/conf.d:
+insgesamt 4
+-rw------- 1 ignaz.forster limux-users 444 2006-09-25 14:57 FAISERVER
+
+./examples/simple/files/etc/apt-proxy:
+insgesamt 4
+drwx------ 3 ignaz.forster limux-users 4096 2009-08-03 16:35 apt-proxy-v2.conf
+
+./examples/simple/files/etc/apt-proxy/apt-proxy-v2.conf:
+insgesamt 4
+-rw------- 1 ignaz.forster limux-users 4014 2006-03-31 18:25 FAISERVER
+
+./examples/simple/files/etc/default:
+insgesamt 4
+drwx------ 3 ignaz.forster limux-users 4096 2009-08-03 16:35 tftpd-hpa
+
+./examples/simple/files/etc/default/tftpd-hpa:
+insgesamt 4
+-rw------- 1 ignaz.forster limux-users 67 2006-07-11 21:41 FAISERVER
+
+./examples/simple/files/etc/dhcp3:
+insgesamt 4
+drwx------ 3 ignaz.forster limux-users 4096 2009-08-03 16:35 dhcpd.conf
+
+./examples/simple/files/etc/dhcp3/dhcpd.conf:
+insgesamt 4
+-rw------- 1 ignaz.forster limux-users 2375 2008-12-16 23:03 FAISERVER
+
+./examples/simple/files/etc/fai:
+insgesamt 20
+drwx------ 4 ignaz.forster limux-users 4096 2009-08-03 16:35 apt
+drwx------ 3 ignaz.forster limux-users 4096 2009-08-03 16:35 fai.conf
+drwx------ 3 ignaz.forster limux-users 4096 2009-08-03 16:35 make-fai-nfsroot.conf
+drwx------ 3 ignaz.forster limux-users 4096 2009-08-03 16:35 menu.lst
+drwx------ 3 ignaz.forster limux-users 4096 2009-08-03 16:35 sources.list
+
+./examples/simple/files/etc/fai/apt:
+insgesamt 4
+drwx------ 3 ignaz.forster limux-users 4096 2009-08-03 16:35 sources.list
+
+./examples/simple/files/etc/fai/apt/sources.list:
+insgesamt 4
+-rw------- 1 ignaz.forster limux-users 361 2008-12-09 13:14 FAISERVER
+
+./examples/simple/files/etc/fai/fai.conf:
+insgesamt 4
+-rw------- 1 ignaz.forster limux-users 1371 2006-09-25 15:02 FAISERVER
+
+./examples/simple/files/etc/fai/make-fai-nfsroot.conf:
+insgesamt 4
+-rw------- 1 ignaz.forster limux-users 1062 2008-09-05 18:36 FAISERVER
+
+./examples/simple/files/etc/fai/menu.lst:
+insgesamt 4
+-rw------- 1 ignaz.forster limux-users 1557 2006-01-06 10:44 FAISERVER
+
+./examples/simple/files/etc/fai/sources.list:
+insgesamt 0
+
+./examples/simple/files/etc/kernel-img.conf:
+insgesamt 4
+-rw------- 1 ignaz.forster limux-users 91 2005-10-08 22:30 DEFAULT
+
+./examples/simple/files/etc/motd:
+insgesamt 4
+-rw------- 1 ignaz.forster limux-users 55 2005-11-23 23:08 FAIBASE
+
+./examples/simple/files/etc/rc2.d:
+insgesamt 4
+drwx------ 3 ignaz.forster limux-users 4096 2009-08-03 16:35 S99fai-setup
+
+./examples/simple/files/etc/rc2.d/S99fai-setup:
+insgesamt 4
+-rwx------ 1 ignaz.forster limux-users 696 2006-04-20 11:39 FAISERVER
+
+./examples/simple/files/etc/X11:
+insgesamt 4
+drwx------ 3 ignaz.forster limux-users 4096 2009-08-03 16:35 XF86Config-4
+
+./examples/simple/files/etc/X11/XF86Config-4:
+insgesamt 0
+
+./examples/simple/hooks:
+insgesamt 8
+-rwx------ 1 ignaz.forster limux-users   83 2007-02-07 17:11 instsoft.FAIBASE
+-rwx------ 1 ignaz.forster limux-users 3966 2009-09-22 16:40 savelog.LAST.source
+
+./examples/simple/package_config:
+insgesamt 28
+-rw------- 1 ignaz.forster limux-users 274 2007-09-07 15:49 DEFAULT
+-rw------- 1 ignaz.forster limux-users 208 2006-10-18 16:17 DEMO
+-rw------- 1 ignaz.forster limux-users 247 2008-08-09 00:22 FAIBASE
+-rw------- 1 ignaz.forster limux-users 172 2008-09-05 16:30 FAISERVER
+-rw------- 1 ignaz.forster limux-users  84 2008-09-05 16:26 GERMAN
+-rw------- 1 ignaz.forster limux-users 424 2008-09-05 16:07 GNOME
+-rw------- 1 ignaz.forster limux-users 117 2008-09-05 16:26 XORG
+
+./examples/simple/scripts:
+insgesamt 28
+drwx------ 3 ignaz.forster limux-users 4096 2009-08-03 16:35 AMD64
+drwx------ 3 ignaz.forster limux-users 4096 2009-08-03 16:35 DEMO
+drwx------ 3 ignaz.forster limux-users 4096 2009-08-03 16:35 FAIBASE
+drwx------ 3 ignaz.forster limux-users 4096 2009-08-03 16:35 FAISERVER
+drwx------ 3 ignaz.forster limux-users 4096 2009-08-03 16:35 GRUB
+drwx------ 3 ignaz.forster limux-users 4096 2009-08-03 16:35 LAST
+drwx------ 3 ignaz.forster limux-users 4096 2009-08-03 16:35 LILO
+
+./examples/simple/scripts/AMD64:
+insgesamt 4
+-rwx------ 1 ignaz.forster limux-users 249 2006-08-01 17:39 99-discover-bug
+
+./examples/simple/scripts/DEMO:
+insgesamt 8
+-rwx------ 1 ignaz.forster limux-users 445 2007-02-07 22:16 10-misc
+-rwx------ 1 ignaz.forster limux-users 408 2006-08-01 17:38 30-demo
+
+./examples/simple/scripts/FAIBASE:
+insgesamt 16
+-rwx------ 1 ignaz.forster limux-users 926 2008-09-05 18:28 10-misc
+-rwx------ 1 ignaz.forster limux-users 744 2007-06-23 23:14 20-removable_media
+-rwx------ 1 ignaz.forster limux-users 809 2007-11-15 14:32 30-interface
+-rwx------ 1 ignaz.forster limux-users 477 2006-10-11 00:12 40-misc
+
+./examples/simple/scripts/FAISERVER:
+insgesamt 8
+-rwx------ 1 ignaz.forster limux-users 487 2007-01-11 17:55 10-conffiles
+-rwx------ 1 ignaz.forster limux-users 469 2008-09-06 20:10 20-copy-mirror
+
+./examples/simple/scripts/GRUB:
+insgesamt 4
+-rwx------ 1 ignaz.forster limux-users 99 2007-12-01 17:57 10-setup
+
+./examples/simple/scripts/LAST:
+insgesamt 4
+-rwx------ 1 ignaz.forster limux-users 903 2007-02-07 22:17 50-misc
+
+./examples/simple/scripts/LILO:
+insgesamt 4
+-rwx------ 1 ignaz.forster limux-users 1538 2005-10-08 22:30 20-create-liloconf
+
+./lib:
+insgesamt 140
+-rw------- 1 ignaz.forster limux-users   240 2005-10-08 22:30 check_status
+-rw------- 1 ignaz.forster limux-users   500 2007-06-12 22:07 create_resolv_conf
+-rw------- 1 ignaz.forster limux-users  2701 2006-08-02 15:37 dhclient-perl
+-rw------- 1 ignaz.forster limux-users  1055 2009-10-19 15:30 disk-info
+-rw------- 1 ignaz.forster limux-users   430 2009-09-22 16:40 fai-abort
+-rwx------ 1 ignaz.forster limux-users  3439 2007-11-13 23:05 fai-divert
+-rw------- 1 ignaz.forster limux-users  2166 2007-02-07 22:36 fai-mount-disk
+-rwx------ 1 ignaz.forster limux-users  4513 2007-11-20 14:41 fai-savelog
+-rw------- 1 ignaz.forster limux-users  2079 2007-11-10 14:55 fai-savelog-ftp
+-rw------- 1 ignaz.forster limux-users  4477 2008-12-18 17:21 get-boot-info
+-rw------- 1 ignaz.forster limux-users  1267 2009-09-22 16:40 get-config-dir
+-rw------- 1 ignaz.forster limux-users  1167 2009-09-22 16:40 get-config-dir-cvs
+-rwx------ 1 ignaz.forster limux-users   267 2006-09-11 16:18 get-config-dir-file
+-rw------- 1 ignaz.forster limux-users   886 2009-09-22 16:40 get-config-dir-git
+-rw------- 1 ignaz.forster limux-users   447 2009-09-22 16:40 get-config-dir-nfs
+-rwx------ 1 ignaz.forster limux-users  1389 2009-09-22 16:40 get-config-dir-svn
+-rwx------ 1 ignaz.forster limux-users   155 2005-10-08 22:30 list_disks
+-rw------- 1 ignaz.forster limux-users   305 2006-09-05 15:41 load_keymap_consolechars
+-rwx------ 1 ignaz.forster limux-users  4406 2009-09-22 16:40 mount2dir
+-rw------- 1 ignaz.forster limux-users  1286 2009-01-12 13:02 prcopyleft
+drwx------ 3 ignaz.forster limux-users  4096 2009-08-03 16:35 setup-storage
+-rw------- 1 ignaz.forster limux-users 18514 2009-09-22 16:40 subroutines
+-rw------- 1 ignaz.forster limux-users 13654 2009-10-19 15:30 subroutines-linux
+-rw------- 1 ignaz.forster limux-users  1211 2006-11-04 22:46 task_sysinfo
+-rw------- 1 ignaz.forster limux-users  1719 2009-10-09 13:09 updatebase
+
+./lib/setup-storage:
+insgesamt 144
+-rw------- 1 ignaz.forster limux-users 34263 2008-12-22 12:06 Commands.pm
+-rw------- 1 ignaz.forster limux-users 12168 2008-10-28 10:32 Exec.pm
+-rw------- 1 ignaz.forster limux-users 10443 2008-06-13 12:28 Fstab.pm
+-rw------- 1 ignaz.forster limux-users  7037 2008-09-06 17:16 Init.pm
+-rw------- 1 ignaz.forster limux-users 25030 2008-10-14 15:29 Parser.pm
+-rw------- 1 ignaz.forster limux-users 24758 2008-10-14 15:29 Sizes.pm
+-rw------- 1 ignaz.forster limux-users 19793 2008-10-14 15:32 Volumes.pm
+
+./man:
+insgesamt 104
+-rw------- 1 ignaz.forster limux-users  2224 2008-09-16 14:01 ainsl.1
+-rw------- 1 ignaz.forster limux-users  4263 2008-09-16 14:01 fai.8
+-rw------- 1 ignaz.forster limux-users  3606 2008-12-09 13:14 fai-cd.8
+-rw------- 1 ignaz.forster limux-users  5802 2008-10-15 11:25 fai-chboot.8
+-rw------- 1 ignaz.forster limux-users  4347 2008-09-16 19:01 fai-class.1
+-rw------- 1 ignaz.forster limux-users  1761 2008-09-24 10:11 fai-debconf.1
+-rw------- 1 ignaz.forster limux-users  1620 2008-12-09 12:59 fai-do-scripts.1
+-rw------- 1 ignaz.forster limux-users  3512 2008-12-09 12:59 fai-mirror.1
+-rw------- 1 ignaz.forster limux-users  1339 2009-01-08 13:16 faimond.8
+-rw------- 1 ignaz.forster limux-users   659 2009-01-08 13:16 faimond-gui.1
+-rw------- 1 ignaz.forster limux-users  2538 2007-11-11 14:26 fai-setup.8
+-rw------- 1 ignaz.forster limux-users  1024 2005-10-08 22:30 fai-start-stop-daemon.8
+-rw------- 1 ignaz.forster limux-users   526 2008-09-03 11:19 fai-statoverride.8
+-rw------- 1 ignaz.forster limux-users  8262 2008-08-29 17:59 fcopy.8
+-rw------- 1 ignaz.forster limux-users  3180 2008-08-29 17:24 ftar.8
+-rw------- 1 ignaz.forster limux-users  3284 2008-09-16 15:33 install_packages.8
+-rw------- 1 ignaz.forster limux-users  4916 2008-09-16 15:35 make-fai-nfsroot.8
+-rw------- 1 ignaz.forster limux-users 10596 2008-09-16 16:31 setup-storage.8
+
+./pixmaps:
+insgesamt 24
+-rw------- 1 ignaz.forster limux-users   71 2007-08-28 22:37 bar.gif
+-rw------- 1 ignaz.forster limux-users 2748 2007-08-28 22:37 begin.gif
+-rw------- 1 ignaz.forster limux-users 2683 2007-08-28 22:37 fail.gif
+-rw------- 1 ignaz.forster limux-users 2656 2007-09-14 11:55 minor.gif
+-rw------- 1 ignaz.forster limux-users 2656 2007-08-28 22:37 ok.gif
+-rw------- 1 ignaz.forster limux-users 2631 2007-09-14 11:55 warning.gif
+
+./utils:
+insgesamt 20
+-rwx------ 1 ignaz.forster limux-users 1175 2005-10-08 22:30 all_hosts
+-rwx------ 1 ignaz.forster limux-users  462 2006-07-14 14:54 create-nfsroot-tar
+-rwx------ 1 ignaz.forster limux-users 1328 2008-12-09 13:15 mkdebmirror
+-rwx------ 1 ignaz.forster limux-users 1308 2005-10-08 22:30 prtnetgr
+-rwx------ 1 ignaz.forster limux-users 2310 2005-10-08 22:30 rshall

Added: branches/lhm/lib/check_status
===================================================================
--- branches/lhm/lib/check_status	                        (rev 0)
+++ branches/lhm/lib/check_status	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,14 @@
+#! /bin/sh
+
+# check_status <command run> <its result status>
+
+cmd=$1
+st=$2
+
+if [ $st -eq 0 ]; then
+   res="OK."
+else
+   res="FAILED with exit code $st."
+fi
+# put result in the log file
+printf "%-20s $res\n" $cmd | tee -a $LOGDIR/status.log

Added: branches/lhm/lib/create_resolv_conf
===================================================================
--- branches/lhm/lib/create_resolv_conf	                        (rev 0)
+++ branches/lhm/lib/create_resolv_conf	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,18 @@
+#! /bin/sh
+
+### BEGIN SUBROUTINE INFO
+# Provides-Var:    $DNSSRVS $DOMAIN
+# Requires-Var:    none
+# Short-Description: <task desc.>
+### END SUBROUTINE INFO
+
+# create a resolv.conf using the DHCP or BOOTP information
+if [ "$DNSSRVS" ]; then
+	[ "$DOMAIN" ] && echo "domain $DOMAIN" >/etc/resolv.conf
+	for dnshost in $DNSSRVS ; do
+	    echo "nameserver $dnshost" >>/etc/resolv.conf
+	done
+else
+    # use the resolv.conf from the installserver
+    cp -p /etc/resolv.conf-installserver /etc/resolv.conf
+fi

Added: branches/lhm/lib/dhclient-perl
===================================================================
--- branches/lhm/lib/dhclient-perl	                        (rev 0)
+++ branches/lhm/lib/dhclient-perl	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,82 @@
+#! /usr/bin/perl
+
+# $Id: dhclient-perl 3739 2006-08-02 13:37:28Z lange $
+#*********************************************************************
+#
+# dhclient-perl -- perl script that prints out DHCP data
+#
+# This script is part of FAI (Fully Automatic Installation)
+# Copyright (c) 2000-2006 by Thomas Lange, 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.
+#
+# 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.
+#*********************************************************************
+
+# TODO: extract search info from DOMAIN
+
+# map dhcp names to bootp names
+%names = qw/
+  ip_address              IPADDR
+  host_name               HOSTNAME
+  network_number          NETWORK
+  subnet_mask             NETMASK
+  broadcast_address       BROADCAST
+  routers                 GATEWAYS
+  domain_name             DOMAIN
+  domain_name_servers     DNSSRVS
+  server_name             SERVER
+  time_servers            TIMESRVS
+  ntp_servers             NTPSRVS
+  nis_domain              YPDOMAIN
+  nis_servers             YPSRVR
+  fai_config_src          FAI_CONFIG_SRC
+  fai_action              FAI_ACTION
+  fai_flags               FAI_FLAGS
+  option_170              FAI_CONFIG_SRC
+  option_171              FAI_ACTION
+  option_172              FAI_FLAGS
+  option_173              reserved173
+  option_174              reserved174
+  option_175              reserved175
+/;
+
+# these lists should also be listed as single items
+ at list = qw/domain_name_servers routers time_servers ntp_servers nis_servers/;
+%listitem = map { $_ => 1 } @list;
+
+# use short host name
+$ENV{new_host_name} = (split '\.',$ENV{new_host_name})[0];
+
+foreach $name (sort keys %names) {
+  $dhcpname="new_$name";
+  if ($ENV{$dhcpname}) {
+    print "$names{$name}='$ENV{$dhcpname}'\n";
+    items($name) if $listitem{$name};
+  }
+}
+
+exit 0;
+
+
+# - - - - - - - - - - - - - - - - - - - - -
+sub items {
+  my $key = shift;
+  my $i = 1;
+    foreach (split /\s+/,$ENV{"new_$key"}){
+      print "$names{$key}_$i='$_'\n";
+      $i++;
+    }
+}

Added: branches/lhm/lib/disk-info
===================================================================
--- branches/lhm/lib/disk-info	                        (rev 0)
+++ branches/lhm/lib/disk-info	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,31 @@
+#! /bin/bash
+
+### BEGIN SUBROUTINE INFO
+# Provides-Var:    none
+# Requires-Var:    none
+# Short-Description: <task desc.>
+### END SUBROUTINE INFO
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+diskandsize() {
+
+    local isdisk major minor blocks device suffix
+
+    while read major minor blocks device suffix; do
+	isdisk=1
+	# skip missing devices
+	[ ! -e /dev/$device ] && continue
+	[ ! -b /dev/$device ] && continue
+	# skip ide cdrom
+	[ -f /proc/ide/$device/media ] && grep -q cdrom /proc/ide/$device/media && isdisk=0
+	# don't install on usb devices
+    readlink /sys/block/${device}/device | grep -q "/usb[0-9]\+/" && exit 2
+	# disks should be owned by group "disk"
+	[ `stat -c %G /dev/$device` = "disk" ] || isdisk=0
+	[ $isdisk -eq 1 ] && echo "$device $blocks"
+    done
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# echo a space separated list of devices and their block size
+egrep ' i2o/hd.\b| cciss/c.d.\b| ida/c.d.\b| rd/c.d.\b| hd.\b| sd[a-z]{1,2}\b|/disc\b| vd.\b' /proc/partitions | diskandsize
+
+

Added: branches/lhm/lib/fai-abort
===================================================================
--- branches/lhm/lib/fai-abort	                        (rev 0)
+++ branches/lhm/lib/fai-abort	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+### BEGIN INIT INFO
+# Provides:          fai-abort
+# Required-Start:    $remote_fs
+# Required-Stop:
+# Default-Start:     2
+# Default-Stop:
+### END INIT INFO
+
+case "$1" in
+    start) ;;
+    stop) ;;
+    restart) ;;
+    force-reload) ;;
+esac
+
+echo FAI: installation aborted.
+echo reboot with: faireboot
+echo or after a logout
+sh
+cd /
+umount -ar
+if [ "$flag_shutdown" -lt "1" ]; then
+  reboot -dfi
+else
+  poweroff -dfi
+fi

Added: branches/lhm/lib/fai-divert
===================================================================
--- branches/lhm/lib/fai-divert	                        (rev 0)
+++ branches/lhm/lib/fai-divert	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,110 @@
+#! /bin/bash
+
+# $Id: fai-divert 4736 2007-11-13 22:05:58Z lange $
+#*********************************************************************
+#
+# fai-divert -- add or remove a diversion for fai
+#
+# This script is part of FAI (Fully Automatic Installation)
+# (c) 2002-2007 by 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.
+#
+# 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.
+# 
+# A copy of the GNU General Public License is available as
+# `/usr/share/common-licences/GPL' in the Debian GNU/Linux distribution
+# or on the World Wide Web at http://www.gnu.org/copyleft/gpl.html.  You
+# can also obtain it by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#*********************************************************************
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+mkdivert() {
+
+    # make a diversion of a file
+    [ "$debug" ] || local divertquiet=--quiet
+    $ROOTCMD dpkg-divert $divertquiet --package fai --rename --add $1 &&
+    cat > $FAI_ROOT/$1 <<-EOF
+	#! /bin/sh
+	# diversion of $1 created by FAI
+	exit 0
+EOF
+    chmod a+rx $FAI_ROOT/$1
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+adddivert() {
+
+    # add an executable to the list of diversions
+    local item
+    for item in "$@"; do
+	mkdivert $item
+    done
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+rmdivert() {
+
+    # remove diversion
+    [ "$debug" ] || local divertquiet=--quiet
+    rm -f $FAI_ROOT/$1
+    $ROOTCMD dpkg-divert $divertquiet --package fai --rename --remove $1
+    # when a diversion was made before the file exists
+    [ -f $FAI_ROOT/$1.distrib.dpkg-new ] && mv $FAI_ROOT/$1.distrib.dpkg-new $FAI_ROOT/$1
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+rmalldivert() {
+
+    # remove all diversions made by fai
+    local item
+    for item in $($ROOTCMD dpkg-divert --list fai | awk '{ print $3 }'); do
+	rmdivert $item
+    done
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+usage() {
+
+    cat <<EOF
+fai-divert, add or remove a diversion for fai.
+
+   Copyright (C) 2002-2007 by Thomas Lange
+
+Usage: fai-divert [OPTION] ... FILE
+
+   -a FILE ...          Replace each file by a dummy script.
+   -R			Remove all diversion made by fai.
+   -r FILE              Remove a diversion.
+   -v                   Be verbose.
+
+Report bugs to <lange at informatik.uni-koeln.de>.
+EOF
+exit 0
+}
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+[ "$1" ] || usage
+
+# do not execute if command is not available
+[ -f $FAI_ROOT/usr/sbin/dpkg-divert ] || {
+    echo "$FAI_ROOT/usr/sbin/dpkg-divert not available. Skipping."
+    exit 1
+}
+
+while getopts arRhv opt ; do
+        case "$opt" in
+        v) verbose=1 ;;
+        R) rmalldivert ;;
+        r) shift ; rmdivert $1 ;;
+        a) shift ; adddivert $@ ;;
+        h) usage ;;
+        esac
+done
+


Property changes on: branches/lhm/lib/fai-divert
___________________________________________________________________
Added: svn:executable
   + 

Added: branches/lhm/lib/fai-mount-disk
===================================================================
--- branches/lhm/lib/fai-mount-disk	                        (rev 0)
+++ branches/lhm/lib/fai-mount-disk	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,70 @@
+#! /bin/bash
+
+# $Id: fai-mount-disk 4230 2007-02-07 21:36:53Z lange $
+# Copyright (c) 2002-2007 by Thomas Lange
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+fstab_mount() {
+
+    if [ $fstabcount -eq 1 ]; then
+        # mount the root partition; then mount the rest according to fstab found
+	umount_local_disks
+	mount -o ro /dev/$fstabpart $FAI_ROOT
+	mount2dir $FAI_ROOT $FAI_ROOT/etc/fstab 0 ro
+	df
+    fi
+    [ $fstabcount -eq 0 ] && echo "No /etc/fstab found"
+    [ $fstabcount -ge 2 ] && echo -n "Found multiple /etc/fstab files in : $fstablist.\nUse mount2dir for mounting."
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+mount_local_disks() {
+
+    # try to mount all local disk partitions
+    local mountoption=ro
+    local disk partition partitions
+    fstabcount=0
+    [ "$1" = "rw" ] && mountoption=$1
+
+    for disk in $disklist; do
+	partitions=`LC_ALL=C file -s /dev/${disk/%disc/part}?* | \
+	    egrep -v " empty$|  data$| extended partition table" | \
+	    perl -ne 'print "$1\n" if m#^/dev/(\S+):\s#'`
+	for partition in $partitions; do
+	    mkdir -p $FAI_ROOT/$partition
+	    mount -o $mountoption /dev/$partition $FAI_ROOT/$partition
+	    # \ && echo $partition mounted successfully
+	    if [ -f $FAI_ROOT/$partition/etc/fstab ]; then
+		echo "/etc/fstab found in $partition"
+		fstabpart=$partition   # used in fstab_mount
+		fstablist="$fstablist $partition"
+		(( fstabcount += 1 ))
+	    fi
+	done
+    done
+    mount | grep $FAI_ROOT
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+umount_local_disks() {
+
+    # can be an extern script
+    local part
+    test -d $FAI_ROOT || return
+    for part in `grep $FAI_ROOT /proc/mounts | cut -d ' ' -f 2| sort -r`; do
+	umount $part
+    done
+    test -d $FAI_ROOT/ida && rmdir $FAI_ROOT/ida/*
+    test -d $FAI_ROOT/rd && rmdir $FAI_ROOT/rd/*
+    rmdir $FAI_ROOT/*
+    umount $FAI_ROOT
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+# main program
+
+while getopts uf opt ; do
+      case "$opt" in
+        u) umount_local_disks ; exit ;;
+        f) mount_local_disks; fstab_mount ; exit ;;
+      esac
+done
+mount_local_disks

Added: branches/lhm/lib/fai-savelog
===================================================================
--- branches/lhm/lib/fai-savelog	                        (rev 0)
+++ branches/lhm/lib/fai-savelog	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,135 @@
+#! /bin/bash
+
+# $Id: fai-savelog 4772 2007-11-20 13:42:17Z lange $
+#*********************************************************************
+#
+# fai-save-log -- save log files from fai to a local or remote location
+#
+# This script is part of FAI (Fully Automatic Installation)
+# (c) 2002-2007 by 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.
+#
+# 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.
+# 
+# A copy of the GNU General Public License is available as
+# `/usr/share/common-licences/GPL' in the Debian GNU/Linux distribution
+# or on the World Wide Web at http://www.gnu.org/copyleft/gpl.html.  You
+# can also obtain it by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#*********************************************************************
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+save_log_local() {
+
+
+    # can be an extern script
+    # save log files on local disk
+
+    local logbase=$FAI_ROOT/var/log/fai
+    local thislog=$logbase/$HOSTNAME/$FAI_ACTION-$fai_rundate
+
+    find $LOGDIR -xdev -size 0 -type f -exec rm {} \;
+    # create the symbolic links forcefully; in case of dirinstalls or
+    # softupdates they already exist as the fai script creates them together
+    # with the directory $LOGDIR
+    ln -snf $FAI_ACTION-$fai_rundate $LOGDIR/../last-$FAI_ACTION
+    ln -snf $FAI_ACTION-$fai_rundate $LOGDIR/../last
+
+    [ -d "$thislog" ] && return # nothing to do, if directory already exists
+
+    mkdir -p $thislog
+    cp -a $LOGDIR/* $thislog
+    chown root $thislog
+    chgrp adm  $thislog
+    chmod 0750 $thislog
+    ln -snf $HOSTNAME $logbase/localhost
+    ln -snf $FAI_ACTION-$fai_rundate $logbase/$HOSTNAME/last-$FAI_ACTION
+    ln -snf $FAI_ACTION-$fai_rundate $logbase/$HOSTNAME/last
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+save_log_remote_shell() {
+
+    local thislog
+    if [ -n "$LOGREMOTEDIR" ];then
+	thislog=$LOGREMOTEDIR/$HOSTNAME/$FAI_ACTION-$fai_rundate
+    else
+	thislog=$HOSTNAME/$FAI_ACTION-$fai_rundate
+    fi
+
+    echo "Save log files via $remotesh to $LOGUSER@$LOGSERVER:$thislog"
+    find $LOGDIR -size 0 -type f -exec rm {} \;
+    $remotesh -l $LOGUSER $LOGSERVER " \
+       mkdir -p $thislog ;\
+       cd $HOSTNAME ;\
+       rm -f last-$FAI_ACTION ;\
+       ln -snf $FAI_ACTION-$fai_rundate last-$FAI_ACTION ;\
+       ln -snf $FAI_ACTION-$fai_rundate last"
+
+    $remotecp -pr $LOGDIR/* $LOGUSER@$LOGSERVER:$thislog
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+save_log_remote() {
+
+    # save log files to $LOGUSER/$HOSTNAME/.. on $LOGSERVER
+    # also create a link last-$FAI_ACTION the the directory of the
+    # last action. The name of the log directory contains date and
+    # time of the action performed
+
+    [ "$LOGUSER" ] || return
+    # LOGSERVER is overridable until now
+    [ -z "$LOGSERVER" ] && LOGSERVER=$SERVER
+    [ "$LOGSERVER" ] || return
+
+    case "$FAI_LOGPROTO" in
+	ftp)
+	    fai-savelog-ftp ;;
+        none)
+            echo "Don't save logs with remote method, only local storage." ;;
+        ssh)
+	    export remotesh=ssh
+	    export remotecp=scp
+	    save_log_remote_shell ;;
+        rsh)
+	    export remotesh=rsh
+	    export remotecp=rcp
+	    save_log_remote_shell ;;
+    esac
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+usage() {
+
+    cat <<EOF
+fai-savelog, save log files from fai to a local or remote location
+
+   Copyright (C) 2002-2007 by Thomas Lange
+
+Usage: fai-savelog [OPTION]
+
+   -r       Save log files to \$LOGSERVER using rcp or scp
+   -l       Save log files to local directory \$FAI_ROOT/var/log/fai
+
+Report bugs to <lange at informatik.uni-koeln.de>.
+EOF
+exit 0
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+[ "$1" ] || usage
+
+[ -z "$FAI_ACTION" ] && FAI_ACTION=noaction
+while getopts lr opt ; do
+        case "$opt" in
+        l) save_log_local ;;
+        r) save_log_remote ;;
+	*) usage ;;
+        esac
+done


Property changes on: branches/lhm/lib/fai-savelog
___________________________________________________________________
Added: svn:executable
   + 

Added: branches/lhm/lib/fai-savelog-ftp
===================================================================
--- branches/lhm/lib/fai-savelog-ftp	                        (rev 0)
+++ branches/lhm/lib/fai-savelog-ftp	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,50 @@
+#!/usr/bin/perl
+
+# $Id: fai-savelog-ftp 4677 2007-11-10 13:55:48Z lange $
+#*********************************************************************
+#
+# fai-savelog-ftp -- save log files from fai to FTP server
+#
+# This script is part of FAI (Fully Automatic Installation)
+#
+#*********************************************************************
+# 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.
+# 
+# A copy of the GNU General Public License is available as
+# '/usr/share/common-licences/GPL' in the Debian GNU/Linux distribution
+# or on the World Wide Web at http://www.gnu.org/copyleft/gpl.html. You
+# can also obtain it by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#*********************************************************************
+
+use strict;
+use Net::FTP;
+
+chomp (my $hostname = `hostname`);
+
+print "Save log files via FTP to $ENV{LOGUSER}\@$ENV{LOGSERVER}:$hostname/$ENV{FAI_ACTION}-$ENV{fai_rundate}\n";
+
+my $ftp = Net::FTP->new("$ENV{LOGSERVER}", Debug => 0)
+   or die "Cannot connect to FTP server $ENV{LOGSERVER}.\n";
+$ftp->login("$ENV{LOGUSER}", "$ENV{LOGPASSWD}")
+   or die "Cannot login to FTP server $ENV{LOGSERVER} with login $ENV{LOGUSER}.\n";
+$ftp->cwd("$ENV{LOGREMOTEDIR}")
+   or die "Cannot change work directory to $ENV{LOGREMOTEDIR}\n";
+my $ftplogdir = $ftp->mkdir("$hostname/$ENV{FAI_ACTION}-$ENV{fai_rundate}", 1) 
+   or die "Cannot create dir $ENV{FAI_ACTION}-$ENV{fai_rundate}.\n";
+$ftp->cwd("$ftplogdir")
+   or die "Cannot change work directory to $ftplogdir.\n";
+
+while (my $file = <$ENV{LOGDIR}/*>) {
+      $ftp->put("$file");
+}
+
+$ftp->quit;

Added: branches/lhm/lib/get-boot-info
===================================================================
--- branches/lhm/lib/get-boot-info	                        (rev 0)
+++ branches/lhm/lib/get-boot-info	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,136 @@
+#! /bin/bash
+
+# $Id: get-boot-info 5230 2008-12-18 16:21:30Z lange $
+#*********************************************************************
+#
+# bootinfo -- get boot information via DHCP or BOOTP protocol
+#
+# This script is part of FAI (Fully Automatic Installation)
+# (c) 2003-2008 by 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.
+#
+# 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.
+# 
+# A copy of the GNU General Public License is available as
+# `/usr/share/common-licences/GPL' in the Debian GNU/Linux distribution
+# or on the World Wide Web at http://www.gnu.org/copyleft/gpl.html.  You
+# can also obtain it by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#*********************************************************************
+
+# TODO
+# -t timeout
+# a list of devices
+#
+
+# this script writes received information to $LOGDIR/boot.log 
+
+bootlog=$LOGDIR/boot.log
+timeout=30 # bootpc timeout
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+netdevice_info() {
+
+    # devices that are running
+    netdevices_up=$(ifconfig | perl -anF'\s+' -e 'print "$F[0]\n" if $F[0];' | grep -v "^lo" | sort | uniq)
+    # netdevices is the list of ethernet devices which will be used for bootpc (maybe dhcp)
+    # if not defined, use boot messages to determine network devices
+    [ -n "$netdevices" ] || netdevices=$netdevices_up
+
+    # some network driver do not echo eth0,..; they are not detected
+    netdevices_all=$(dmesg| perl -ne 'print $&,"\n" if m/\beth[0-9]\b/')
+    tmp=$(ifconfig -a | awk '/^eth/ { print $1 }')
+    netdevices_all="$netdevices_all $tmp"
+    netdevices_all=$(for dev in $netdevices_all; do echo $dev; done| sort | uniq)
+
+    cat > $bootlog <<-EOF
+	netdevices_all="$netdevices_all"
+	netdevices_up="$netdevices_up"
+	netdevices="$netdevices_up"
+	EOF
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+get_dhcp_info() {
+
+    boot=1
+    dhclient -lf /dev/null -cf /etc/dhcp3/dhclient-fai.conf -sf /etc/dhcp3/dhclient-fai-script $netdevices >>$bootlog 2> $LOGDIR/dhclient.log
+    killall dhclient
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+get_bootp_info() {
+
+    local device
+    boot=1
+    # use all devices in $netdevices
+    for device in $netdevices; do
+	echo "Sending BOOTP request using device $device"
+	echo "# --- network device $device ---" >> $bootlog
+	bootpc --dev $device --timeoutwait $timeout --returniffail >> $bootlog 2>&1
+    done
+
+    # change comments, because bootpc uses ^* for comments
+    perl -pi -e 's/^\*/#/' $bootlog
+
+    cat >> $bootlog <<-'EOM'
+	# define variable if T17x is defined
+	[ "$T170" ] && FAI_CONFIG_SRC=$T170
+	[ "$T171" ] && FAI_ACTION=$T171
+	[ "$T172" ] && FAI_FLAGS=$T172
+EOM
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+setnet() {
+
+    local ips=$1
+    IPADDR=${ips%%:*}
+    ips=${ips#*:}
+    SERVER=${ips%%:*}
+    ips=${ips#*:}
+    GATEWAYS=${ips%%:*}
+    ips=${ips#*:}
+    NETMASK=${ips%%:*}
+    BROADCAST=${IPADDR%\.*}.255
+
+    cat >> $bootlog <<-EOF
+	IPADDR=$IPADDR
+	SERVER=$SERVER
+	NETMASK=$NETMASK
+	GATEWAYS=$GATEWAYS
+	BROADCAST=$BROADCAST
+	EOF
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+get_fixed_info() {
+
+    boot=1
+    # ip contains the network parameters
+    echo $ip | grep -q : || echo "Kernel parameter ip= does not contain network parameters."
+    setnet $ip
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+netdevice_info
+boot=0
+
+# when using live-initramfs
+if [ -f /var/log/live.log ]; then
+    grep IP-Config /var/log/live.log | grep -q "DHCP" && get_dhcp_info
+    grep IP-Config /var/log/live.log | grep -q "BOOTP" && get_bootp_info
+else
+    dmesg | grep -q "Sending DHCP requests"  && get_dhcp_info
+    dmesg | grep -q "Sending BOOTP requests" && get_bootp_info
+    [ $boot -eq 0 -a "$ip" = "dhcp" ] && get_dhcp_info
+fi
+
+if [ $boot -eq 0 ]; then
+    get_fixed_info
+fi

Added: branches/lhm/lib/get-config-dir
===================================================================
--- branches/lhm/lib/get-config-dir	                        (rev 0)
+++ branches/lhm/lib/get-config-dir	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,46 @@
+#!/bin/bash
+
+# (c) 2006 Henning Glawe <glaweh at debian.org>
+
+### BEGIN SUBROUTINE INFO
+# Provides-Var:
+# Requires-Var:    $FAI_CONFIG_SRC $FAI
+# Suggests-Var:
+# Short-Description: get $FAI directory from $FAI_CONFIG_SRC
+### END SUBROUTINE INFO
+
+if [ -z "$FAI_CONFIG_SRC" ]; then
+	sendmon "TASKERROR get_fai_dir 21"
+	echo "Error: Provide the URL to obtain the fai config storage in \$FAI_CONFIG_SRC"
+	exit 21
+fi
+
+# extract method to get the config dir
+# matched string: "cvs[+ssh]://user at host/path/to/cvsroot module[=tag]"
+#                  ^^^
+#                 "nfs://host/path/to/exported/config"
+#                  ^^^
+# the "major" protocol name is the one up to the first "+", if it exists
+method=$(expr match "$FAI_CONFIG_SRC" '\([^+]*\).*://')
+
+# run get-config-dir-$method script if it exists
+if which get-config-dir-$method &>/dev/null ; then
+	get-config-dir-$method
+else
+	method=$FAI_CONFIG_SRC
+	if which "get-config-dir-$method" &>/dev/null ; then
+		get-config-dir-$method
+	else
+		sendmon "TASKERROR get_fai_dir 22"
+		echo "Error: get-config-dir-"$method "not found"
+		exit 22
+	fi
+fi
+
+ln -s $FAI /var/run/fai/current_config
+if [ ! -d $FAI/class ]; then
+	echo "WARNING: directory $FAI/class not found."
+	sendmon "TASKERROR get_fai_dir 23"
+	exit 23
+fi
+exit 0

Added: branches/lhm/lib/get-config-dir-cvs
===================================================================
--- branches/lhm/lib/get-config-dir-cvs	                        (rev 0)
+++ branches/lhm/lib/get-config-dir-cvs	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,46 @@
+#!/bin/bash
+
+# (c) 2002-2006 Henning Glawe <glaweh at debian.org>
+
+### BEGIN SUBROUTINE INFO
+# Provides-Var:
+# Requires-Var:    $FAI_CONFIG_SRC $FAI $LOGDIR
+# Suggests-Var:
+# Short-Description: get $FAI from a cvs repository.
+### END SUBROUTINE INFO
+
+# matched string: "cvs[+ssh]://user at host/path/to/cvsroot module[=tag]"
+# dir contains user at host/path/to/cvsroot
+protocol=$(expr match "$FAI_CONFIG_SRC" '\([^:]*\)://')
+dir=$(expr match "$FAI_CONFIG_SRC" '[^:]*://\([^[:space:]]\+\)[[:space:]]\+')
+module=$(expr match "$FAI_CONFIG_SRC" '[^:]*://.*[[:space:]]\+\([^=]*\)')
+tag=$(expr match "$FAI_CONFIG_SRC" '[^=]*=\([^=]*\)')
+
+case $protocol in
+	cvs+ssh)
+		export CVS_RSH=ssh
+		export CVSROOT=":ext:$dir"
+		;;
+	cvs)
+		export CVSROOT=":pserver:$dir"
+		;;
+	*)
+		echo "get-config-dir-cvs: protocol $protocol not implemented"
+		exit 1
+		;;
+esac
+		
+[ -n "$tag" ] && tag="-r $tag"
+
+if [ -d "$FAI/CVS" ] ; then
+   echo "Updating CVS in $FAI"
+   cd $FAI
+   cvs -q up -P $tag -d -C > $LOGDIR/getconf.log
+   task error 701
+else 
+   echo "Checking out CVS"
+   cd $(dirname "$FAI")
+   cvs -q co -P -d $(basename "$FAI") \
+     $tag $module > $LOGDIR/getconf.log
+   task error 702
+fi

Added: branches/lhm/lib/get-config-dir-file
===================================================================
--- branches/lhm/lib/get-config-dir-file	                        (rev 0)
+++ branches/lhm/lib/get-config-dir-file	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+### BEGIN SUBROUTINE INFO
+# Provides-Var:
+# Requires-Var:    $FAI_CONFIG_SRC
+# Suggests-Var:
+# Short-Description: get $FAI by local path
+### END SUBROUTINE INFO
+
+localpath=$(expr match "$FAI_CONFIG_SRC" '.*://\(/.*\)')
+echo "Using local path $localpath"


Property changes on: branches/lhm/lib/get-config-dir-file
___________________________________________________________________
Added: svn:executable
   + 

Added: branches/lhm/lib/get-config-dir-git
===================================================================
--- branches/lhm/lib/get-config-dir-git	                        (rev 0)
+++ branches/lhm/lib/get-config-dir-git	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+# (c) 2002-2006 Henning Glawe <glaweh at debian.org>
+# (c) 2007 Holger Levsen <holger at layer-acht.org> for the modifications to use git
+
+### BEGIN SUBROUTINE INFO
+# Provides-Var:
+# Requires-Var:    $FAI_CONFIG_SRC $FAI $LOGDIR
+# Suggests-Var:
+# Short-Description: get $FAI from a git repository.
+### END SUBROUTINE INFO
+
+# matched string: "git://gitpath"
+protocol=$(expr match "$FAI_CONFIG_SRC" '\([^:]*\)://')
+gitpath=$(expr match "$FAI_CONFIG_SRC" '[^:]*://\([^[:space:]]\+\)')
+
+case $protocol in
+	git)
+		giturl="git://$gitpath"
+		;;
+	git+http)
+		echo git+http
+		giturl="http://$gitpath"
+		;;
+	*)
+		echo "get-config-dir-git: protocol $protocol not implemented"
+		exit 1
+		;;
+esac
+		
+if [ -d "$FAI/.git" ] ; then
+   echo "Updating git copy in $FAI"
+   cd $FAI
+   git pull
+   task error 701
+else 
+   echo "Checking out from git"
+   git clone $giturl $FAI 
+   task error 702
+fi

Added: branches/lhm/lib/get-config-dir-nfs
===================================================================
--- branches/lhm/lib/get-config-dir-nfs	                        (rev 0)
+++ branches/lhm/lib/get-config-dir-nfs	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+### BEGIN SUBROUTINE INFO
+# Provides-Var:
+# Requires-Var:    $FAI_CONFIG_SRC $FAI
+# Suggests-Var:    $romountopt
+# Short-Description: get $FAI by mounting it via nfs
+### END SUBROUTINE INFO
+
+server=$(expr match "$FAI_CONFIG_SRC" '.*://\([^/]*\)/.*')
+nfspath=$(expr match "$FAI_CONFIG_SRC" '.*://[^/]*\(/.*\)')
+
+mount -n $romountopt $server:$nfspath $FAI &&
+  echo "Configuration space $server:$nfspath mounted to $FAI"
+task error 701

Added: branches/lhm/lib/get-config-dir-svn
===================================================================
--- branches/lhm/lib/get-config-dir-svn	                        (rev 0)
+++ branches/lhm/lib/get-config-dir-svn	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,53 @@
+#!/bin/bash
+
+# (c) 2002-2006 Henning Glawe <glaweh at debian.org>
+
+### BEGIN SUBROUTINE INFO
+# Provides-Var:
+# Requires-Var:    $FAI_CONFIG_SRC $FAI $LOGDIR
+# Suggests-Var:
+# Short-Description: get $FAI from an svn repository.
+### END SUBROUTINE INFO
+
+# matched string: "svn://user@host/svnpath"
+protocol=$(expr match "$FAI_CONFIG_SRC" '\([^:]*\)://')
+username=$(expr match "$FAI_CONFIG_SRC" '[^:]*://\([^@]*\)@')
+svnpath=$(expr match "$FAI_CONFIG_SRC" '[^:]*://[^@]\+@\([^[:space:]]\+\)')
+
+case $protocol in
+	svn)
+		svnurl="svn://$svnpath"
+		;;
+	svn+file)
+		svnurl="file://$svnpath"
+		;;
+	svn+http)
+		svnurl="http://$svnpath"
+		;;
+	svn+https)
+		svnurl="https://$svnpath"
+		;;
+	svn+ssh)
+		svnurl="svn+ssh://$username@$svnpath"
+		# this is a bit hackish: if $username is empty, the path gets corrected below... 
+		# explaination: svn co -username foo svn+ssh://bar doesnt work as svn co svn+ssh://foo@bar
+		;;
+	*)
+		echo "get-config-dir-svn: protocol $protocol not implemented"
+		exit 1
+		;;
+esac
+		
+[ -n "$username" ] && user="--username $username"
+[ -z "$username" ] && svnurl=$FAI_CONFIG_SRC
+
+if [ -d "$FAI/.svn" ] ; then
+   echo "Updating SVN in $FAI"
+   cd $FAI
+   svn up $user | grep -v 'Updated to revision' > $LOGDIR/getconf.log
+   task error 701
+else 
+   echo "Checking out SVN"
+   svn co $user $svnurl $FAI | grep -v 'Checked out revision' > $LOGDIR/getconf.log
+   task error 702
+fi


Property changes on: branches/lhm/lib/get-config-dir-svn
___________________________________________________________________
Added: svn:executable
   + 

Added: branches/lhm/lib/list_disks
===================================================================
--- branches/lhm/lib/list_disks	                        (rev 0)
+++ branches/lhm/lib/list_disks	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,14 @@
+#! /bin/sh
+
+# print only every second entry; used by disk_info
+
+i=0
+
+for ent in $@; do
+    if [ $i -eq 0 ]; then
+	echo $ent
+	i=1
+    else
+	i=0
+    fi
+done


Property changes on: branches/lhm/lib/list_disks
___________________________________________________________________
Added: svn:executable
   + 

Added: branches/lhm/lib/load_keymap_consolechars
===================================================================
--- branches/lhm/lib/load_keymap_consolechars	                        (rev 0)
+++ branches/lhm/lib/load_keymap_consolechars	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,12 @@
+#! /bin/sh
+
+# $Id: load_keymap_consolechars 3861 2006-09-05 13:41:49Z lange $
+
+[ "$CONSOLEFONT" ] &&
+	consolechars -v -f /usr/share/consolefonts/$CONSOLEFONT.psf.gz
+
+# nothing to do if $KEYMAP is undefined
+[ "$KEYMAP" ] || exit
+
+echo -n "Loading keymap(s) $KEYMAP ..."
+loadkeys -q $KEYMAP && echo "done."

Added: branches/lhm/lib/mount2dir
===================================================================
--- branches/lhm/lib/mount2dir	                        (rev 0)
+++ branches/lhm/lib/mount2dir	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,121 @@
+#! /bin/bash
+
+# $Id: mount2dir 4677 2007-11-10 13:55:48Z lange $
+#*********************************************************************
+#
+# mount2dir -- mount partitions to a directory using a fstab file
+#
+# This script is part of FAI (Fully Automatic Installation)
+# (c) 2001-2007 by 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.
+#
+# 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.
+# 
+# A copy of the GNU General Public License is available as
+# `/usr/share/common-licences/GPL' in the Debian GNU/Linux distribution
+# or on the World Wide Web at http://www.gnu.org/copyleft/gpl.html.  You
+# can also obtain it by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#*********************************************************************
+
+# examples:
+# mount new created partitions to /target
+# mount2dir /target /tmp/fstab 1
+#
+# root filesystem already mounted. Found a fstab inside. Now mount
+# the remaining partitons
+# mount2dir $target $target/etc/fstab 0 ro
+#
+# TODO: option parsing with getopts, option for also mounting nfs directories
+# matching a certain server name
+
+target=$1 # where to mount
+fstab=$2
+fscheck=$3 # make fsck if 1
+moptions=$4 # if set, use only this mount option (mostly -r)
+
+# exit if too few parameters given
+[ "$fstab" ] || {
+    echo "Too few parameters."
+    echo "Usage: mount2dir targetdir fstab [ fscheck mopt ]"
+    exit 1
+}
+
+[ -f $fstab ] || {
+    echo "No fstab file $fstab found."
+    exit 2
+}
+
+(
+while read device mountpoint fstype mopt dummy; do
+
+    case $mopt in
+	*noauto*) continue ;;
+    esac
+
+    [ "$mountpoint" == "none" ]  && continue
+    [ "$fstype" == "swap" ]  && continue
+    [ "$fstype" == "proc" ]  && continue
+    [ "$fstype" == "usbfs" ]  && continue
+    [ "$fstype" == "sysfs" ]  && continue
+    [ "$fstype" == "tmpfs" ]  && continue
+    [ "$fstype" == "devpts" ]  && continue
+
+    case $device in
+	""|\#*) continue ;;
+
+	/dev/*|LABEL=*|UUID=*)
+
+	    # overwrite mount options
+	    mopt="-o $mopt"
+	    [ "$moptions" ] && mopt="-o $moptions"
+	    mkdir -p $target$mountpoint
+	    if [ $debug ]; then
+		echo "Mounting $device to $target$mountpoint type: $fstype opt: $mopt"
+	    else
+		[ $verbose ] && echo "Mounting $device to $target$mountpoint"
+	    fi
+	    # should we fsck the partition first?
+	    [ "$fscheck" = 1 -a \( "$fstype" = "ext2" -o "$fstype" = "ext3" \) ] && fsck -nt $fstype $device
+	    [ $debug ] && echo "$BASH_SOURCE: calling 'mount -t $fstype -o noatime $mopt $device $target$mountpoint'"
+	    mount -t $fstype -o noatime $mopt $device $target$mountpoint
+	    ;;
+
+        UUID=*)
+            mopt="-o $mopt"
+            [ "$moptions" ] && mopt="-o $moptions"
+            [ -d $target/$mountpoint ] || mkdir -p $target$mountpoint
+            if [ "$fscheck" = 1 -a \( "$fstype" = "ext2" -o "$fstype" = "ext3" \) ]; then
+                fsck -nt $fstype $device
+                [ $debug ] && echo "$BASH_SOURCE: calling 'fsck -nt $fstype $device'"
+            fi
+            device="-U ${device#UUID=}"
+            [ $debug ] && echo "$BASH_SOURCE: calling 'mount -t $fstype $mopt $device $target$mountpoint'"
+            mount -t $fstype $mopt $device $target$mountpoint
+            ;;
+
+        LABEL=*)
+            mopt="-o $mopt"
+            [ "$moptions" ] && mopt="-o $moptions"
+            [ -d $target/$mountpoint ] || mkdir -p $target$mountpoint
+            if [ "$fscheck" = 1 -a \( "$fstype" = "ext2" -o "$fstype" = "ext3" \) ]; then
+                fsck -nt $fstype $device
+                [ $debug ] && echo "$BASH_SOURCE: calling 'fsck -nt $fstype $device'"
+            fi
+            device="-L ${device#LABEL=}"
+            [ $debug ] && echo "$BASH_SOURCE: calling 'mount -t $fstype $mopt $device $target$mountpoint'"
+            mount -t $fstype $mopt $device $target$mountpoint
+            ;;
+    esac
+done
+
+) < $fstab


Property changes on: branches/lhm/lib/mount2dir
___________________________________________________________________
Added: svn:executable
   + 

Added: branches/lhm/lib/prcopyleft
===================================================================
--- branches/lhm/lib/prcopyleft	                        (rev 0)
+++ branches/lhm/lib/prcopyleft	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,44 @@
+#! /bin/bash
+
+#*********************************************************************
+#
+# This script is part of FAI (Fully Automatic Installation)
+# (c) 2003-2009 by Thomas Lange, lange at informatik.uni-koeln.de
+# Universitaet zu Koeln
+#
+#*********************************************************************
+
+# variables needed: FAI_VERSION, do_init_tasks
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+_prcopyleft() {
+
+    cat <<-EOF
+             -------------------------------------------------
+                   Fully Automatic Installation  -  FAI
+
+               $FAI_VERSION  Copyright (c) 1999-2009
+               Thomas Lange  <lange at informatik.uni-koeln.de>
+             -------------------------------------------------
+EOF
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+# color logo only if initial install
+color_logo=$do_init_tasks
+
+# set red color, but not on some archs
+[ -e /.nocolorlogo ] && color_logo=0
+[ -n "$console" ] && color_logo=0  # no red logo if console was defined on the command line
+case $HOSTTYPE in
+    sparc*|powerpc*) color_logo=0 ;;
+esac
+
+[ $color_logo -eq 1 ] && echo -ne "\ec\e[1;31m"
+
+_prcopyleft | tee -a $LOGDIR/fai.log
+
+if [ $color_logo -eq 1 ]; then
+	echo -ne "\e[7;0r"
+	echo -ne "\e[9B\e[1;m"
+fi

Added: branches/lhm/lib/setup-storage/Commands.pm
===================================================================
--- branches/lhm/lib/setup-storage/Commands.pm	                        (rev 0)
+++ branches/lhm/lib/setup-storage/Commands.pm	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,932 @@
+#!/usr/bin/perl -w
+
+#*********************************************************************
+# 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.
+#
+# A copy of the GNU General Public License is available as
+# `/usr/share/common-licences/GPL' in the Debian GNU/Linux distribution
+# or on the World Wide Web at http://www.gnu.org/copyleft/gpl.html. You
+# can also obtain it by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#*********************************************************************
+
+use strict;
+
+################################################################################
+#
+# @file commands.pm
+#
+# @brief Build the required commands in @FAI::commands using the config stored
+# in %FAI::configs
+#
+# $Id: Commands.pm 5231 2008-12-22 10:02:42Z mt $
+#
+# @author Christian Kern, Michael Tautschnig, Sebastian Hetze, Andreas Schuldei
+# @date Sun Jul 23 16:09:36 CEST 2006
+#
+################################################################################
+
+package FAI;
+
+################################################################################
+#
+# @brief Build the mkfs commands for the partition pointed to by $partition
+#
+# @param $device Device name of the target partition
+# @param $partition Reference to partition in the config hash
+#
+################################################################################
+sub build_mkfs_commands {
+
+  my ($device, $partition) = @_;
+
+  defined ($partition->{filesystem})
+    or &FAI::internal_error("filesystem is undefined");
+  my $fs = $partition->{filesystem};
+
+  return if ($fs eq "-");
+
+  my ($create_options) = $partition->{fs_options} =~ m/createopts="([^"]+)"/;
+  my ($tune_options)   = $partition->{fs_options} =~ m/tuneopts="([^"]+)"/;
+
+  # this enables the use of all remaining options as create option if
+  # you did not specify createopts= Example: -m0 -i0 will then be used
+  # as createopts. This fails if you do only specify tuneopts without
+  # using createopts. Therefore is disable this feature. IMO this
+  # special behaviour is also not documented in setup-storage.8
+  # T.Lange
+  # $create_options = $partition->{fs_options} unless $create_options;
+
+  # prevent warnings of uninitialized variables
+  $create_options = '' unless $create_options;
+  $tune_options   = '' unless $tune_options;
+
+  print "$partition->{mountpoint} create_options: $create_options\n" if ($FAI::debug && $create_options);
+  print "$partition->{mountpoint} tune_options: $tune_options\n" if ($FAI::debug && $tune_options);
+
+  # check for encryption requests
+  $device = &FAI::encrypt_device($device, $partition);
+
+  # create the file system with options
+  my $create_tool = "mkfs.$fs";
+  ($fs eq "swap") and $create_tool = "mkswap";
+  ($fs eq "xfs") and $create_options = "$create_options -f" unless ($create_options =~ m/-f/);
+  my $pre_encrypt = "exist_$device";
+  $pre_encrypt = "encrypt_$device" if ($partition->{encrypt});
+  &FAI::push_command( "$create_tool $create_options $device", $pre_encrypt,
+    "has_fs_$device" );
+
+  # possibly tune the file system - this depends on whether the file system
+  # supports tuning at all
+  return unless $tune_options;
+  my $tune_tool;
+  ($fs eq "ext2" || $fs eq "ext3") and $tune_tool = "tune2fs";
+  ($fs eq "reiserfs") and $tune_tool = "reiserfstune";
+  die "Don't know how to tune $fs\n" unless $tune_tool;
+
+  # add the tune command
+  &FAI::push_command( "$tune_tool $tune_options $device", "has_fs_$device",
+    "has_fs_$device" );
+}
+
+################################################################################
+#
+# @brief Encrypt a device and change the device name before formatting it
+#
+# @param $device Original device name of the target partition
+# @param $partition Reference to partition in the config hash
+#
+# @return Device name, may be the same as $device
+#
+################################################################################
+sub encrypt_device {
+
+  my ($device, $partition) = @_;
+
+  return $device unless $partition->{encrypt};
+
+  # encryption requested, rewrite the device name
+  my $enc_dev_name = $device;
+  $enc_dev_name =~ "s#/#_#g";
+  my $enc_dev_short_name = "crypt$enc_dev_name";
+  $enc_dev_name = "/dev/mapper/$enc_dev_short_name";
+  my $keyfile = "$ENV{LOGDIR}/$enc_dev_short_name";
+
+  # generate a key for encryption
+  &FAI::push_command( 
+    "head -c 2048 /dev/urandom | head -n 47 | tail -n 46 | od | tee $keyfile",
+    "", "keyfile_$device" );
+
+  # prepare encryption
+  &FAI::push_command(
+    "yes YES | cryptsetup luksFormat $device $keyfile -c aes-cbc-essiv:sha256 -s 256",
+    "exist_$device,keyfile_$device", "crypt_format_$device" );
+  &FAI::push_command(
+    "cryptsetup luksOpen $device $enc_dev_short_name --key-file $keyfile",
+    "crypt_format_$device", "encrypted_$device" );
+
+  # add entries to crypttab
+  push @FAI::crypttab, "$enc_dev_short_name\t$device\t$keyfile\tluks";
+
+  return $enc_dev_name;
+}
+
+################################################################################
+#
+# @brief Set the partition type $t on a device $d. This is a no-op if $d is not
+# a physical device
+#
+# @param $d Device name
+# @param $t Type (e.g., lvm or raid)
+#
+################################################################################
+sub set_partition_type_on_phys_dev {
+
+  my ($d, $t) = @_;
+  my ($i_p_d, $disk, $part_no) = &FAI::phys_dev($d);
+  return unless $i_p_d;
+  # make sure this device really exists (we can't check for the partition
+  # as that may be created later on
+  (-b $disk) or die "Specified disk $disk does not exist in this system!\n";
+  # set the raid flag
+  &FAI::push_command( "parted -s $disk set $part_no $t on", "exist_$d",
+    "type_${t}_$d" );
+}
+
+################################################################################
+#
+# @brief Using the configurations from %FAI::configs, a list of commands is
+# built to create any RAID devices
+#
+################################################################################
+sub build_raid_commands {
+
+  foreach my $config (keys %FAI::configs) { # loop through all configs
+    # no LVM or physical devices here
+    next if ($config =~ /^VG_./ || $config =~ /^PHY_./);
+    ($config eq "RAID") or &FAI::internal_error("Invalid config $config");
+
+    # create all raid devices
+    foreach my $id (&numsort(keys %{ $FAI::configs{$config}{volumes} })) {
+
+      # keep a reference to the current volume
+      my $vol = (\%FAI::configs)->{$config}->{volumes}->{$id};
+      # the desired RAID level
+      my $level = $vol->{mode};
+
+      warn "RAID implementation is incomplete - preserve is not supported\n" if
+        ($vol->{preserve});
+
+      # prepend "raid", if the mode is numeric-only
+      $level = "raid$level" if ($level =~ /^\d+$/);
+
+      # the list of RAID devices
+      my @devs = keys %{ $vol->{devices} };
+      my @eff_devs = ();
+      my @spares = ();
+      my $pre_req;
+
+      # set proper partition types for RAID
+      foreach my $d (@devs) {
+        if ($vol->{devices}{$d}{missing}) {
+          if ($vol->{devices}->{$d}->{spare}) {
+            push @spares, "missing";
+          } else {
+            push @eff_devs, "missing";
+          }
+          # skip devices marked missing
+          next if $vol->{devices}{$d}{missing};
+        } else {
+          if ($vol->{devices}->{$d}->{spare}) {
+            push @spares, $d;
+          } else {
+            push @eff_devs, $d;
+          }
+        }
+        &FAI::set_partition_type_on_phys_dev($d, "raid");
+        if ((&FAI::phys_dev($d))[0]) {
+          $pre_req .= ",type_raid_$d";
+        } else {
+          $pre_req .= ",exist_$d";
+        }
+      }
+
+      # create the command
+      $pre_req = "exist_/dev/md" . ( $id - 1 ) . $pre_req if (0 != $id);
+      $pre_req =~ s/^,//;
+      &FAI::push_command(
+        "yes | mdadm --create /dev/md$id --level=$level --force --run --raid-devices="
+          . scalar(@eff_devs) . " --spare-devices=" . scalar(@spares) . " "
+          . join(" ", @eff_devs) . " " . join(" ", @spares),
+        "$pre_req", "exist_/dev/md$id" );
+
+      # create the filesystem on the volume
+      &FAI::build_mkfs_commands("/dev/md$id",
+        \%{ $FAI::configs{$config}{volumes}{$id} });
+    }
+  }
+}
+
+################################################################################
+#
+# @brief Erase the LVM signature from a list of devices that should be prestine
+# in order to avoid confusion of the lvm tools
+#
+################################################################################
+sub erase_lvm_signature {
+
+  my ($devices_aref) = @_;
+  # first remove the dm_mod module to prevent ghost lvm volumes 
+  # from existing
+  # push @FAI::commands, "modprobe -r dm_mod";
+  # zero out (broken?) lvm signatures
+  # push @FAI::commands, "dd if=/dev/zero of=$_ bs=1 count=1"
+  #   foreach ( @{$devices_aref} );
+  my $device_list = join (" ", @{$devices_aref});
+  $FAI::debug and print "Erased devices: $device_list\n"; 
+  &FAI::push_command( "pvremove -ff -y $device_list", "", "pv_sigs_removed" );
+
+  # reload module
+  # push @FAI::commands, "modprobe dm_mod";
+}
+
+################################################################################
+#
+# @brief Create the volume group $config, unless it exists already; if the
+# latter is the case, only add/remove the physical devices
+#
+# @param $config Config entry
+#
+################################################################################
+sub create_volume_group {
+
+  my ($config) = @_;
+  ($config =~ /^VG_(.+)$/) and ($1 ne "--ANY--") or &FAI::internal_error("Invalid config $config");
+  my $vg = $1; # the actual volume group
+
+  # create the volume group, if it doesn't exist already
+  if (!defined ($FAI::current_lvm_config{$vg})) {
+    # create all the devices
+    my @devices = keys %{ $FAI::configs{$config}{devices} };
+    &FAI::erase_lvm_signature(\@devices);
+    &FAI::push_command( "pvcreate $_", "pv_sigs_removed,exist_$_",
+      "pv_done_$_" ) foreach (@devices);
+    # create the volume group
+    my $pre_dev = "";
+    $pre_dev .= ",exist_$_,pv_done_$_" foreach (@devices);
+    $pre_dev =~ s/^,//;
+    &FAI::push_command( "vgcreate $vg " . join (" ", @devices), "$pre_dev",
+      "vg_created_$vg" );
+    # we are done
+    return;
+  }
+
+  # otherwise add or remove the devices for the volume group, run pvcreate
+  # where needed
+  # the list of devices to be created
+  my %new_devs = ();
+
+  # create an undefined entry for each new device
+  @new_devs{ keys %{ $FAI::configs{$config}{devices} } } = ();
+
+  my @new_devices = keys %new_devs;
+
+  # &FAI::erase_lvm_signature( \@new_devices );
+
+  # create all the devices
+  &FAI::push_command( "pvcreate $_", "exist_$_", "pv_done_$_" ) foreach (@new_devices);
+
+  # extend the volume group by the new devices (includes the current ones)
+  my $pre_dev = "";
+  $pre_dev .= ",pv_done_$_" foreach (@new_devices);
+  $pre_dev =~ s/^,//;
+  &FAI::push_command( "vgextend $vg " . join (" ", @new_devices), "$pre_dev",
+    "vg_extended_$vg" );
+
+  # the devices to be removed
+  my %rm_devs = ();
+  @rm_devs{ @{ $FAI::current_lvm_config{$vg}{"physical_volumes"} } } = ();
+
+  # remove remaining devices from the list
+  delete $rm_devs{$_} foreach (@new_devices);
+
+  # run vgreduce to get them removed
+  if (scalar (keys %rm_devs)) {
+    $pre_dev = "";
+    $pre_dev .= ",pv_done_$_" foreach (keys %rm_devs);
+    &FAI::push_command( "vgreduce $vg " . join (" ", keys %rm_devs),
+      "vg_extended_$vg$pre_dev", "vg_created_$vg" );
+  } else {
+    &FAI::push_command( "true", "vg_extended_$vg", "vg_created_$vg" );
+  }
+}
+
+################################################################################
+#
+# @brief Create the volume group $config, unless it exists already; if the
+# latter is the case, only add/remove the physical devices
+#
+# @param $config Config entry
+#
+################################################################################
+sub setup_logical_volumes {
+
+  my ($config) = @_;
+  ($config =~ /^VG_(.+)$/) and ($1 ne "--ANY--") or &FAI::internal_error("Invalid config $config");
+  my $vg = $1; # the actual volume group
+
+  my $lv_rm_pre = "";
+  my $lv_resize_pre = "";
+  # remove, resize, create the logical volumes
+  # remove all volumes that do not exist anymore or need not be preserved
+  foreach my $lv (keys %{ $FAI::current_lvm_config{$vg}{volumes} }) {
+    # skip preserved/resized volumes
+    if (defined ( $FAI::configs{$config}{volumes}{$lv})
+      && ($FAI::configs{$config}{volumes}{$lv}{size}{preserve} == 1)) {
+      $lv_resize_pre .= ",lv_resize_$vg/$lv" if
+        $FAI::configs{$config}{volumes}{$lv}{size}{resize};
+      next;
+    }
+
+    &FAI::push_command( "lvremove -f $vg/$lv", "vg_enabled_$vg", "lv_rm_$vg/$lv");
+    $lv_rm_pre .= ",lv_rm_$vg/$lv";
+  }
+  $lv_rm_pre =~ s/^,//;
+  $lv_resize_pre =~ s/^,//;
+
+  # now create or resize the configured logical volumes
+  foreach my $lv (keys %{ $FAI::configs{$config}{volumes} }) {
+    # reference to the size of the current logical volume
+    my $lv_size = (\%FAI::configs)->{$config}->{volumes}->{$lv}->{size};
+    # skip preserved partitions, but ensure that they exist
+    if ($lv_size->{preserve}) {
+      defined ($FAI::current_lvm_config{$vg}{volumes}{$lv})
+        or die "Preserved volume $vg/$lv does not exist\n";
+      warn "$vg/$lv will be preserved\n";
+      next;
+    }
+
+    # resize the volume
+    if ($lv_size->{resize}) {
+      defined ($FAI::current_lvm_config{$vg}{volumes}{$lv})
+        or die "Resized volume $vg/$lv does not exist\n";
+      warn "$vg/$lv will be resized\n";
+
+      if ($lv_size->{eff_size} <
+        $FAI::current_lvm_config{$vg}{volumes}{$lv}{size})
+      {
+        &FAI::push_command( "parted -s /dev/$vg/$lv resize 1 0 " . $lv_size->{eff_size} .  "B",
+          "vg_enabled_$vg,$lv_rm_pre", "lv_shrink_$vg/$lv" );
+        &FAI::push_command( "lvresize -L " . $lv_size->{eff_size} . " $vg/$lv",
+          "vg_enabled_$vg,$lv_rm_pre,lv_shrink_$vg/$lv", "lv_created_$vg/$lv" );
+      } else {
+        &FAI::push_command( "lvresize -L " . $lv_size->{eff_size} . " $vg/$lv",
+          "vg_enabled_$vg,$lv_rm_pre", "lv_grow_$vg/$lv" );
+        &FAI::push_command( "parted -s /dev/$vg/$lv resize 1 0 " . $lv_size->{eff_size} .  "B",
+          "vg_enabled_$vg,$lv_rm_pre,lv_grow_$vg/$lv", "exist_/dev/$vg/$lv" );
+      }
+
+      next;
+    }
+
+    # create a new volume
+    &FAI::push_command( "lvcreate -n $lv -L " . $lv_size->{eff_size} . " $vg",
+      "vg_enabled_$vg,$lv_rm_pre", "exist_/dev/$vg/$lv" );
+
+    # create the filesystem on the volume
+    &FAI::build_mkfs_commands("/dev/$vg/$lv",
+      \%{ $FAI::configs{$config}{volumes}{$lv} });
+  }
+}
+
+################################################################################
+#
+# @brief Using the configurations from %FAI::configs, a list of commands is
+# built to setup the LVM
+# creates the volume groups, the logical volumes and the filesystems
+#
+################################################################################
+sub build_lvm_commands {
+
+  # loop through all configs
+  foreach my $config (keys %FAI::configs) {
+
+    # no physical devices or RAID here
+    next if ($config =~ /^PHY_./ || $config eq "RAID");
+    ($config =~ /^VG_(.+)$/) or &FAI::internal_error("Invalid config $config");
+    next if ($1 eq "--ANY--");
+    my $vg = $1; # the volume group
+
+    # set proper partition types for LVM
+    &FAI::set_partition_type_on_phys_dev($_, "lvm")
+      foreach (keys %{ $FAI::configs{$config}{devices} });
+    my $type_pre = "";
+    foreach my $d (keys %{ $FAI::configs{$config}{devices} }) {
+      if ((&FAI::phys_dev($d))[0]) {
+        $type_pre .= ",type_lvm_$d"
+      } else {
+        $type_pre .= ",exist_$d"
+      }
+    }
+
+    # create the volume group or add/remove devices
+    &FAI::create_volume_group($config);
+    # enable the volume group
+    &FAI::push_command( "vgchange -a y $vg",
+      "vg_created_$vg$type_pre", "vg_enabled_$vg" );
+
+    # perform all necessary operations on the underlying logical volumes
+    &FAI::setup_logical_volumes($config);
+  }
+}
+
+################################################################################
+#
+# @brief Return an ordered list of partitions that must be preserved
+#
+# @param $config Config entry
+#
+################################################################################
+sub get_preserved_partitions {
+
+  my ($config) = @_;
+  ($config =~ /^PHY_(.+)$/) or &FAI::internal_error("Invalid config $config");
+  my $disk = $1; # the device to be configured
+
+  # the list of partitions that must be preserved
+  my @to_preserve = ();
+
+  # find partitions that should be preserved or resized
+  foreach my $part_id (&numsort(keys %{ $FAI::configs{$config}{partitions} })) {
+    # reference to the current partition
+    my $part = (\%FAI::configs)->{$config}->{partitions}->{$part_id};
+    next unless ($part->{size}->{preserve} || $part->{size}->{resize});
+
+    # preserved or resized partitions must exist already
+    defined( $FAI::current_config{$disk}{partitions}{$part_id} )
+      or die "$part_id can't be preserved, it does not exist.\n";
+
+    # add a mapping from the configured partition to the existing one
+    # (identical here, may change for extended partitions below)
+    $part->{maps_to_existing} = $part_id;
+
+    # add $part_id to the list of preserved partitions
+    push @to_preserve, $part_id;
+
+  }
+
+  # sort the list of preserved partitions
+  @to_preserve = &numsort(@to_preserve);
+
+  # add the extended partition as well, if logical partitions must be
+  # preserved; and mark it as resize
+  if ($FAI::configs{$config}{disklabel} eq "msdos") {
+    # we assume there are no logical partitions
+    my $has_logical = 0;
+    my $extended    = -1;
+
+    # now check all entries; the array is sorted
+    foreach my $part_id (@to_preserve) {
+      # the extended partition may already be listed; then, the id of the
+      # extended partition must not change
+      if ($FAI::current_config{$disk}{partitions}{$part_id}{is_extended}) {
+        (defined ($FAI::configs{$config}{partitions}{$extended}{size}{extended})
+          && defined ($FAI::current_config{$disk}{partitions}{$extended}{is_extended})
+          && $FAI::configs{$config}{partitions}{$extended}{size}{extended}
+          && $FAI::current_config{$disk}{partitions}{$extended}{is_extended}) 
+          or die "ID of extended partition changes\n";
+
+        # make sure resize is set
+        $FAI::configs{$config}{partitions}{$part_id}{size}{resize} = 1;
+        $extended = $part_id;
+        last;
+      }
+
+      # there is some logical partition
+      if ($part_id > 4) {
+        $has_logical = 1;
+        last;
+      }
+    }
+
+    # if the extended partition is not listed yet, find and add it now; note
+    # that we need to add the existing one
+    if ($has_logical && -1 == $extended) {
+      foreach my $part_id (&numsort(keys %{ $FAI::current_config{$disk}{partitions} })) {
+
+        # no extended partition
+        next unless
+          $FAI::current_config{$disk}{partitions}{$part_id}{is_extended};
+
+        # find the configured extended partition to set the mapping
+        foreach my $p (&numsort(keys %{ $FAI::configs{$config}{partitions} })) {
+          # reference to the current partition
+          my $part = (\%FAI::configs)->{$config}->{partitions}->{$p};
+          next unless $part->{size}->{extended};
+
+          # make sure resize is set
+          $part->{size}->{resize} = 1;
+
+          # store the id for further checks
+          $extended = $p;
+
+          # add a mapping entry to the existing extended partition
+          $part->{maps_to_existing} = $part_id;
+
+          # add it to the preserved partitions
+          push @to_preserve, $p;
+
+          last;
+        }
+
+        # sort the list of preserved partitions (again)
+        @to_preserve = &numsort(@to_preserve);
+
+        last;
+      }
+    }
+
+    # a sanity check: if there are logical partitions, the extended must
+    # have been added
+    (0 == $has_logical || -1 != $extended) 
+      or &FAI::internal_error("Required extended partition not detected for preserve");
+  }
+
+  return @to_preserve;
+}
+
+################################################################################
+#
+# @brief Recreate the preserved partitions once the partition table has been
+# flushed
+#
+# @param $config Config entry
+# @param $to_preserve Reference to list of preserved/resized partitions
+#
+################################################################################
+sub rebuild_preserved_partitions {
+
+  my ($config, $to_preserve) = @_;
+  ($config =~ /^PHY_(.+)$/) or &FAI::internal_error("Invalid config $config");
+  my $disk = $1; # the device to be configured
+
+  # once we rebuild partitions, their ids are likely to change; this counter
+  # helps keeping track of this
+  my $part_nr = 0;
+
+  # now rebuild all preserved partitions
+  foreach my $part_id (@{$to_preserve}) {
+    # get the existing id
+    my $mapped_id =
+    $FAI::configs{$config}{partitions}{$part_id}{maps_to_existing};
+
+    # get the original starts and ends
+    my $start =
+      $FAI::current_config{$disk}{partitions}{$mapped_id}{begin_byte};
+    my $end =
+      $FAI::current_config{$disk}{partitions}{$mapped_id}{end_byte};
+
+    # the type of the partition defaults to primary
+    my $part_type = "primary";
+    if ( $FAI::configs{$config}{disklabel} eq "msdos" ) {
+
+      # change the partition type to extended or logical as appropriate
+      if ( $FAI::configs{$config}{partitions}{$part_id}{size}{extended} == 1 ) {
+        $part_type = "extended";
+      } elsif ( $part_id > 4 ) {
+        $part_type = "logical";
+        $part_nr = 4 if ( $part_nr < 4 );
+      }
+    }
+
+    # restore the partition type, if any
+    my $fs =
+      $FAI::current_config{$disk}{partitions}{$mapped_id}{filesystem};
+
+    # increase the partition counter for the partition created next and
+    # write it to the configuration
+    $part_nr++;
+    $FAI::current_config{$disk}{partitions}{$mapped_id}{new_id} = $part_nr;
+
+    my $post = "exist_" . &FAI::make_device_name($disk, $part_nr);
+    $post .= ",rebuilt_" . &FAI::make_device_name($disk, $part_nr) if
+      $FAI::configs{$config}{partitions}{$part_id}{size}{resize};
+    # build a parted command to create the partition
+    &FAI::push_command( "parted -s $disk mkpart $part_type $fs ${start}B ${end}B",
+      "cleared1_$disk", $post );
+  }
+}
+
+################################################################################
+#
+# @brief Set up physical partitions
+#
+# @param $config Config entry
+#
+################################################################################
+sub setup_partitions {
+
+  my ($config) = @_;
+  ($config =~ /^PHY_(.+)$/) or &FAI::internal_error("Invalid config $config");
+  my $disk = $1; # the device to be configured
+
+  # the list of partitions that must be preserved
+  my @to_preserve = &FAI::get_preserved_partitions($config);
+
+  # A new disk label may only be written if no partitions need to be
+  # preserved
+  (($FAI::configs{$config}{disklabel} eq
+      $FAI::current_config{$disk}{disklabel})
+    || (scalar (@to_preserve) == 0)) 
+    or die "Can't change disklabel, partitions are to be preserved\n";
+
+  # write the disklabel to drop the previous partition table
+  &FAI::push_command( "parted -s $disk mklabel " .
+    $FAI::configs{$config}{disklabel}, "exist_$disk", "cleared1_$disk" );
+
+  &FAI::rebuild_preserved_partitions($config, \@to_preserve);
+
+  my $pre_all_resize = "";
+
+  # resize partitions while checking for dependencies
+  foreach my $part_id (reverse &numsort(@to_preserve)) {
+    # reference to the current partition
+    my $part = (\%FAI::configs)->{$config}->{partitions}->{$part_id};
+    # get the existing id
+    my $mapped_id = $part->{maps_to_existing};
+    # get the intermediate partition id
+    my $p = $FAI::current_config{$disk}{partitions}{$mapped_id}{new_id};
+    # anything to be done?
+    $pre_all_resize .= ",exist_" . &FAI::make_device_name($disk, $p) unless
+      $part->{size}->{resize};
+    if ($part->{size}->{resize}) {
+      warn &FAI::make_device_name($disk, $p) . " will be resized\n";
+    } else {
+      warn &FAI::make_device_name($disk, $p) . " will be preserved\n";
+      next;
+    }
+
+    $pre_all_resize .= ",resized_" . &FAI::make_device_name($disk, $p);
+    my $deps = "";
+    # now walk all other partitions requiring a resize to check for overlaps
+    foreach my $part_other (reverse &numsort(@to_preserve)) {
+      # don't compare to self
+      next if ($part_id == $part_other);
+      # reference to the current partition
+      my $part_other_ref = (\%FAI::configs)->{$config}->{partitions}->{$part_other};
+      # anything to be done?
+      next unless $part_other_ref->{size}->{resize};
+      # get the existing id
+      my $mapped_id_other = $part_other_ref->{maps_to_existing};
+      # get the intermediate partition id
+      my $p_other = $FAI::current_config{$disk}{partitions}{$mapped_id_other}{new_id};
+      # check for overlap
+      next if($part->{start_byte} >
+        $FAI::current_config{$disk}{partitions}{$mapped_id_other}{end_byte});
+      next if($part->{end_byte} <
+        $FAI::current_config{$disk}{partitions}{$mapped_id_other}{begin_byte});
+      # overlap detected - add dependency, but handle extended<->logical with
+      # special care, even though this does not catch all cases (sometimes it
+      # will fail nevertheless
+      if ($part->{size}->{extended} && $part_other > 4) {
+        if($part->{start_byte} >
+          $FAI::current_config{$disk}{partitions}{$mapped_id_other}{begin_byte}) {
+          $deps .= ",resized_" . &FAI::make_device_name($disk, $p_other);
+        }
+        elsif($part->{end_byte} <
+          $FAI::current_config{$disk}{partitions}{$mapped_id_other}{end_byte}) {
+          $deps .= ",resized_" . &FAI::make_device_name($disk, $p_other);
+        }
+      }
+      elsif ($part_id > 4 && $part_other_ref->{size}->{extended}) {
+        if($part->{start_byte} <
+          $FAI::current_config{$disk}{partitions}{$mapped_id_other}{begin_byte}) {
+          $deps .= ",resized_" . &FAI::make_device_name($disk, $p_other);
+        }
+        elsif($part->{end_byte} >
+          $FAI::current_config{$disk}{partitions}{$mapped_id_other}{end_byte}) {
+          $deps .= ",resized_" . &FAI::make_device_name($disk, $p_other);
+        }
+      } else {
+        $deps .= ",resized_" . &FAI::make_device_name($disk, $p_other);
+      }
+    }
+
+    # get the new starts and ends
+    my $start = $part->{start_byte};
+    my $end = $part->{end_byte};
+
+    # build an appropriate command
+    # ntfs requires specific care
+    if ($FAI::current_config{$disk}{partitions}{$mapped_id}{filesystem} eq
+      "ntfs") {
+      # check, whether ntfsresize is available
+      &FAI::in_path("ntfsresize") or die "ntfsresize not found in PATH\n";
+      # ntfs partition can't be moved
+      ($start == $FAI::current_config{$disk}{partitions}{$mapped_id}{begin_byte}) 
+        or &FAI::internal_error("ntfs partition supposed to move");
+      # ntfsresize requires device names
+      my $eff_size = $part->{size}->{eff_size};
+
+      &FAI::push_command( "yes | ntfsresize -s $eff_size " .
+        &FAI::make_device_name($disk, $p), "rebuilt_" .
+        &FAI::make_device_name($disk, $p) . $deps, "ntfs_ready_for_rm_" .
+        &FAI::make_device_name($disk, $p) );
+      &FAI::push_command( "parted -s $disk rm $p", "ntfs_ready_for_rm_" .
+        &FAI::make_device_name($disk, $p), "resized_" .
+        &FAI::make_device_name($disk, $p) );
+    } else {
+      &FAI::push_command( "parted -s $disk resize $p ${start}B ${end}B",
+        "rebuilt_" . &FAI::make_device_name($disk, $p) . $deps, "resized_" .
+        &FAI::make_device_name($disk, $p) );
+    }
+
+  }
+
+  # write the disklabel again to drop the partition table and create a new one
+  # that has the proper ids
+  &FAI::push_command( "parted -s $disk mklabel " .
+    $FAI::configs{$config}{disklabel}, "cleared1_$disk$pre_all_resize",
+    "cleared2_$disk" );
+
+  my $prev_id = -1;
+  # generate the commands for creating all partitions
+  foreach my $part_id (&numsort(keys %{ $FAI::configs{$config}{partitions} })) {
+    # reference to the current partition
+    my $part = (\%FAI::configs)->{$config}->{partitions}->{$part_id};
+    # get the existing id
+    my $mapped_id = $part->{maps_to_existing};
+
+    # get the new starts and ends
+    my $start = $part->{start_byte};
+    my $end = $part->{end_byte};
+
+    # the type of the partition defaults to primary
+    my $part_type = "primary";
+    if ($FAI::configs{$config}{disklabel} eq "msdos") {
+
+      # change the partition type to extended or logical as appropriate
+      if ($part->{size}->{extended} == 1) {
+        $part_type = "extended";
+      } elsif ($part_id > 4) {
+        $part_type = "logical";
+      }
+    }
+
+    my $fs = $part->{filesystem};
+    $fs = "" unless defined($fs);
+    $fs = "linux-swap" if ($fs eq "swap");
+    $fs = "fat32" if ($fs eq "vfat");
+    $fs = "fat16" if ($fs eq "msdos");
+    $fs = $FAI::current_config{$disk}{partitions}{$mapped_id}{filesystem}
+      if ($part->{size}->{preserve} || $part->{size}->{resize});
+    $fs = "" if ($fs eq "-");
+
+    my $pre = "";
+    $pre = ",exist_" . &FAI::make_device_name($disk, $prev_id) if ($prev_id > -1);
+    # build a parted command to create the partition
+    &FAI::push_command( "parted -s $disk mkpart $part_type $fs ${start}B ${end}B",
+      "cleared2_$disk$pre", "exist_" . &FAI::make_device_name($disk, $part_id) );
+    $prev_id = $part_id;
+  }
+
+  # set the bootable flag, if requested at all
+  if ($FAI::configs{$config}{bootable} > -1) {
+    &FAI::push_command( "parted -s $disk set " .
+      $FAI::configs{$config}{bootable} . " boot on", "exist_" .
+      &FAI::make_device_name($disk, $FAI::configs{$config}{bootable}),
+      "boot_set_$disk" );
+  }
+}
+
+
+################################################################################
+#
+# @brief Using the configurations from %FAI::configs, a list of commands is
+# built to setup the partitions
+#
+################################################################################
+sub build_disk_commands {
+
+  # loop through all configs
+  foreach my $config ( keys %FAI::configs ) {
+    # no RAID or LVM devices here
+    next if ($config eq "RAID" || $config =~ /^VG_./);
+    ($config =~ /^PHY_(.+)$/) or &FAI::internal_error("Invalid config $config");
+    my $disk = $1; # the device to be configured
+
+    # create partitions on non-virtual configs
+    &FAI::setup_partitions($config) unless ($FAI::configs{$config}{virtual});
+
+    # generate the commands for creating all filesystems
+    foreach my $part_id (&numsort(keys %{ $FAI::configs{$config}{partitions} })) {
+      # reference to the current partition
+      my $part = (\%FAI::configs)->{$config}->{partitions}->{$part_id};
+
+      # skip preserved/resized/extended partitions
+      next if ($part->{size}->{preserve} == 1
+        || $part->{size}->{resize} == 1 || $part->{size}->{extended} == 1);
+
+      # create the filesystem on the device
+      &FAI::build_mkfs_commands( &FAI::make_device_name($disk, $part_id), $part );
+    }
+  }
+}
+
+################################################################################
+#
+# @brief Whatever happened, write the previous partition table to the disk again
+#
+################################################################################
+sub restore_partition_table {
+
+  # loop through all existing configs
+  foreach my $disk (keys %FAI::current_config) {
+
+    # write the disklabel again to drop the partition table
+    &FAI::execute_command("parted -s $disk mklabel "
+        . $FAI::current_config{$disk}{disklabel}, 0, 0);
+
+    # generate the commands for creating all partitions
+    foreach my $part_id (&numsort(keys %{ $FAI::current_config{$disk}{partitions} })) {
+      # reference to the current partition
+      my $curr_part = (\%FAI::current_config)->{$disk}->{partitions}->{$part_id};
+
+      # get the starts and ends
+      my $start = $curr_part->{begin_byte};
+      my $end = $curr_part->{end_byte};
+
+      # the type of the partition defaults to primary
+      my $part_type = "primary";
+      if ($FAI::current_config{$disk}{disklabel} eq "msdos") {
+
+        # change the partition type to extended or logical as appropriate
+        if ($curr_part->{is_extended}) {
+          $part_type = "extended";
+        } elsif ($part_id > 4) {
+          $part_type = "logical";
+        }
+      }
+
+      # restore the partition type, if any
+      my $fs = $curr_part->{filesystem};
+
+      # build a parted command to create the partition
+      &FAI::execute_command("parted -s $disk mkpart $part_type $fs ${start}B ${end}B");
+    }
+    warn "Partition table of disk $disk has been restored\n";
+  }
+
+  die "setup-storage failed, but the partition tables have been restored\n";
+}
+
+################################################################################
+#
+# @brief Try to order the queued commands to satisfy all dependencies
+#
+################################################################################
+sub order_commands {
+  my @pre_deps = ();
+  my $i = 1;
+  my $pushed = -1;
+
+  while ($i < $FAI::n_c_i) {
+    my $all_matched = 1;
+    if (defined($FAI::commands{$i}{pre})) {
+      foreach (split(/,/, $FAI::commands{$i}{pre})) {
+        my $cur = $_;
+        next if scalar(grep(m{^$cur$}, @pre_deps));
+        $all_matched = 0;
+        last;
+      }
+    }
+    if ($all_matched) {
+      defined($FAI::commands{$i}{post}) and push @pre_deps, split(/,/, $FAI::commands{$i}{post});
+      $pushed = -1;
+      $i++;
+      next;
+    }
+    if (-1 == $pushed) {
+      $pushed = $FAI::n_c_i;
+    }
+    elsif ($i == $pushed) {
+      die "Cannot satisfy pre-depends for " . $FAI::commands{$i}{cmd} . ": " .
+        $FAI::commands{$i}{pre} . " -- system left untouched.\n";
+    }
+    &FAI::push_command( $FAI::commands{$i}{cmd}, $FAI::commands{$i}{pre},
+      $FAI::commands{$i}{post} );
+    delete $FAI::commands{$i};
+    $i++;
+  }
+}
+
+1;
+

Added: branches/lhm/lib/setup-storage/Exec.pm
===================================================================
--- branches/lhm/lib/setup-storage/Exec.pm	                        (rev 0)
+++ branches/lhm/lib/setup-storage/Exec.pm	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,369 @@
+#!/usr/bin/perl -w
+
+#*********************************************************************
+# 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.
+#
+# A copy of the GNU General Public License is available as
+# `/usr/share/common-licences/GPL' in the Debian GNU/Linux distribution
+# or on the World Wide Web at http://www.gnu.org/copyleft/gpl.html. You
+# can also obtain it by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#*********************************************************************
+
+use strict;
+
+################################################################################
+#
+# @file exec.pm
+#
+# @brief functions to execute system commands
+#
+# $Id: Exec.pm 5214 2008-10-28 09:32:32Z lange $
+#
+# @author Christian Kern, Michael Tautschnig
+# @date Sun Jul 23 16:09:36 CEST 2006
+#
+################################################################################
+
+use File::Temp;
+
+package FAI;
+
+################################################################################
+#
+# @brief hash, defined: errors, descriptions, actions on error
+#
+# @scalar error error
+# @scalar message our errormessage
+# @scalar stderr_regex regex to recognize the error message on stderr output of the bash
+# @scalar stdout_regex regex to recognize the error message on stdout output of the bash
+# @scalar program the program this error message can come from
+# @scalar response default action on this error.
+#
+################################################################################
+$FAI::error_codes = [
+  {
+    error   => "parted_1",
+    message => "Parted failed to open the device\n",
+    stderr_regex => "Error: Could not stat device .* - No such file or directory",
+    stdout_regex => "",
+    program      => "parted",
+    response     => "die",
+  },
+  {
+    error   => "parted_1_new",
+    message => "Parted failed to open the device\n",
+    stderr_regex => "",
+    stdout_regex => "Error: Could not stat device .* - No such file or directory",
+    program      => "parted",
+    response     => "die",
+  },
+  {
+    error        => "parted_2",
+    message      => "Parted could not read a disk label\n",
+    stderr_regex => "Error: Unable to open .* - unrecognised disk label",
+    stdout_regex => "",
+    program      => "parted",
+    response     => "warn",
+  },
+  {
+    error        => "parted_2_new",
+    message      => "Parted could not read a disk label\n",
+    stderr_regex => "",
+    stdout_regex => "Error: .* unrecognised disk label",
+    program      => "parted",
+    response     => "warn",
+  },
+  ## {
+  ##   error        => "parted_3",
+  ##   message      => "Parted was unable to create the partition\n",
+  ##   stderr_regex => "Warning: You requested a partition from .* to .*\\.\$",
+  ##   stdout_regex => "",
+  ##   program      => "parted",
+  ##   response     => \&FAI::restore_partition_table,
+  ## },
+  {
+    error        => "parted_4",
+    message      => "Parted was unable to read the partition table\n",
+    stderr_regex => "No Implementation: Partition \\d+ isn't aligned to cylinder boundaries",
+    stdout_regex => "",
+    program      => "parted",
+    response     => "die",
+  },
+  {
+    error        => "parted_4_new",
+    message      => "Parted was unable to read the partition table\n",
+    stderr_regex => "",
+    stdout_regex => "No Implementation: Partition \\d+ isn't aligned to cylinder boundaries",
+    program      => "parted",
+    response     => "die",
+  },
+  {
+    error        => "parted_5",
+    message      => "Parted failed to resize due to a setup-storage internal error\n",
+    stderr_regex => "Error: Can't have overlapping partitions",
+    stdout_regex => "",
+    program      => "parted",
+    response     => "die",
+  },
+  {
+    error        => "parted_5_new",
+    message      => "Parted failed to resize due to a setup-storage internal error\n",
+    stderr_regex => "",
+    stdout_regex => "Error: Can't have overlapping partitions",
+    program      => "parted",
+    response     => "die",
+  },
+  {
+    error        => "parted_6",
+    message      => "Parted failed to resize the partition (is it too small?)\n",
+    stderr_regex => "Error: Unable to satisfy all constraints on the partition",
+    stdout_regex => "",
+    program      => "parted",
+    response     => "die",
+  },
+  {
+    error        => "parted_6_new",
+    message      => "Parted failed to resize the partition (is it too small?)\n",
+    stderr_regex => "",
+    stdout_regex => "Error: Unable to satisfy all constraints on the partition",
+    program      => "parted",
+    response     => "die",
+  },
+  {
+    error   => "cmd_parted_1",
+    message => "parted not found\n",
+    stderr_regex => "(parted: command not found|/sbin/parted: No such file or directory)",
+    stdout_regex => "",
+    program      => "parted",
+    response     => "die"
+  },
+  {
+    error => "mkfs.xfs_1",
+    message => "mkfs.xfs refused to create a filesystem. Probably you should add -f to the mkfs options in your disk_config file.\n",
+    stderr_regex => "mkfs.xfs: /dev/.* appears to contain an existing filesystem",
+    stdout_regex => "",
+    program      => "mkfs.xfs",
+    response     => "die",
+  },
+  {
+    error        => "ntfsresize_1",
+    message      => "NTFS resize cannot proceed\n",
+    stderr_regex => "(Error|ERROR)",
+    stdout_regex => "",
+    program      => "ntfsresize",
+    response     => "die",
+  },
+];
+
+################################################################################
+#
+# @brief returns the error message associated with an error
+#
+# @param error identifier of an error
+#
+# @return our interpretation of the error as string
+#
+################################################################################
+sub get_error_message {
+
+  my ($error) = @_;
+  my @treffer = grep { $_->{error} eq "$error" } @$FAI::error_codes;
+
+  # returns the first found error message.
+  return $treffer[0]->{'message'};
+}
+
+################################################################################
+#
+# @brief gets any part of the error struct associated with an error
+#
+# @param error identifier of an error
+# @param field field of the error struct as string, example: "stderr_regex"
+#
+# @return the associated value
+#
+################################################################################
+sub get_error {
+
+  my ($error, $field) = @_;
+  my @treffer = grep { $_->{error} eq "$error" } @$FAI::error_codes;
+
+  # returns the first found error message.
+  return $treffer[0]->{$field};
+}
+################################################################################
+#
+# @brief execute a shell command, given as string. also catch stderr and
+# stdout, to be passed to the caller function, and also used for error
+# recognition. This execute function does execute the in the error struct
+# defined action, when an error occurs.
+#
+# @param command bash command to be executed as string
+# @reference stdout reference to a list, that should contain the standard
+# output of the bash command
+#
+# @reference stderr reference to a list, that should contain the standard
+# errer output of the bash command
+#
+# @return the identifier of the error
+#
+################################################################################
+sub execute_command {
+
+  my ($command, $stdout, $stderr) = @_;
+
+  my $err = &execute_command_internal($command, $stdout, $stderr);
+
+  if ($err ne "") {
+    my $response = &get_error($err, "response");
+    my $message  = &get_error($err, "message");
+
+    $response->() if (ref ($response));
+
+    die $message if ($response eq "die");
+
+    warn $message if ($response eq "warn");
+
+    return $err;
+  }
+  return "";
+}
+################################################################################
+#
+# @brief Execute a command as in execute_command, but prefix it with udevsettle
+#
+# @return the identifier of the error
+#
+################################################################################
+sub execute_with_udevsettle {
+  my ($command, $stdout, $stderr) = @_;
+  return &execute_command("udevsettle --timeout 10 && $command", $stdout,
+    $stderr);
+}
+
+################################################################################
+#
+# @brief Execute a command that is known to be read-only and thus acceptable to
+# be run despite dry_run mode
+#
+# @return the identifier of the error
+#
+################################################################################
+sub execute_ro_command {
+  my ($command, $stdout, $stderr) = @_;
+
+  # backup value of $FAI::no_dry_run
+  my $no_dry_run = $FAI::no_dry_run;
+
+  # set no_dry_run to perform read-only commands always
+  $FAI::no_dry_run = 1;
+
+  my $err = &execute_command_internal($command, $stdout, $stderr);
+
+  # reset no_dry_run
+  $FAI::no_dry_run = $no_dry_run;
+
+  if ($err ne "") {
+    my $response = &get_error($err, "response");
+    my $message  = &get_error($err, "message");
+
+    $response->() if (ref ($response));
+
+    die $message if ($response eq "die");
+
+    warn $message if ($response eq "warn");
+
+    return $err;
+  }
+  return "";
+}
+
+
+################################################################################
+#
+# @brief execute a /bin/bash command, given as string. also catch stderr and
+# stdout, to be passed to the caller function, and also used for error
+# recognition. This caller function must handle the error.
+#
+# @param command bash command to be executed as string
+# @reference stdout_ref reference to a list, that should contain the standard
+# output of the bash command
+#
+# @reference stderr_ref reference to a list, that should contain the standard
+# error output of the bash command
+#
+# @return the identifier of the error
+#
+################################################################################
+sub execute_command_internal {
+
+  my ($command, $stdout_ref, $stderr_ref) = @_;
+
+  my @stderr      = ();
+  my @stdout      = ();
+  my $stderr_line = "";
+  my $stdout_line = "";
+
+  #make tempfile, get perl filehandle and filename of the file
+  my ($stderr_fh, $stderr_filename) = File::Temp::tempfile(UNLINK => 1);
+  my ($stdout_fh, $stdout_filename) = File::Temp::tempfile(UNLINK => 1);
+
+  # do only execute the given command, when in no_dry_mode
+  if ($FAI::no_dry_run) {
+
+    $FAI::debug
+      and print "(CMD) $command 1> $stdout_filename 2> $stderr_filename\n";
+
+    # execute the bash command, write stderr and stdout into the testfiles
+    print "Executing: $command\n";
+    `$command 1> $stdout_filename 2> $stderr_filename`;
+    ( ($?>>8) ne 0 ) and warn "Command $command had exit code " . ($?>>8) . "\n";
+  } else {
+    print "would run command $command; to have them executed, use -X \n";
+  }
+
+  # read the tempfile into lists, each element of the list one line
+  @stderr = <$stderr_fh>;
+  @stdout = <$stdout_fh>;
+
+  #when closing the files, the tempfiles are removed too
+  close ($stderr_fh);
+  close ($stdout_fh);
+
+  $FAI::debug and print "(STDERR) $_" foreach (@stderr);
+  $FAI::debug and print "(STDOUT) $_" foreach (@stdout);
+
+  #if the stderr contains information, get the first line for error recognition
+  $stderr_line = $stderr[0] if (scalar (@stderr));
+
+  #see last comment
+  $stdout_line = $stdout[0] if (scalar (@stdout));
+
+  #if an array is passed to the function, it is filled with the stdout
+  @$stdout_ref = @stdout if ('ARRAY' eq ref ($stdout_ref));
+
+  #see above
+  @$stderr_ref = @stderr if ('ARRAY' eq ref ($stderr_ref));
+
+  #get the error, if there was any
+  foreach my $err (@$FAI::error_codes) {
+    if (($err->{stdout_regex} eq "" || $stdout_line =~ /$err->{stdout_regex}/)
+      && ($err->{stderr_regex} eq "" || $stderr_line =~ /$err->{stderr_regex}/)
+      && ($err->{program} eq "" || $command =~ /$err->{program}/)) {
+      return $err->{error};
+    }
+  }
+
+}
+
+1;
+

Added: branches/lhm/lib/setup-storage/Fstab.pm
===================================================================
--- branches/lhm/lib/setup-storage/Fstab.pm	                        (rev 0)
+++ branches/lhm/lib/setup-storage/Fstab.pm	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,295 @@
+#!/usr/bin/perl -w
+
+#*********************************************************************
+# 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.
+#
+# A copy of the GNU General Public License is available as
+# `/usr/share/common-licences/GPL' in the Debian GNU/Linux distribution
+# or on the World Wide Web at http://www.gnu.org/copyleft/gpl.html. You
+# can also obtain it by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#*********************************************************************
+
+use strict;
+
+################################################################################
+#
+# @file fstab.pm
+#
+# @brief Generate an fstab file as appropriate for the configuration
+#
+# $Id: Fstab.pm 4978 2008-06-13 10:28:34Z lange $
+#
+# @author Christian Kern, Michael Tautschnig
+# @date Sun Jul 23 16:09:36 CEST 2006
+#
+################################################################################
+
+package FAI;
+
+################################################################################
+#
+# @brief Create a line for /etc/fstab
+#
+# @reference $d_ref Device reference
+# @param $name Device name used as a key in /etc/fstab
+# @param $dev_name Real (current) device name to be used in SWAPLIST
+#
+# @return fstab line
+#
+################################################################################
+sub create_fstab_line {
+  my ($d_ref, $name, $dev_name) = @_;
+
+  my @fstab_line = ();
+
+  # start with the device key
+  push @fstab_line, $name;
+
+  # add mount information, never dump, order of filesystem checks
+  push @fstab_line, ($d_ref->{mountpoint}, $d_ref->{filesystem},
+    $d_ref->{mount_options}, 0, 2);
+  # order of filesystem checks: the root filesystem gets a 1, the others
+  # got 2
+  $fstab_line[-1] = 1 if ($d_ref->{mountpoint} eq "/");
+
+  # set the ROOT_PARTITION variable, if this is the mountpoint for /
+  $FAI::disk_var{ROOT_PARTITION} = $name
+    if ($d_ref->{mountpoint} eq "/");
+
+  # add to the swaplist, if the filesystem is swap
+  $FAI::disk_var{SWAPLIST} .= " " . $dev_name
+    if ($d_ref->{filesystem} eq "swap");
+
+  # join the columns of one line with tabs
+  return join ("\t", @fstab_line);
+}
+
+
+################################################################################
+#
+# @brief Obtain UUID and filesystem label information, if any.
+#
+# @param device_name Full device name
+# @param key_type Type to be used (uuid, label, or device)
+#
+# @return fstab key to be used
+#
+################################################################################
+sub get_fstab_key {
+  my ($device_name, $key_type) = @_;
+
+  ("uuid" eq $key_type) or ("label" eq $key_type) or ("device" eq $key_type) or
+    &FAI::internal_error("Invalid key type $key_type");
+
+  # write the device name as the first entry; if the user prefers uuids
+  # or labels, use these if available
+  my @uuid = ();
+  &FAI::execute_ro_command(
+    "/lib/udev/vol_id -u $device_name", \@uuid, 0);
+
+  # every device must have a uuid, otherwise this is an error (unless we
+  # are testing only)
+  ($FAI::no_dry_run == 0 || scalar (@uuid) == 1)
+    or die "Failed to obtain UUID for $device_name\n";
+
+  # get the label -- this is likely empty
+  my @label = ();
+  &FAI::execute_ro_command(
+    "/lib/udev/vol_id -l $device_name", \@label, 0);
+
+  # using the fstabkey value the desired device entry is defined
+  if ($key_type eq "uuid") {
+    chomp ($uuid[0]);
+    return "UUID=$uuid[0]";
+  } elsif ($key_type eq "label" && scalar(@label) == 1) {
+    chomp($label[0]);
+    return "LABEL=$label[0]";
+  } else {
+    # otherwise, use the usual device path
+    return $device_name;
+  }
+}
+
+
+################################################################################
+#
+# @brief this function generates the fstab file from our representation of the
+# partitions to be created.
+#
+# @reference config Reference to our representation of the partitions to be
+# created
+#
+# @return list of fstab lines
+#
+################################################################################
+sub generate_fstab {
+
+  # config structure is the only input
+  my ($config) = @_;
+
+  # the file to be returned, a list of lines
+  my @fstab = ();
+
+  # walk through all configured parts
+  # the order of entries is most likely wrong, it is fixed at the end
+  foreach my $c (keys %$config) {
+
+    # entry is a physical device
+    if ($c =~ /^PHY_(.+)$/) {
+      my $device = $1;
+
+      # make sure the desired fstabkey is defined at all
+      defined ($config->{$c}->{fstabkey})
+        or &FAI::internal_error("fstabkey undefined");
+
+      # create a line in the output file for each partition
+      foreach my $p (keys %{ $config->{$c}->{partitions} }) {
+
+        # keep a reference to save some typing
+        my $p_ref = $config->{$c}->{partitions}->{$p};
+
+        # skip extended partitions and entries without a mountpoint
+        next if ($p_ref->{size}->{extended} || $p_ref->{mountpoint} eq "-");
+
+        my $device_name = &FAI::make_device_name($device, $p_ref->{number});
+        if ($p_ref->{encrypt}) {
+          # encryption requested, rewrite the device name
+          $device_name =~ "s#/#_#g";
+          $device_name = "/dev/mapper/crypt$device_name";
+        }
+
+        # if the mount point is / or /boot, the variables should be set, unless
+        # they are already
+        if ($p_ref->{mountpoint} eq "/boot" || ($p_ref->{mountpoint} eq "/" && 
+              !defined ($FAI::disk_var{BOOT_PARTITION}))) {
+          # set the BOOT_DEVICE and BOOT_PARTITION variables, if necessary
+          $FAI::disk_var{BOOT_PARTITION} = $device_name;
+          ($c =~ /^PHY_(.+)$/) or &FAI::internal_error("unexpected mismatch");
+          defined ($FAI::disk_var{BOOT_DEVICE}) and ($FAI::disk_var{BOOT_DEVICE} ne "") or
+            $FAI::disk_var{BOOT_DEVICE} = $1;
+        }
+
+        push @fstab, &FAI::create_fstab_line($p_ref,
+          &FAI::get_fstab_key($device_name, $config->{$c}->{fstabkey}), $device_name);
+
+      }
+    } elsif ($c =~ /^VG_(.+)$/) {
+      next if ($1 eq "--ANY--");
+
+      my $device = $1;
+
+      # create a line in the output file for each logical volume
+      foreach my $l (keys %{ $config->{$c}->{volumes} }) {
+
+        # keep a reference to save some typing
+        my $l_ref = $config->{$c}->{volumes}->{$l};
+
+        # skip entries without a mountpoint
+        next if ($l_ref->{mountpoint} eq "-");
+
+        # real device name
+        my @fstab_key = ();
+
+        # resolve the symlink to the real device
+        # and write it as the first entry
+        &FAI::execute_ro_command("readlink -f /dev/$device/$l", \@fstab_key, 0);
+
+        # remove the newline
+        chomp ($fstab_key[0]);
+
+        # make sure we got back a real device
+        ($FAI::no_dry_run == 0 || -b $fstab_key[0]) 
+          or die "Failed to resolve /dev/$device/$l\n";
+
+        my $device_name = "/dev/$device/$l";
+        if ($l_ref->{encrypt}) {
+          # encryption requested, rewrite the device name
+          $device_name =~ "s#/#_#g";
+          $device_name = "/dev/mapper/crypt$device_name";
+        } else {
+          $device_name = $fstab_key[0];
+        }
+
+        # according to http://grub.enbug.org/LVMandRAID, this should work...
+        # if the mount point is / or /boot, the variables should be set, unless
+        # they are already
+        if ($l_ref->{mountpoint} eq "/boot" || ($l_ref->{mountpoint} eq "/" && 
+              !defined ($FAI::disk_var{BOOT_PARTITION}))) {
+          # set the BOOT_DEVICE and BOOT_PARTITION variables, if necessary
+          $FAI::disk_var{BOOT_PARTITION} = $device_name;
+          defined ($FAI::disk_var{BOOT_DEVICE}) and ($FAI::disk_var{BOOT_DEVICE} ne "") or
+            $FAI::disk_var{BOOT_DEVICE} = $device_name;
+        }
+
+        push @fstab, &FAI::create_fstab_line($l_ref,
+          &FAI::get_fstab_key($device_name, $config->{"VG_--ANY--"}->{fstabkey}), $device_name);
+      }
+    } elsif ($c eq "RAID") {
+
+      # create a line in the output file for each device
+      foreach my $r (keys %{ $config->{$c}->{volumes} }) {
+
+        # keep a reference to save some typing
+        my $r_ref = $config->{$c}->{volumes}->{$r};
+
+        # skip entries without a mountpoint
+        next if ($r_ref->{mountpoint} eq "-");
+
+        my $device_name = "/dev/md$r";
+        if ($r_ref->{encrypt}) {
+          # encryption requested, rewrite the device name
+          $device_name =~ "s#/#_#g";
+          $device_name = "/dev/mapper/crypt$device_name";
+        } 
+
+        # according to http://grub.enbug.org/LVMandRAID, this should work...
+        # if the mount point is / or /boot, the variables should be set, unless
+        # they are already
+        if ($r_ref->{mountpoint} eq "/boot" || ($r_ref->{mountpoint} eq "/" && 
+              !defined ($FAI::disk_var{BOOT_PARTITION}))) {
+          # set the BOOT_DEVICE and BOOT_PARTITION variables, if necessary
+          $FAI::disk_var{BOOT_PARTITION} = "$device_name";
+          defined ($FAI::disk_var{BOOT_DEVICE}) and ($FAI::disk_var{BOOT_DEVICE} ne "") or
+            $FAI::disk_var{BOOT_DEVICE} = "$device_name";
+        }
+
+        push @fstab, &FAI::create_fstab_line($r_ref,
+          &FAI::get_fstab_key($device_name, $config->{RAID}->{fstabkey}), $device_name);
+      }
+    } else {
+      &FAI::internal_error("Unexpected key $c");
+    }
+  }
+
+  # cleanup the swaplist (remove leading space and add quotes)
+  $FAI::disk_var{SWAPLIST} =~ s/^\s*/"/;
+  $FAI::disk_var{SWAPLIST} =~ s/\s*$/"/;
+
+  # cleanup the list of boot devices (remove leading space and add quotes)
+  $FAI::disk_var{BOOT_DEVICE} =~ s/^\s*/"/;
+  $FAI::disk_var{BOOT_DEVICE} =~ s/\s*$/"/;
+
+  # sort the lines in @fstab to enable all sub mounts
+  @fstab = sort { [split("\t",$a)]->[1] cmp [split("\t",$b)]->[1] } @fstab;
+
+  # add a nice header to fstab
+  unshift @fstab,
+    "# <file sys>\t<mount point>\t<type>\t<options>\t<dump>\t<pass>";
+  unshift @fstab, "#";
+  unshift @fstab, "# /etc/fstab: static file system information.";
+
+  # return the list of lines
+  return @fstab;
+}
+
+1;
+

Added: branches/lhm/lib/setup-storage/Init.pm
===================================================================
--- branches/lhm/lib/setup-storage/Init.pm	                        (rev 0)
+++ branches/lhm/lib/setup-storage/Init.pm	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,218 @@
+#!/usr/bin/perl -w
+
+#*********************************************************************
+# 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.
+#
+# A copy of the GNU General Public License is available as
+# `/usr/share/common-licences/GPL' in the Debian GNU/Linux distribution
+# or on the World Wide Web at http://www.gnu.org/copyleft/gpl.html. You
+# can also obtain it by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#*********************************************************************
+
+use strict;
+
+################################################################################
+#
+# @file init.pm
+#
+# @brief Initialize all variables and acquire the set of disks of the system.
+#
+# The layout of the data structures is documented in the wiki:
+# http://faiwiki.informatik.uni-koeln.de/index.php/Setup-storage
+#
+# $Id: Init.pm 5116 2008-09-06 15:16:51Z lange $
+#
+# @author Christian Kern, Michael Tautschnig
+# @date Sun Jul 23 16:09:36 CEST 2006
+#
+################################################################################
+
+package FAI;
+
+################################################################################
+#
+# @brief Enable debugging by setting $debug to a value greater than 0
+#
+################################################################################
+$FAI::debug = 0;
+defined( $ENV{debug} ) and $FAI::debug = $ENV{debug};
+
+################################################################################
+#
+# @brief The lists of disks of the system
+#
+################################################################################
+ at FAI::disks = split( /\n/, $ENV{disklist} );
+( $FAI::debug > 0 ) and print "disklist was: $ENV{disklist}\n";
+
+################################################################################
+#
+# @brief The variables later written to disk_var.sh
+#
+################################################################################
+%FAI::disk_var = ();
+$FAI::disk_var{SWAPLIST} = "";
+$FAI::disk_var{BOOT_DEVICE} = "";
+
+################################################################################
+#
+# @brief The contents later written to crypttab, if any
+#
+################################################################################
+ at FAI::crypttab = ();
+
+################################################################################
+#
+# @brief A flag to tell our script that the system is not installed for the
+# first time
+#
+################################################################################
+$FAI::reinstall = 1;
+defined( $ENV{flag_initial} ) and $FAI::reinstall = 0;
+
+################################################################################
+#
+# @brief The hash of all configurations specified in the disk_config file
+#
+################################################################################
+%FAI::configs = ();
+
+################################################################################
+#
+# @brief The current disk configuration
+#
+################################################################################
+%FAI::current_config = ();
+
+################################################################################
+#
+# @brief The current LVM configuration
+#
+################################################################################
+%FAI::current_lvm_config = ();
+
+################################################################################
+#
+# @brief The current RAID configuration
+#
+################################################################################
+%FAI::current_raid_config = ();
+
+################################################################################
+#
+# @brief The commands to be executed
+#
+################################################################################
+%FAI::commands = ();
+
+################################################################################
+#
+# @brief Each command is associated with a unique id -- this one aids in
+# counting (next_command_index)
+#
+################################################################################
+$FAI::n_c_i = 1;
+
+################################################################################
+#
+# @brief Add command to hash
+#
+# @param cmd Command
+# @param pre Preconditions
+# @param post Postconditions
+#
+################################################################################
+sub push_command { 
+  my ($cmd, $pre, $post) = @_;
+
+  $FAI::commands{$FAI::n_c_i} = {
+    cmd => $cmd,
+    pre => $pre,
+    post => $post
+  };
+  $FAI::n_c_i++;
+}
+
+
+################################################################################
+#
+# @brief Sort integer arrays
+#
+################################################################################
+sub numsort { return sort { $a <=> $b } @_; }
+
+
+################################################################################
+#
+# @brief Check, whether $dev is a physical device, and extract sub-parts
+#
+# @param $dev Device string
+#
+# @return 1, if it the matches the regexp, and disk device string, and
+# partition number, if any, otherwise -1
+#
+################################################################################
+sub phys_dev {
+  my ($dev) = @_;
+  if ($dev =~ m{^/dev/(i2o/hd[a-t]|sd[a-t]{1,2}|hd[a-t]|vd[a-t])(\d+)?$})
+  {
+    defined($2) or return (1, "/dev/$1", -1);
+    return (1, "/dev/$1", $2);
+  }
+  elsif ($dev =~ m{^/dev/(cciss/c\dd\d|ida/c\dd\d|rd/c\dd\d|ataraid/d\d)p(\d+)?$})
+  {
+    defined($2) or return (1, "/dev/$1", -1);
+    return (1, "/dev/$1", $2);
+  }
+  return (0, "", -2);
+}
+
+################################################################################
+#
+# @brief Convert a device name and a partition id to a proper device name,
+# handling cciss and the like
+#
+# @param $dev Device name of disk
+# @param $id Partition id
+#
+# @return Full device name
+#
+################################################################################
+sub make_device_name {
+  my ($dev, $p) = @_;
+  $dev .= "p" if ($dev =~
+    m{^/dev/(cciss/c\dd\d|ida/c\dd\d|rd/c\dd\d|ataraid/d\d)$});
+  $dev .= $p;
+  internal_error("Invalid device $dev") unless (&FAI::phys_dev($dev))[0];
+  return $dev;
+}
+
+################################################################################
+#
+# @brief Report an error that is due to a bug in the implementation
+#
+# @param $error_msg Error message
+#
+################################################################################
+sub internal_error {
+
+  my ($error_msg) = @_;
+
+  die <<EOF;
+INTERNAL ERROR in setup-storage:
+$error_msg
+Please report this error to the Debian Bug Tracking System.
+EOF
+}
+
+1;
+

Added: branches/lhm/lib/setup-storage/Parser.pm
===================================================================
--- branches/lhm/lib/setup-storage/Parser.pm	                        (rev 0)
+++ branches/lhm/lib/setup-storage/Parser.pm	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,691 @@
+#!/usr/bin/perl -w
+
+#*********************************************************************
+# 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.
+#
+# A copy of the GNU General Public License is available as
+# `/usr/share/common-licences/GPL' in the Debian GNU/Linux distribution
+# or on the World Wide Web at http://www.gnu.org/copyleft/gpl.html. You
+# can also obtain it by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#*********************************************************************
+
+use strict;
+
+################################################################################
+#
+# @file parser.pm
+#
+# @brief A parser for the disk_config files within FAI.
+#
+# $Id: Parser.pm 5188 2008-10-14 13:29:57Z lange $
+#
+# @author Christian Kern, Michael Tautschnig, Sam Vilain, Andreas Schludei
+# @date Sun Jul 23 16:09:36 CEST 2006
+#
+################################################################################
+
+use Parse::RecDescent;
+
+package FAI;
+
+################################################################################
+#
+# @brief the name of the device currently being configured, including a prefix
+# such as PHY_ or VG_ to indicate physical devices or LVM volume groups. For
+# RAID, the entry is only "RAID"
+#
+################################################################################
+$FAI::device = "";
+
+################################################################################
+#
+# @brief Test, whether @ref $cmd is available on the system using $PATH
+#
+# @param $cmd Command that is to be found in $PATH
+#
+# @return 1, if the command is found, else 0
+#
+################################################################################
+sub in_path {
+
+  # initialize the parameter
+  my ($cmd) = @_;
+
+  # split $PATH into its components, search all of its components
+  # and test for $cmd being executable
+  (-x "$_/$cmd") and return 1 foreach (split (":", $ENV{PATH}));
+  # return 0 otherwise
+  return 0;
+}
+
+################################################################################
+#
+# @brief Initialise a new entry in @ref $FAI::configs for a physical disk.
+#
+# Besides creating the entry in the hash, the fully path of the device is
+# computed (see @ref $disk) and it is tested, whether this is a block device.
+# The device name is then used to define @ref $FAI::device.
+#
+# @param $disk Either an integer, occurring in the context of, e.g., disk2, or
+# a device name. The latter may be fully qualified, such as /dev/hda, or a short
+# name, such as sdb, in which case /dev/ is prepended.
+#
+################################################################################
+sub init_disk_config {
+
+  # Initialise $disk
+  my ($disk) = @_;
+
+  # test $disk for being numeric
+  if ($disk =~ /^\d+$/) {
+
+    # $disk-1 must be a valid index in the map of all disks in the system
+    (scalar(@FAI::disks) >= $disk)
+      or die "this system does not have a physical disk $disk\n";
+
+    # fetch the (short) device name
+    $disk = $FAI::disks[ $disk - 1 ];
+  }
+
+  # test, whether the device name starts with a / and prepend /dev/, if
+  # appropriate
+  ($disk =~ m{^/}) or $disk = "/dev/$disk";
+
+  # prepend PHY_
+  $FAI::device = "PHY_$disk";
+
+  # test, whether this is the first disk_config stanza to configure $disk
+  defined ($FAI::configs{$FAI::device})
+    and die "Duplicate configuration for disk $FAI::disks[ $1-1 ]\n";
+
+  # Initialise the entry in $FAI::configs
+  $FAI::configs{$FAI::device} = {
+    virtual    => 0,
+    disklabel  => "msdos",
+    bootable   => -1,
+    fstabkey   => "device",
+    partitions => {}
+  };
+}
+
+################################################################################
+#
+# @brief Initialise the entry of a partition in @ref $FAI::configs
+#
+# @param $type The type of the partition. It must be either primary or logical.
+#
+################################################################################
+sub init_part_config {
+
+  # the type of the partition to be created
+  my ($type) = @_;
+
+  # type must either be primary or logical, nothing else may be accepted by the
+  # parser
+  ($type eq "primary" || $type eq "logical") or 
+    &FAI::internal_error("invalid type $type");
+
+  # check that a physical device is being configured; logical partitions are
+  # only supported on msdos disk labels.
+  ($FAI::device =~ /^PHY_/ && ($type ne "logical"
+      || $FAI::configs{$FAI::device}{disklabel} eq "msdos")) or 
+    die "Syntax error: invalid partition type";
+
+  # the index of the new partition
+  my $part_number = 0;
+
+  # create a primary partition
+  if ($type eq "primary") {
+
+    # find all previously defined primary partitions
+    foreach my $part_id (&numsort(keys %{ $FAI::configs{$FAI::device}{partitions} })) {
+
+      # break, if the partition has not been created by init_part_config
+      defined ($FAI::configs{$FAI::device}{partitions}{$part_id}{size}{extended}) or last;
+
+      # on msdos disklabels we cannot have more than 4 primary partitions
+      last if ($part_id > 4 && ! $FAI::configs{$FAI::device}{virtual}
+        && $FAI::configs{$FAI::device}{disklabel} eq "msdos");
+
+      # store the latest index found
+      $part_number = $part_id;
+    }
+
+    # the next index available - note that $part_number might have been 0
+    $part_number++;
+
+    # msdos disk labels don't allow for more than 4 primary partitions
+    ($part_number < 5 || $FAI::configs{$FAI::device}{virtual} || 
+      $FAI::configs{$FAI::device}{disklabel} ne "msdos")
+      or die "$part_number are too many primary partitions\n";
+  } else {
+
+    # no further checks for the disk label being msdos have to be performed in
+    # this branch, it has been ensured above
+
+    # find the index of the new partition, initialise it to the highest current index
+    foreach my $part_id (&numsort(keys %{ $FAI::configs{$FAI::device}{partitions} })) {
+
+      # skip primary partitions
+      next if ($part_id < 5);
+
+      # break, if the partition has not been created by init_part_config
+      defined($FAI::configs{$FAI::device}{partitions}{$part_id}{size}{extended})
+        or last;
+
+      # store the latest index found
+      $part_number = $part_id;
+    }
+
+    # and use the next one available
+    $part_number++;
+
+    # if this is the first logical partition, the index must be set to 5 and an
+    # extended partition  must be created
+    if ($part_number <= 5) {
+      $part_number = 5;
+
+      # the proposed index of the extended partition
+      my $extended = 0;
+
+      # find all previously defined primary partitions
+      foreach my $part_id (&numsort(keys %{ $FAI::configs{$FAI::device}{partitions} })) {
+
+        # break, if the partition has not been created by init_part_config
+        defined ($FAI::configs{$FAI::device}{partitions}{$part_id}{size}{extended}) or last;
+
+        # we cannot have more than 4 primary partitions
+        last if ($part_id > 4);
+
+        # store the latest index found
+        $extended = $part_id;
+      }
+
+      # the next index available
+      $extended++;
+
+      # msdos disk labels don't allow for more than 4 primary partitions
+      ($extended < 5)
+        or die "Too many primary partitions while creating extended\n";
+
+      # initialize the entry, unless it already exists
+      defined ($FAI::configs{$FAI::device}{partitions}{$extended})
+        or (\%FAI::configs)->{$FAI::device}->{partitions}->{$extended} = {
+          size => {}
+        };
+
+      my $part_size =
+        (\%FAI::configs)->{$FAI::device}->{partitions}->{$extended}->{size};
+
+      # mark the entry as an extended partition
+      $part_size->{extended} = 1;
+
+      # add the preserve = 0 flag, if it doesn't exist already
+      defined ($part_size->{preserve})
+        or $part_size->{preserve} = 0;
+
+      # add the resize = 0 flag, if it doesn't exist already
+      defined ($part_size->{resize}) or $part_size->{resize} = 0;
+    }
+  }
+
+  # initialise the hash for the partitions, if it doesn't exist already
+  # note that it might exists due to options, such as preserve:x,y
+  # the initialisation is required for the reference defined next
+  defined ($FAI::configs{$FAI::device}{partitions}{$part_number})
+    or $FAI::configs{$FAI::device}{partitions}{$part_number} = {};
+
+  # set the reference to the current partition
+  # the reference is used by all further processing of this config line
+  $FAI::partition_pointer =
+    (\%FAI::configs)->{$FAI::device}->{partitions}->{$part_number};
+
+  # as we can't compute the index from the reference, we need to store the
+  # $part_number explicitly
+  $FAI::partition_pointer->{number} = $part_number;
+
+  # the partition is not an extended one
+  $FAI::partition_pointer->{size}->{extended} = 0;
+
+  # add the preserve = 0 flag, if it doesn't exist already
+  defined ($FAI::partition_pointer->{size}->{preserve})
+    or $FAI::partition_pointer->{size}->{preserve} = 0;
+
+  # add the resize = 0 flag, if it doesn't exist already
+  defined ($FAI::partition_pointer->{size}->{resize})
+    or $FAI::partition_pointer->{size}->{resize} = 0;
+}
+
+################################################################################
+#
+# @brief This function converts different sizes to Mbyte
+#
+# @param $val is the number with its unit
+#
+################################################################################
+sub convert_unit
+{
+  my ($val) = @_;
+  ($val =~ /^(\d+(\.\d+)?)([kMGTP%]?)(B)?\s*$/) or
+    &FAI::internal_error("convert_unit $val");
+  $val = $1 * (1 / 1024) * (1 / 1024) if ($3 eq "" && defined ($4) && $4 eq "B");
+  $val = $1 * (1 / 1024) if ($3 eq "k");
+  $val = $1 if ($3 eq "M");
+  $val = $1 * 1024 if ($3 eq "G");
+  $val = $1 * (1024 * 1024) if ($3 eq "T");
+  $val = $1 * (1024 * 1024 * 1024) if ($3 eq "P");
+  # % is returned as is
+  return $val;
+}
+
+# have RecDescent do proper error reporting
+$::RD_HINT = 1;
+
+################################################################################
+#
+# @brief The effective implementation of the parser is instantiated here
+#
+################################################################################
+$FAI::Parser = Parse::RecDescent->new(
+  q{
+    file: line(s?) /\Z/
+        {
+          $return = 1;
+        }
+        | <error>
+
+    line: <skip: qr/[ \t]*/> "\\n"
+        | <skip: qr/[ \t]*/> comment "\\n"
+        | <skip: qr/[ \t]*/> config "\\n"
+
+    comment: /^\s*#.*/
+
+    config: 'disk_config' disk_config_arg
+        | volume
+
+    disk_config_arg: 'raid'
+        {
+          # check, whether raid tools are available
+          &FAI::in_path("mdadm") or die "mdadm not found in PATH\n";
+          $FAI::device = "RAID";
+          $FAI::configs{$FAI::device}{fstabkey} = "device";
+        }
+        raid_option(s?)
+        | /^lvm/
+        {
+
+          # check, whether lvm tools are available
+          &FAI::in_path("lvcreate") or die "LVM tools not found in PATH\n";
+          # initialise $FAI::device to inform the following lines about the LVM
+          # being configured
+          $FAI::device = "VG_";
+          $FAI::configs{"VG_--ANY--"}{fstabkey} = "device";
+        }
+        lvm_option(s?)
+        | 'end'
+        {
+          # exit config mode
+          $FAI::device = "";
+        }
+        | /^disk(\d+)/
+        {
+          # check, whether parted is available
+          &FAI::in_path("parted") or die "parted not found in PATH\n";
+          # initialise the entry of the hash corresponding to disk$1
+          &FAI::init_disk_config($1);
+        }
+        option(s?)
+        | /^\S+/
+        {
+          # check, whether parted is available
+          &FAI::in_path("parted") or die "parted not found in PATH\n";
+          # initialise the entry of the hash corresponding to $item[1]
+          &FAI::init_disk_config($item[ 1 ]);
+        }
+        option(s?)
+
+    raid_option: /^preserve_always:(\d+(,\d+)*)/
+        {
+          # set the preserve flag for all ids in all cases
+          $FAI::configs{RAID}{volumes}{$_}{preserve} = 1 foreach (split (",", $1));
+        }
+        | /^preserve_reinstall:(\d+(,\d+)*)/
+        {
+          # set the preserve flag for all ids if $FAI::reinstall is set
+          if ($FAI::reinstall) {
+            $FAI::configs{RAID}{volumes}{$_}{preserve} = 1 foreach (split(",", $1));
+          }
+        }
+        | /^fstabkey:(device|label|uuid)/
+        {
+          # the information preferred for fstab device identifieres
+          $FAI::configs{$FAI::device}{fstabkey} = $1;
+        }
+
+    lvm_option: m{^preserve_always:([^/,\s\-]+-[^/,\s\-]+(,[^/,\s\-]+-[^/,\s\-]+)*)}
+        {
+          # set the preserve flag for all ids in all cases
+          foreach (split (",", $1)) {
+            (m{^([^/,\s\-]+)-([^/,\s\-]+)\s+}) or 
+              die &FAI::internal_error("VG re-parse failed");
+            $FAI::configs{"VG_$1"}{volumes}{$2}{size}{preserve} = 1 
+          }
+        }
+        | m{^preserve_reinstall:([^/,\s\-]+-[^/,\s\-]+(,[^/,\s\-]+-[^/,\s\-]+)*)}
+        {
+          # set the preserve flag for all ids if $FAI::reinstall is set
+          if ($FAI::reinstall) {
+            foreach (split (",", $1)) {
+              (m{^([^/,\s\-]+)-([^/,\s\-]+)\s+}) or 
+                die &FAI::internal_error("VG re-parse failed");
+              $FAI::configs{"VG_$1"}{volumes}{$2}{size}{preserve} = 1 
+            }
+          }
+        }
+        | m{^resize:([^/,\s\-]+-[^/,\s\-]+(,[^/,\s\-]+-[^/,\s\-]+)*)}
+        {
+          # set the resize flag for all ids
+          foreach (split (",", $1)) {
+            (m{^([^/,\s\-]+)-([^/,\s\-]+)\s+}) or 
+              die &FAI::internal_error("VG re-parse failed");
+            $FAI::configs{"VG_$1"}{volumes}{$2}{size}{resize} = 1 
+          }
+        }
+        | /^fstabkey:(device|label|uuid)/
+        {
+          # the information preferred for fstab device identifieres
+          $FAI::configs{"VG_--ANY--"}{fstabkey} = $1;
+        }
+
+    option: /^preserve_always:(\d+(,\d+)*)/
+        {
+          # set the preserve flag for all ids in all cases
+          $FAI::configs{$FAI::device}{partitions}{$_}{size}{preserve} = 1 foreach (split (",", $1));
+        }
+        | /^preserve_reinstall:(\d+(,\d+)*)/
+        {
+          # set the preserve flag for all ids if $FAI::reinstall is set
+          if ($FAI::reinstall) {
+            $FAI::configs{$FAI::device}{partitions}{$_}{size}{preserve} = 1 foreach (split(",", $1));
+          }
+        }
+        | /^resize:(\d+(,\d+)*)/
+        {
+          # set the resize flag for all ids
+          $FAI::configs{$FAI::device}{partitions}{$_}{size}{resize} = 1 foreach (split(",", $1));
+        }
+        | /^disklabel:(msdos|gpt)/
+        {
+          # set the disk label - actually not only the above, but all types 
+          # supported by parted could be allowed, but others are not implemented
+          # yet
+          $FAI::configs{$FAI::device}{disklabel} = $1;
+        }
+        | /^bootable:(\d+)/
+        {
+          # specify a partition that should get the bootable flag set
+          $FAI::configs{$FAI::device}{bootable} = $1;
+          ($FAI::device =~ /^PHY_(.+)$/) or
+            &FAI::internal_error("unexpected device name");
+          $FAI::disk_var{BOOT_DEVICE} .= " $1"; 
+        }
+        | 'virtual'
+        {
+          # this is a configuration for a virtual disk
+          $FAI::configs{$FAI::device}{virtual} = 1;
+        }
+        | /^fstabkey:(device|label|uuid)/
+        {
+          # the information preferred for fstab device identifieres
+          $FAI::configs{$FAI::device}{fstabkey} = $1;
+        }
+
+    volume: /^vg\s+/ name devices
+        | /^raid([0156])\s+/
+        {
+          # make sure that this is a RAID configuration
+          ($FAI::device eq "RAID") or die "RAID entry invalid in this context\n";
+          # initialise RAID entry, if it doesn't exist already
+          defined ($FAI::configs{RAID}) or $FAI::configs{RAID}{volumes} = {};
+          # compute the next available index - the size of the entry
+          my $vol_id = scalar (keys %{ $FAI::configs{RAID}{volumes} });
+          # set the RAID type of this volume
+          $FAI::configs{RAID}{volumes}{$vol_id}{mode} = $1;
+          # initialise the hash of devices
+          $FAI::configs{RAID}{volumes}{$vol_id}{devices} = {};
+          # set the reference to the current volume
+          # the reference is used by all further processing of this config line
+          $FAI::partition_pointer = (\%FAI::configs)->{RAID}->{volumes}->{$vol_id};
+        }
+        mountpoint devices filesystem mount_options fs_options
+        | type mountpoint size filesystem mount_options fs_options
+
+    type: 'primary'
+        {
+          # initialise a primary partition
+          &FAI::init_part_config($item[ 1 ]);
+        }
+        | 'logical'
+        {
+          # initialise a logical partition
+          &FAI::init_part_config($item[ 1 ]);
+        }
+        | m{^([^/,\s\-]+)-([^/,\s\-]+)\s+}
+        {
+          # set $FAI::device to VG_$1
+          $FAI::device = "VG_$1";
+          # make sure, the volume group $1 has been defined before
+          defined ($FAI::configs{$FAI::device}) or 
+            die "Volume group $1 has not been declared yet.\n";
+          # make sure, $2 has not been defined already
+          defined ($FAI::configs{$FAI::device}{volumes}{$2}{size}{range}) and 
+            die "Logical volume $2 has been defined already.\n";
+          # initialise the new hash
+          defined($FAI::configs{$FAI::device}{volumes}{$2}) or
+            $FAI::configs{$FAI::device}{volumes}{$2} = {};
+          # initialise the preserve and resize flags
+          defined($FAI::configs{$FAI::device}{volumes}{$2}{size}{preserve}) or
+            $FAI::configs{$FAI::device}{volumes}{$2}{size}{preserve} = 0;
+          defined($FAI::configs{$FAI::device}{volumes}{$2}{size}{resize}) or
+            $FAI::configs{$FAI::device}{volumes}{$2}{size}{resize} = 0;
+          # set the reference to the current volume
+          # the reference is used by all further processing of this config line
+          $FAI::partition_pointer = (\%FAI::configs)->{$FAI::device}->{volumes}->{$2};
+        }
+
+    mountpoint: '-'
+        {
+          # this partition should not be mounted
+          $FAI::partition_pointer->{mountpoint} = "-";
+          $FAI::partition_pointer->{encrypt} = 0;
+        }
+        | 'swap'
+        {
+          # this partition is swap space, not mounted
+          $FAI::partition_pointer->{mountpoint} = "none";
+          $FAI::partition_pointer->{encrypt} = 0;
+        }
+        | m{^/\S*}
+        {
+          # set the mount point, may include encryption-request
+          if ($item[ 1 ] =~ m{^(/[^:]*):encrypt$}) {
+            &FAI::in_path("cryptsetup") or die "cryptsetup not found in PATH\n";
+            $FAI::partition_pointer->{mountpoint} = $1;
+            $FAI::partition_pointer->{encrypt} = 1;
+          } else {
+            $FAI::partition_pointer->{mountpoint} = $item[ 1 ];
+            $FAI::partition_pointer->{encrypt} = 0;
+          }
+        }
+
+    name: m{^([^/,\s\-]+)}
+        {
+          # set the device name to VG_ and the name of the volume group
+          $FAI::device = "VG_$1";
+          # make sure, the volume group $1 not has been defined already
+          defined ($FAI::configs{$FAI::device}) and
+            die "Volume group $1 has been defined already.\n";
+          # make sure this line is part of an LVM configuration
+          ($FAI::device =~ /^VG_/) or
+            die "vg is invalid in a non LVM-context.\n";
+          # initialise the new hash
+          $FAI::configs{$FAI::device}{volumes} = {};
+          # initialise the list of physical devices
+          $FAI::configs{$FAI::device}{devices} = ();
+          # the rule must not return undef
+          1;
+        }
+
+    size: /^(\d+[kMGTP%]?(-(\d+[kMGTP%]?)?)?)(:resize)?\s+/
+        {
+          # complete the size specification to be a range in all cases
+          my $range = $1;
+          # the size is fixed
+          if (!defined ($2))
+          {
+            # make it a range of the form x-x
+            $range = "$range-$1";
+          }
+          elsif (!defined ($3))
+          {
+            # range has no upper limit, assume the whole disk
+            $range = "${range}100%";
+          } 
+
+          # convert the units, if necessary
+          my ($min, $max) = split (/-/, $range);
+          $min   = &FAI::convert_unit($min);
+          $max   = &FAI::convert_unit($max);
+          $range = "$min-$max";
+          # enter the range into the hash
+          $FAI::partition_pointer->{size}->{range} = $range;
+          # set the resize flag, if required
+          defined ($4) and $FAI::partition_pointer->{size}->{resize} = 1;
+        }
+        | /^(-\d+[kMGTP%]?)(:resize)?\s+/
+        {
+          # complete the range by assuming 0 as the lower limit 
+          my $range = "0$1";
+          # convert the units, if necessary
+          my ($min, $max) = split (/-/, $range);
+          $min   = &FAI::convert_unit($min);
+          $max   = &FAI::convert_unit($max);
+          $range = "$min-$max";
+          # enter the range into the hash
+          $FAI::partition_pointer->{size}->{range} = $range;
+          # set the resize flag, if required
+          defined( $2 ) and $FAI::partition_pointer->{size}->{resize} = 1;
+        }
+        | <error: invalid partition size near "$text">
+
+    devices: /^([^\d,:\s\-][^,:\s]*(:(spare|missing))*(,[^,:\s]+(:(spare|missing))*)*)/
+        {
+          # split the device list by ,
+          foreach my $dev (split(",", $1))
+          {
+            # match the substrings
+            ($dev =~ /^([^\d,:\s\-][^,:\s]*)(:(spare|missing))*$/) or 
+              &FAI::internal_error("PARSER ERROR");
+            # redefine the device string
+            $dev = $1;
+            # make $dev a full path name; can't validate device name yet as it
+            # might be created later on
+            unless ($dev =~ m{^/}) {
+              if ($dev =~ m/^disk(\d+)\.(\d+)/) {
+                $dev = &FAI::make_device_name("/dev/" . $FAI::disks[ $1 - 1 ], $2);
+              } else {
+                $dev = "/dev/$dev";
+              }
+            }
+            # options are only valid for RAID
+            defined ($2) and ($FAI::device ne "RAID") and die "Option $2 invalid in a non-RAID context\n";
+            if ($FAI::device eq "RAID") {
+              # parse all options
+              my $spare = 0;
+              my $missing = 0;
+              if (defined ($2)) {
+                ($2 =~ /spare/) and $spare = 1;
+                ($2 =~ /missing/) and $missing = 1;
+              }
+              # each device may only appear once
+              defined ($FAI::partition_pointer->{devices}->{$dev}) and 
+                die "$dev is already part of the RAID volume\n";
+              # set the options
+              $FAI::partition_pointer->{devices}->{$dev}->{options} = {
+                "spare" => $spare,
+                "missing" => $missing
+              };
+            } else {
+              # create an empty hash for each device
+              $FAI::configs{$FAI::device}{devices}{$dev} = {};
+            }
+          }
+          1;
+        }
+        | <error: invalid device spec "$text">
+
+    mount_options: /\S+/
+        {
+          $FAI::partition_pointer->{mount_options} = $item[ 1 ];
+        }
+
+    filesystem: '-'
+        {
+          $FAI::partition_pointer->{filesystem} = $item[ 1 ];
+        }
+        | 'swap'
+        {
+          $FAI::partition_pointer->{filesystem} = $item[ 1 ];
+        }
+        | /^\S+/
+        {
+          &FAI::in_path("mkfs.$item[1]") or 
+            die "unknown/invalid filesystem type $item[1] (mkfs.$item[1] not found in PATH)\n";
+          $FAI::partition_pointer->{filesystem} = $item[ 1 ];
+        }
+
+    fs_options: /[^;\n]*/
+        {
+          $FAI::partition_pointer->{fs_options} = $item[ 1 ];
+        }
+}
+);
+
+################################################################################
+#
+# @brief Parse the data from <$IN> using @ref $FAI::Parser
+#
+# @param IN file handle for input file, may be STDIN
+#
+################################################################################
+sub run_parser {
+  my ($IN) = @_;
+
+  # read <$IN> to a single string (not a list), thus $/ has to be unset
+  my $ifs = $/;
+  undef $/;
+  my $input = <$IN>;
+  $/ = $ifs;
+
+  # print the contents of <$IN> for debugging purposes
+  $FAI::debug and print "Input was:\n" . $input;
+
+  # check for old-style configuration files
+  ($input =~ m{(^|\n)[^\n#]+;})
+    and die "Error: Old style configuration files are not supported\n";
+
+  # attempt to parse $input - any error will lead to termination
+  defined $FAI::Parser->file($input) or die "Syntax error\n";
+}
+
+1;
+

Added: branches/lhm/lib/setup-storage/Sizes.pm
===================================================================
--- branches/lhm/lib/setup-storage/Sizes.pm	                        (rev 0)
+++ branches/lhm/lib/setup-storage/Sizes.pm	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,705 @@
+#!/usr/bin/perl -w
+
+#*********************************************************************
+# 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.
+#
+# A copy of the GNU General Public License is available as
+# `/usr/share/common-licences/GPL' in the Debian GNU/Linux distribution
+# or on the World Wide Web at http://www.gnu.org/copyleft/gpl.html. You
+# can also obtain it by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#*********************************************************************
+
+use strict;
+
+################################################################################
+#
+# @file sizes.pm
+#
+# @brief Compute the size of the partitions and volumes to be created
+#
+# $Id: Sizes.pm 5188 2008-10-14 13:29:57Z lange $
+#
+# @author Christian Kern, Michael Tautschnig
+# @date Sun Jul 23 16:09:36 CEST 2006
+#
+################################################################################
+
+package FAI;
+
+################################################################################
+#
+# @brief Build an array $start,$end from ($start-$end)
+#
+# @param $rstr Range string
+# @param $size Size and unit
+#
+# @return ($start,$end) in bytes
+#
+################################################################################
+sub make_range {
+
+  use POSIX qw(ceil floor);
+
+  my ($rstr, $size) = @_;
+  # convert size to Bytes
+  my $size_b = &FAI::convert_unit($size) * 1024.0 * 1024.0;
+  # check the format of the string
+  ($rstr =~ /^(\d+(\.\d+)?%?)-(\d+(\.\d+)?%?)$/) or &FAI::internal_error("Invalid range");
+  my ($start, $end) = ($1, $3);
+  # start may be given in percents of the size
+  if ($start =~ /^(\d+(\.\d+)?)%$/) {
+    # rewrite it to bytes
+    $start = POSIX::floor($size_b * $1 / 100);
+  } else {
+    # it is given in megabytes, make it bytes
+    $start = $start * 1024.0 * 1024.0;
+  }
+
+  # end may be given in percents of the size
+  if ( $end =~ /^(\d+(\.\d+)?)%$/ ) {
+    # rewrite it to bytes
+    $end = POSIX::ceil($size_b * $1 / 100);
+  } else {
+    # it is given in megabytes, make it bytes
+    $end = $end * 1024.0 * 1024.0;
+  }
+
+  # make sure that $end >= $start
+  ($end >= $start) or &FAI::internal_error("end < start");
+
+  return ($start, $end);
+}
+
+################################################################################
+#
+# @brief Estimate the size of the device $dev
+#
+# @param $dev Device the size of which should be determined. This may be a
+# a partition, a RAID device or an entire disk.
+#
+# @return the size of the device in megabytes
+#
+################################################################################
+sub estimate_size {
+  my ($dev) = @_;
+
+  # try the entire disk first; we then use the data from the current
+  # configuration; this matches in fact for than the allowable strings, but
+  # this should be caught later on
+  my ($i_p_d, $disk, $part_no) = &FAI::phys_dev($dev);
+  if (1 == $i_p_d && -1 == $part_no) {
+    defined ($FAI::current_config{$dev}{end_byte})
+      or die "$dev is not a valid block device\n";
+
+    # the size is known, return it
+    return ($FAI::current_config{$dev}{end_byte} -
+        $FAI::current_config{$dev}{begin_byte}) / (1024 * 1024);
+  }
+
+  # try a partition
+  elsif (1 == $i_p_d && $part_no > -1) {
+    # the size is configured, return it
+    defined ($FAI::configs{"PHY_$disk"}{partitions}{$part_no}{size}{eff_size})
+      and return $FAI::configs{"PHY_$disk"}{partitions}{$part_no}{size}{eff_size} /
+      (1024 * 1024);
+
+    # the size is known from the current configuration on disk, return it
+    defined ($FAI::current_config{$disk}{partitions}{$part_no}{count_byte})
+      and return $FAI::current_config{$disk}{partitions}{$part_no}{count_byte} /
+      (1024 * 1024);
+
+    # the size is not known (yet?)
+    warn "Cannot determine size of $dev\n";
+    return 0;
+  }
+
+  # try RAID; estimations here are very limited and possible imprecise
+  elsif ($dev =~ /^\/dev\/md(\d+)$/) {
+
+    # the list of underlying devices
+    my @devs = ();
+
+    # the raid level, like raid0, raid5, linear, etc.
+    my $level = "";
+
+    # let's see, whether there is a configuration of this volume
+    if (defined ($FAI::configs{RAID}{volumes}{$1}{devices})) {
+      @devs  = keys %{ $FAI::configs{RAID}{volumes}{$1}{devices} };
+      $level = $FAI::configs{RAID}{volumes}{$1}{mode};
+    } elsif (defined ($FAI::current_raid_config{$1}{devices})) {
+      @devs  = $FAI::current_raid_config{$1}{devices};
+      $level = $FAI::current_raid_config{$1}{mode};
+    } else {
+      die "$dev is not a known RAID device\n";
+    }
+
+    # prepend "raid", if the mode is numeric-only
+    $level = "raid$level" if ($level =~ /^\d+$/);
+
+    # the number of devices in the volume
+    my $dev_count = scalar (@devs);
+
+    # now do the mode-specific size estimations
+    if ($level =~ /^raid[015]$/) {
+      my $min_size = &estimate_size(shift @devs);
+      foreach (@devs) {
+        my $s = &FAI::estimate_size($_);
+        $min_size = $s if ($s < $min_size);
+      }
+
+      return $min_size * POSIX::floor($dev_count / 2)
+        if ($level eq "raid1");
+      return $min_size * $dev_count if ($level eq "raid0");
+      return $min_size * ($dev_count - 1) if ($level eq "raid5");
+    } else {
+
+      # probably some more should be implemented
+      die "Don't know how to estimate the size of a $level device\n";
+    }
+  }
+
+  # otherwise we are clueless
+  else {
+    die "Cannot determine size of $dev - scheme unknown\n";
+  }
+}
+
+################################################################################
+#
+# @brief Compute the desired sizes of logical volumes
+#
+################################################################################
+sub compute_lv_sizes {
+
+  # loop through all device configurations
+  foreach my $config (keys %FAI::configs) {
+
+    # for RAID or physical disks there is nothing to be done here
+    next if ($config eq "RAID" || $config =~ /^PHY_./);
+    ($config =~ /^VG_(.+)$/) or &FAI::internal_error("invalid config entry $config");
+    next if ($1 eq "--ANY--");
+    my $vg = $1; # the volume group name
+
+    # compute the size of the volume group; this is not exact, but should at
+    # least give a rough estimation, we assume 1 % of overhead; the value is
+    # stored in megabytes
+    my $vg_size = 0;
+    foreach my $dev (keys %{ $FAI::configs{$config}{devices} }) {
+
+      # $dev may be a partition, an entire disk or a RAID device; otherwise we
+      # cannot deal with it
+      $vg_size += &FAI::estimate_size($dev);
+    }
+
+    # now subtract 1% of overhead
+    $vg_size *= 0.99;
+
+    # the volumes that require redistribution of free space
+    my @redist_list = ();
+
+    # the minimum and maximum space required in this volume group
+    my $min_space = 0;
+    my $max_space = 0;
+
+    # set effective sizes where available
+    foreach my $lv (keys %{ $FAI::configs{$config}{volumes} }) {
+      # reference to the size of the current logical volume
+      my $lv_size = (\%FAI::configs)->{$config}->{volumes}->{$lv}->{size};
+      # get the effective sizes (in Bytes) from the range
+      my ($start, $end) = &FAI::make_range($lv_size->{range}, "${vg_size}MB");
+      # make them MB
+      $start /= 1024.0 * 1024.0;
+      $end /= 1024.0 * 1024.0;
+
+      # increase the used space
+      $min_space += $start;
+      $max_space += $end;
+
+      # write back the range in MB
+      $lv_size->{range} = "$start-$end";
+
+      # the size is fixed
+      if ($start == $end) { 
+        # write the size back to the configuration
+        $lv_size->{eff_size} = $start;
+      } else {
+
+        # add this volume to the redistribution list
+        push @redist_list, $lv;
+      }
+    }
+
+    # test, whether the configuration fits on the volume group at all
+    ($min_space < $vg_size)
+      or die "Volume group $vg requires $min_space MB, but available space was estimated to be $vg_size\n";
+
+    # the extension factor
+    my $redist_factor = 0;
+    $redist_factor = ($vg_size - $min_space) / ($max_space - $min_space)
+      if ($max_space > $min_space);
+    $redist_factor = 1.0 if ($redist_factor > 1.0);
+
+    # update all sizes that are still ranges
+    foreach my $lv (@redist_list) {
+
+      # get the range again
+      my ($start, $end) =
+      &FAI::make_range($FAI::configs{$config}{volumes}{$lv}{size}{range}, "${vg_size}MB");
+      # make them MB
+      $start /= 1024.0 * 1024.0;
+      $end /= 1024.0 * 1024.0;
+
+      # write the final size
+      $FAI::configs{$config}{volumes}{$lv}{size}{eff_size} =
+        $start + (($end - $start) * $redist_factor);
+    }
+  }
+}
+
+################################################################################
+#
+# @brief Handle preserved partitions while computing the size of partitions
+#
+# @param $part_id Partition id within $config
+# @param $config Disk config
+# @param $current_disk Current config of this disk
+# @param $next_start Start of the next partition
+# @param $min_req_total_space Minimum space required on disk
+#
+# @return Updated values of ($next_start, $min_req_total_space)
+#
+################################################################################
+sub do_partition_preserve {
+
+  my ($part_id, $config, $current_disk, $next_start, $min_req_total_space) = @_;
+
+  # reference to the current partition
+  my $part = (\%FAI::configs)->{$config}->{partitions}->{$part_id};
+
+  # a partition that should be preserved must exist already
+  defined($current_disk->{partitions}->{$part_id})
+    or die "$part_id can't be preserved, it does not exist.\n";
+
+  my $curr_part = $current_disk->{partitions}->{$part_id};
+
+  ($next_start > $curr_part->{begin_byte})
+    and die "Previous partitions overflow begin of preserved partition $part_id\n";
+
+  # get what the user desired
+  my ($start, $end) = &FAI::make_range($part->{size}->{range},
+    $current_disk->{size} . "B");
+  ($start > $curr_part->{count_byte} || $end < $curr_part->{count_byte})
+    and warn "Preserved partition $part_id retains size " .
+      $curr_part->{count_byte} . "\n";
+
+  # set the effective size to the value known already
+  $part->{size}->{eff_size} = $curr_part->{count_byte};
+
+  # copy the start_byte and end_byte information
+  $part->{start_byte} = $curr_part->{begin_byte};
+  $part->{end_byte} = $curr_part->{end_byte};
+
+  # and add it to the total disk space required by this config
+  $min_req_total_space += $part->{size}->{eff_size};
+
+  # set the next start
+  $next_start = $part->{end_byte} + 1;
+
+  # several msdos specific parts
+  if ($FAI::configs{$config}{disklabel} eq "msdos") {
+
+    # make sure the partition ends at a cylinder boundary
+    (0 == ($curr_part->{end_byte} + 1)
+        % ($current_disk->{sector_size} *
+          $current_disk->{bios_sectors_per_track} *
+          $current_disk->{bios_heads})) or 
+      die "Preserved partition $part_id does not end at a cylinder boundary\n";
+
+    # add one head of disk usage if this is a logical partition
+    $min_req_total_space += $current_disk->{bios_sectors_per_track} *
+      $current_disk->{sector_size} if ($part_id > 4);
+
+    # make sure we don't change extended partitions to ordinary ones and
+    # vice-versa
+    ($part->{size}->{extended} == $curr_part->{is_extended})
+      or die "Preserved partition $part_id can't change extended/normal setting\n";
+
+    # extended partitions consume no space
+    if ($part->{size}->{extended}) {
+
+      # revert the addition of the size
+      $min_req_total_space -= $part->{size}->{eff_size};
+
+      # set the next start to the start of the extended partition
+      $next_start = $part->{start_byte};
+    }
+  }
+
+  # on gpt, ensure that the partition ends at a sector boundary
+  if ($FAI::configs{$config}{disklabel} eq "gpt") {
+    (0 == ($current_disk->{partitions}{$part_id}{end_byte} + 1)
+        % $current_disk->{sector_size})
+      or die "Preserved partition $part_id does not end at a sector boundary\n";
+  }
+
+  return ($next_start, $min_req_total_space);
+}
+
+################################################################################
+#
+# @brief Handle extended partitions while computing the size of partitions
+#
+# @param $part_id Partition id within $config
+# @param $config Disk config
+# @param $current_disk Current config of this disk
+#
+################################################################################
+sub do_partition_extended {
+
+  my ($part_id, $config, $current_disk) = @_;
+
+  # reference to the current partition
+  my $part = (\%FAI::configs)->{$config}->{partitions}->{$part_id};
+
+  ($FAI::configs{$config}{disklabel} eq "msdos")
+    or die "found an extended partition on a non-msdos disklabel\n";
+
+  # ensure that it is a primary partition
+  ($part_id <= 4) or
+    &FAI::internal_error("Extended partition wouldn't be a primary one");
+
+  my $epbr_size = $current_disk->{bios_sectors_per_track} *
+    $current_disk->{sector_size};
+
+  # initialise the size and the start byte
+  $part->{size}->{eff_size} = 0;
+  $part->{start_byte} = -1;
+
+  foreach my $p (&numsort(keys %{ $FAI::configs{$config}{partitions} })) {
+    next if ($p < 5);
+
+    $part->{start_byte} = $FAI::configs{$config}{partitions}{$p}{start_byte} -
+      $epbr_size if (-1 == $part->{start_byte});
+
+    $part->{size}->{eff_size} += $FAI::configs{$config}{partitions}{$p}{size}{eff_size} +
+      $epbr_size;
+
+    $part->{end_byte} = $FAI::configs{$config}{partitions}{$p}{end_byte};
+  }
+
+  ($part->{size}->{eff_size} > 0)
+    or die "Extended partition has a size of 0\n";
+}
+
+################################################################################
+#
+# @brief Handle all other partitions while computing the size of partitions
+#
+# @param $part_id Partition id within $config
+# @param $config Disk config
+# @param $current_disk Current config of this disk
+# @param $next_start Start of the next partition
+# @param $min_req_total_space Minimum space required on disk
+# @param $worklist Reference to the remaining partitions
+#
+# @return Updated values of ($next_start, $min_req_total_space)
+#
+################################################################################
+sub do_partition_real {
+
+  my ($part_id, $config, $current_disk, $next_start, $min_req_total_space,
+    $worklist) = @_;
+
+  # reference to the current partition
+  my $part = (\%FAI::configs)->{$config}->{partitions}->{$part_id};
+
+  my ($start, $end) = &FAI::make_range($part->{size}->{range},
+    $current_disk->{size} . "B");
+
+  # check, whether the size is fixed
+  if ($end != $start) {
+
+    # the end of the current range (may be the end of the disk or some
+    # preserved partition or an ntfs volume to be resized)
+    my $end_of_range = -1;
+
+   # minimum space required by all partitions, i.e., the lower ends of the
+   # ranges
+   # $min_req_space counts up to the next preserved partition or the
+   # end of the disk
+    my $min_req_space = 0;
+
+    # maximum useful space
+    my $max_space = 0;
+
+    # inspect all remaining entries in the worklist
+    foreach my $p (@{$worklist}) {
+
+      # we have found the delimiter
+      if ($FAI::configs{$config}{partitions}{$p}{size}{preserve} ||
+        ($FAI::configs{$config}{partitions}{$p}{size}{resize} &&
+          ($current_disk->{partitions}->{$p}->{filesystem} eq "ntfs"))) {
+        $end_of_range = $current_disk->{partitions}->{$p}->{begin_byte};
+
+        # logical partitions require the space for the EPBR to be left
+        # out
+        if (($FAI::configs{$config}{disklabel} eq "msdos")
+          && ($p > 4)) {
+          $end_of_range -= $current_disk->{bios_sectors_per_track} *
+            $current_disk->{sector_size};
+        }
+        last;
+      } elsif ($FAI::configs{$config}{partitions}{$p}{size}{extended}) {
+        next;
+      } else {
+        my ($min_size, $max_size) = &FAI::make_range(
+          $FAI::configs{$config}{partitions}{$p}{size}{range},
+          $current_disk->{size} . "B");
+
+        # logical partitions require the space for the EPBR to be left
+        # out
+        if (($FAI::configs{$config}{disklabel} eq "msdos")
+          && ($p > 4)) {
+          $min_size += $current_disk->{bios_sectors_per_track} *
+            $current_disk->{sector_size};
+          $max_size += $current_disk->{bios_sectors_per_track} *
+            $current_disk->{sector_size};
+        }
+
+        $min_req_space += $min_size;
+        $max_space     += $max_size;
+      }
+    }
+
+    # set the end if we have reached the end of the disk
+    $end_of_range = $current_disk->{end_byte} if (-1 == $end_of_range);
+
+    my $available_space = $end_of_range - $next_start + 1;
+
+    # the next boundary is closer than the minimal space that we need
+    ($available_space < $min_req_space)
+      and die "Insufficient space available for partition $part_id\n";
+
+    # the new size
+    my $scaled_size = $end;
+    $scaled_size = POSIX::floor(($end - $start) * 
+      (($available_space - $min_req_space) /
+          ($max_space - $min_req_space))) + $start
+      if ($max_space > $available_space);
+
+    ($scaled_size >= $start)
+      or &FAI::internal_error("scaled size is smaller than the desired minimum");
+
+    $start = $scaled_size;
+    $end   = $start;
+  }
+
+  # now we compute the effective locations on the disk
+  # msdos specific offset for logical partitions
+  if (($FAI::configs{$config}{disklabel} eq "msdos")
+    && ($part_id > 4)) {
+
+    # add one head of disk usage if this is a logical partition
+    $min_req_total_space += $current_disk->{bios_sectors_per_track} *
+      $current_disk->{sector_size};
+
+    # move the start byte as well
+    $next_start += $current_disk->{bios_sectors_per_track} *
+      $current_disk->{sector_size};
+  }
+
+  # partition starts at where we currently are, or remains fixed in case of
+  # resized ntfs
+  if ($FAI::configs{$config}{partitions}{$part_id}{size}{resize} &&
+    ($current_disk->{partitions}->{$part_id}->{filesystem} eq "ntfs")) {
+    ($next_start <= $current_disk->{partitions}->{$part_id}->{begin_byte}) 
+      or die "Cannot preserve start byte of ntfs volume on partition $part_id, space before it is too small\n";
+    $next_start = $current_disk->{partitions}->{$part_id}->{begin_byte};
+  }
+  $FAI::configs{$config}{partitions}{$part_id}{start_byte} =
+    $next_start;
+
+  # the end may need some alignment, depending on the disk label
+  my $end_byte = $next_start + $start - 1;
+
+  # on msdos, ensure that the partition ends at a cylinder boundary
+  if ($FAI::configs{$config}{disklabel} eq "msdos") {
+    $end_byte -=
+      ($end_byte + 1) % ($current_disk->{sector_size} *
+        $current_disk->{bios_sectors_per_track} *
+        $current_disk->{bios_heads});
+  }
+
+  # on gpt, ensure that the partition ends at a sector boundary
+  if ($FAI::configs{$config}{disklabel} eq "gpt") {
+    $end_byte -=
+      ($end_byte + 1) % $current_disk->{sector_size};
+  }
+
+  # set $start and $end to the effective values
+  $start = $end_byte - $next_start + 1;
+  $end   = $start;
+
+  # write back the size spec in bytes
+  $part->{size}->{range} = $start . "-" . $end;
+
+  # then set eff_size to a proper value
+  $part->{size}->{eff_size} = $start;
+
+  # write the end byte to the configuration
+  $part->{end_byte} = $end_byte;
+
+  # and add it to the total disk space required by this config
+  $min_req_total_space += $part->{size}->{eff_size};
+
+  # set the next start
+  $next_start = $part->{end_byte} + 1;
+
+  return ($next_start, $min_req_total_space);
+}
+
+################################################################################
+#
+# @brief Compute the desired sizes of the partitions and test feasibility
+# thereof.
+#
+################################################################################
+sub compute_partition_sizes
+{
+
+  # loop through all device configurations
+  foreach my $config (keys %FAI::configs) {
+
+    # for RAID or LVM, there is nothing to be done here
+    next if ($config eq "RAID" || $config =~ /^VG_./);
+    ($config =~ /^PHY_(.+)$/) or &FAI::internal_error("invalid config entry $config");
+    # nothing to be done, if this is a configuration for a virtual disk
+    next if $FAI::configs{$config}{virtual};
+    my $disk = $1; # the device name of the disk
+    # test, whether $disk is a block special device
+    (-b $disk) or die "$disk is not a valid device name\n";
+    # reference to the current disk config
+    my $current_disk = $FAI::current_config{$disk};
+
+    # at various points the following code highly depends on the desired disk label!
+    # initialise variables
+    # the id of the extended partition to be created, if required
+    my $extended = -1;
+
+    # the id of the current extended partition, if any; this setup only caters
+    # for a single existing extended partition!
+    my $current_extended = -1;
+
+    # find the first existing extended partition
+    foreach my $part_id (&numsort(keys %{ $current_disk->{partitions} })) {
+      if ($current_disk->{partitions}->{$part_id}->{is_extended}) {
+        $current_extended = $part_id;
+        last;
+      }
+    }
+
+    # the space required on the disk
+    my $min_req_total_space = 0;
+
+    # the start byte for the next partition
+    my $next_start = 0;
+
+    # on msdos disk labels, the first partitions starts at head #1
+    if ($FAI::configs{$config}{disklabel} eq "msdos") {
+      $next_start = $current_disk->{bios_sectors_per_track} *
+        $current_disk->{sector_size};
+
+      # the MBR requires space, too
+      $min_req_total_space += $current_disk->{bios_sectors_per_track} *
+        $current_disk->{sector_size};
+    }
+
+    # on GPT disk labels the first 34 and last 34 sectors must be left alone
+    if ($FAI::configs{$config}{disklabel} eq "gpt") {
+      $next_start = 34 * $current_disk->{sector_size};
+
+      # modify the disk to claim the space for the second partition table
+      $current_disk->{end_byte} -= 34 * $current_disk->{sector_size};
+
+      # the space required by the GPTs
+      $min_req_total_space += 2 * 34 * $current_disk->{sector_size};
+    }
+
+    # the list of partitions that we need to find start and end bytes for
+    my @worklist = (&numsort(keys %{ $FAI::configs{$config}{partitions} }));
+
+    while (scalar (@worklist))
+    {
+
+      # work on the first entry of the list
+      my $part_id = $worklist[0];
+      # reference to the current partition
+      my $part = (\%FAI::configs)->{$config}->{partitions}->{$part_id};
+
+      # the partition $part_id must be preserved
+      if ($part->{size}->{preserve}) {
+        ($next_start, $min_req_total_space) = &FAI::do_partition_preserve($part_id, 
+          $config, $current_disk, $next_start, $min_req_total_space);
+
+        # partition done
+        shift @worklist;
+      }
+
+      # msdos specific: deal with extended partitions
+      elsif ($part->{size}->{extended}) {
+        # make sure that there is only one extended partition
+        ($extended == -1 || 1 == scalar (@worklist))
+          or &FAI::internal_error("More than 1 extended partition");
+
+        # set the local variable to this id
+        $extended = $part_id;
+
+        # the size cannot be determined now, push it to the end of the
+        # worklist; the check against $extended being == -1 ensures that
+        # there is no indefinite loop
+        if (scalar (@worklist) > 1) {
+          push @worklist, shift @worklist;
+          next;
+        }
+
+        # determine the size of the extended partition
+        &FAI::do_partition_extended($part_id, $config, $current_disk);
+
+        # partition done
+        shift @worklist;
+      } else {
+        ($next_start, $min_req_total_space) = &FAI::do_partition_real($part_id, 
+          $config, $current_disk, $next_start, $min_req_total_space, \@worklist);
+
+        # partition done
+        shift @worklist;
+      }
+    }
+
+    # check, whether there is sufficient space on the disk
+    ($min_req_total_space > $current_disk->{size})
+      and die "Disk $disk is too small - at least $min_req_total_space bytes are required\n";
+
+    # make sure, extended partitions are only created on msdos disklabels
+    ($FAI::configs{$config}{disklabel} ne "msdos" && $extended > -1)
+      and &FAI::internal_error("extended partitions are not supported by this disklabel");
+
+    # ensure that we have done our work
+    (defined ($FAI::configs{$config}{partitions}{$_}{start_byte})
+        && defined ($FAI::configs{$config}{partitions}{$_}{end_byte}))
+      or &FAI::internal_error("start or end of partition $_ not set")
+        foreach (&numsort(keys %{ $FAI::configs{$config}{partitions} }));
+  }
+}
+
+1;
+

Added: branches/lhm/lib/setup-storage/Volumes.pm
===================================================================
--- branches/lhm/lib/setup-storage/Volumes.pm	                        (rev 0)
+++ branches/lhm/lib/setup-storage/Volumes.pm	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,537 @@
+#!/usr/bin/perl -w
+
+#*********************************************************************
+# 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.
+#
+# A copy of the GNU General Public License is available as
+# `/usr/share/common-licences/GPL' in the Debian GNU/Linux distribution
+# or on the World Wide Web at http://www.gnu.org/copyleft/gpl.html. You
+# can also obtain it by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#*********************************************************************
+
+use strict;
+
+################################################################################
+#
+# @file volumes.pm
+#
+# @brief Parse the current partition table and LVM/RAID configurations
+#
+# $Id: Volumes.pm 5189 2008-10-14 13:32:41Z lange $
+#
+# @author Christian Kern, Michael Tautschnig
+# @date Sun Jul 23 16:09:36 CEST 2006
+#
+################################################################################
+
+package FAI;
+
+################################################################################
+#
+# @brief Collect the current partition information from all disks listed both
+# in $FAI::disks and $FAI::configs{PHY_<disk>}
+#
+################################################################################
+sub get_current_disks {
+
+  # obtain the current state of all disks
+  foreach my $disk (@FAI::disks) {
+
+    # create full paths
+    ($disk =~ m{^/}) or $disk = "/dev/$disk";
+
+    # make sure, $disk is a proper block device
+    (-b $disk) or die "$disk is not a block special device!\n";
+    &FAI::push_command( "true", "", "exist_$disk" );
+
+    # initialise the hash
+    $FAI::current_config{$disk}{partitions} = {};
+
+    # the list to hold the output of parted commands as parsed below
+    my @parted_print = ();
+
+    # try to obtain the partition table for $disk
+    # it might fail with parted_2 in case the disk has no partition table
+    my $error =
+      &FAI::execute_ro_command("parted -s $disk unit TiB print", \@parted_print, 0);
+
+    # parted_2 happens when the disk has no disk label, because parted then
+    # provides no information about the disk
+    if ($error eq "parted_2" || $error eq "parted_2_new") {
+      $FAI::no_dry_run or die 
+        "Can't run on test-only mode on this system because there is no disklabel on $disk\n";
+
+      # if there is no disk configuration, write an msdos disklabel
+      if (!defined ($FAI::configs{"PHY_$disk"}{disklabel})) {
+
+        # write the disk label as configured
+        $error = &FAI::execute_command("parted -s $disk mklabel msdos");
+      } else {
+
+        # write the disk label as configured
+        $error = &FAI::execute_command("parted -s $disk mklabel " 
+          . $FAI::configs{"PHY_$disk"}{disklabel});
+      }
+      # retry partition-table print
+      $error =
+        &FAI::execute_ro_command("parted -s $disk unit TiB print", \@parted_print, 0);
+    }
+
+    ($error eq "") or die "Failed to read the partition table from $disk\n";
+
+# the following code parses the output of parted print, using various units
+# (TiB, B, chs)
+# the parser is capable of reading the output of parted version 1.7.1, which
+# looks like
+#
+# $ /sbin/parted -s /dev/hda unit B print
+# WARNING: You are not superuser.  Watch out for permissions.
+#
+# Disk /dev/hda: 80026361855B
+# Sector size (logical/physical): 512B/512B
+# Partition Table: mac
+#
+# Number  Start         End           Size          File system  Name     Flags
+#  1      512B          32767B        32256B                     primary
+#  5      32768B        1033215B      1000448B      hfs          primary  boot
+#  3      134250496B    32212287487B  32078036992B  hfs+         primary
+#  6      32212287488B  46212287487B  14000000000B  ext3         primary
+#  2      46212287488B  47212287999B  1000000512B   linux-swap   primary  swap
+#  4      47212288000B  80026361855B  32814073856B  ext3         primary
+#
+# Note that the output contains an additional column on msdos, indicating,
+# whether the type of a partition is primary, logical or extended.
+#
+# $ parted -s /dev/hda unit B print
+#
+# Disk /dev/hda: 82348277759B
+# Sector size (logical/physical): 512B/512B
+# Partition Table: msdos
+#
+# Number  Start         End           Size          Type      File system  Flags
+#  1      32256B        24675839B     24643584B     primary   ext3
+#  2      24675840B     1077511679B   1052835840B   primary   linux-swap
+#  3      1077511680B   13662190079B  12584678400B  primary   ext3         boot
+#  4      13662190080B  82343278079B  68681088000B  extended
+#  5      13662222336B  14715025919B  1052803584B   logical   ext3
+#         14715058176B  30449986559B  15734928384B
+#  7      30450018816B  32547432959B  2097414144B   logical   ext3
+#  8      32547465216B  82343278079B  49795812864B  logical   ext3
+#
+
+    # As shown above, some entries may be blank. Thus the exact column starts
+    # and lengths must be parsed from the header line. This is stored in the
+    # following hash
+    my %cols = ();
+
+    # Parse the output line by line
+    foreach my $line (@parted_print) {
+
+      # now we test line by line - some of them may be ignored
+      next if ($line =~ /^Disk / || $line =~ /^Model: / || $line =~ /^\s*$/
+        || $line =~ /^WARNING: You are not superuser/);
+
+      # determine the logical sector size
+      if ($line =~ /^Sector size \(logical\/physical\): (\d+)B\/\d+B$/) {
+        $FAI::current_config{$disk}{sector_size} = $1;
+      }
+
+      # read and store the current disk label
+      elsif ($line =~ /^Partition Table: (.+)$/) {
+        $FAI::current_config{$disk}{disklabel} = $1;
+      }
+
+      # the line containing the table headers
+      elsif ($line =~ /^(Number\s+)(\S+\s+)+/) {
+        my $col_start = 0;
+
+        # check the length of each heading; note that they might contain spaces
+        while ($line =~ /^(\S+( [a-z]\S+)?\s*)([A-Z].*)?$/) {
+          my $heading = $1;
+
+          # set the line to the remainder
+          $line = "";
+          $line = $3 if defined ($3);
+
+          # the width of the column includes any whitespace
+          my $col_width = length ($heading);
+          $heading =~ s/(\S+)\s*$/$1/;
+
+          # build the hash entry
+          # this start counter starts at 0, which is useful below
+          $cols{$heading} = {
+            "start"  => $col_start,
+            "length" => $col_width
+          };
+          $col_start += $col_width;
+        }
+      } else { # one of the partitions
+
+        # we must have seen the header, otherwise probably the format has
+        # changed
+        defined ($cols{"File system"}{"start"})
+          or &FAI::internal_error("Table header not seen yet");
+
+        # the info for the partition number
+        my $num_cols_before = $cols{"Number"}{"start"};
+        my $num_col_width   = $cols{"Number"}{"length"};
+
+        # the info for the file system column
+        my $fs_cols_before = $cols{"File system"}{"start"};
+        my $fs_col_width   = $cols{"File system"}{"length"};
+
+        # get the partition number, if any
+        $line =~ /^.{$num_cols_before}(.{$num_col_width})/;
+        my $id = $1;
+        $id =~ s/\s*//g;
+
+        # if there is no partition number, then it must be free space, so no
+        # file system either
+        next if ($id eq "");
+
+        # extract the set of characters
+        $line =~ /^.{$fs_cols_before}(.{$fs_col_width})/;
+        my $fs = $1;
+
+        # remove any trailing space
+        $fs =~ s/\s*$//g;
+
+        # store the information in the hash
+        $FAI::current_config{$disk}{partitions}{$id}{filesystem} = $fs;
+      }
+    }
+
+    # reset the output list
+    @parted_print = ();
+
+    # obtain the partition table using bytes as units
+    $error =
+      &FAI::execute_ro_command("parted -s $disk unit B print free", \@parted_print, 0);
+
+    # Parse the output of the byte-wise partition table
+    foreach my $line (@parted_print) {
+
+      # the disk size line (Disk /dev/hda: 82348277759B)
+      if ($line =~ /Disk \Q$disk\E: (\d+)B$/) {
+        $FAI::current_config{$disk}{begin_byte} = 0;
+        $FAI::current_config{$disk}{end_byte}   = $1 - 1;
+        $FAI::current_config{$disk}{size}       = $1;
+
+        # nothing else to be done
+        next;
+      }
+
+      # One of the partition lines, see above example
+      next unless ($line =~
+        /^\s*(\d+)\s+(\d+)B\s+(\d+)B\s+(\d+)B(\s+(primary|logical|extended))?/i);
+
+      # mark the bounds of existing partitions
+      $FAI::current_config{$disk}{partitions}{$1}{begin_byte} = $2;
+      $FAI::current_config{$disk}{partitions}{$1}{end_byte}   = $3;
+      $FAI::current_config{$disk}{partitions}{$1}{count_byte} = $4;
+
+      # is_extended defaults to false/0
+      $FAI::current_config{$disk}{partitions}{$1}{is_extended} = 0;
+
+      # but may be true/1 on msdos disk labels
+      ( ( $FAI::current_config{$disk}{disklabel} eq "msdos" )
+          && ( $6 eq "extended" ) )
+        and $FAI::current_config{$disk}{partitions}{$1}{is_extended} = 1;
+    }
+
+    # reset the output list
+    @parted_print = ();
+
+    # obtain the partition table using bytes as units
+    $error =
+      &FAI::execute_ro_command(
+      "parted -s $disk unit chs print free", \@parted_print, 0);
+
+    # Parse the output of the CHS partition table
+    foreach my $line (@parted_print) {
+
+   # find the BIOS geometry that looks like this:
+   # BIOS cylinder,head,sector geometry: 10011,255,63.  Each cylinder is 8225kB.
+      if ($line =~
+        /^BIOS cylinder,head,sector geometry:\s*(\d+),(\d+),(\d+)\.\s*Each cylinder is \d+kB\.$/) {
+        $FAI::current_config{$disk}{bios_cylinders}         = $1;
+        $FAI::current_config{$disk}{bios_heads}             = $2;
+        $FAI::current_config{$disk}{bios_sectors_per_track} = $3;
+      }
+    }
+
+    # make sure we have determined all the necessary information
+    ($FAI::current_config{$disk}{begin_byte} == 0)
+      or die "Invalid start byte\n";
+    ($FAI::current_config{$disk}{end_byte} > 0) or die "Invalid end byte\n";
+    defined ($FAI::current_config{$disk}{size})
+      or die "Failed to determine disk size\n";
+    defined ($FAI::current_config{$disk}{sector_size})
+      or die "Failed to determine sector size\n";
+    defined ($FAI::current_config{$disk}{bios_sectors_per_track})
+      or die "Failed to determine the number of sectors per track\n";
+
+  }
+}
+
+################################################################################
+#
+# @brief Collect the current LVM configuration
+#
+################################################################################
+sub get_current_lvm {
+
+  # use Linux::LVM, once #488205
+
+  # the list to hold the output of vgdisplay commands as parsed below
+  my @vgdisplay_print = ();
+
+  # try to obtain the list of volume groups
+  my $error =
+    &FAI::execute_ro_command( "vgdisplay --units m -s", \@vgdisplay_print, 0 );
+
+  # the expected output (if any) contains lines like the following
+  #
+  # $ vgdisplay -s
+  #   "XENU" 453.36 MB [451.93 MB used / 1.43 MB free]
+
+  # parse the output line by line and call vgdisplay -v <VG>
+  foreach my $line (@vgdisplay_print) {
+    ( 
+      # example output with an empty vg:
+      #   "my_pv" 267476.00 MB [0 MB      used / 267476.00 MB free]
+      $line =~
+/^\s*"(\S+)"\s+\d+\.\d+ MB\s+\[\d+\.*\d* MB\s+used \/ \d+\.\d+ MB\s+free\]$/
+    ) or die "Unexpected vgdisplay output $line";
+
+    # the name of the volume group
+    my $vg = $1;
+    
+    # initialise the hash entry
+    $FAI::current_lvm_config{$vg}{"physical_volumes"} = ();
+    &FAI::push_command( "true", "", "vg_created_$vg" );
+
+    # get the detailed configuration for $vg
+    my @vgdisplay_v_print = ();
+
+    # try to obtain the detailed information for the volume group $vg
+    my $error = &FAI::execute_ro_command( "vgdisplay --units m -v $vg",
+      \@vgdisplay_v_print, 0 );
+
+    # the expected output (if any) looks like this:
+    # $ vgdisplay -v XENU
+    #     Using volume group(s) on command line
+    #     Finding volume group "XENU"
+    #   --- Volume group ---
+    #   VG Name               XENU
+    #   System ID
+    #   Format                lvm2
+    #   Metadata Areas        4
+    #   Metadata Sequence No  65
+    #   VG Access             read/write
+    #   VG Status             resizable
+    #   MAX LV                0
+    #   Cur LV                53
+    #   Open LV               46
+    #   Max PV                0
+    #   Cur PV                4
+    #   Act PV                4
+    #   VG Size               453.36 MB
+    #   PE Size               4.00 MB
+    #   Total PE              116060
+    #   Alloc PE / Size       115693 / 451.93 MB
+    #   Free  PE / Size       367 / 1.43 MB
+    #   VG UUID               09JCPv-v2RU-NWEZ-ilNA-mNLk-Scw3-aURtE6
+    #
+    #   --- Logical volume ---
+    #   LV Name                /dev/XENU/mole_
+    #   VG Name                XENU
+    #   LV UUID                WBcBDw-1z2J-F3b2-FGAk-u7Ki-IEgF-lMEURK
+    #   LV Write Access        read/write
+    #   LV Status              available
+    #   # open                 1
+    #   LV Size                1000.00 MB
+    #   Current LE             250
+    #   Segments               1
+    #   Allocation             inherit
+    #   Read ahead sectors     0
+    #   Block device           254:0
+    #
+    #   --- Physical volumes ---
+    #   PV Name               /dev/sda8
+    #   PV UUID               4i7Tpi-k9io-Ud44-gWJd-nSuG-hbh7-CE1m43
+    #   PV Status             allocatable
+    #   Total PE / Free PE    29015 / 0
+    #
+    #   PV Name               /dev/sda9
+    #   PV UUID               VXSxq1-vEwU-5VrY-QVC8-3Wf1-AY45-ayD9KY
+    #   PV Status             allocatable
+    #   Total PE / Free PE    29015 / 0
+    #
+
+    # parse the output to select the interesting parts
+    # there are 3 main groups: the volume group, logical volumes and physical
+    # volumes; use mode to indicate this
+    my $mode = "";
+
+    # we need to remember the logical volume name across the lines
+    my $lv_name = "";
+
+    # do the line-wise parsing
+    foreach my $line_v (@vgdisplay_v_print) {
+      $mode = "vg" if ( $line_v =~ /^\s*--- Volume group ---\s*$/ );
+      $mode = "lv" if ( $line_v =~ /^\s*--- Logical volume ---\s*$/ );
+      $mode = "pv" if ( $line_v =~ /^\s*--- Physical volumes ---\s*$/ );
+      $mode = "" if ( $mode ne "pv" && $line_v =~ /^\s*$/ );
+      next if ( $mode eq "" );
+
+      # Now select the interesting information for each mode
+      if ( $mode eq "vg" ) {
+
+        # for a volume group only the size is needed
+        # extract the floatingpoint value
+        $FAI::current_lvm_config{$vg}{"size"} = $1
+          if ( $line_v =~ /^\s*Alloc PE \/ Size\s+\d+ \/ (\d+\.\d+) MB\s*$/ );
+      } elsif ( $mode eq "lv" ) {
+
+        # we need the name and the size of each existing logical volume
+        if ( $line_v =~ /^\s*LV Name\s+\/dev\/\Q$vg\E\/(\S+)\s*$/ ) {
+          $lv_name = $1;
+          &FAI::push_command( "true", "", "exist_/dev/$vg/$lv_name" );
+        }
+
+        # the size of the logical volume
+        # extract the floatingpoint value
+        $FAI::current_lvm_config{$vg}{"volumes"}{$lv_name}{"size"} = $1
+          if ( $line_v =~ /^\s*LV Size\s+(\d+\.\d+) MB\s*$/ );
+      } elsif ( $mode eq "pv" ) {
+
+        # get the physical devices that are part of this volume group
+        push @{ $FAI::current_lvm_config{$vg}{"physical_volumes"} }, $1
+          if ( $line_v =~ /^\s*PV Name\s+(\S+)\s*$/ );
+      }
+    }
+  }
+}
+
+################################################################################
+#
+# @brief Collect the current RAID device information from all partitions
+# currently active in the system
+#
+################################################################################
+sub get_current_raid {
+
+  # the list to hold the output of mdadm commands as parsed below
+  my @mdadm_print = ();
+
+  # try to obtain the list of existing RAID arrays
+  my $error =
+    &FAI::execute_ro_command("mdadm --detail --scan --verbose -c partitions",
+    \@mdadm_print, 0);
+
+# the expected output is as follows
+# $ mdadm --detail --scan --verbose -c partitions
+# ARRAY /dev/md0 level=linear num-devices=2 UUID=7e11efd6:93e977fd:b110d941:ce79a4f6
+#    devices=/dev/hda1,/dev/hda2
+# ARRAY /dev/md1 level=raid0 num-devices=2 UUID=50d7a6ec:4207f0db:b110d941:ce79a4f6
+#    devices=/dev/md0,/dev/hda3
+
+  # the id of the RAID
+  my $id;
+
+  # parse the output line by line
+  foreach my $line (@mdadm_print) {
+    if ($line =~ /^ARRAY \/dev\/md(\d+) level=(\S+) num-devices=\d+ UUID=/) {
+      $id = $1;
+      $FAI::current_raid_config{$id}{mode} = $2;
+      &FAI::push_command( "true", "", "exist_/dev/md$id" );
+    } elsif ($line =~ /^\s*devices=(\S+)$/) {
+      @{ $FAI::current_raid_config{$id}{devices} } = split (",", $1);
+    }
+  }
+}
+
+
+################################################################################
+#
+# @brief Set the appropriate preserve flag for $device_name
+#
+# @param device_name Full device path
+#
+################################################################################
+sub mark_preserve {
+  my ($device_name) = @_;
+  my ($i_p_d, $disk, $part_no) = &FAI::phys_dev($device_name);
+
+  if (1 == $i_p_d && defined($FAI::configs{"PHY_$disk"}{partitions}{$part_no})) {
+    $FAI::configs{"PHY_$disk"}{partitions}{$part_no}{size}{preserve} = 1;
+  } elsif ($device_name =~ m{^/dev/md(\d+)$}) {
+    my $vol = $1;
+    if (defined($FAI::configs{RAID}{volumes}{$vol}) && 
+        $FAI::configs{RAID}{volumes}{$vol}{preserve} != 1) {
+      $FAI::configs{RAID}{volumes}{$vol}{preserve} = 1;
+      &FAI::mark_preserve($_) foreach (keys %{ $FAI::configs{RAID}{volumes}{$vol}{devices} });
+    }
+  } elsif ($device_name =~ m{^/dev/([^/\s]+)/([^/\s]+)$}) {
+    my $vg = $1;
+    my $lv = $2;
+    if (defined($FAI::configs{"VG_$vg"}{volumes}{$lv}) &&
+        $FAI::configs{"VG_$vg"}{volumes}{$lv}{size}{preserve} != 1) {
+      $FAI::configs{"VG_$vg"}{volumes}{$lv}{size}{preserve} = 1;
+      &FAI::mark_preserve($_) foreach (keys %{ $FAI::configs{"VG_$vg"}{devices} });
+    }
+  } else {
+    warn "Don't know how to mark $device_name for preserve\n";
+  }
+}
+
+
+################################################################################
+#
+# @brief Mark devices as preserve, in case an LVM volume or RAID device shall be
+# preserved
+#
+################################################################################
+sub propagate_preserve {
+
+  # loop through all configs
+  foreach my $config (keys %FAI::configs) {
+
+    # no physical devices here
+    next if ($config =~ /^PHY_./);
+
+    if ($config =~ /^VG_(.+)$/) {
+      next if ($1 eq "--ANY--");
+      # check for logical volumes that need to be preserved and preserve the
+      # underlying devices recursively
+      foreach my $l (keys %{ $FAI::configs{$config}{volumes} }) {
+        next unless ($FAI::configs{$config}{volumes}{$l}{size}{preserve} == 1);
+        &FAI::mark_preserve($_) foreach (keys %{ $FAI::configs{$config}{devices} });
+        last;
+      }
+    } elsif ($config eq "RAID") {
+      # check for volumes that need to be preserved and preserve the underlying
+      # devices recursively
+      foreach my $r (keys %{ $FAI::configs{$config}{volumes} }) {
+        next unless ($FAI::configs{$config}{volumes}{$r}{preserve} == 1);
+        &FAI::mark_preserve($_) foreach (keys %{ $FAI::configs{$config}{volumes}{$r}{devices} });
+      }
+    } else {
+      &FAI::internal_error("Unexpected key $config");
+    }
+  }
+}
+
+
+1;
+

Added: branches/lhm/lib/subroutines
===================================================================
--- branches/lhm/lib/subroutines	                        (rev 0)
+++ branches/lhm/lib/subroutines	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,634 @@
+#! /bin/bash
+
+# $Id: subroutines 5224 2008-12-09 15:40:41Z lange $
+#*********************************************************************
+#
+# subroutines -- useful subroutines for FAI
+#
+# This script is part of FAI (Fully Automatic Installation)
+# (c) 2000-2008 by Thomas Lange, lange at informatik.uni-koeln.de
+# Universitaet zu Koeln
+# (c) 2001-2005 by Henning Glawe, glaweh at physik.fu-berlin.de
+# Freie Universitaet Berlin
+#
+#*********************************************************************
+# 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.
+# 
+# A copy of the GNU General Public License is available as
+# `/usr/share/common-licences/GPL' in the Debian GNU/Linux distribution
+# or on the World Wide Web at http://www.gnu.org/copyleft/gpl.html.  You
+# can also obtain it by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#*********************************************************************
+
+# source this file, then you have these function available in the shell
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+die() {
+
+    # echo comment and exit installation
+    task savelog
+    echo "$@"
+    if [ X$FAI_ACTION = Xinstall ]; then
+	exec bash -i
+    else
+	exit 99
+    fi
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+defnop() {
+
+    # define given list of subroutine names as dummy function;
+    # this will fake unknown commands
+
+    local name
+    for name in "$@";do
+        eval "$name () { :;}"
+    done
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+### BEGIN SUBROUTINE INFO
+# Provides-Var:      none
+# Required-Var:      $classes
+# Short-Description: test if class is defined
+### END SUBROUTINE INFO
+
+ifclass() {
+
+    [ "$debug" ] && echo "Test if class $1 is in $classes" >&2
+    # test if a class is defined
+    local cl
+    local ret=1
+
+    for cl in $classes; do
+	[ x$cl = x$1 ] && ret=0 && break
+    done
+    [ "$debug" ] && echo "ifclass returns $ret" >&2
+    return $ret
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+rwmount() {
+
+    # remount partition read/write
+    mount -o rw,remount $1
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+save_dmesg() {
+
+    dmesg > $LOGDIR/dmesg.log
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+wait_for_jobs() {
+
+    # can be an extern script
+    # wait for running (background) jobs to finish (e.g. update-auctex-elisp)
+    local i=0
+    while jobsrunning; do
+	[ $(($i % 3)) -eq 0 ] && echo "Waiting for background jobs to finish."
+	(( i += 1 ))
+	sleep 10
+    done
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+stop_fai_installation() {
+
+    # this subroutine should directly stop the installation process
+    echo "Traceback: $task_error_func"
+    die "FATAL ERROR. Installation stopped."
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+### BEGIN SUBROUTINE INFO
+# Provides-Var:      $task_error_code
+# Required-Var:      $1 $2 $task_error_code
+# Short-Description: save the maximum error code,
+# Short-Description: $1 is the error that will be saved unless $2 is zero
+### END SUBROUTINE INFO
+
+task_error() {
+
+    [ X$2 = X0 ] && return
+    task_error_func=${FUNCNAME[*]}
+    [ $1 -gt $task_error_code ] && task_error_code=$1
+    [ $task_error_code -gt $STOP_ON_ERROR ] && stop_fai_installation
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+### BEGIN SUBROUTINE INFO
+# Provides-Var:      $task_error_code
+# Required-Var:      $LOGDIR
+# Short-Description: call a certain task
+### END SUBROUTINE INFO
+
+task() {
+
+    # hooks are called before a task is called
+    # if a task is skipped, also its hooks are skipped
+    # a hook can set the flag, so the accociated task is skipped
+
+    local taskname=$1
+    shift
+
+    [ -f $LOGDIR/skip.$taskname ] || call_hook $taskname $@
+
+    if [ -f $LOGDIR/skip.$taskname ]; then
+        # skip task
+	rm $LOGDIR/skip.$taskname # TODO: remove skip files at the very end
+	[ "$verbose" ] && echo "Skiping task_$taskname"
+	sendmon "TASKSKIP $taskname"
+    else
+	echo "Calling task_$taskname"
+	sendmon "TASKBEGIN $taskname"
+	task_error_code=0   # task can set this variable to indicate an error
+	task_error_func=''
+	task_$taskname $@
+	sendmon "TASKEND $taskname $task_error_code"
+	[ "$task_error_code" -ne 0 ] && echo "Exit code task_$taskname: $task_error_code"
+    fi
+
+    # since the subroutine is not needed any more, we can undefine it, except
+    # if it's our error handler, which may be called multiple times
+    if [ "$taskname" != "error" ]; then
+	unset task_$taskname
+    fi
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+### BEGIN SUBROUTINE INFO
+# Provides-Var:      
+# Required-Var:      $classes $debug
+# Short-Description: call a hook, hook.source can define additional variables
+### END SUBROUTINE INFO
+
+call_hook() {
+
+    local hook=$1
+    shift
+
+    local cl dflag hfile
+    [ "$debug" ] && dflag="-d"
+
+    for cl in $classes; do
+	hfile=$FAI/hooks/$hook.$cl
+	if [ -f $hfile -a ! -x $hfile ]; then
+	    echo "WARNING: Skipping $hfile execustion because it's not executable."
+	    continue
+	fi
+	if [ -f $hfile.source -a ! -x $hfile.source ]; then
+	    echo "WARNING: Skipping $hfile.source execustion because it's not executable."
+	    continue
+	fi
+	if [ -x $hfile ]; then
+	    echo "Calling hook: $hook.$cl"
+	    sendmon "HOOK $hook.$cl"
+	    # execute the hook
+	    $hfile $dflag $@
+	    check_status $hook.$cl $?
+	fi
+	if [ -x $hfile.source ]; then
+	    echo "Source hook: $hook.$cl.source"
+	    sendmon "HOOK $hook.$cl.source"
+            # source this hook
+	    . $hfile.source $dflag $@
+	    check_status $hook.$cl.source $?
+	fi
+     done
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+skiptask() {
+
+    # mark all given tasks, so they will be skipped
+    local task
+
+    for task in "$@"; do
+	> $LOGDIR/skip.$task
+    done
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+define_fai_flags() {
+
+    local flag
+
+    # FAI_FLAGS are comma separated, define all flags
+    FAI_FLAGS=${FAI_FLAGS//,/ }
+    echo "FAI_FLAGS: $FAI_FLAGS"
+    for flag in $FAI_FLAGS; do
+	# define this flag as 1
+	eval "flag_$flag=1"
+	case $flag in
+	shutdown|reboot) export FAI_ABORT=$flag ;;
+	esac
+    done
+    [ "$flag_verbose" ]  && verbose=1 # for backward compability
+    [ "$flag_debug" ]    && debug=1   # for backward compability
+    [ "$flag_shutdown" -o "$flag_reboot" ] && flag_nowait=1
+    if [ "$FAI_ABORT" = "shutdown" ]; then
+        unset flag_reboot
+        trap 'echo "Now shutting down";faishutdown' INT QUIT
+    else
+        unset flag_shutdown
+        trap 'echo "Now rebooting";faireboot' INT QUIT
+    fi
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+### BEGIN SUBROUTINE INFO
+# Provides-Var:    $fai_rundate
+# Requires-Var:    $DOMAIN $do_init_tasks
+# Suggests-Var:    $flag_createvt $flag_sshd
+# Short-Description: <task desc.>
+### END SUBROUTINE INFO
+
+task_setup() {
+
+    # source user specific subroutines
+    [ -f $FAI/hooks/subroutines ] && . $FAI/hooks/subroutines
+
+    # warn user if cdrom has DMA not enabled
+    if [ -f /etc/RUNNING_FROM_FAICD ]; then
+	local cdrom=$(mount| awk '/dev.+on \/ /{print $1}')
+	if [ -n "$cdrom" ]; then
+	    hdparm -d $cdrom | grep -q off 2>/dev/null
+	    if [ $? -eq 0 ]; then
+		echo "WARNING: CD-ROM does not use DMA mode. The installation will be sloooow."
+	    fi
+	fi
+    fi
+
+    define_fai_flags
+
+    # this may be moved to an external script
+    if [ $do_init_tasks -eq 1 ] ; then
+        # set the system time and date using rdate or/and ntpdate
+        [ "$TIMESRVS_1" ] && rdate $TIMESRVS_1
+        [ "$NTPSRVS_1" ]  && ntpdate -b $NTPSRVS
+        [ "$flag_createvt" ] && {
+	    # create two virtual terminals
+	    echo "Press ctrl-c to interrupt FAI and to get a shell"
+	    openvt -v /bin/bash 2>&1
+	    openvt -v /bin/bash 2>&1
+	    trap 'echo "You can reboot with faireboot";bash' INT QUIT
+        }
+    
+        # start secure shell daemon for remote access
+	[ "$flag_sshd" -a -x /usr/sbin/sshd ] && /usr/sbin/sshd
+    fi
+    unset flag_createvt flag_sshd
+
+    # when did FAI start, using localtime
+    [ -z "$fai_rundate" ] && fai_rundate=$(date +'%Y%m%d_%H%M%S')
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+### BEGIN SUBROUTINE INFO
+# Provides-Var:    none
+# Requires-Var:    $FAI_ACTION
+# Short-Description: call task depending on $FAI_ACTION
+### END SUBROUTINE INFO
+
+task_action() {
+
+    if [ -z "$FAI_ACTION" ]; then
+	echo "No action in \$FAI_ACTION defined."
+	sendmon "TASKERROR action 21"
+	task faiend
+	exit 
+    fi
+    echo "FAI_ACTION: $FAI_ACTION"
+    case $FAI_ACTION in
+
+	install)
+	    if [ $do_init_tasks -eq 0 ]; then
+		echo "Cowardly refusing to run a FAI installation on a running system."
+		return
+	    fi
+	    echo Performing FAI installation. All data may be overwritten!
+	    echo -ne "\a"; sleep 1
+	    echo -ne "\a"; sleep 1
+	    echo  -e "\a"; sleep 5
+	    task install
+	    task faiend
+	    ;;
+	dirinstall)
+	    task dirinstall
+	    task faiend
+	    ;;
+	softupdate)
+	    echo Performing FAI system update. All data may be overwritten!
+	    task softupdate
+	    task faiend
+	    ;;
+	sysinfo)
+	    echo Showing system information.
+	    task sysinfo
+	    task faiend
+	    die Now you have a shell.
+	    ;;
+	*)
+	    if [ -f $FAI/hooks/$FAI_ACTION ]; then
+		echo "Calling user defined action: $FAI_ACTION"
+		$FAI/hooks/$FAI_ACTION
+	    else
+		echo "ERROR: User defined action $FAI/hooks/$FAI_ACTION not found."
+		sendmon "TASKERROR action 22"
+		task faiend
+	    fi
+	    ;;
+	esac
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+### BEGIN SUBROUTINE INFO
+# Provides-Var:    $classes $cfclasses
+# Requires-Var:    $LOGDIR
+# Suggests-Var:    $renewclass
+# Short-Description: <task desc.>
+### END SUBROUTINE INFO
+
+task_defclass() {
+
+    if [ ! -d $FAI/class ]; then
+	sendmon "TASKERROR defclass 21"
+	echo "Directory $FAI/class not found. Following subdirectories are found:"
+	find $FAI -maxdepth 1 -type d -printf "%p\n"
+	die "Aborting."
+    fi
+
+    # new script for defining classes; variables imported: $LOGDIR, $verbose, $debug
+    if [ $renewclass -eq 1 ]; then
+	# reevaluate new list of classes
+	fai-class -T $FAI/class $LOGDIR/FAI_CLASSES
+	classes=$(< $LOGDIR/FAI_CLASSES)
+    elif [ -n "$cmdlineclasses" ]; then
+	classes=$cmdlineclasses
+    elif [ ! -f /var/lib/fai/FAI_CLASSES ]; then
+	# use classes defined at installation time
+	die "Try to read classes from /var/lib/fai/FAI_CLASSES. Failed. Aborting."
+    else
+	classes=$(< /var/lib/fai/FAI_CLASSES)
+    fi
+    echo "List of all classes: " $classes
+
+    # define classes as: a.b.c.d for cfengine -D
+    # this doesn't work without echo
+    cfclasses=$(echo $classes)
+    cfclasses=${cfclasses// /.}
+    [ "$debug" ] && echo "cfclasses: $cfclasses"
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+_defvar() {
+
+    local showvar=1 # TODO: new FAI_FLAG or always set when verbose is used
+    [ "$showvar" ] && set -x
+    . $1 </dev/null 
+    [ "$showvar" ] && set +x
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+task_defvar() {
+
+    local svar=$LOGDIR/showvar.log
+    local odir=$(pwd)
+    cd $FAI/class
+    for class in $classes ; do
+	if [ -f $class.var -a -r $class.var ]; then
+	    [ "$verbose" ] && echo "Executing $class.var"
+	    # show only lines with ++, we cannot use a pipe, since it would call
+	    # _devfar in a subprocess. Then, variables are not defined 
+	    _defvar $class.var > $svar 2>&1
+	    grep ^++ $svar
+	    rm $svar
+	fi
+    done
+
+    # /fai/class/S* scripts or hooks can write variable definitions
+    # to additonal.var. now source these definitions
+    if [ -f $LOGDIR/additional.var -a -r $LOGDIR/additional.var ]; then
+	_defvar $LOGDIR/additional.var > $svar 2>&1
+	grep ^++ $svar
+	rm $svar
+    fi
+    unset class svar
+    # now all variables are defined. Dump them to variables.log
+    set | perl -ne 'print if /^\w\w+=/ and not /^(BASH_VERSINFO|EUID|PPID|SHELLOPTS|UID|rootpw|ROOTPW|HOME|PWD)/' > $LOGDIR/variables.log
+    cd $odir
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+task_mountdisks() {
+
+    [ ! -f $LOGDIR/fstab ] && die "No $LOGDIR/fstab created."
+    # mount swap space
+    local sd
+    for sd in $SWAPLIST; do
+	swapon -p1 $sd && [ "$verbose" ] && echo "Enable swap device $sd"
+    done
+    mount2dir $FAI_ROOT $LOGDIR/fstab
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+task_configure() {
+
+    fai-do-scripts $FAI/scripts
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+task_test() {
+
+    echo "Will be implemented soon"
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+task_savelog() {
+
+    mkdir -p $FAI_ROOT/var/lib/fai
+    mkdir -p $FAI_ROOT/var/log/fai
+    fai-savelog -l
+    [ -f $LOGDIR/FAI_CLASSES ] && cp -pu $LOGDIR/FAI_CLASSES $FAI_ROOT/var/lib/fai
+    [ -f $LOGDIR/disk_var.sh ] && cp -pu $LOGDIR/disk_var.sh $FAI_ROOT/var/lib/fai
+    fai-savelog -r
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+task_faiend() {
+
+    local dir cdromdevice
+
+    # initialize empty flags
+    [ -z "${flag_faiend:=0}" ] && flag_faiend=0
+    [ -z "${flag_nowait:=0}" ] && flag_nowait=0
+
+    [ $do_init_tasks -eq 0 -a $flag_faiend -eq 0 ] && exit 0
+    wait_for_jobs
+    [ -s $LOGDIR/error.log -a "$flag_nowait" -gt "0" ] && sleep 10
+
+    # quit without prompting if FAI_FLAG nowait is set
+    if [ "$flag_nowait" -lt "1" ]; then
+      echo "Press <RETURN> to '${FAI_ABORT}'."
+      read
+    else
+      if [ "$FAI_ABORT" != "shutdown" ]; then
+	echo "Rebooting $HOSTNAME now"
+      else
+	echo "Shutting down $HOSTNAME now"
+      fi
+    fi
+
+    # inform faimond of last action
+    if [ "$FAI_ABORT" != "shutdown" ]; then
+      sendmon "TASKEND REBOOT 0"
+    else
+      sendmon "TASKEND SHUTDOWN 0"
+    fi
+
+    cd /
+    sync
+
+    [ $do_init_tasks -eq 1 ] && killall -q sshd udevd
+    if [ -f /etc/RUNNING_FROM_FAICD ]; then
+	cat > $target/tmp/rebootCD <<'EOF'
+#! /bin/bash
+ device=$1
+eject -m /dev/$device 2>/dev/null >/dev/null
+echo "Remove CDROM, close tray and press <RETURN> to continue $FAI_ABORT"
+read
+eject -t /dev/$device 2>/dev/null >/dev/null
+if [ "$FAI_ABORT" != "shutdown" ]; then
+  exec reboot -df
+else
+  exec poweroff -df
+fi
+EOF
+	chmod +x $target/tmp/rebootCD
+	sync
+	for dir in $(mount | grep $target | awk '{print $3}' | sort -r); do
+	    mount -o remount,ro $dir
+	done
+	cdromdevice=$(awk '/ name:/ {print $3}' /proc/sys/dev/cdrom/info)
+	chroot $target /tmp/rebootCD $cdromdevice
+	# never reached, because chroot will reboot the machine
+	die "Internal error when calling /tmp/rebootCD."
+    fi
+
+    if [ $do_init_tasks -eq 1 ]; then
+      umount $FAI_ROOT/proc
+      umount -ar
+    fi
+    if [ "$FAI_ABORT" != "shutdown" ]; then
+      exec reboot -dfi
+    else
+      exec poweroff -dfi
+    fi
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+task_install() {
+
+    echo $$ > $stamp
+
+    save_dmesg
+
+    task partition
+    task mountdisks
+    task extrbase
+    task mirror
+    task debconf
+    task prepareapt
+    task updatebase
+    task instsoft
+    task configure
+    task finish
+    task chboot
+
+    rm -f $stamp
+    # save again, because new messages could be created
+    save_dmesg
+    task test
+    task savelog
+
+    if [ -f $stamp ]; then
+	echo "Error while executing commands in subshell."
+	echo -n "$stamp was not removed. PID of running process: "
+	cat $stamp
+	sendmon "TASKERROR install 21"
+	die "Please look at the log files in $LOGDIR for errors."
+    fi
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+task_dirinstall() {
+
+    echo $$ > $stamp
+
+    mkdir -p $FAI_ROOT
+    FAI_ROOT=$(cd $FAI_ROOT;pwd)
+    echo "Installing into directory $FAI_ROOT"
+    task extrbase
+    [ -f $target/etc/fstab ] || touch $target/etc/fstab
+    task mirror
+    task debconf
+    task prepareapt
+    task updatebase
+    task instsoft
+    task configure
+    task finish
+
+    rm -f $stamp
+    unset LOGUSER # so logfile are not saved to remote
+    task savelog
+
+    if [ -f $stamp ]; then
+	echo "Error while executing commands in subshell."
+	echo -n "$stamp was not removed. PID of running process: "
+	cat $stamp
+	sendmon "TASKERROR install 21"
+	die "Please look at the log files in $LOGDIR for errors."
+    fi
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+task_softupdate() {
+
+    stamp=/var/run/fai/fai_softupdate_is_running
+
+    [ -f "$stamp" ] && die "Another fai softupdate is already running. Aborting."
+    echo $$ > $stamp
+    # if the system had been installed using fai < 3.0 disk_var.sh is found in /etc/fai
+    if [ ! -f /var/lib/fai/disk_var.sh -a -f /etc/fai/disk_var.sh ] ; then
+      mv /etc/fai/disk_var.sh /var/lib/fai/
+    fi
+    # the following copy operation is required to make $LOGDIR a reliable source
+    # for disk_var.sh
+    # use the last disk_var during update if available
+    [ -f /var/lib/fai/disk_var.sh ] && cp -p /var/lib/fai/disk_var.sh $LOGDIR 
+
+    defnop wait_for_jobs
+    save_dmesg
+
+    task mirror
+    task debconf
+    task updatebase
+    task instsoft
+    task configure
+    date
+    [ -f /proc/uptime ] && echo "The $FAI_ACTION took $[$(cut -d . -f 1 /proc/uptime)-$start_seconds] seconds."
+
+    rm -f $stamp
+    # save again, because new messages could be created
+    save_dmesg
+    task savelog
+
+    # umount config space if accessed via nfs
+    echo $FAI_CONFIG_SRC | grep -q ^nfs://
+    if [ $? -eq 0 ]; then
+	grep -q " $FAI nfs" /etc/mtab && umount $FAI
+    fi
+
+    if [ -f $stamp ]; then
+	echo "Error while executing commands in subshell."
+	echo -n "$stamp was not removed. PID of running process: "
+	cat $stamp
+	sendmon "TASKERROR softupdate 21"
+	die "Please look at the log files in $LOGDIR for errors."
+    fi
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+catnc() {
+    # cat but no comment lines
+    egrep -v "^#" $@
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Added: branches/lhm/lib/subroutines-linux
===================================================================
--- branches/lhm/lib/subroutines-linux	                        (rev 0)
+++ branches/lhm/lib/subroutines-linux	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,432 @@
+#! /bin/bash
+
+# $Id: subroutines-linux 5018 2008-08-10 08:40:40Z lange $
+#
+# subroutine definitions for linux
+#
+# This script is part of FAI (Fully Automatic Installation)
+# (c) 2005-2008 by Thomas Lange, lange at informatik.uni-koeln.de
+# Universitaet zu Koeln
+# (c) 2001-2005 by Henning Glawe, glaweh at physik.fu-berlin.de
+# Freie Universitaet Berlin
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+### BEGIN SUBROUTINE INFO
+# Provides-Var:    $device_size $disklist
+# Requires-Var:    
+# Short-Description: create list of available disks and their sizes
+### END SUBROUTINE INFO
+
+set_disk_info() {
+
+    # the variable holds a space separated list of devices and their block size
+    device_size=$(disk-info)
+
+    # If returncode is 2 an usbdevice is connected to the system.
+    # This may cause problems with the order of harddisks in grub.
+    # Abort the installation.
+    if [ $? -eq 2 ]
+    then
+        export STOP_ON_ERROR=700
+        task error 810 1 "USB-Device_connected_aborting_installation."
+        die "USB-Device found. Aborting installation."
+    fi
+
+
+    # a list of all local disks, without size
+    disklist=$(list_disks $device_size | sort)
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+jobsrunning() {
+
+    # test if jobs are running
+    ps r | egrep -qv "ps r|TIME COMMAND|rcS"
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+eval_cmdline() {
+
+    # parse kernel parameters and define variables
+    local word
+
+    echo -n "Kernel currently running: "
+    uname -rsmo
+    echo -n "Kernel parameters: "; cat /proc/cmdline
+    for word in $(cat /proc/cmdline) ; do
+	case $word in
+	    [a-zA-Z]*=*)
+		eval "export $word"
+		;;
+	esac
+    done
+}
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+### BEGIN SUBROUTINE INFO
+# Short-Description: get ip from hostname by using host, echos IP or nothing
+### END SUBROUTINE INFO
+
+get_ip_from_hostname() {
+
+    local ip
+
+    ip=$(LANG=C host $1 2> /dev/null | sed -ne 's/.* has address \(.*\)$/\1/p')
+    if [ "x$ip" = "x" ]; then
+        ip=$1
+    fi
+
+    if echo $ip | grep -q "[0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}"
+    then
+        echo $ip
+    fi
+}
+
+## - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+### BEGIN SUBROUTINE INFO
+# Short-Description: calls ip and cleans \ and whitespace
+### END SUBROUTINE INFO
+call_ip() {
+  eval "LANG=C ip -o $1 2> /dev/null | sed -e 's/\\\//g' -e 's/ \+/ /g' ${2}"
+}
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+### BEGIN SUBROUTINE INFO
+# Provides-Var:    $faimond $sendhostname $sendid
+# Requires-Var:    $LOGDIR $FAI
+# Suggests-Var:    $monserver
+# Short-Description: <task desc.>
+### END SUBROUTINE INFO
+
+task_confdir() {
+
+    if [ $do_init_tasks -eq 1 ] ; then
+        local bootlog
+        eval_cmdline
+
+        bootlog=$LOGDIR/boot.log
+        get-boot-info
+        echo "Reading $bootlog"
+        . $bootlog
+        unset T170 T171 T172 ROOT_PATH BOOTFILE
+
+        printk=${printk:-6}
+        echo $printk > /proc/sys/kernel/printk
+        klogd -f $LOGDIR/kernel.log
+        echo "*.* $LOGDIR/syslog.log" > /etc/syslog.conf   
+        syslogd -m 0
+
+        create_resolv_conf
+    fi
+    define_fai_flags
+    get-config-dir || {
+        echo "Problems accessing the config space."
+        die ""
+    }
+    # now you have enough time to make changes to the config space
+    if [ -n "$flag_wait" ]; then
+	echo "Sleeping. Now you may change the config space in $FAI."
+	echo "Continue after killall sleep."
+	sleep 50000
+    fi
+
+    # check if monitor server is available
+    [ -z "$monserver" ] && monserver=$SERVER
+    if [ -z "$monserver" ]; then
+       echo "No monitor daemon defined."
+       return
+    fi
+
+    [ -z "$FAI_MONITOR_SEND_ID" ] && FAI_MONITOR_SEND_ID='host'
+    faimond=1
+
+    # Send variables: hostname, mac, PXE, monitoring ip
+    sendhostname=$HOSTNAME
+
+    if [ "x" != "x$monserver" ]; then
+        # Get monitoring server IP
+        monip=$(get_ip_from_hostname $monserver)
+        if [ "x" = "x$monip" ]; then
+            echo "unable to resolve IP for '$monserver' - disabled."
+            faimond=0
+        fi
+
+        # Get routing interface to IP
+        if [ $faimond -eq 1 -a "$FAI_MONITOR_SEND_ID" != "host" ]; then
+            sendifc=$(call_ip "route get to ${monip}" \
+                "-n -e 's/.*dev \([^ ]\+\).*/\1/p'")
+            if [ "x" = "x$sendifc" ]; then
+                echo "unable to find routing interface - disabled"
+                faimond=0
+            fi
+        fi
+
+        # Get MAC of interface        
+        if [ $faimond -eq 1 -a "$FAI_MONITOR_SEND_ID" != "host" ]; then
+            sendmac=$(call_ip "link show ${sendifc}" \
+                "-n -e 's/.*link[^ ]* \+\(\([0-9a-f]\{2\}:\)\{5\}[0-9a-f]\{2\}\).*/\1/p'")
+            if [ "x" = "x$sendmac" ]; then
+                echo "unable to find MAC for $sendifc - disabled"
+                faimond=0
+            else
+                sendpxe="01-$(echo $sendmac | tr : -)"
+            fi
+        fi
+
+        # Try to connect to monitoring server
+        if [ $faimond -eq 1 ]; then
+            case "$FAI_MONITOR_SEND_ID" in
+            host) sendid=$sendhostname ;;
+            pxe) sendid=$sendpxe ;;
+            mac) sendid=$sendmac ;;
+            *)
+                echo
+                echo "  Unknown FAI_MONITOR_SEND_ID: $FAI_MONITOR_SEND_ID, using default host"
+                echo "  logging status: "
+                sendid=$sendhostname
+                ;;
+            esac
+            if sendmon check $sendhostname; then
+                echo "enabled for '$monserver'."
+            else
+                echo "can't connect to '$monserver:4711' - disabled."
+                faimond=0
+            fi
+        fi
+    else
+        echo "no monitoring server set - disabled"
+        faimond=0
+    fi
+}
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+### BEGIN SUBROUTINE INFO
+# Provides-Var:    $BOOT_DEVICE $ROOT_PARTITION $BOOT_PARTITION $SWAPLIST
+# Requires-Var:    $LOGDIR $LOGDIR/disk_var.sh
+# Short-Description: partition local hard disk
+### END SUBROUTINE INFO
+
+task_partition() {
+
+    if [ X$USE_SETUP_STORAGE = X1 ]; then
+       echo "Partitioning local harddisks using setup-storage"
+       [ ! -s $LOGDIR/disk_var.sh ] && setup-storage -X 2>&1 | tee $LOGDIR/format.log 
+    else
+       echo "Partitioning local harddisks using setup_harddisks"
+       [ ! -s $LOGDIR/disk_var.sh ] && setup_harddisks -d -X 2>&1 | tee $LOGDIR/format.log
+    fi
+
+    # partitioning tool must create $LOGDIR/disk_var.sh file
+    if [ ! -s $LOGDIR/disk_var.sh ]; then
+        cat $LOGDIR/format.log
+        sendmon "TASKERROR partition 21"
+        task error 710
+        die "Partitioning tool did not create $LOGDIR/disk_var.sh file."
+    fi
+    # now define variable for root and boot partition and boot device
+    . $LOGDIR/disk_var.sh
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+### BEGIN SUBROUTINE INFO
+# Provides-Var:    none
+# Requires-Var:    $NFSROOT
+# Suggests-Var:    
+# Short-Description: <task desc.>
+### END SUBROUTINE INFO
+
+call_debootstrap() {
+    
+    local dversion=$(dpkg -l debootstrap | grep debootstrap | cut -f7 -d' ')
+    echo "Creating base system using debootstrap version $dversion"
+    echo "Calling debootstrap $FAI_DEBOOTSTRAP_OPTS $1 $FAI_ROOT $2 $3"
+    yes '' | LC_ALL=C debootstrap $FAI_DEBOOTSTRAP_OPTS $1 $FAI_ROOT $2 $3
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+### BEGIN SUBROUTINE INFO
+# Provides-Var:    none
+# Requires-Var:    $FAI_ROOT $do_init_tasks $NFSROOT $LOGDIR
+# Suggests-Var:    $FAI_DEBOOTSTRAP
+# Short-Description: <task desc.>
+### END SUBROUTINE INFO
+
+task_extrbase() {
+
+    local fs=$FAI_ROOT/etc/fstab
+    local basefile=/var/tmp/base.tgz
+
+    echo "Unpacking Debian base archive"
+    # copy the base file class based if it exists
+    [ -d $FAI/basefiles ] && ftar -1v -s $FAI/basefiles /
+    if [ $? -ne 0 ]; then
+	[ $do_init_tasks -eq 0 ] && basefile=$NFSROOT/live/filesystem.dir/var/tmp/base.tgz
+	if [ -f $basefile ]; then
+	    # extract the tar file which was the result of debootstrap
+	    echo "Extracting $basefile"
+	    gzip -dc $basefile | tar -C $FAI_ROOT -xpf -
+	else
+	    echo "No base.tgz found. Calling debootstrap."
+	    [ -z "$FAI_DEBOOTSTRAP" ] && die "$FAI_DEBOOTSTRAP undefined. Aborting"
+	    call_debootstrap $FAI_DEBOOTSTRAP
+	    task error 801 $?
+	fi
+    fi
+    # now we can copy fstab
+    [ -f $fs ] && mv $fs $fs.old
+    [ -f $LOGDIR/fstab ] && cp -p $LOGDIR/fstab $fs
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+### BEGIN SUBROUTINE INFO
+# Provides-Var:    
+# Requires-Var:    $FAI_ROOT $MNTPOINT $romountopt
+# Suggests-Var:    $FAI_DEBMIRROR $debug
+# Short-Description: <task desc.>
+### END SUBROUTINE INFO
+
+task_mirror() {
+
+    # mount debian mirror directory
+    [ "$FAI_DEBMIRROR" ] || return   # nothing to do
+    mkdir -p ${FAI_ROOT}${MNTPOINT}
+    if mount $romountopt $FAI_DEBMIRROR ${FAI_ROOT}${MNTPOINT}; then
+      [ "$debug" ] && echo "Mirror mounted from $FAI_DEBMIRROR to ${FAI_ROOT}${MNTPOINT}"
+    else
+      sendmon "TASKERROR mirror $?"
+      die "Can't mount $FAI_DEBMIRROR"
+    fi
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+task_debconf () {
+
+    if [ ! -d $FAI/debconf ]; then
+	echo "Can't find debconf directory $FAI/debconf. Skipping preseeding."
+	task error 2
+	return
+    fi
+    fai-debconf $FAI/debconf
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+### BEGIN SUBROUTINE INFO
+# Provides-Var:    none
+# Requires-Var:    $FAI_ROOT $FAI_ETC_DIR
+# Suggests-Var:    $IPADDR $DOMAIN
+# Short-Description: <task desc.>
+### END SUBROUTINE INFO
+
+task_prepareapt () {
+
+    # ftp and http needs resolv.conf in chroot environment, /etc/hosts is useful
+    # think about using fcopy for these two files
+    [ -f /etc/resolv.conf ] && cp /etc/resolv.conf $FAI_ROOT/etc
+    [ -f /etc/hosts ] && cp /etc/hosts $FAI_ROOT/etc
+    # set hostname in $FAI_ROOT
+    if [ -f /var/run/fai/FAI_INSTALLATION_IN_PROGRESS ]; then
+      echo $HOSTNAME >$FAI_ROOT/etc/hostname
+      if [ -n "$IPADDR" ]; then
+	  ainsl -s $FAI_ROOT/etc/hosts "$IPADDR $HOSTNAME.$DOMAIN $HOSTNAME"
+      fi
+    fi
+
+    if [ X$FAI_ALLOW_UNSIGNED = X1 ]; then
+	cat <<EOF > $FAI_ROOT/etc/apt/apt.conf.d/10fai
+APT::Get::AllowUnauthenticated "true";
+Aptitude::CmdLine::Ignore-Trust-Violations yes;
+EOF
+    fi
+    # during normal installation, we need sources.list from /etc/apt
+    [ $do_init_tasks -eq 1 ] && FAI_ETC_DIR=/etc
+    [ -d $FAI_ETC_DIR/apt ] && cp -r $FAI_ETC_DIR/apt/* $FAI_ROOT/etc/apt/
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+task_updatebase() {
+
+    # maybe the base system is not up to date
+    echo "Updating base"
+    updatebase
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+task_instsoft() {
+
+    echo "Installing software may take a while"
+    if [ "$debug" ]; then
+	install_packages | tee -a $LOGDIR/software.log
+	task error 471 $?
+    elif [ "$verbose" ]; then
+	install_packages </dev/null 2>&1 | tee -a $LOGDIR/software.log
+	task error 471 $?
+    else
+	install_packages </dev/null >> $LOGDIR/software.log 2>&1
+	task error 471 $?
+    fi
+    # This almost indicates an error
+    egrep "^E:" $LOGDIR/software.log && task error 472
+    grep "Couldn't find any package whose name or description matched" $LOGDIR/software.log && task error 321
+    grep -q "E: Sub-process /usr/bin/dpkg returned an error code" $LOGDIR/software.log && task error 620
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+task_finish() {
+
+    if [ $do_init_tasks -eq 1 ] ; then
+	# show some local information
+	ifconfig; df
+	# umount swap space
+	swapoff -a
+    fi
+    # undo fake of all programs made by fai
+    fai-divert -R
+    rm -f $FAI_ROOT/etc/apt/apt.conf.d/{10,90}fai
+    date
+    echo "The $FAI_ACTION took $[$(cut -d . -f 1 /proc/uptime)-$start_seconds] seconds."
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+task_chboot() {
+
+    # the whole subroutine may be an externel script
+
+    [ -z "$LOGUSER" ] && return # silently return from subroutine
+
+    local frsh
+    local doexit=0
+    local hostname=$(hostname)
+    local ipaddr=$(grep IPADDR $LOGDIR/boot.log | cut -d\' -f2)
+    local remotesh
+
+    case "$FAI_LOGPROTO" in
+	ftp) remotesh=ssh ;;
+	ssh) remotesh=ssh ;;
+	rsh) remotesh=rsh ;;
+    esac
+    frsh="$remotesh -l $LOGUSER ${SERVER}"
+
+    if [ -z "$SERVER" ] ; then
+	echo "SERVER not defined. Can't change network boot configuration"
+	task error 2
+	doexit=1
+    fi
+    [ $doexit -eq 1 ] && return
+
+    if dmesg | grep -q "Sending BOOTP requests"; then
+        # change boot device (local disk or network) when using bootp
+	[ "$LOGUSER" -a "$TFTPLINK" ] &&
+	    $frsh "cd /srv/tftp/fai; rm -f $hostname; ln -s $TFTPLINK $hostname"
+    else
+        # change boot device (local disk or network) when using PXE
+        # first test if rsh to server works
+	$frsh true >/dev/null 2>&1
+	if [ $? -ne 0 ]; then
+	    task error 3
+	    echo "WARNING: $frsh failed. Can't call fai-chboot on the install server."
+	else
+	    # remove pxe config, so host will use default and boot from local disk
+	    $frsh /usr/sbin/fai-chboot -vd $ipaddr
+	fi
+    fi
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+sendmon() {
+
+    # send message to monitor daemon
+    [ "$faimond" -eq 0 ] && return 0
+    echo "$sendid $*" | nc -w 8 $monserver 4711 2>/dev/null
+    return $?
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+# vim:ts=4:sw=4:expandtab:shiftwidth=2:syntax:paste
+

Added: branches/lhm/lib/task_sysinfo
===================================================================
--- branches/lhm/lib/task_sysinfo	                        (rev 0)
+++ branches/lhm/lib/task_sysinfo	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,54 @@
+#! /bin/bash
+
+# display some information about the system and save it to the logserver
+
+
+echo The defined classes are:
+echo $classes
+echo The classes are also saved in $LOGDIR/FAI_CLASSES
+
+# now show hardware info
+
+[ -x "$(which dmidecode)" ] && dmidecode
+[ -x "$(which lshw)" ] && lshw -short
+
+[ -x "$(which discover)" ] && {
+    discover
+    discover-modprobe -v
+    discover --data-path=xfree86/server/device/driver display
+    discover --data-path=linux/module/name network
+}
+
+[ -x "$(which hwinfo)" ] && hwinfo --short
+
+lspci
+lsdev
+lsusb
+echo "Ethernet cards found: $netdevices_all"
+echo "Ethernet cards running: $netdevices_up"
+ifconfig -a
+
+[ -x "$(which sysinfo)" ] && sysinfo -class device -level all
+
+[ -x "$(which sfdisk)" ] && sfdisk -d
+
+# show ide disk geometry
+grep . /proc/ide/ide?/hd?/geometry /dev/null | sed -e 's#/proc/ide/ide./##' 2>/dev/null
+
+[ -f /proc/scsi/scsi ] && cat /proc/scsi/scsi
+cat /proc/partitions
+
+for disk in $disklist; do
+    smartctl -i /dev/$disk 
+    hdparm -iv /dev/$disk
+    fdisk -lu /dev/$disk
+    parted -s /dev/$disk print
+    LC_ALL=C file -s /dev/$disk?* | grep -v ": empty"
+done
+
+fdisk -lu
+fai-mount-disk -f
+lsmod
+# - - - - - - - - - - -
+save_dmesg
+fai-savelog -r

Added: branches/lhm/lib/updatebase
===================================================================
--- branches/lhm/lib/updatebase	                        (rev 0)
+++ branches/lhm/lib/updatebase	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,45 @@
+#! /bin/bash
+
+if [ "$FAI_ACTION" = "install" -o "$FAI_ACTION" = "dirinstall" ]; then
+    # some packages must access /proc even in chroot environment
+    mount -t proc proc $FAI_ROOT/proc
+    # some packages must access /sys even in chroot environment
+    mount -t sysfs sysfs $FAI_ROOT/sys
+    # if we are using udev, also mount it into $FAI_ROOT
+    [ -f /etc/init.d/udev ] && mount --bind /dev $FAI_ROOT/dev
+    mount -t devpts devpts $FAI_ROOT/dev/pts
+    # if libc is upgraded init u is called in chroot environment and
+    # then init will eat up much cpu time
+    fai-divert -a /sbin/init /usr/sbin/liloconfig /usr/sbin/invoke-rc.d
+    # fake some more programs
+    fai-divert -a /etc/init.d/nis /sbin/start-stop-daemon /usr/sbin/policy-rc.d
+    cp /sbin/fai-start-stop-daemon $FAI_ROOT/sbin/start-stop-daemon
+    # never start any daemons inside chroot during installtion
+    cat > $FAI_ROOT/usr/sbin/policy-rc.d <<EOF
+#!/bin/sh
+exit 101
+EOF
+    chmod a+rx $FAI_ROOT/usr/sbin/policy-rc.d
+fi
+
+# update the apt-get information inside the nfsroot 
+
+export aptopt='-y -o Dpkg::Options::=--force-confnew'
+$ROOTCMD apt-get $aptopt update
+$ROOTCMD apt-get $aptopt check
+[ $? -ne 0 ] && $ROOTCMD apt-get $aptopt -f install </dev/null 
+$ROOTCMD dpkg -C
+[ $? -ne 0 ] && yes '' | $ROOTCMD dpkg --configure -a 
+# this may be removed in lenny
+if $ROOTCMD aptitude --help | grep -q safe-upgrade; then
+    $ROOTCMD aptitude $aptopt -y safe-upgrade
+else
+    $ROOTCMD aptitude $aptopt -y upgrade
+fi
+
+$ROOTCMD aptitude $aptopt -f -y dist-upgrade </dev/null
+# update dpkg info which packages are available
+tmp=$($ROOTCMD mktemp)
+$ROOTCMD apt-cache dumpavail > $FAI_ROOT/$tmp
+$ROOTCMD dpkg --update-avail $tmp
+rm -f $FAI_ROOT/$tmp

Added: branches/lhm/man/ainsl.1
===================================================================
--- branches/lhm/man/ainsl.1	                        (rev 0)
+++ branches/lhm/man/ainsl.1	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,75 @@
+.\"                                      Hey, EMACS: -*- nroff -*-
+.TH ainsl 1 "18 june 2008" "FAI 3.2"
+.\" Please adjust this date whenever revising the manpage.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh        disable hyphenation
+.\" .hy        enable hyphenation
+.\" .ad l      left justify
+.\" .ad b      justify to both left and right margins
+.\" .nf        disable filling
+.\" .fi        enable filling
+.\" .br        insert line break
+.\" .sp <n>    insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.SH NAME
+ainsl \- AppendIfNoSuchLine
+.SH SYNOPSIS
+.B ainsl
+.RI [ options ] " FILE LINE [PATTERN]"
+.SH DESCRIPTION
+Add LINE to the end of FILE if this file does not contain this line
+already. If PATTERN is given, then the LINE is only appended if
+PATTERN is not found in the file.
+
+If PATTERN is not given, LINE is used instead for matching a line in
+FILE. Then LINE may also contain the anchors '^' and '$' which
+are only treated specialy at the beginning or end of the pattern and
+are used for matching, not when adding the line. Additionaly,
+the following characters are escaped in LINE: ( ) +
+
+.SH OPTIONS
+.TP
+.B \-a
+Autocreate file if it does not exist.
+.TP
+.B \-D
+Create debugging output.
+.TP
+.B \-h
+Show help, version and summary of options.
+.TP
+.BI "\-n "
+Print the actions, but do not execute them.
+.TP
+.BI "\-Q "
+Quote all metacharacters in pattern. Uses perl's \\Q function.
+.TP
+.BI "\-q "
+Quote * and + metacharacters in pattern.
+.TP
+.BI "\-s "
+Convert white space in LINE or PATTERN to '\\s+' regexp for matching.
+.TP
+.B \-v
+Create verbose output.
+.SH EXAMPLES
+.br
+ainsl -v /etc/fstab '/dev/fd0  /floppy  auto  users,noauto 0 0'
+
+Append the entry for the floppy device to /etc/fstab, if this line
+isn't already inlcuded.
+
+ainsl -s /etc/exports '/srv/www @linuxhosts(async,rw) backup(async,ro)'
+
+Add exports entry without exactly matching spaces.
+
+.SH NOTES
+This is a similar function to AppendIfNoSuchLine from cfengine(8).
+.SH SEE ALSO
+.br
+This program is part of FAI (Fully Automatic Installation).  See the FAI manual
+for more information on how to use ainsl.  The FAI homepage is http://www.informatik.uni-koeln.de/fai.
+
+.SH AUTHOR
+Thomas Lange <lange at informatik.uni-koeln.de>

Added: branches/lhm/man/fai-cd.8
===================================================================
--- branches/lhm/man/fai-cd.8	                        (rev 0)
+++ branches/lhm/man/fai-cd.8	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,121 @@
+.\"                                      Hey, EMACS: -*- nroff -*-
+.if \n(zZ=1 .ig zZ
+.if \n(zY=1 .ig zY
+.TH fai-cd 8 "6 september 2008" "FAI 3.2.10"
+.\" Please adjust this date whenever revising the manpage.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh        disable hyphenation
+.\" .hy        enable hyphenation
+.\" .ad l      left justify
+.\" .ad b      justify to both left and right margins
+.\" .nf        disable filling
+.\" .fi        enable filling
+.\" .br        insert line break
+.\" .sp <n>    insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.de }1
+.ds ]X \&\\*(]B\\
+.nr )E 0
+.if !"\\$1"" .nr )I \\$1n
+.}f
+.ll \\n(LLu
+.in \\n()Ru+\\n(INu+\\n()Iu
+.ti \\n(INu
+.ie !\\n()Iu+\\n()Ru-\w\\*(]Xu-3p \{\\*(]X
+.br\}
+.el \\*(]X\h|\\n()Iu+\\n()Ru\c
+.}f
+..
+.\"
+.\" File Name macro.  This used to be `.PN', for Path Name,
+.\" but Sun doesn't seem to like that very much.
+.\"
+.de FN
+\fI\|\\$1\|\fP
+..
+.SH NAME
+fai-cd \- make a bootable CD-ROM or USB stick that performs an FAI
+.SH SYNOPSIS
+.B fai-cd
+[\fIOPTION\fR] -m MIRROR \fIFILE\fR
+.br
+.B fai-cd
+[\fIOPTION\fR] -m MIRROR \fI-u DIRECTORY\fR
+.br
+.SH DESCRIPTION
+This command creates a bootable ISO CD-ROM image that performs the
+fully automatic installation from CD-ROM without an install server. The
+ISO image will be written to FILE. To create the image, the
+command needs the NFSROOT, the configuration space and a partial
+mirror, which is created by fai-mirror. The command can also copy all
+needed data to DIRECTORY on a mounted USB stick.
+.SH OPTIONS
+.TP
+.BI \-b
+After creating the ISO image burn it by calling cdrecord(1).
+.TP
+.B \-C CFDIR
+Use CFDIR as the configuration directory. Default is /etc/fai. You can
+also set the environment variable FAI_ETC_DIR.
+.TP
+.BI \-f
+Force removal of an existing ISO image before creating a new one.
+.TP
+.BI "\-g " FILE
+Use FILE as grub menu.lst file. The script will looks for FILE in CFDIR.
+If FILE is located in another directory then a full path
+must be specified. If not specified, use /etc/fai/menu.lst.
+.TP
+.BI \-h
+Show simple help and version.
+.TP
+.BI \-k
+Keep the temporary filesystem for debugging. The script will sleep for
+a long time, before continuing the cleanup of temp files and
+mounts. Beware of killing or suspending the script itself, since a lot
+of mounts will remain. This is for debugging only!
+.TP
+.BI "\-m " DIRECTORY
+Use DIRECTORY as partial FAI mirror. This option is mandatory.
+.TP
+.BI \-n
+No ISO image. Do not call mkisofs to create the ISO image. This is for
+creating the filesystem only. Useful for writing it to a USB stick.
+.TP
+.BI "\-u " DIRECTORY
+Create a bootable USB stick. The USB stick must be mounted on
+DIRECTORY before you run fai-cd. Copies all FAI-CD data to DIRECTORY
+and try to install grub onto its device. Currently the file system
+on the USB stick must be ext2. USUALLY THIS WILL ERASE ALL DATA ON YOUR USB-STICK!
+
+.SH EXAMPLES
+.br
+After you've created a mirror with fai-mirror in /media/mirror, you
+can create a CD using:
+
+   # fai-cd -m /media/mirror fai-cd.iso
+
+If you want to create a bootable USB stick, create an ext2 file system
+on your stick, mount it to /media/usbstick and call
+
+   # fai-cd -m /media/mirror -u /media/usbstick
+   # umount /media/usbstick
+
+.SH SEE ALSO
+.br
+This program is part of FAI (Fully Automatic Installation).
+The FAI homepage is http://www.informatik.uni-koeln.de/fai. 
+.TP
+\fBfai-mirror\fP(1)
+.PD
+.SH FILES
+.PD 0
+.TP
+.FN /etc/fai/fai.conf
+The FAI configuration file.
+.TP
+.FN /etc/fai/menu.lst
+The default grub menu configuration file for fai-cd.
+.SH AUTHOR
+Thomas Lange <lange at informatik.uni-koeln.de>

Added: branches/lhm/man/fai-chboot.8
===================================================================
--- branches/lhm/man/fai-chboot.8	                        (rev 0)
+++ branches/lhm/man/fai-chboot.8	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,187 @@
+.\"                                      Hey, EMACS: -*- nroff -*-
+.TH fai-chboot 8 "16 September 2008" "FAI 3.2"
+.\"
+.\" File Name macro.  This used to be `.PN', for Path Name,
+.\" but Sun doesn't seem to like that very much.
+.\"
+.de FN
+\fI\|\\$1\|\fP
+..
+
+.SH NAME
+fai-chboot \- manage the network boot configuration files
+.SH SYNOPSIS
+.B fai-chboot
+[OPTION]... KERNELNAME HOST...
+.br
+.B fai-chboot
+-l[e|d|t|o|g] [PATTERN]
+.br
+.B fai-chboot
+-e HOST...
+.br
+.B fai-chboot
+-d HOST...
+.br
+.B fai-chboot
+-c HOST|TEMPLATE HOST|TEMPLATE...
+.br
+.B fai-chboot
+-i [OPTION]... HOST...
+.br
+.B fai-chboot
+-I [OPTION]... HOST...
+.SH DESCRIPTION
+This command creates the configuration files for network booting using
+pxelinux and DHCP.
+
+KERNELNAME is the file name of the kernel that will be booted. This
+kernel will mount the root filesystem via NFS. You can add
+additional kernel parameters and define some FAI specific flags. For
+each host one configuration file is created. The file name of the
+configuration file is its IP address in upper case hexadecimal. HOST
+can be a host name, an IP address or the keyword "default".
+
+.SH OPTIONS
+.TP
+.BI \-B
+Set default values for FAI_FLAGS. This is the same as -f
+verbose,sshd,reboot
+.TP
+.B \-c
+Copy an existing config file to one or more hosts or templates and enable
+them for network booting.
+.TP
+.BI "\-C " CFDIR
+Use CFDIR as the configuration directory. Default is /etc/fai. You can
+also set the environment variable FAI_ETC_DIR.
+.TP
+.BI "\-D " DIR
+Set the directory for the network boot configuration to
+DIR. The default value is /srv/tftp/fai/pxelinux.cfg/.
+.TP
+.B \-d
+Disable network booting for HOST. This renames the config file adding
+the suffix .disable to it.
+.TP
+.B \-e
+Reenable network booting for HOST. This renames the config file removing
+the suffix .disable from it, so the next time it uses the PXE configuration.
+.TP
+.BI "\-f " fai_flags
+Set FAI_FLAGS. The flags must be comma separated.
+.TP
+.BI \-F
+Set default values for FAI_FLAGS. This is the same as -f
+verbose,sshd,createvt
+.TP
+.B \-h
+Show simple help and version.
+.TP
+.B \-i
+Set parameters for booting the FAI install kernel. Same as -k "ip=dhcp" vmlinuz-install /dev/nfs. This does not set FAI_ACTION.
+.TP
+.B \-I
+Same as -i but also sets FAI_ACTION=install. So a fully automatic
+installation will be performed. ATTENTION! This will erase most of the
+data on the local disks of the install clients.
+.TP
+.BI "\-k " parameters
+Set kernel append parameters.
+.TP
+.B \-l
+List the configuration for all hosts in short format. If PATTERN is
+given, list only hosts matching PATTERN. Lists hostname, FAI_ACTION,
+kernel name and IP address in hex. Use \fB\-le\fR, to list only enabled hosts,
+\fB-ld\fR to list only disabled hosts, \fB-lt\fR to list only templates,
+\fB-lo\fR to list only hosts that do not match any of the
+previous categories, and \fB-lg\fR to list the configuration for all hosts,
+sorted and ordered by groups (enabled, disabled, templates, others).
+Note that a combination of multiple \fB-l\fR options is not supported and that
+in listing mode no other action will be performed.
+.TP
+.B \-L
+List the configuration for all hosts. Also list the kernel append parameters.
+If PATTERN is given, list only hosts matching PATTERN.
+.TP
+.B \-n
+Do not create configuration but show what would be done. This also
+enables the verbose flag.
+.TP
+.BI \-o
+Do localboot via PXE. Do not boot via network card, but use next boot
+device which is specified in the BIOS. Normally this is the local disk.
+.TP
+.B \-p
+Preserve existing config files. The default is to overwrite an
+existing config file.
+.TP
+.BI "\-s" SUFFIX
+Use SUFFIX to determine which kernel and initrd to use.
+.TP
+.BI \-S
+Same as -i but also sets FAI_ACTION=sysinfo.
+.TP
+.B \-v
+Create verbose output.
+.SH EXAMPLES
+.TP
+fai-chboot -l
+List the configuration for all hosts.
+.TP
+fai-chboot -iFv atom02 atom03 dom kueppers
+The hosts atom02, atom03, dom and kueppers will boot the FAI install
+kernel. FAI_ACTION will not be set unless specified with option
+-k or -I. You can also use the script class/LAST.var on the install server
+to set FAI_ACTION.
+.TP
+fai-chboot -FSv atom02
+The host atom02 will boot the FAI install kernel but with FAI_ACTION sysinfo.
+.TP
+fai-chboot -IBv atom02
+The host atom02 will be installed. ATTENTION! All data on the local
+hard disks are lost in most cases, because we want to install a new
+system. After the installation the host automatically reboots.
+.TP
+fai-chboot -v atom-localboot atom03 
+Next time atom03 will boot the kernel atom-localboot.
+.TP
+fai-chboot -vS -s2.6.18-4-amd64 faiserver
+Booting kernel vmlinuz-2.6.18-4-amd64
+ append initrd=initrd.img-2.6.18-4-amd64 ip=dhcp   
+
+faiserver has 1.2.3.4 in hex 01020304
+.br
+Writing file /srv/tftp/fai/pxelinux.cfg/01020304 for faiserver
+.TP
+fai-chboot memtest86+ atom02
+The host atom02 will boot the memory test. Install the package
+memtest86+ and copy the executable memtest86+.bin to /srv/tftp/fai
+without the .bin suffix.
+.TP
+fai-chboot -o default
+All hosts, that do not have a PXE configuration for their IP-address
+will do a localboot, i.e. booting from local disk.
+.TP
+fai-chboot -vc lenny64 james007
+This command will tell the host james007 to use the template called lenny64.
+Beforehand, you have to manually create the template 
+and save it to /srv/tftp/fai/pxelinux.cfg/lenny64.tmpl.
+
+
+.SH NOTES
+Currently only PXE boot is supported. BOOTP configuration can be
+managed using the tlink utility.
+
+.SH SEE ALSO
+.br
+\fBfai-mirror\fP(1)
+.TP
+.FN /usr/share/doc/syslinux/pxelinux.doc.gz
+The pxelinux documentation.
+.TP
+
+This program is part of FAI (Fully Automatic Installation). See the FAI manual for more information on how to use fai-chboot. The FAI homepage is http://www.informatik.uni-koeln.de/fai.
+
+.SH AUTHOR
+Thomas Lange <lange at informatik.uni-koeln.de>

Added: branches/lhm/man/fai-class.1
===================================================================
--- branches/lhm/man/fai-class.1	                        (rev 0)
+++ branches/lhm/man/fai-class.1	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,147 @@
+.\" Hey, EMACS: -*- nroff -*-
+.\" Please adjust this date whenever revising the manpage.
+.\" 
+.\" Some roff macros, for reference:
+.\" .nh        disable hyphenation
+.\" .hy        enable hyphenation
+.\" .ad l      left justify
+.\" .ad b      justify to both left and right margins
+.\" .nf        disable filling
+.\" .fi        enable filling
+.\" .br        insert line break
+.\" .sp <n>    insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.TH "fai-class" "1" "15 September 2008" "FAI 2.5" ""
+.SH "NAME"
+fai\-class \- define classes using files and scripts.
+.SH "SYNOPSIS"
+.B fai\-class
+.RI [OPTION] " DIRECTORY CLASSFILE"
+.SH "DESCRIPTION"
+fai\-class executes scripts in DIRECTORY to define classes. All classes
+are written to CLASSFILE, each class on a separate line. Use absolute paths
+for both arguments. All scripts or executables matching "[0\-9][0\-9]*"
+are executed in alphabetical order. They can define classes by writing
+the names of the classes to stdout. Classes can be separated by spaces
+or written one on a line. All lines that start with a "#" are comment
+lines and are ignored.
+
+Shell scripts that end in ".source" are sourced and can define classes
+by setting the variable $newclasses. This is useful for scripts where
+you can't control stdout. Variables that are defined in these scripts
+are available to other scripts in DIRECTORY, but they are not exported
+to the shell that calls fai\-class.
+
+All scripts can define additional classes by writing the classes to the
+file $LOGDIR/additional\-classes. These classes are defined after all
+scripts are executed. This temporary file will be removed
+after use.
+
+The order of the classes is important because it defines the priority
+of the classes from low to high. First, the class DEFAULT is
+defined. Then all scripts are executed to define classes. After that,
+the classes from the file $LOGDIR/additional\-classes are added. Then,
+all classes in the file with the hostname are added. Finally, the
+class with the hostname and LAST are defined.
+
+It's important that each line in a file containg a class name ends
+with a newline. If the newline is missing on the last line of a file,
+this class can't be added.
+
+The exit code of every script is written to the file status.log in LOGDIR.
+
+.SH "OPTIONS"
+.TP 
+.B \-d
+Create debugging output.
+.TP 
+.B \-h
+Show help, version and summary of options.
+.TP 
+.B \-T
+Test if classes in CLASSFILE are defined multiple times. This should
+never happen. The test is executed after the classes are defined.
+.TP 
+.B \-t tmpdir
+The file additional\-classes is read from the directory tmpdir. Default
+value is /tmp/fai/.
+.TP 
+.B \-v
+Create verbose output.
+
+
+.SH "EXAMPLES"
+.br 
+In FAI, fai\-class is used in the following way: 
+
+   # fai\-class /fai/class /tmp/fai/FAI_CLASSES
+
+Then a list of all classes is defined in a shell script using
+the following command:
+
+    classes=`cat /tmp/fai/FAI_CLASSES`
+
+.SH "EXAMPLES FOR SCRIPTS"
+.ta 40n
+.sp
+.nf 
+
+This is the script 01alias:
+
+#! /bin/sh
+
+catnc() { # cat but no comment lines
+    grep \-v "^#" $1
+}
+# echo architecture in upper case
+dpkg \-\-print\-installation\-architecture | tr /a\-z/ /A\-Z/
+uname \-s | tr /a\-z/ /A\-Z/
+
+# all hosts named ant?? use the classes in file anthill
+case $HOSTNAME in
+    ant??) catnc anthill ;;
+esac
+
+# a Beowulf cluster; all nodes except the master node
+# use classes from file class/atoms
+case $HOSTNAME in
+    atom00) echo BEOWULF_MASTER ;;
+    atom??) catnc atoms ;;
+esac
+
+# if host belongs to class C subnet 123.45.6.0 use class NET_6
+case $IPADDR in
+    123.45.6.*) echo NET_6 ;;
+esac
+
+
+Another EXAMPLE:
+
+The script 24nis:
+
+#! /bin/sh
+
+# add NIS and the NIS domain name if YPDOMAIN is defined
+
+if [ \-n "$YPDOMAIN" ];then
+   echo "NIS $YPDOMAIN" | tr /.a\-z\-/ /_A\-Z_/
+else
+   echo NONIS
+fi
+.sp
+.fi 
+.PP 
+.SH "NOTES"
+All class names should be written in uppercase letters (execpt the
+class of the hostname). Do not use a dash, use an underscore. Only
+executable scripts in DIRECTORY are used. CLASSFILE is removed before
+writing to it. Scripts should not directly write to CLASSFILE. LOGDIR
+should not be writable for everybody.
+
+.SH "SEE ALSO"
+.br 
+This program is part of FAI (Fully Automatic Installation). The FAI
+homepage is http://www.informatik.uni\-koeln.de/fai.
+
+.SH "AUTHOR"
+Written by Thomas Lange <lange at informatik.uni\-koeln.de>

Added: branches/lhm/man/fai-debconf.1
===================================================================
--- branches/lhm/man/fai-debconf.1	                        (rev 0)
+++ branches/lhm/man/fai-debconf.1	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,53 @@
+.\" Hey, EMACS: -*- nroff -*-
+.\" Please adjust this date whenever revising the manpage.
+.\" 
+.\" Some roff macros, for reference:
+.\" .nh        disable hyphenation
+.\" .hy        enable hyphenation
+.\" .ad l      left justify
+.\" .ad b      justify to both left and right margins
+.\" .nf        disable filling
+.\" .fi        enable filling
+.\" .br        insert line break
+.\" .sp <n>    insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.TH "fai-debconf" "1" "23 September 2008" "FAI 3" ""
+.SH "NAME"
+fai\-debconf \- set debconf values using classes
+.SH "SYNOPSIS"
+.B fai\-debconf
+.RI [OPTION] " DIRECTORY"
+.SH "DESCRIPTION"
+fai\-debconf reads files in DIRECTORY which are also a defined
+class. If the name of the class is a directory, all files in this
+directory are read. The files must have the format of debconf\-get\-selections(1).
+All this input is used to call debconf\-set\-selections(1). This is done
+in the chroot environment, if the variable $ROOTCMD is set. After
+setting the debconf values, dpkg\-reconfigure(8) is called for every
+package which is installed and for which some debconf data was set.
+
+.SH "OPTIONS"
+.TP 
+.B \-h
+Show help, version and summary of options.
+.TP 
+.B \-s
+Skip reconfiguration of packages. Only set values in debconf database.
+.TP 
+.B \-v
+Create verbose output.
+.TP 
+.B \-f
+Run dpkg\-reconfigure for all packages FAI has information on, not only for
+those whose database entries were modified.
+.SH "SEE ALSO"
+.BR debconf\-get\-selections (1),
+.BR debconf\-set\-selections (1),
+.BR dpkg\-reconfigure (8)
+
+.br 
+This program is part of FAI (Fully Automatic Installation). The FAI
+homepage is http://www.informatik.uni\-koeln.de/fai.
+
+.SH "AUTHOR"
+Written by Thomas Lange <lange at informatik.uni\-koeln.de>

Added: branches/lhm/man/fai-do-scripts.1
===================================================================
--- branches/lhm/man/fai-do-scripts.1	                        (rev 0)
+++ branches/lhm/man/fai-do-scripts.1	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,54 @@
+.\" Hey, EMACS: -*- nroff -*-
+.\" Please adjust this date whenever revising the manpage.
+.\" 
+.\" Some roff macros, for reference:
+.\" .nh        disable hyphenation
+.\" .hy        enable hyphenation
+.\" .ad l      left justify
+.\" .ad b      justify to both left and right margins
+.\" .nf        disable filling
+.\" .fi        enable filling
+.\" .br        insert line break
+.\" .sp <n>    insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.TH "fai-do-scripts" "1" "1 December 2008" "FAI 2.8" ""
+.SH "NAME"
+fai\-do\-scripts \- call configuration scripts
+.SH "SYNOPSIS"
+.B fai\-do\-scripts
+.RI [OPTION] " DIRECTORY"
+.SH "DESCRIPTION"
+fai\-do\-scripts executes all scripts in DIRECTORY which are also a
+defined class. If the name of the class is a directory, all scripts
+that match `[0\-9][0\-9]*' in this directory are executed.  So it is
+possible to have several scripts of different types (shell,
+cfengine,...) be executed for one class.
+
+For backwards compatibility, scripts matching `S[0\-9]*' are also
+executed, but a warning is printed.
+This will be removed in a future version.
+
+.SH "OPTIONS"
+.TP 
+.B \-h
+Show help, version and summary of options.
+.TP 
+.B \-L DIR
+Write log files to DIR.
+.TP 
+.B \-n
+Show type of scripts that would be executed, but do not execute them.
+
+.SH "EXAMPLES"
+.br 
+In FAI, fai\-do\-scripts is used in the following way: 
+
+   # fai\-do\-scripts /fai/scripts
+
+.SH "SEE ALSO"
+.br 
+This program is part of FAI (Fully Automatic Installation). The FAI
+homepage is http://www.informatik.uni\-koeln.de/fai.
+
+.SH "AUTHOR"
+Written by Thomas Lange <lange at informatik.uni\-koeln.de>

Added: branches/lhm/man/fai-mirror.1
===================================================================
--- branches/lhm/man/fai-mirror.1	                        (rev 0)
+++ branches/lhm/man/fai-mirror.1	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,137 @@
+.\"                                      Hey, EMACS: -*- nroff -*-
+.if \n(zZ=1 .ig zZ
+.if \n(zY=1 .ig zY
+.TH fai-mirror 1 "1 December 2008" "FAI 3.2"
+.\" Please adjust this date whenever revising the manpage.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh        disable hyphenation
+.\" .hy        enable hyphenation
+.\" .ad l      left justify
+.\" .ad b      justify to both left and right margins
+.\" .nf        disable filling
+.\" .fi        enable filling
+.\" .br        insert line break
+.\" .sp <n>    insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.de }1
+.ds ]X \&\\*(]B\\
+.nr )E 0
+.if !"\\$1"" .nr )I \\$1n
+.}f
+.ll \\n(LLu
+.in \\n()Ru+\\n(INu+\\n()Iu
+.ti \\n(INu
+.ie !\\n()Iu+\\n()Ru-\w\\*(]Xu-3p \{\\*(]X
+.br\}
+.el \\*(]X\h|\\n()Iu+\\n()Ru\c
+.}f
+..
+.\"
+.\" File Name macro.  This used to be `.PN', for Path Name,
+.\" but Sun doesn't seem to like that very much.
+.\"
+.de FN
+\fI\|\\$1\|\fP
+..
+.SH NAME
+fai-mirror \- create and manage a partial mirror for FAI
+
+.SH SYNOPSIS
+.B fai-mirror
+.RI [OPTION]... 
+DIRECTORY
+.br
+
+.SH DESCRIPTION
+This command creates a partial mirror of Debian packages. It can
+be used to create the fai CD or as a local mirror when you can't
+download the whole Debian mirror. By default the mirror will contain
+all packages of all classes used in the configuration space (/srv/fai/config/package_config).
+
+.SH OPTIONS
+.TP
+.BI \-B
+Do not add packages included in base.tgz and packages defined in
+make-fai-nfsroot.conf to the mirror. By default all these packages are
+included in the mirror.
+.TP
+.B \-C CFDIR
+Use CFDIR as the configuration directory. Default is /etc/fai. You can
+also set the environment variable FAI_ETC_DIR.
+.TP
+.BI "\-c " CLASS[,CLASS]
+Use only this list of classes for building the mirror. Can't be used
+in conjunction with -x.
+.TP
+.BI \-h
+Show simple help and version.
+.TP
+.BI "\-x " CLASS[,CLASS]
+Exclude these classes. Do not add the packages of these classes to
+the mirror.
+.TP
+.B \-p
+Preserve existing sources.list. NOT YET IMPLEMENTED.
+.TP
+.B \-v
+Create verbose output.
+
+.SH EXAMPLES
+.br
+   # fai-mirror -v /files/scratch/mirror
+
+Creates a partial mirror in the directory /files/scratch/mirror
+using all classes.
+
+   # fai-mirror -v -cDEFAULT,DEMO /debmirror
+
+Creates a partial mirror containing all packages used in the classes
+DEFAULT and DEMO.
+
+
+.SH NOTES
+You only need root permissions if you access the official Debian
+mirror via NFS. By default, the variable MAXPACKAGES is set to 1, so
+conflicting packages can also be added to the mirror. Setting
+this to a higher number (e.g. 99999) reduces the time for creating the
+mirror, but some packages may be missing.
+
+.SH SEE ALSO
+.br
+This program is part of FAI (Fully Automatic Installation).
+The FAI homepage is http://www.informatik.uni-koeln.de/fai. 
+.TP
+\fBmake-fai-nfsroot\fP(8), \fBinstall_packages\fP(8)
+.PD
+
+.SH FILES
+.PD 0
+.TP
+.FN /etc/fai/fai.conf
+The FAI configuration file.
+
+.TP
+.FN /etc/fai/make-fai-nfsroot.conf
+The FAI configuration file for the nfsroot.
+.TP
+
+.FN /etc/fai/apt/sources.list
+Package resource definition for FAI.
+.TP
+
+.FN /srv/fai/config/package_config/
+The FAI package configuration directory. This directory is defined by
+the variable FAI_CONFIGDIR.
+.TP
+
+.FN $NFSROOT/var/tmp/base-pkgs.lis
+The list of packages included in base.tgz inside the nfsroot.
+.TP
+
+.FN $NFSROOT/var/tmp/packages.nfsroot
+Additional packages that were added to the nfsroot by the
+configuration file /etc/fai/NFSROOT.
+
+.SH AUTHOR
+Thomas Lange <lange at informatik.uni-koeln.de>

Added: branches/lhm/man/fai-setup.8
===================================================================
--- branches/lhm/man/fai-setup.8	                        (rev 0)
+++ branches/lhm/man/fai-setup.8	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,84 @@
+.\"                                      Hey, EMACS: -*- nroff -*-
+.if \n(zZ=1 .ig zZ
+.if \n(zY=1 .ig zY
+.TH fai-setup 8 "11 November April 2007" "FAI 3.2"
+.\" Please adjust this date whenever revising the manpage.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh        disable hyphenation
+.\" .hy        enable hyphenation
+.\" .ad l      left justify
+.\" .ad b      justify to both left and right margins
+.\" .nf        disable filling
+.\" .fi        enable filling
+.\" .br        insert line break
+.\" .sp <n>    insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.de }1
+.ds ]X \&\\*(]B\\
+.nr )E 0
+.if !"\\$1"" .nr )I \\$1n
+.}f
+.ll \\n(LLu
+.in \\n()Ru+\\n(INu+\\n()Iu
+.ti \\n(INu
+.ie !\\n()Iu+\\n()Ru-\w\\*(]Xu-3p \{\\*(]X
+.br\}
+.el \\*(]X\h|\\n()Iu+\\n()Ru\c
+.}f
+..
+.\"
+.\" File Name macro.  This used to be `.PN', for Path Name,
+.\" but Sun doesn't seem to like that very much.
+.\"
+.de FN
+\fI\|\\$1\|\fP
+..
+.SH NAME
+fai-setup \- Setup script for Fully Automatic Installation (FAI)
+.SH SYNOPSIS
+.B fai-setup
+.SH DESCRIPTION
+Fully Automatic Installation (FAI) is used to provide unattended installation of
+Debian GNU/Linux operating systems with a very flexible class-based system.
+fai-setup is a shell script written for FAI to create the initial NFSROOT
+directory, add that directory to the NFS exports configuration file
+(/etc/exports), prepare the files as necessary to create the network boot floppy
+disk, and create the initial fai user that is used for copying over the installation
+logs to a centralized directory on the server.  make-fai-nfsroot(8) is called
+to create the initial NFS root directory.
+
+fai-setup should be called after each change to /etc/fai/fai.conf.
+.PD
+.SH OPTIONS
+.TP
+All options are also passed to make-fai-nfsroot.
+.TP
+.B \-C CFDIR
+Use CFDIR as configuration directory. Default is /etc/fai. You can
+also set the environment variable FAI_ETC_DIR.
+.TP
+.B \-e
+Expert mode. Do not add entries to /etc/export and do not restart the nfs nserver.
+.SH SEE ALSO
+.PD 0
+This program is part of FAI (Fully Automatic Installation).  See the FAI manual
+for more information on how to use fai-setup.  The FAI homepage is
+http://www.informatik.uni-koeln.de/fai.
+.TP
+\fImake-fai-nfsroot\fP(8), \fIexports\fP(5)
+.PD
+.SH FILES
+.PD 0
+.TP
+.FN /etc/fai/fai.conf
+The FAI configuration file.
+.TP
+.FN /etc/fai/make-fai-nfsroot.conf
+The configuration file for make-fai-nfsroot.
+.TP
+.FN /etc/exports
+The NFS configuration file for exported filesystems.
+
+.SH AUTHOR
+Thomas Lange <lange at informatik.uni-koeln.de>

Added: branches/lhm/man/fai-start-stop-daemon.8
===================================================================
--- branches/lhm/man/fai-start-stop-daemon.8	                        (rev 0)
+++ branches/lhm/man/fai-start-stop-daemon.8	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,29 @@
+.\"                                      Hey, EMACS: -*- nroff -*-
+.TH fai-start-stop-damon 8 "july 2003" "FAI 2.5"
+.\" Please adjust this date whenever revising the manpage.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh        disable hyphenation
+.\" .hy        enable hyphenation
+.\" .ad l      left justify
+.\" .ad b      justify to both left and right margins
+.\" .nf        disable filling
+.\" .fi        enable filling
+.\" .br        insert line break
+.\" .sp <n>    insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.SH NAME
+fai-start-stop-damon \- a fake of the start-stop-daemon command
+.SH SYNOPSIS
+.B fai-start-stop-damon
+.SH DESCRIPTION
+
+This commands returns the same exit code as start-stop-daemon(8), but
+does not start any daemons.
+
+.SH SEE ALSO
+.br
+This program is part of FAI (Fully Automatic Installation).  See the FAI manual
+for more information on how to use ftar.  The FAI homepage is http://www.informatik.uni-koeln.de/fai.
+.SH AUTHOR
+Thomas Lange <lange at informatik.uni-koeln.de>

Added: branches/lhm/man/fai-statoverride.8
===================================================================
--- branches/lhm/man/fai-statoverride.8	                        (rev 0)
+++ branches/lhm/man/fai-statoverride.8	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,19 @@
+.\"                                      Hey, EMACS: -*- nroff -*-
+.TH fai-statoverride 8 "3 Sep 2008" "FAI 3.2"
+
+.SH NAME
+fai-statoverride \- dpkg-statoverride for multiple files
+.SH SYNOPSIS
+.B fai-statoverride FILE ...
+.SH DESCRIPTION
+Override owner and mode of a file or directory. Calls
+dpkg-statoverride with multiple files. This command is
+idempotent.
+.SH SEE ALSO
+.TP
+\fIdpkg-statoverride\fP(8)
+.P
+.br
+This program is part of FAI (Fully Automatic Installation).
+.SH AUTHOR
+Thomas Lange <lange at informatik.uni-koeln.de>

Added: branches/lhm/man/fai.8
===================================================================
--- branches/lhm/man/fai.8	                        (rev 0)
+++ branches/lhm/man/fai.8	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,143 @@
+.\"                                      Hey, EMACS: -*- nroff -*-
+.TH fai 8 "6 September 2008" "FAI 3.2"
+.\" Please adjust this date whenever revising the manpage.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh        disable hyphenation
+.\" .hy        enable hyphenation
+.\" .ad l      left justify
+.\" .ad b      justify to both left and right margins
+.\" .nf        disable filling
+.\" .fi        enable filling
+.\" .br        insert line break
+.\" .sp <n>    insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.SH NAME
+fai \- fully automatic installation
+.SH SYNOPSIS
+.B fai
+.RI [ options ] " ACTION"
+.br
+.B fai
+.RI [ options ] " dirinstall DIRECTORY"
+.SH DESCRIPTION
+fai starts an fai-action, e.g. an installation or a softupdate.
+If the variable FAI_ACTION is defined, this action will be
+performed. The command line argument will override the value of
+FAI_ACTION. You can also define your own actions which will be
+executed when specified.
+.SH OPTIONS
+.TP
+ACTION is required.
+.TP
+.B \-C CFDIR
+Use CFDIR as the configuration directory. Default is /etc/fai.
+.TP
+.BI "\-c|\-\-class " class[,class]
+Define classes.  Multiple classes must be comma separated.  If not
+specified, use the shell environment variable $classes (space
+separated).  The first class has lowest priority.
+.TP
+.B \-h|\-\-help
+Show help, version and summary of options.
+.TP
+.B \-N|\-\-new
+Renew the list of defined classes. By default, FAI uses the list of
+classes which was created during the first installation and skips
+calling fai-class(1). You need this option for the first 
+softupdate if the system was not installed with FAI, you can also use
+it in subsequent runs.
+.TP
+.B \-u|\--hostname <HOSTNAME>
+Use this hostname instead the output of the hostname command. This is
+useful in conjunction with the dirinstall action, where you
+want to manually define a hostname that should be used for
+defining classes and for the network setup and other stuff. There, you
+don't want the name of the host where you run fai
+dirinstall to be used - because programs in a chroot, or in a
+virtualized OS instance should run with their own name, and install
+their own set of classes.
+.TP
+.B \-v|\-\-verbose
+Create verbose output.
+.SH ACTIONS
+.TP
+.B install
+starts a fully automatic installation:
+.RS
+.IP 1. 3
+setup the fai environment (create ramdisk, get configuration data,...) 
+.IP 2. 3
+define classes and variables
+.IP 3. 3
+partition the local hard disk and create file systems
+.IP 4. 3
+install new software packages
+.IP 5. 3
+call configuration scripts
+.IP 6. 3
+check and save the logfiles
+.RE
+
+.TP
+.B sysinfo
+starts a system rescue:
+.RS
+.IP 1. 3
+setup the fai environment (create ramdisk, get configuration data,...) 
+.IP 2. 3
+define classes and variables
+.IP 3. 3
+do different types of hardware detection and print hardware info
+.IP 4. 3
+save the logfiles
+.RE
+
+.TP
+.B softupdate
+starts a softupdate:
+.RS
+.IP 1. 3
+fetch FAI configuration according to /etc/fai/fai.conf 
+.IP 2. 3
+define classes and variables
+.IP 3. 3
+update the installed packages
+.IP 4. 3
+install new software
+.IP 5. 3
+call configuration scripts
+.IP 6. 3
+check and save the logfiles
+.RE
+
+.TP
+.B dirinstall [DIR]
+Installation into a directory. This is nearly the same action as
+install except for skipping the task that partitions the hard disks and
+creates the file systems. Classes can be defined with option -c, or by
+giving the hostname with -u or --hostname and enabling automatic definition
+by class scripts from hostname with -N. (Without -N class scripts aren't
+executed)
+
+.SH NOTES
+Running with action "install" on a running system will almost
+certainly destroy it.
+.SH EXAMPLES
+
+   fai -v dirinstall /srv/etchroot -cDEFAULT,FAIBASE,LAST
+
+This command will do an installation into the directory
+/src/etchroot. For defining variables, selecting the software packages
+and calling the customization script the classes DEFAULT, FAIBASE and
+LAST are used.
+
+.SH SEE ALSO
+.br
+This program is the central part of FAI (Fully Automatic Installation).  See 
+the FAI manual for more information on how to use FAI. 
+The FAI homepage is http://www.informatik.uni-koeln.de/fai.
+
+.SH AUTHOR
+This manual page was written by Henning Glawe
+<glaweh at physik.fu-berlin.de> and Thomas Lange <lange at informatik.uni-koeln.de>.

Added: branches/lhm/man/faimond-gui.1
===================================================================
--- branches/lhm/man/faimond-gui.1	                        (rev 0)
+++ branches/lhm/man/faimond-gui.1	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,22 @@
+.\"                                      Hey, EMACS: -*- nroff -*-
+.TH faimond-gui 1 "7 January 2009" "FAI 3.2"
+
+.SH NAME
+faimond-gui \- fai monitor daemon, graphical interface
+.SH SYNOPSIS
+.B faimond-gui FILE
+.SH DESCRIPTION
+.B faimond-gui
+Read faimond(8) messages from FILE and create a graphical table using
+PerlTk. Normally you call it this way:
+.P
+faimond | faimond-gui -
+.SH SEE ALSO
+.TP
+\fIfaimond\fP(8)
+.P
+.br
+This program is part of FAI (Fully Automatic Installation).  See the FAI manual
+for more information on how to use faimond.  The FAI homepage is http://www.informatik.uni-koeln.de/fai.
+.SH AUTHOR
+Thomas Lange <lange at informatik.uni-koeln.de>

Added: branches/lhm/man/faimond.8
===================================================================
--- branches/lhm/man/faimond.8	                        (rev 0)
+++ branches/lhm/man/faimond.8	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,49 @@
+.\"                                      Hey, EMACS: -*- nroff -*-
+.TH faimond 8 "7 January 2009" "FAI 3.2"
+
+.SH NAME
+faimond \- fai monitor daemon
+.SH SYNOPSIS
+.B faimond
+.SH DESCRIPTION
+.B faimond
+receives messages from all install clients on port 4711 and prints
+them to stdout.
+.SH OPTIONS
+.TP
+.B "-p " port
+Define port to listen on. Default is port 4711.
+.TP
+.B "-b "
+Call fai-chboot for the install client if the task install was finished
+properly. Default is not to call fai-chboot.
+.TP
+.B "-i"
+Use IP address of connecting host when calling fai-chboot. This can only be used
+if the host has the same IP while installing as when running.
+.TP
+.B "-l FILE"
+Logfile. Default is standard out in non-daemon mode and "/var/log/faimond.log"
+in daemon mode.
+.TP
+.B "-t TIMEOUT"
+Timeout for bad clients. 0 to disable.
+.TP
+.B "-d"
+Daemon mode.
+.TP
+.B "-P FILE"
+PID-file. Default is "/var/run/faimond.pid". Used only if starting in daemon
+mode.
+.TP
+.B "-T"
+Print timestamps in the log.
+.SH NOTES
+Normally, the output will be piped to faimond-gui, a GUI which displays
+all information.
+.SH SEE ALSO
+.br
+This program is part of FAI (Fully Automatic Installation).  See the FAI manual
+for more information on how to use faimond.  The FAI homepage is http://www.informatik.uni-koeln.de/fai.
+.SH AUTHOR
+Thomas Lange <lange at informatik.uni-koeln.de>

Added: branches/lhm/man/fcopy.8
===================================================================
--- branches/lhm/man/fcopy.8	                        (rev 0)
+++ branches/lhm/man/fcopy.8	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,226 @@
+.\"                                      Hey, EMACS: -*- nroff -*-
+.TH fcopy 8 "29 august 2008" "FAI 3.2"
+.\" Please adjust this date whenever revising the manpage.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh        disable hyphenation
+.\" .hy        enable hyphenation
+.\" .ad l      left justify
+.\" .ad b      justify to both left and right margins
+.\" .nf        disable filling
+.\" .fi        enable filling
+.\" .br        insert line break
+.\" .sp <n>    insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.SH NAME
+fcopy \- copy files using classes
+.SH SYNOPSIS
+.B fcopy
+.RI [ options ] " SOURCE" ...
+.SH DESCRIPTION
+Copy a file from SOURCE to its target using classes.
+It also sets permission modes, owner and group.
+Each SOURCE argument is a directory which contains one or more
+template files for the source file to copy.  Depending on the list of
+defined classes, one file of the source directory is selected and
+copied to the target.  The target filename is the name of the source
+directory.
+
+The exit code returned by fcopy is 0 if all files are copied
+successfully and >0 if an error occurs.  For every successfully copied
+file, a log message is printed to standard output.
+.SH OPTIONS
+.TP
+Options -c, -s, -t and a SOURCE are required. Usually -c, -s and -t
+are set via variables in FAI.
+.TP
+.B \-B
+Remove backup files with suffix .pre_fcopy. You can also set the
+environment variable FCOPY_NOBACKUP to 1.
+.TP
+.BI "\-b " dir
+Don't copy files to file.pre_fcopy, but use hierarchy under "dir" instead.
+The same effect is achieved by setting environment variable FAI_BACKUPDIR. 
+.TP
+.BI "\-c " class[,class]
+Define classes.  Multiple classes must be comma separated.  If not
+specified, use the shell environment variable $classes (space
+separated).  The first class has lowest priority.
+.TP
+.BI "\-C " file
+Read classes from \fIfile\fR.  Lines can contain multiple classes which 
+are space separated.  Lines starting with # are comments.
+.TP
+.BI \-d
+Delete target file if no class applies.
+.TP
+.B \-D
+Create debugging output.
+.TP
+.BI "\-F " file
+Read list of sources from \fIfile\fR.  One SOURCE per line.
+.TP
+.B \-h
+Show help, version and summary of options.
+.TP
+.B \-i
+Ignore warnings about no matching class and always exit with 0.
+.TP
+.BI "\-I " dir[,dir]
+Override list of ignored directories when recursing. If not given, it is 
+taken from $FCOPY_IGNOREDIRS and as a last chance an internal list of known
+revision control system's metadata is used (CVS, .cvs, {arch}, .arch\-ids).
+.TP
+.B \-l
+Do not copy if destination is a symbolic link
+.TP
+.BI "\-L " file
+Log SOURCE and used class to \fIfile\fR.  Output format is
+.br
+SOURCE CLASS COMMENT
+.br
+where COMMENT gives some information about why the file has been 
+preserved (especially useful in combination with -P). If not specified and
+$LOGDIR is set, use $LOGDIR/fcopy.log.
+.TP
+.BI "\-m " user,group,mode
+Set user, group and mode for all copied files (mode as octal number, user and
+group numeric id or name).  If not specified, use file file-modes or data of source file.
+.TP
+.BI "\-M "
+Use default values for user, group and mode.  This is equal to -m root,root,0644
+.TP
+.BI "\-n "
+Print the commands, but do not execute them. This is like --dry-run in
+other programs. You can enable it for all calls of fcopy by setting
+the environment variable $FCOPY_DRYRUN.
+.TP
+.BI "\-P " plog,changes
+Don't compare files literally, but use information from files \fIplog\fR and \fIchanges\fR:
+A file is overwritten when either another class applies (\fIplog\fR is a
+log generated with -L in the previous run, so it now contains the necessary
+information) or the version of SOURCE for the used class has changed
+(\fIchanges\fR is checked for the appearance of the version itself, the
+file-modes and the postinst of the particular SOURCE)
+\fIchanges\fR is a file specifying line by line in the last column which
+files have been changed, path has to be relative to $FAI, i.e. should begin
+with 'files/'. This way, the logfile from cvs checkout could be used
+directly.
+If not given, $FCOPY_LASTLOG and $FCOPY_UPDATELOG are used for \fIplog\fR and
+\fIchanges\fR.
+.TP
+.B \-r
+Copy recursively (traverse down the tree).  Copy all files below
+SOURCE.  These are all subdirectory leaves in the SOURCE tree.  Ignore
+"ignored" directories (see "\-I" for details).
+.TP
+.BI "\-s " source_dir
+Look for SOURCE files relative to \fIsource_dir\fR.  Use $FAI/files if
+not specified.
+.TP
+.BI "\-t " target_dir
+Copy files relative to \fItarget_dir\fR.  Use $FAI_ROOT if not specified.
+.TP
+.B \-U
+If in softupdate mode skip this entire fcopy command.
+.TP
+.B \-v
+Create verbose output.
+
+.SH SCRIPTS
+.TP
+.B preinst
+If a file 'preinst' exists and is executable, it is used in the following way:
+.RS
+.IP 1. 3
+a temporary copy of the file for the used class is created
+.IP 2. 3
+preinst is called with the used class and the full pathname to this 
+temporary copy (you can do in-place substitutions or other modifications on this
+copy)
+.IP 3. 3
+the copy is compared to the destination and replaces it only if there are 
+any differences
+.RE
+
+.TP
+.B postinst
+If a file 'postinst' exists and is executable, it is called after
+successfully having copied the file with the class being used and the full
+pathname to the target file. The variable ROOTCMD is set, so you can
+prepend it to commands which should be executed in the newly installed system.
+
+.SH EXAMPLES
+.br
+Suppose the source directory /files/etc/X11/XF86Config consists of the
+following files:
+
+CAD DEFAULT LAB MACH64 server1 faifoo file-modes postinst
+
+Each file is an instance of a XF86Config file for a different
+xserver configuration except file-modes,
+which holds the file creation data.  The command
+
+    # fcopy -s /files -t /target /etc/X11/XF86Config
+
+copies one of these files from the directory /files/etc/X11/XF86Config to
+the file /target/etc/XF86Config.  For all defined classes, fcopy looks if a
+corresponding file exists.  The class with the highest priority will be used
+for copying.  Here are examples of defined classes and the file which will be copied
+by fcopy.
+
+.sp
+.nf
+.ta 40n
+      Defined classes	File used for copy
+
+      DEFAULT,LAB,server3	LAB
+      DEFAULT,CAD,server1	server1
+      DEFAULT,MACH64,ant01	MACH64
+      DEFAULT,TFT,ant13	DEFAULT
+.sp
+.fi
+.PP
+
+In FAI (look at SEE ALSO) the list of defined classes starts with DEFAULT and the
+last class is the hostname.  So DEFAULT is only used when no file for
+another class exists.  If a file is equal to the hostname, this
+will be used, since hostname should always be the last class. 
+
+User, group and permissions for the files can be defined in several
+ways.  Option -m has the highest priority and will be used for all
+files, if specified.  The file file-modes in the source directory can
+contain one line for each class.  The space separated parameters are:
+
+owner group mode class
+
+where owner and group can be specified by numeric id or by name.  The
+file permissions are defined by mode, which must be octal.  If class is
+missing, the data is used for all other classes, for which no data is
+defined.  If neither -m or file-modes data is available, the user,
+group and mode of the source file will be used for the target file.
+
+Missing subdirectories for the target file are created with mode
+0755.  If the destination file already exists and is different from the
+source file, the suffix .pre_fcopy is appended to the old version of
+the target file.  If source and target files are equal, no copy is performed. 
+A copied file gets the same access and modification time as the source file, not
+the time of the copy.  If also the file postinst exists, it will be
+executed after the file was copied.
+
+.SH NOTES
+Do not create a file DEFAULT if no reasonable default configuration file can be
+used.  It's better to exit with an error than to copy a wrong
+configuration file.
+
+This command can also be used to maintain your configuration files on
+a huge number of hosts.
+.SH SEE ALSO
+.br
+This program is part of FAI (Fully Automatic Installation).  See the FAI manual
+for more information on how to use fcopy.  The FAI homepage is http://www.informatik.uni-koeln.de/fai.
+
+.SH AUTHOR
+Thomas Lange <lange at informatik.uni-koeln.de>
+.br
+Henning Glawe <glaweh at physik.fu-berlin.de>

Added: branches/lhm/man/ftar.8
===================================================================
--- branches/lhm/man/ftar.8	                        (rev 0)
+++ branches/lhm/man/ftar.8	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,102 @@
+.\"                                      Hey, EMACS: -*- nroff -*-
+.TH ftar 8 "29 August 2008"
+.\" Please adjust this date whenever revising the manpage.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh        disable hyphenation
+.\" .hy        enable hyphenation
+.\" .ad l      left justify
+.\" .ad b      justify to both left and right margins
+.\" .nf        disable filling
+.\" .fi        enable filling
+.\" .br        insert line break
+.\" .sp <n>    insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.SH NAME
+ftar \- extract tar files using classes
+.SH SYNOPSIS
+.B ftar
+.RI [ options ] " SOURCE"
+.SH DESCRIPTION
+Extract an archive from SOURCE to its target directory using classes.
+
+SOURCE is a directory which contains one or more template files for
+the source archive to extract.  Depending on the list of defined
+classes, one or more archives of the source directory are selected and
+extracted to the target.  The base target directory is the name of the
+source directory.  Template file must have suffix .tar, .tar.gz,
+or .tar.bz2 depending on the type of archive.
+
+The exit code returned by ftar is mostly 0.  For every successfully
+extracted tar file, a log message is printed to standard output.
+.SH OPTIONS
+.TP
+Options -c, -s, -t (or their analog variables) and a SOURCE are required.
+.TP
+.BI \-1
+Use only one archive file matching a class name.
+.TP
+.BI "\-c " class[class]
+Define classes.  Multiple classes must be space separated.  The first class
+has the lowest priority.  If not specified, use the classes from
+the file /tmp/FAI_CLASES.
+.TP
+.B \-d
+Delete all files in target directory before extracting the archive(s).
+.TP
+.B \-D
+Create debugging output.
+.TP
+.B \-h
+Show help, version and summary of options.
+.TP
+.B \-r
+Recursively remove files in target directory before extracting archive.
+.TP
+.BI "\-s " source_dir
+Look for SOURCE files relative to \fIsource_dir\fR.  Use $FAI/files if
+not specified.
+.TP
+.BI "\-t " target_dir
+Extract archives relative to \fItarget_dir\fR.  Use $FAI_ROOT if not specified.
+.TP
+.B \-v
+Be verbose.  Not yet used.
+
+
+.SH EXAMPLES
+.br
+Suppose the source directory /files/usr/local consists of the following files:
+
+DATALESS.tar.gz ant01.tar.bz2
+
+Each file is a compressed archive. If only class DATALESS is defined,
+the following command
+
+   # ftar -s /files -t /target /usr/local
+
+is equal to
+
+   # tar -C /target/usr/local -zxf /files/usr/local/DATALESS.tar.gz
+
+If additionally class ant01 is defined, the following command is also executed
+
+   # tar -C /target/usr/local -jxf /files/usr/local/ant01.tar.bz2
+
+If only one archive should be extracted, the class with highest
+priority is used.
+
+.SH NOTES
+Do not create a file DEFAULT if no reasonable default configuration file can be
+used.  It's better to exit with an error than to extract a wrong
+archive.
+
+This command can also be used to maintain your complete directory trees on
+a huge number of hosts.
+.SH SEE ALSO
+.br
+This program is part of FAI (Fully Automatic Installation).  See the FAI manual
+for more information on how to use ftar.  The FAI homepage is http://www.informatik.uni-koeln.de/fai.
+
+.SH AUTHOR
+Thomas Lange <lange at informatik.uni-koeln.de>

Added: branches/lhm/man/install_packages.8
===================================================================
--- branches/lhm/man/install_packages.8	                        (rev 0)
+++ branches/lhm/man/install_packages.8	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,114 @@
+.\"                                      Hey, EMACS: -*- nroff -*-
+.if \n(zZ=1 .ig zZ
+.if \n(zY=1 .ig zY
+.TH install_packages 8 "16 september 2008" "FAI 3.2"
+.\" Please adjust this date whenever revising the manpage.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh        disable hyphenation
+.\" .hy        enable hyphenation
+.\" .ad l      left justify
+.\" .ad b      justify to both left and right margins
+.\" .nf        disable filling
+.\" .fi        enable filling
+.\" .br        insert line break
+.\" .sp <n>    insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.de }1
+.ds ]X \&\\*(]B\\
+.nr )E 0
+.if !"\\$1"" .nr )I \\$1n
+.}f
+.ll \\n(LLu
+.in \\n()Ru+\\n(INu+\\n()Iu
+.ti \\n(INu
+.ie !\\n()Iu+\\n()Ru-\w\\*(]Xu-3p \{\\*(]X
+.br\}
+.el \\*(]X\h|\\n()Iu+\\n()Ru\c
+.}f
+..
+.\"
+.\" File Name macro.  This used to be `.PN', for Path Name,
+.\" but Sun doesn't seem to like that very much.
+.\"
+.de FN
+\fI\|\\$1\|\fP
+..
+.SH NAME
+install_packages \- install FAI configured packages
+.SH SYNOPSIS
+.B install_packages
+.SH DESCRIPTION
+Fully Automatic Installation (FAI) is used to provide unattended installation of
+Debian GNU/Linux operating systems with a very flexible class-based system.
+install_packages is a Perl script written for FAI to selectively install, hold,
+remove, or purge packages or tasks.
+
+install_packages is called from the fai installation script and should not be
+called directly.  Its function is to parse the package_config files based on
+the class definitions of the client.  For example, if the client belonged to
+the SMTPSERVER class, install_packages would parse ../package_config/SMTPSERVER
+for instructions on what packages to install, hold, remove, or purge.
+
+.SH OPTIONS
+.TP
+.B \-d
+Only download packages instead of installing them. Variable
+$aptoptions must be set.
+.TP
+.B \-h
+Show help, version and summary of options.
+.TP
+.B \-H
+Show list of all available commands for the file in package_config.
+.TP
+.B \-l
+Print only the list of all packages that would be installed, then exit.
+.TP
+.B \-L
+Print the list of all packages with version number that would be installed, then exit.
+.TP
+.B \-m MAX
+Install only MAX packages at a time. Same as setting the shell
+environment variable MAXPACKAGES.
+.TP
+.BI "\-n "
+Dry run. Do not execute installation commands, just print them.
+.TP
+.B \-N
+Do not check package names if they are valid.
+.TP
+.BI "\-p " DIRECTORY
+Read the configuration files from DIRECTORY instead of $FAI/packages_config.
+.TP
+.B \-v
+Be verbose.
+
+
+.SH NOTES
+.PD 0
+install_packages expects to find the FAI_ROOT directory, the location of class
+definitions, package configurations, and custom install scripts, somewhere in
+the filesystem.  This location is configurable in /etc/fai/fai.conf and defaults to
+/srv/fai/config.
+.PD
+.SH SEE ALSO
+.PD 0
+\fIapt\fP(1), \fIaptitude\fP(8), \fIapt-get\fP(8), \fIdpkg\fP(8), \fItasksel\fP(1)
+
+This program is part of FAI (Fully Automatic Installation). See the FAI manual
+for more information on how to use install_packages. The FAI homepage is
+http://www.informatik.uni-koeln.de/fai.
+.PD
+.SH FILES
+.PD 0
+.TP
+.FN /etc/fai/fai.conf
+The FAI configuration file.
+
+.TP
+.FN /srv/fai/config/package_config/
+The FAI package configuration directory.
+
+.SH AUTHOR
+Thomas Lange <lange at informatik.uni-koeln.de>

Added: branches/lhm/man/make-fai-nfsroot.8
===================================================================
--- branches/lhm/man/make-fai-nfsroot.8	                        (rev 0)
+++ branches/lhm/man/make-fai-nfsroot.8	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,168 @@
+.\"                                      Hey, EMACS: -*- nroff -*-
+.if \n(zZ=1 .ig zZ
+.if \n(zY=1 .ig zY
+.TH make-fai-nfsroot 8 "16 september 2008" "FAI 3.2"
+.de }1
+.ds ]X \&\\*(]B\\
+.nr )E 0
+.if !"\\$1"" .nr )I \\$1n
+.}f
+.ll \\n(LLu
+.in \\n()Ru+\\n(INu+\\n()Iu
+.ti \\n(INu
+.ie !\\n()Iu+\\n()Ru-\w\\*(]Xu-3p \{\\*(]X
+.br\}
+.el \\*(]X\h|\\n()Iu+\\n()Ru\c
+.}f
+..
+.\"
+.\" File Name macro.  This used to be `.PN', for Path Name,
+.\" but Sun doesn't seem to like that very much.
+.\"
+.de FN
+\fI\|\\$1\|\fP
+..
+.SH NAME
+make-fai-nfsroot \- create the FAI nfsroot directory
+.SH SYNOPSIS
+.B make-fai-nfsroot
+.RI [ options ]
+.SH DESCRIPTION
+Create the FAI nfsroot directory as pointed by $NFSROOT in the
+config_file.  This directory is necessary for the installation of
+Debian on remote clients using the FAI package. The config_file
+location is discussed in the OPTIONS below.
+
+The exit code returned is 0 if all commands to build the root directory exited
+successfully and >0 if an error occurs.
+.SH OPTIONS
+.TP
+.B \-C CFDIR
+Use CFDIR as configuration directory. Default is /etc/fai. You can
+also set the environment variable FAI_ETC_DIR.
+.TP
+.B \-f config_file
+Not supported any more. Use option -C instead.
+.TP
+.B \-K
+Remove all kernels from NFSROOT. This is the same as calling aptitude
+purge ~nlinux-image inside the nfsroot.
+.TP
+.B \-k
+Install additional packages defined in /etc/fai/NFSROOT into the
+nfsroot. Also copies all kernels from the nfsroot to the directory $TFTPROOT.
+.TP
+.B \-p
+Preserve ssh keys. This will preserve the whole .ssh directory of the
+root account inside the nfsroot.
+.TP
+.B \-U
+Do not divert update-initramfs during build of the nfsroot. This
+will slow down the creation process a bit. It was only added because
+Ubuntu will fail if the diversion exists.
+.TP
+.B \-v
+Create verbose output on stdout.
+.TP
+.BI \-h
+Show simple help.
+.TP
+.B \-r
+Attempt to recover a previously failed run of this command.  
+
+.SH NOTES
+.PD 0
+If you do not use NFS, you may still use the NFSROOT
+directory as a staging point for building the base installation tarball.  
+
+.SH RECOVERY
+.PD 0
+.B CAUTION!
+This is an advanced feature.  You should be willing to open up an
+editor and browse the make-fai-nfsroot code to understand what each task
+does and how your use of the recovery option can be impacted by fiddling
+around with the stamp files.
+
+You can call make-fai-nfsroot with the '-r' option to attempt a recovery of
+a previous run.  As tasks are completed, stamp files are generated in
+/var/run/fai/make-fai-nfsroot.  As each task is called in recovery mode, the
+stamp file is checked.  If it exists, the task is skipped.  This will save
+you much time during your initial install and debug phase.  It is not a very
+sophisticated mechanism but it can help you on updating the nfsroot as
+well.  For example, if you want to update the kernel that is installed,
+remove the following stamp files: install_kernel_nfsroot_stamp,
+setup_bootp_stamp, setup_dhcp_stamp.
+
+The order in which the stamp files are created are as follows:
+
+.TP
+.B call_debootstrap_stamp
+Debootstrap was called successfully.
+
+.TP
+.B create_base_stamp
+Created after successfully calling debootstrap plus a couple of other tasks.
+
+.TP
+.B upgrade_nfsroot_stamp
+The packages in $NFSROOT have successfully been upgraded with apt.
+
+.TP
+.B add_packages_nfsroot_stamp
+New packages have been installed with apt as specified by the $NFSPACKAGES
+environment variable in /etc/fai/fai.conf.
+
+.TP
+.B copy_fai_files_stamp
+FAI copies a base of files to the NFSROOT directory.
+
+.TP
+.B setup_ssh_stamp
+The SSH environment is set up.  You could probably remove this stamp alone
+to refresh your ssh setup.
+
+.TP
+.B create_nfsroot_stamp
+This stamp file is created when all the preceeding steps have been taken.
+You have a base nfsroot directory.  All you need now is the kernel and the
+BOOTP or DHCP setup.
+
+.TP
+.B install_kernel_nfsroot_stamp
+The kernel you specified in $KERNELPACKAGE has been installed.
+
+.TP
+.B setup_bootp_stamp | setup_dhcp_stamp
+Your kernel was either BOOTP or DHCP.  The appropriate setup has been completed.
+
+.PD
+.SH SEE ALSO
+.PD 0
+\fIexports\fP(5), \fInfsd\fP(8), \fIfai-setup\fP(8)
+
+This program is part of FAI (Fully Automatic Installation).  See the FAI manual
+for more information on how to use make-fai-nfsroot. The FAI homepage is
+http://www.informatik.uni-koeln.de/fai.
+.SH FILES
+.PD 0
+.TP
+.FN /etc/fai/fai.conf
+The FAI configuration file.
+.TP
+.FN /etc/fai/make-fai-nfsroot.conf
+The configuration file for make-fai-nfsroot.
+.PD 0
+.TP
+.FN /etc/fai/nfsroot-hooks/
+Directory containing shell scripts to be sourced at the end of make-fai-nfsroot for additional configuration of the nfsroot. Can be changed with NFSROOT_HOOKS.
+.PD 0
+.TP
+.FN /etc/fai/apt/sources.list
+Copy this file to the NFSROOT.
+.PD 0
+.TP
+.FN /var/run/fai/make-fai-nfsroot/*-stamp
+Stamp files used for recovery.
+
+.SH AUTHOR
+Thomas Lange <lange at informatik.uni-koeln.de>

Added: branches/lhm/man/setup-storage.8
===================================================================
--- branches/lhm/man/setup-storage.8	                        (rev 0)
+++ branches/lhm/man/setup-storage.8	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,431 @@
+.TH setup-storage 8 "September 16, 2008" "Debian/GNU Linux"
+.SH NAME
+\fBsetup-storage\fP
+\- automatically prepare storage devices
+.SH SYNOPSIS
+.br
+\fBsetup-storage\fP
+[\fB\-X\fP]
+[\fB\-f\fP \fIfilename\fP]
+[\fB\-d\fP]
+[\fB\-h\fP]
+.SH DESCRIPTION
+Using FAI disk_config files,
+\fBsetup-storage\fP
+computes effective partition and volume sizes and executes the necessary
+commands to configure storage devices. It manages disk drives as well as RAID
+and LVM volumes. It handles all file systems supported by
+\fBparted\fP(8)
+as well as ntfs but is flexible enough to be extended to further types as well.
+Once the storage devices are prepared, an appropriate
+\fBfstab\fP(5)
+file is generated.
+
+Without the
+\fB\-X\fP
+parameter
+\fBsetup-storage\fP
+runs in test-only mode and does not execute commands other than writing disk
+labels to a blank disk.
+
+The exit code of
+\fBsetup-storage\fP
+is 0 if all operations were performed successfully and non-zero if an error
+occurs.
+.SH USAGE
+To enable the use of the new partioning tool setup-storage you have to
+set
+.IR USE_SETUP_STORAGE =1 
+in the according class file in configspace (like
+/srv/fai/config/class/FAIBASE.var for example).
+.SH OPTIONS
+
+.TP
+\fB\-X\fP
+Really write the configuration to disk. Otherwise
+\fBsetup-storage\fP
+runs in test-only mode.
+
+.TP
+\fB\-f\fP \fIfilename\fP
+Normally
+\fBsetup-storage\fP
+selects an appropriate configuration from
+$FAI/disk_config/
+by picking the first class from
+.IR classes
+that has an existing file.
+If however
+\fB\-f\fP
+is given the configuration in
+\fIfilename\fP
+is used.
+
+.TP
+\fB\-d\fP
+Enable debugging output.
+
+.TP
+\fB\-h\fP
+Display the synopsis and version info and exit.
+.SH ENVIRONMENT
+\fBsetup-storage\fP
+will use the following environment variables:
+.TP
+.B disklist
+The
+.IR disklist
+variable must contain a newline separated list of disk drives available in the
+system. Their order matters as they may be referred to as disk1, etc. in
+disk_config.
+.TP
+.B debug
+If
+.IR debug
+is set to a non-zero value all actions and details to track the operation of
+\fBsetup-storage\fP
+are printed to stderr.
+.TP
+.B FAI
+The location of the config space to find the disk_config directory.
+.TP
+.B classes
+The list of FAI classes to determine the appropriate configuration to choose.
+.TP
+.B LOGDIR
+\fBsetup-storage\fP
+generates disk_var.sh and fstab (see below) in this directory.
+.SH FILES
+If
+\fBsetup-storage\fP
+executes successfully an
+\fBfstab\fP(5)
+file matching the specified configuration is generated as
+$LOGDIR/fstab. Further $LOGDIR/disk_var.sh
+is generated and may be sourced to get the variables
+.IR SWAPLIST ,
+.IR ROOT_PARTITION ,
+.IR BOOT_PARTITION
+and
+.IR BOOT_DEVICE .
+The latter two will only be set in case they
+reside on a disk drive.
+.SH SYNTAX
+This section describes the syntax of disk_config files
+
+
+file ::= <lines> EOF
+.br
+
+
+lines ::= EOL 
+.br
+          /* empty lines or whitespace only */
+.br
+          | <comment> EOL 
+.br
+          | <config> EOL 
+.br
+
+
+comment ::= #.* 
+.br
+
+
+config ::= disk_config lvm( <lvmoption>)* 
+.br
+           | disk_config raid( <raidoption>)*
+.br
+           | disk_config end 
+.br
+           | disk_config disk[[:digit:]]+( <option>)*
+.br
+           | disk_config [^[:space:]]+( <option>)*
+.br
+           /* fully qualified device-path or short form, like hda, whereby full
+.br
+            * path is assumed to be /dev/hda */
+.br
+           | <volume>
+.br
+
+
+lvmoption ::= /* empty */
+.br
+           | preserve_always:[^/,\\s\\-]+-[^/,\\s\\-]+(,[^/,\\s\\-]+-[^/,\\s\\-]+)*
+.br
+           /* preserve partitions -- always */
+.br
+           | preserve_reinstall:[^/,\\s\\-]+-[^/,\\s\\-]+(,[^/,\\s\\-]+-[^/,\\s\\-]+)*
+.br
+           /* preserve partitions -- unless the system is installed for the 
+.br
+           first time */
+.br
+           | resize:[^/,\\s\\-]+-[^/,\\s\\-]+(,[^/,\\s\\-]+-[^/,\\s\\-]+)*
+.br
+           /* attempt to resize partitions */
+.br
+           | fstabkey:(device|label|uuid)
+.br
+           /* when creating the fstab, the key used for defining the device
+.br
+           may be the device (/dev/xxx), a label given using -L, or the uuid
+.br
+           */  
+.br
+
+
+raidoption ::= /* empty */
+.br
+           | preserve_always:[[:digit:]]+(,[[:digit:]]+)*
+.br
+           /* preserve partitions -- always */
+.br
+           | preserve_reinstall:[[:digit:]]+(,[[:digit:]]+)*
+.br
+           /* preserve partitions -- unless the system is installed for the 
+.br
+           first time */
+.br
+           | fstabkey:(device|label|uuid)
+.br
+           /* when creating the fstab the key used for defining the device
+.br
+           may be the device (/dev/xxx), a label given using -L, or the uuid
+.br
+           */  
+.br
+
+
+option ::= /* empty */
+.br
+           | preserve_always:[[:digit:]]+(,[[:digit:]]+)*
+.br
+           /* preserve partitions -- always */
+.br
+           | preserve_reinstall:[[:digit:]]+(,[[:digit:]]+)*
+.br
+           /* preserve partitions -- unless the system is installed for the 
+.br
+           first time */
+.br
+           | resize:[[:digit:]]+(,[[:digit:]]+)*
+.br
+           /* attempt to resize partitions */
+.br
+           | disklabel:(msdos|gpt)
+.br
+           /* write a disklabel - default is msdos */
+.br
+           | bootable:[[:digit:]]+
+.br
+           /* mark a partition bootable, default is / */
+.br
+           | virtual
+.br
+           /* do not assume the disk to be a physical device, use with xen */
+.br
+           | fstabkey:(device|label|uuid)
+.br
+           /* when creating the fstab the key used for defining the device
+.br
+           may be the device (/dev/xxx), a label given using -L, or the uuid
+.br
+           */  
+.br
+
+
+volume ::= <type> <mountpoint> <size> <filesystem> <mount_options> <fs_options>
+.br
+           | vg <name> <size>
+.br
+           /* lvm vg */
+.br
+
+
+type ::= primary
+.br
+         /* for physical disks only */
+.br
+         | logical
+.br
+         /* for physical disks only */
+.br
+         | raid[0156]
+.br
+         /* raid level */
+.br
+         | [^/[:space:]]+-[^/[:space:]]+
+.br
+         /* lvm logical volume: vg name and lv name*/
+.br
+
+
+mountpoint ::= -
+.br
+               /* do not mount */
+.br
+               | swap
+.br
+               /* swap space */
+.br
+               | /[^[:space:]]*(:encrypt)?
+.br
+               /* fully qualified path; if :encrypt is given the partition
+.br
+                * will be encrypted, the key is generated automatically */
+.br
+
+
+name ::= [^/[:space:]]+
+.br
+         /* lvm volume group name */
+.br
+
+
+size ::= [[:digit:]]+[kMGTP%]?(-([[:digit:]]+[kMGTP%]?)?)?(:resize)?
+.br
+         /* size in kilo, mega (default), giga, tera or petabytes or %,
+.br
+          * possibly given as a range; physical
+.br
+          * partitions or lvm logical volumes only; */
+.br
+         | -[[:digit:]]+[kMGTP%]?(:resize)?
+.br
+         /* size in kilo, mega (default), giga, tera or petabytes or %,
+.br
+          * given as upper limit; physical partitions
+.br
+          * or lvm logical volumes only */
+.br
+         | [^,:[:space:]]+(:(spare|missing))*(,[^,:[:space:]]+(:(spare|missing))*)*
+.br
+         /* devices and options for a raid or lvm vg */
+.br
+
+
+mount_options ::= [^[:space:]]+
+.br
+
+
+filesystem ::= -
+.br
+               | swap
+.br
+               | [^[:space:]]
+.br
+               /* mkfs.xxx must exist */
+.br
+
+
+fs_options ::= (createopts=".*"|tuneopts=".*")*
+.br
+               /* options to append to mkfs.xxx and to the filesystem-specific
+.br
+                * tuning tool */
+.br
+.SH MIGRATION FROM SETUP_HARDDISKS
+The major differences to the prior configuration syntax are:
+.IP \(bu
+The disk_config ... line allows for the keywords lvm and raid
+.IP \(bu
+Options may need to be appended to the disk_config line
+.IP \(bu
+The ";" is not used anymore, the options that were given there have now been split up
+.IP \(bu
+The filesystem is now an explicit parameter; note that the order of
+filesystem/mount-options is the same /etc/fstab as opposed to the previous
+format of disk_config.
+.IP \(bu
+Any options to mkfs.xxx may be given using createopts="".
+.IP \(bu
+The "preserveX" and "boot" options are one of the options now given on the
+disk_config line, using preserve_reinstall or preserve_always and bootable.
+preserve_always is equivalent to the previous preserveX option, whereas
+preserve_reinstall preserves the partition unless "initial" is given as one of
+the FAI_FLAGS.
+.IP \(bu
+Support for LVM and RAID is completely new
+.IP \(bu
+Resizing partitions and filesystems is supported
+.SH EXAMPLES
+Simple configuration of /dev/hda
+.sp
+.nf
+.ta 10n 20n 30n 40n 50n
+disk_config  hda	preserve_always:6,7	disklabel:msdos  bootable:3
+
+primary	/boot	20-100	ext3	rw
+primary	swap	1000	swap	sw
+primary	/	12000	ext3	rw	createopts="-b 2048"
+logical	/tmp	1000	ext3	rw,nosuid
+logical	/usr	5000	ext3	rw
+logical	/var	10%-	ext3	rw
+logical	/nobackup	0-	xfs	rw
+.sp
+.fi
+.PP
+.IP \(bu
+Preserve the 6th and the 7th partition. The disklabel is msdos which is the default
+for x86. Furthermore the 3rd partition is made bootable.
+.IP \(bu
+Create a primary partition /dev/hda1 with a size between 20 and 100 MB and mount it
+read-write as /boot; it is formatted using ext3 filesystem.
+.IP \(bu
+/dev/hda2 will be a swap space of 1000 MB
+.IP \(bu
+/dev/hda3 should be formatted using ext3 filesystem; when calling mkfs.ext3
+the option "-b 2048" is appended.
+.IP \(bu
+Create the logical partition /dev/hda5
+.IP \(bu
+Make /dev/hda7 at least 10% of the disk size
+.IP \(bu
+Use mkfs.xfs to format the partition 8
+
+.TP
+Create a softRAID
+.sp
+.nf
+.ta 6n 9n 40n 45n
+disk_config raid
+raid1	/	sda1,sdd1	ext2	rw,errors=remount-ro
+raid0	-	disk2.2,sdc1,sde1:spare:missing	ext2  default
+.sp
+.fi
+.PP
+.IP \(bu
+Create a RAID-1 on /dev/sda1 and /dev/sdd1, format using mkfs.ext2 and mount
+it as /
+.IP \(bu
+Create a RAID-0 on the second partition of the second disk, /dev/sdc1, and
+/dev/sde1 as a spare partition. The latter may be missing.
+
+.TP
+Simple LVM example
+.sp
+.nf
+.ta 15n 22n 30n 40n
+disk_config sda  bootable:1
+primary	/boot	500	ext3	rw
+primary	-	4096-	-	-
+disk_config lvm
+vg  my_pv  sda2
+my_pv-_swap	swap	2048	swap	sw
+my_pv-_root	/	2048	ext3	rw
+.sp
+.fi
+.PP
+.SH SEE ALSO
+This program is part of FAI (Fully Automatic Installation).
+The FAI homepage is http://www.informatik.uni-koeln.de/fai.
+
+Further documentation, including coding related information, is maintained
+in a wiki page at http://faiwiki.informatik.uni-koeln.de/index.php/Setup-storage.
+.SH AUTHOR
+FAI is courtesy of Thomas Lange <lange at informatik.uni-koeln.de>. Michael
+Tautschnig <mt at debian.org> contributed the initial version of
+\fBsetup-storage\fP
+to replace the previous setup-harddisks, with the help of Christian Kern.

Added: branches/lhm/pixmaps/bar.gif
===================================================================
(Binary files differ)


Property changes on: branches/lhm/pixmaps/bar.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: branches/lhm/pixmaps/begin.gif
===================================================================
(Binary files differ)


Property changes on: branches/lhm/pixmaps/begin.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: branches/lhm/pixmaps/fail.gif
===================================================================
(Binary files differ)


Property changes on: branches/lhm/pixmaps/fail.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: branches/lhm/pixmaps/minor.gif
===================================================================
(Binary files differ)


Property changes on: branches/lhm/pixmaps/minor.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: branches/lhm/pixmaps/ok.gif
===================================================================
(Binary files differ)


Property changes on: branches/lhm/pixmaps/ok.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: branches/lhm/pixmaps/warning.gif
===================================================================
(Binary files differ)


Property changes on: branches/lhm/pixmaps/warning.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: branches/lhm/utils/all_hosts
===================================================================
--- branches/lhm/utils/all_hosts	                        (rev 0)
+++ branches/lhm/utils/all_hosts	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,57 @@
+#! /bin/sh
+
+# determine the list of all hosts that respond to a ping
+#
+# (c) Thomas Lange, Institut fuer Informatik, Uni Koeln, 1998,2001
+
+# define a netgroup called allhosts which is the list of all hostnames
+
+fpingopt="-i40"
+
+make_hostlist() {
+
+    # example for a Beowulf cluster
+    server=atom00
+    nodeprefix=atom
+    endnum=25
+    # create the list of all hosts
+    i=1
+    while [ $i -le $endnum ]; do
+	num=`printf "%.2d" $i`
+	nodes="$nodes $nodeprefix$num"
+	i=$(($i+1))
+    done
+    allhosts="$server $nodes"
+}
+
+usage() {
+cat <<EOF
+   Usage: all_hosts [parameter]
+
+    all_hosts without any option show all answering hosts.
+
+    -h     print this message.
+    -n     show all non answering hosts.
+    -p     print only the list of all hosts
+
+EOF
+exit 0
+}
+
+# - - - - - - - - - - - - - - - - - - - -
+# if using NIS this is very nice
+# prtnetgr prints all hosts belonging to a netgroup
+allhosts=`prtnetgr allhosts`
+#make_hostlist
+
+while getopts anhp opt
+do
+        case "$opt" in
+	n) fping $fpingopt -u $allhosts 2>/dev/null ;;
+        h) usage ;;
+        p) echo $allhosts ;;
+	*) usage
+	    exit 2;;
+	esac
+done
+[ -n "$1" ] || fping $fpingopt -a $allhosts 2>/dev/null


Property changes on: branches/lhm/utils/all_hosts
___________________________________________________________________
Added: svn:executable
   + 

Added: branches/lhm/utils/create-nfsroot-tar
===================================================================
--- branches/lhm/utils/create-nfsroot-tar	                        (rev 0)
+++ branches/lhm/utils/create-nfsroot-tar	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,17 @@
+#! /bin/sh
+
+# create a tarball of FAI (inlcuding nfsroot, tftp and the configuration), for
+# those how don't have Debain yet
+# What's missing: bootptab or dhcp.conf
+#
+# Thomas Lange, (c) copyright 2001-2003
+
+# How to use this tarball:
+# After unpacking copy base2_2.tgz to $nfsroot/var/tmp, set up bootpd
+
+tarball=/tmp/fai-tarball.tar.bz2
+nfsroot=/srv/fai/nfsroot
+
+cd /
+tar -cvf - $nfsroot /srv/tftp/fai /srv/fai/config | bzip2 > $tarball
+echo $tarball created.


Property changes on: branches/lhm/utils/create-nfsroot-tar
___________________________________________________________________
Added: svn:executable
   + 

Added: branches/lhm/utils/mkdebmirror
===================================================================
--- branches/lhm/utils/mkdebmirror	                        (rev 0)
+++ branches/lhm/utils/mkdebmirror	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,40 @@
+#! /bin/sh
+
+# $Id: mkdebmirror 5222 2008-12-09 12:15:53Z lange $
+# Thomas Lange, lange at informatik.uni-koeln.de, (c) 2001-2008
+
+# create partial debian mirror using command debmirror(1)
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+update_from() {
+
+    # update local mirror from a host
+    host=$1
+    defopt="$allopt --host=$host --dist=$dist"
+
+    echo "------------------ create mirror for debian ------------------"
+    debmirror --getcontents $destdir/debian $defopt
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# main program
+#
+# here you have to adjust the hostnames of the mirror and the names of the distributions
+
+
+debug="$@"
+arch=i386
+dist=etch,etch-proposed-updates
+
+destdir=/files/scratch/debmirror
+
+allopt="$debug --ignore-missing-release --ignore-release-gpg --passive --nosource --arch=$arch --ignore=disks-$arch/"
+
+# first sync from a mirror near to you
+#update_from ftp.uni-koeln.de
+
+# since this mirror is not always up to date, sync the rest from an official mirror
+update_from ftp.de.debian.org
+
+# even one should not mirror the security site, but I will do it.
+echo "------------------ create mirror for debian-security ------------------"
+debmirror $destdir/debian-security $allopt --host=security.debian.org -r debian-security  --section main,contrib,non-free -d etch/updates


Property changes on: branches/lhm/utils/mkdebmirror
___________________________________________________________________
Added: svn:executable
   + 

Added: branches/lhm/utils/prtnetgr
===================================================================
--- branches/lhm/utils/prtnetgr	                        (rev 0)
+++ branches/lhm/utils/prtnetgr	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,53 @@
+#! /usr/bin/perl
+
+#*********************************************************************
+#
+# prtnetgr -- print a host netgroup, convert the netgroup tree to a flat listing
+#
+# (c) 2001-2002 by Thomas Lange, lange at informatik.uni-koeln.de
+# Universitaet zu Koeln
+#
+#*********************************************************************
+# TODO: match the form (,,); currently these lines are skipped
+# global variable
+# %netgroup
+
+# - - - - - - - - - - - - - - - - - - - - -
+sub usage {
+
+  print <<EOM
+  Usage: prtnetgrp netgroup_name
+
+  prtnetgrp prints a plain list of all hosts belonging to the netgroup
+EOM
+}
+# - - - - - - - - - - - - - - - - - - - - -
+sub mklist {
+
+  my $grp = shift;
+  $netgroup{$grp} || return $grp;
+  map { mklist($_) } @{$netgroup{$grp}};
+}
+# - - - - - - - - - - - - - - - - - - - - -
+
+&usage unless @ARGV;
+
+# for debugging
+#open NET, "<netgroup " or die "Can't read NIS netgroup info\n";
+
+open NET, "ypcat -k netgroup |" or die "Can't read NIS netgroup info\n";
+while (<NET>) {
+  next if /^\s*$/;
+  next if /\(/;
+  next if /^#/;
+  ($grp, @members) = split;
+  $netgroup{$grp} = [ @members ];
+}
+
+# only one argument: the name of a host netgroup
+$arg = shift;
+# exit if argument is not a netgroup
+exit 1 unless $netgroup{$arg};
+$plist = join ' ', mklist($arg);
+print "$plist\n";
+exit 0;


Property changes on: branches/lhm/utils/prtnetgr
___________________________________________________________________
Added: svn:executable
   + 

Added: branches/lhm/utils/rshall
===================================================================
--- branches/lhm/utils/rshall	                        (rev 0)
+++ branches/lhm/utils/rshall	2009-10-29 16:12:46 UTC (rev 5621)
@@ -0,0 +1,124 @@
+#! /bin/sh 
+
+# executes a command on all hosts which are return by all_hosts
+# T. Lange; jan 2000 Institut fuer Informatik, Uni Koeln
+# A. Menze und F. Möllers; März 2003 Institut für Informatik, Uni Köln
+# Add usage and exclude function
+
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+usage() {
+cat <<EOF
+   Usage: rshall [option] arguments
+
+     rshall with given arguments executes those arguments on all alive
+ hosts of the network 
+
+ options:
+
+    -h                   print this message.
+    -e host[,host ...]   exclude this comma sperated list of machines
+
+
+ examples:
+
+    rshall date
+    rshall -e rubens,frueh,suenner,[...] date
+
+
+EOF
+exit 0
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+list() {
+
+    if [ -n "$nohosts" ] ; then
+	echo
+	echo The command will not be executed on the following hosts because 
+	echo they are down: $nohosts
+#	echo You have 5 seconds to stop by typing "control c"
+	sleep 5s
+    fi
+
+    for h in $hosts; do
+        echo ''
+        echo ''
+        echo '*****   '$h:
+        rsh $h "$@"
+    done
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+typos() {
+
+    all=`prtnetgr allhosts`
+
+    for e in $ehosts; do
+	exists=0
+	for a in $all; do
+	    if [ $e = $a ] ; then
+		exists=1
+	    fi
+	done
+
+	if [ $exists = 0 ] ; then
+	    error=1
+	    error_hosts="$error_hosts $e"
+	fi
+    done
+
+    if [ $error = 1 ] ; then
+        echo +++ !!! +++ ATTENTION PLEASE +++ !!! +++
+        echo
+        echo The following machine\(s\) does not exist: $error_hosts 
+        echo
+        exit 1
+    fi
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+exclude() {
+
+    ehosts=`echo $* | sed "s/,/ /g"`
+    error=0
+
+    typos
+   
+    for h in $allhosts; do
+	einf=1
+	for e in $ehosts; do
+	    if [ $h = $e ] ; then
+		einf=0
+	    fi
+	done
+
+	if [ $einf = 1 ] ; then
+	    dhosts="$dhosts $h"
+       	fi
+    done
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+eflag=0
+
+while getopts e:h a
+do
+        case "$a" in
+        h) usage;;
+        e) eflag=1;; 
+	*) usage;;
+	
+	esac
+done
+
+[ -z "$1" ] && usage;
+
+allhosts=`all_hosts`
+nohosts=`all_hosts -n`
+
+if [ $eflag = 0 ]; then
+    hosts=$allhosts
+else
+    exclude $OPTARG
+    shift `expr $OPTIND - 1`
+    hosts=$dhosts
+fi
+
+list "$*"


Property changes on: branches/lhm/utils/rshall
___________________________________________________________________
Added: svn:executable
   + 




More information about the Fai-commit mailing list