[debian-lan-devel] [debian-lan] 02/03: Merge with FAI 4.1 examples config space.

Andreas B. Mundt andi at moszumanska.debian.org
Tue Mar 25 19:21:06 UTC 2014


This is an automated email from the git hooks/post-receive script.

andi pushed a commit to branch master
in repository debian-lan.

commit cd03b48a7b65d8ea0ae818639732596560eba485
Author: Andreas B. Mundt <andi at debian.org>
Date:   Fri Mar 21 12:29:52 2014 +0100

    Merge with FAI 4.1 examples config space.
---
 fai/config/class/20-hwdetect.source             | 15 +++---------
 fai/config/class/50-host-classes                |  2 +-
 fai/config/class/DEBIAN.var                     |  9 ++++++-
 fai/config/class/FAIBASE.var                    |  3 +++
 fai/config/files/etc/fai/NFSROOT/FAISERVER      | 12 ++++------
 fai/config/files/etc/fai/nfsroot.conf/FAISERVER |  2 +-
 fai/config/hooks/instsoft.DEBIAN                | 13 +++++++++++
 fai/config/hooks/savelog.LAST.source            |  9 +++----
 fai/config/package_config/DEBIAN                |  6 ++---
 fai/config/scripts/DEBIAN/30-interface          | 12 +++++-----
 fai/config/scripts/DEBIAN/40-misc               | 15 +++++++++---
 fai/config/scripts/DEMO/10-misc                 |  7 +++---
 fai/config/scripts/FAIBASE/10-misc              |  4 +++-
 fai/config/scripts/FAIBASE/20-removable_media   |  2 +-
 fai/config/scripts/GRUB_PC/10-setup             | 31 ++++++++++++++++++++-----
 fai/config/tests/Faitest.pm                     |  3 ++-
 16 files changed, 94 insertions(+), 51 deletions(-)

diff --git a/fai/config/class/20-hwdetect.source b/fai/config/class/20-hwdetect.source
index 4b4aacd..5bc3c52 100755
--- a/fai/config/class/20-hwdetect.source
+++ b/fai/config/class/20-hwdetect.source
@@ -1,6 +1,6 @@
 #! /bin/bash
 
-# (c) Thomas Lange, 2002-2012, lange at informatik.uni-koeln.de
+# (c) Thomas Lange, 2002-2013, 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.
@@ -9,24 +9,15 @@
 
 echo 0 > /proc/sys/kernel/printk
 
-# wheezy does not have -m and modules.pcimap
-depmod -m 2>/dev/null
-if [ -f "/lib/modules/`uname -r`/modules.pcimap" ]; then
-    for module in $(pcimodules) ; do
-        [ "$verbose" ] && echo loading kernel module $module
-        modprobe "$module"
-    done
-fi
-
+#kernelmodules=
 # here, you can load modules depending on the kernel version
-kernelmodules="sd_mod sr_mod"
 case $(uname -r) in
     2.6*) kernelmodules="$kernelmodules mptspi dm-mod md-mod aes dm-crypt" ;;
       3*) kernelmodules="$kernelmodules mptspi dm-mod md-mod aes dm-crypt" ;;
 esac
 
 for mod in $kernelmodules; do
-    [ "$verbose" ] && echo loading kernel module $mod
+    [ "$verbose" ] && echo Loading kernel module $mod
     modprobe -a $mod 1>/dev/null 2>&1
 done
 
diff --git a/fai/config/class/50-host-classes b/fai/config/class/50-host-classes
index 596b9c2..41c988a 100755
--- a/fai/config/class/50-host-classes
+++ b/fai/config/class/50-host-classes
@@ -51,7 +51,7 @@ case $HOSTNAME in
 ## The following hosts are kept for reference only (FAI project).
 ## They are not tested and probably do not work with Debian-LAN:
     faiserver)
-       echo "FAIBASE DEBIAN DEMO FAISERVER" ;;
+       echo "FAIBASE DEBIAN DHCPD DEMO FAISERVER" ;;
     demohost|client*)
        echo "FAIBASE DEBIAN DHCPC DEMO" ;;
     xfcehost)
diff --git a/fai/config/class/DEBIAN.var b/fai/config/class/DEBIAN.var
index d1ac5da..d47658e 100644
--- a/fai/config/class/DEBIAN.var
+++ b/fai/config/class/DEBIAN.var
@@ -5,4 +5,11 @@ KEYMAP=us-latin1
 # 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.
-MODULESLIST="loop"
+MODULESLIST="usbhid psmouse"
+
+# if you have enough RAM (>2GB) you may want to enable this line. It
+# also puts /var/cache into a ramdisk.
+#FAI_RAMDISKS:="$target/var/lib/dpkg $target/var/cache/apt"
+
+# if you want to use the faiserver as APT proxy
+#APTPROXY=http://faiserver:3142
diff --git a/fai/config/class/FAIBASE.var b/fai/config/class/FAIBASE.var
index 82f33b0..dec4211 100644
--- a/fai/config/class/FAIBASE.var
+++ b/fai/config/class/FAIBASE.var
@@ -13,3 +13,6 @@ TIMEZONE=Europe/Berlin
 
 # errors in tasks greater than this value will cause the installation to stop
 STOP_ON_ERROR=700
+
+# set parameter for install_packges(8)
+MAXPACKAGES=300
diff --git a/fai/config/files/etc/fai/NFSROOT/FAISERVER b/fai/config/files/etc/fai/NFSROOT/FAISERVER
index 81eef00..996ebb2 100644
--- a/fai/config/files/etc/fai/NFSROOT/FAISERVER
+++ b/fai/config/files/etc/fai/NFSROOT/FAISERVER
@@ -7,11 +7,10 @@ hwinfo psmisc pciutils hdparm smartmontools parted mdadm lvm2
 dnsutils ntpdate dosfstools xfsprogs xfsdump
 procinfo numactl dialog
 console-tools console-common
-iproute udev subversion
+iproute moreutils udev subversion
 xz-utils
 cupt
 
-grub-pc
 cfengine2
 # we need mkpasswd:
 whois
@@ -22,17 +21,16 @@ firmware-bnx2 firmware-bnx2x firmware-realtek
 # dracut can replace live-boot
 dracut-network live-boot- live-boot-initramfs-tools-
 
-# squeeze also needs initramfs-tools, even with dracut
-#initramfs-tools
-
 # choose if you like live-boot or dracut inside the nfsroot
-#live-boot
+#live-boot live-boot-doc
 
 # you should not edit the lines below
 # architecture dependend list of packages that are installed
 
 PACKAGES aptitude I386
-linux-image-686-pae
+grub-pc
+linux-image-686
 
 PACKAGES aptitude AMD64
+grub-pc
 linux-image-amd64
diff --git a/fai/config/files/etc/fai/nfsroot.conf/FAISERVER b/fai/config/files/etc/fai/nfsroot.conf/FAISERVER
index 7bf7667..fa699e1 100644
--- a/fai/config/files/etc/fai/nfsroot.conf/FAISERVER
+++ b/fai/config/files/etc/fai/nfsroot.conf/FAISERVER
@@ -11,4 +11,4 @@ FAI_DEBOOTSTRAP_OPTS="--exclude=info"
 FAI_CONFIGDIR=/srv/fai/config
 
 NFSROOT_ETC_HOSTS="192.168.33.250 faiserver"
-FAI_DEBOOTSTRAP="jessie http://faiserver:9999/debian"
+FAI_DEBOOTSTRAP="jessie http://http.debian.net/debian"
diff --git a/fai/config/hooks/instsoft.DEBIAN b/fai/config/hooks/instsoft.DEBIAN
new file mode 100755
index 0000000..905acdd
--- /dev/null
+++ b/fai/config/hooks/instsoft.DEBIAN
@@ -0,0 +1,13 @@
+#! /bin/bash
+
+# if package locales will be installed, then install it early, before
+#  other packages
+
+if [ $FAI_ACTION != "install" ]; then
+   exit 0
+fi
+
+install_packages -l 2>/dev/null | egrep  -q  ' locales|locales '
+if [ $? -eq 0 ]; then
+   $ROOTCMD aptitude -R -y install locales
+fi
diff --git a/fai/config/hooks/savelog.LAST.source b/fai/config/hooks/savelog.LAST.source
index b89fe5c..6c3a888 100755
--- a/fai/config/hooks/savelog.LAST.source
+++ b/fai/config/hooks/savelog.LAST.source
@@ -15,6 +15,7 @@ no space
 syntax
 Couldn't stat
 Cannot access
+ conflict
 is bigger than the limit
 did not exist
 non existent
@@ -44,6 +45,7 @@ task_error_func=
 STOP_ON_ERROR=
 courier-webadmin
 gstreamer0.10-plugins-bad
+libgstreamer-plugins-bad0
 ibwebadmin
 kernel-patch-badram
 kolab-webadmin
@@ -60,6 +62,7 @@ liberror-perl
 libgpg-error-dev
 libgpg-error0
 ^fstab.\+errors=remount
+Opts: errors=remount-ro
 [RT]X packets:
 WARNING: unexpected IO-APIC
 warned about = ( )
@@ -134,6 +137,8 @@ live-premount.\+ If this fails
 cannot read table of mounted file systems
 error: no alternatives for
 ERST: Error Record Serialization Table (ERST) support is initialized
+ERST: Table is not found
+HEST: Table not found
 failed to stat /dev/pts"
 
 # add pattern on some conditions
@@ -148,10 +153,7 @@ fi
 myerrorpatterns="XXXXX"
 myignorepatterns="create mode
 /etc/munin/munin-conf.d/nodes.conf
-EST: Table not found.
-ERST: Table is not found!
 WARNING! power/level is deprecated; use power/control instead
-Opts: errors=remount-ro
 Warning: no domain name configured, using "localdomain"
 CUPS failed to reload its configuration!
 Warning: you may need to reload your webservice!
@@ -182,7 +184,6 @@ if [ -s $errfile ]; then
    echo "ERRORS reported in ${errfile}:"
    cat $errfile | nl
    echo "ERRORS found in log files. See above and $errfile" >&2
-
 else
    echo "Congratulations! No errors found in log files."
 fi
diff --git a/fai/config/package_config/DEBIAN b/fai/config/package_config/DEBIAN
index 10dcb54..86c6b2d 100644
--- a/fai/config/package_config/DEBIAN
+++ b/fai/config/package_config/DEBIAN
@@ -1,9 +1,9 @@
 PACKAGES aptitude-r I386
-linux-image-686-pae initramfs-tools
+linux-image-686 initramfs-tools
 memtest86+
 
 PACKAGES aptitude CHROOT
-linux-image-686-pae-
+linux-image-686-
 linux-image-amd64-
 
 PACKAGES aptitude-r AMD64
@@ -11,7 +11,7 @@ linux-image-amd64 initramfs-tools
 memtest86+
 
 PACKAGES aptitude XEN
-xen-linux-system-2.6.26-2-xen-amd64
+linux-image-amd64 initramfs-tools
 
 PACKAGES aptitude DHCPC
 isc-dhcp-client
diff --git a/fai/config/scripts/DEBIAN/30-interface b/fai/config/scripts/DEBIAN/30-interface
index 18dcecc..201d6bb 100755
--- a/fai/config/scripts/DEBIAN/30-interface
+++ b/fai/config/scripts/DEBIAN/30-interface
@@ -2,21 +2,21 @@
 
 error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code
 
-if ifclass DHCPC && [ $FAI_ACTION != "softupdate" ]
+if ifclass DHCPC && [ $FAI_ACTION = "install" ]
 then
     cat > $target/etc/network/interfaces <<-EOF
 	# generated by FAI
-	auto lo eth0
+	auto lo $NIC1
 	iface lo inet loopback
-	iface eth0 inet dhcp
+	iface $NIC1 inet dhcp
 EOF
-elif [ $FAI_ACTION != "softupdate" ]
+elif [ $FAI_ACTION = "install" ]
 then
       [ -n "$IPADDR" ] && cat > $target/etc/network/interfaces <<-EOF
 	# generated by FAI
-	auto lo eth0
+	auto lo $NIC1
 	iface lo inet loopback
-	iface eth0 inet static
+	iface $NIC1 inet static
 	  address $IPADDR
 	  netmask $NETMASK
 	  broadcast $BROADCAST
diff --git a/fai/config/scripts/DEBIAN/40-misc b/fai/config/scripts/DEBIAN/40-misc
index 6a76e15..993b6b0 100755
--- a/fai/config/scripts/DEBIAN/40-misc
+++ b/fai/config/scripts/DEBIAN/40-misc
@@ -1,6 +1,6 @@
 #! /bin/bash
 
-# (c) Thomas Lange, 2001-2011, lange at debian.org
+# (c) Thomas Lange, 2001-2013, lange at debian.org
 # (c) Michael Goetze, 2010-2011, mgoetze at mgoetze.net
 
 error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code
@@ -12,10 +12,19 @@ done
 
 fcopy -Mv /etc/hostname || echo $HOSTNAME > $target/etc/hostname
 ainsl -av /etc/mailname ${HOSTNAME}
-sed -i -e "s/^UTC.*/UTC=${UTC}/" $target/etc/default/rcS
+if [ ! -e $target/etc/adjtime ]; then
+    printf "0.0 0 0.0\n0\nUTC" > $target/etc/adjtime
+fi
+if [ "$UTC" = "yes" ]; then
+    sed -i -e 's:^LOCAL$:UTC:' $target/etc/adjtime
+else
+    sed -i -e 's:^UTC$:LOCAL:' $target/etc/adjtime
+fi
 sed -i -e 's#/sbin/getty 38400#/sbin/getty --noclear -f /etc/issue.linuxlogo 38400#' ${target}/etc/inittab
 
-[ $FAI_ACTION = "softupdate" ] || cp /etc/fai/fai.conf $target/etc/fai/fai.conf
+rm -f $target/etc/dpkg/dpkg.cfg.d/fai
+
+[ $FAI_ACTION = "install" ] && cp /etc/fai/fai.conf $target/etc/fai/fai.conf
 ainsl -av /etc/fai/fai.conf "FAI_CONFIG_SRC=$FAI_CONFIG_SRC"
 
 fcopy -Miv /etc/fai/fai.conf
diff --git a/fai/config/scripts/DEMO/10-misc b/fai/config/scripts/DEMO/10-misc
index 1f4f7a8..563ea65 100755
--- a/fai/config/scripts/DEMO/10-misc
+++ b/fai/config/scripts/DEMO/10-misc
@@ -1,6 +1,8 @@
 #! /bin/bash
 
-# (c) Thomas Lange, 2001-2010, lange at debian.org
+# (c) Thomas Lange, 2001-2013, lange at debian.org
+
+error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code
 
 ifclass XORG && {
     fcopy -M /etc/X11/xorg.conf
@@ -11,6 +13,3 @@ if [ -n "$ROOTPW" ] && ! $ROOTCMD getent passwd demo ; then
     $ROOTCMD adduser --disabled-login --gecos "fai demo user" demo
     $ROOTCMD usermod -p "$ROOTPW" demo
 fi
-
-chmod -c 666 ${target}/dev/fd*
-chmod -c 444 ${target}/dev/sr*
diff --git a/fai/config/scripts/FAIBASE/10-misc b/fai/config/scripts/FAIBASE/10-misc
index 5ed10e5..f22cee8 100755
--- a/fai/config/scripts/FAIBASE/10-misc
+++ b/fai/config/scripts/FAIBASE/10-misc
@@ -8,7 +8,9 @@ echo $TIMEZONE    > $target/etc/timezone
 cp -f /usr/share/zoneinfo/${TIMEZONE} $target/etc/localtime
 
 if [ -n "$IPADDR" ]; then
-    ifclass DHCPC || ainsl -s /etc/hosts "$IPADDR $HOSTNAME.$DOMAIN $HOSTNAME"
+    ainsl -vs /etc/hosts "$IPADDR $HOSTNAME.$DOMAIN $HOSTNAME"
+else
+    ainsl -vs /etc/hosts "127.0.0.1 $HOSTNAME"
 fi
 
 fcopy -iM /etc/hosts /etc/motd
diff --git a/fai/config/scripts/FAIBASE/20-removable_media b/fai/config/scripts/FAIBASE/20-removable_media
index 2db7167..bac0658 100755
--- a/fai/config/scripts/FAIBASE/20-removable_media
+++ b/fai/config/scripts/FAIBASE/20-removable_media
@@ -20,7 +20,7 @@ fstabline () {
 
 i=0
 for cdrom in $(cdromlist | tac); do
-    [ $i -eq 0 ] && [ ! -L $target/media/cdrom/cdrom0 ] && ln -s cdrom0 $target/media/cdrom
+    [ $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))
diff --git a/fai/config/scripts/GRUB_PC/10-setup b/fai/config/scripts/GRUB_PC/10-setup
index 86e62d4..a4f393e 100755
--- a/fai/config/scripts/GRUB_PC/10-setup
+++ b/fai/config/scripts/GRUB_PC/10-setup
@@ -1,5 +1,5 @@
 #! /bin/bash
-# support for GRUB version 2 (1.98-1)
+# support for GRUB version 2
 
 error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code
 
@@ -9,7 +9,6 @@ if [ "$FAI_ACTION" != "install" ] ; then
 fi
 
 set -a
-
 # during softupdate use this file
 [ -r $LOGDIR/disk_var.sh ] && . $LOGDIR/disk_var.sh
 
@@ -17,13 +16,33 @@ set -a
 
 $ROOTCMD grub-mkdevicemap --no-floppy
 GROOT=$($ROOTCMD grub-probe -tdrive -d $BOOT_DEVICE)
-# see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=606035
-GROOT=$(echo $GROOT | sed 's:md/:md:g')
-
 $ROOTCMD grub-install --no-floppy "$GROOT"
-echo "Grub installed on $BOOT_DEVICE = $GROOT"
+if [ $? -eq 0 ]; then
+    echo "Grub installed on $BOOT_DEVICE = $GROOT"
+fi
+
+# check if mdadm has been forgotten
+if grep -q active /proc/mdstat 2>/dev/null; then
+    if [ ! -d $target/etc/mdadm ]; then
+	echo WARNING: Found Software RAID, but mdadm was not installed
+    fi
+fi
 
 $ROOTCMD update-grub
 
+# skip the rest, if not an initial installation
+if [ $FAI_ACTION != "install" ]; then
+    exit $error
+fi
+
+# Check if RAID is used for the boot device
+if [[ $BOOT_DEVICE =~ '/dev/md' ]]; then
+    raiddev=${BOOT_DEVICE#/dev/}
+    # install grub on all members of RAID
+    for device in `perl -ne 'if(/^'$raiddev'\s.+raid\d+\s(.+)/){ $_=$1; s/\d+\[\d+\]//g; print }' /proc/mdstat`; do
+	echo Install grub on /dev/$device
+	$ROOTCMD grub-install --no-floppy "/dev/$device"
+    done
+fi
 
 exit $error
diff --git a/fai/config/tests/Faitest.pm b/fai/config/tests/Faitest.pm
index 98f9bc4..022b407 100644
--- a/fai/config/tests/Faitest.pm
+++ b/fai/config/tests/Faitest.pm
@@ -7,8 +7,9 @@
 
 package FAITEST;
 
-$errors = 0;
+my $errors = 0;
 
+use strict;
 use Getopt::Long;
 use Pod::Usage;
 #  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/debian-lan.git



More information about the debian-lan-devel mailing list