update to 5.1.2 example
authorThomas Lange <lange@informatik.uni-koeln.de>
Tue, 9 Aug 2016 05:40:54 +0000 (22:40 -0700)
committerIan Kelling <ian@iankelling.org>
Mon, 6 Feb 2017 06:21:40 +0000 (22:21 -0800)
22 files changed:
fai/config/basefiles/mk-basefile
fai/config/class/DEBIAN.var
fai/config/class/GERMAN.var [new file with mode: 0644]
fai/config/class/UBUNTU.var [new file with mode: 0644]
fai/config/class/example.profile
fai/config/debconf/GERMAN [new file with mode: 0644]
fai/config/disk_config/CENTOS [new file with mode: 0644]
fai/config/disk_config/FAIBASE [new file with mode: 0644]
fai/config/disk_config/FAISERVER [new file with mode: 0644]
fai/config/disk_config/LVM [new file with mode: 0644]
fai/config/files/etc/rc.local/FAISERVER
fai/config/hooks/instsoft.DEBIAN
fai/config/hooks/savelog.LAST.sh
fai/config/hooks/setup.DEFAULT.sh
fai/config/hooks/updatebase.UBUNTU
fai/config/package_config/CENTOS
fai/config/package_config/GERMAN [new file with mode: 0644]
fai/config/package_config/XFCE
fai/config/scripts/CENTOS/30-mkinitrd
fai/config/scripts/DEBIAN/30-interface
fai/config/scripts/LAST/50-misc
fai/config/scripts/UBUNTU/90-apt

index 6eb29dbf4a54e86c2b8aab8f07578572c37571bb..591a87836cce9293b5fd47ec9cd38c94efe2e2ed 100755 (executable)
@@ -10,7 +10,7 @@
 
 # Supported distributions (each i386/amd64):
 # Debian GNU/Linux
-# Ubuntu 14.04
+# Ubuntu 14.04/16.04
 # CentOS 5/6/7
 # Scientific Linux Cern 5/6
 #
@@ -31,6 +31,7 @@ EXCLUDE_SQUEEZE=isc-dhcp-client,isc-dhcp-common,info,tasksel,tasksel-data
 EXCLUDE_WHEEZY=isc-dhcp-client,isc-dhcp-common,info,tasksel,tasksel-data
 EXCLUDE_JESSIE=isc-dhcp-client,isc-dhcp-common,info,tasksel,tasksel-data
 EXCLUDE_TRUSTY=dhcp3-client,dhcp3-common,info
+EXCLUDE_XENIAL=isc-dhcp-client,isc-dhcp-common,udhcpc,dibbler-client,dhcpcd5,info,tasksel,tasksel-data
 
 INCLUDE_DEBIAN=aptitude
 
@@ -197,6 +198,16 @@ trusty() {
     tarit
 }
 
+xenial() {
+
+    local arch=$1
+
+    check
+    debootstrap --arch $arch --exclude=${EXCLUDE_XENIAL} --include=${INCLUDE_DEBIAN} xenial $xtmp ${MIRROR_UBUNTU}
+    cleanup-deb
+    tarit
+}
+
 
 unknown() {
 
@@ -208,7 +219,9 @@ unknown() {
     CENTOS7_32   CENTOS7_64
     SLC5_32      SLC5_64
     SLC6_32      SLC6_64
+                 SLC7_64
     TRUSTY32     TRUSTY64
+    XENIAL32     XENIAL64
     SQUEEZE32    SQUEEZE64
     WHEEZY32     WHEEZY64
     JESSIE32     JESSIE64
@@ -251,8 +264,11 @@ case "$target" in
     SLC5_64) slc amd64 5 ;;
     SLC6_32) slc i386 6 ;;
     SLC6_64) slc amd64 6 ;;
+    SLC7_64) slc amd64 7 ;;
     TRUSTY32) trusty i386 ;;
     TRUSTY64) trusty amd64 ;;
+    XENIAL32) xenial i386 ;;
+    XENIAL64) xenial amd64 ;;
     SQUEEZE32) squeeze i386 ;;
     SQUEEZE64) squeeze amd64 ;;
     WHEEZY32) wheezy i386 ;;
index 37cbe7a15182e8c0179e2e74b2f1dd9c8c539ff4..a6fb66b6ba3b480799c9c58422abfd024582b9b5 100644 (file)
@@ -9,7 +9,7 @@ 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"
+#FAI_RAMDISKS="$target/var/lib/dpkg $target/var/cache"
 
 # if you want to use the faiserver as APT proxy
 #APTPROXY=http://faiserver:3142
diff --git a/fai/config/class/GERMAN.var b/fai/config/class/GERMAN.var
new file mode 100644 (file)
index 0000000..cbe2c93
--- /dev/null
@@ -0,0 +1,2 @@
+# german environment (for Debian)
+KEYMAP=de-latin1-nodeadkeys
diff --git a/fai/config/class/UBUNTU.var b/fai/config/class/UBUNTU.var
new file mode 100644 (file)
index 0000000..f45c3ce
--- /dev/null
@@ -0,0 +1 @@
+ubuntudist=xenial
index 084824f412c56d3a361b7ac5f918e14d39edad6d..d8467fc839084ee87b3d86e556b71aeb1af58e3c 100644 (file)
@@ -34,12 +34,12 @@ downloaded from the internet.
 Classes: INSTALL FAIBASE CENTOS CENTOS7_64 XORG
 
 Name: Ubuntu
-Description: Ubuntu 14.04 desktop installation
+Description: Ubuntu 16.04 desktop installation
 Short: Unity desktop
 Long: We use the Debian nfsroot for installing the Ubuntu OS.
 You should have a fast network connection, because most packages are
 downloaded from the internet.
-Classes: INSTALL FAIBASE DEMO DEBIAN UBUNTU TRUSTY TRUSTY64 XORG
+Classes: INSTALL FAIBASE DEMO DEBIAN UBUNTU XENIAL XENIAL64 XORG
 
 Name: Inventory
 Description: Show hardware info
diff --git a/fai/config/debconf/GERMAN b/fai/config/debconf/GERMAN
new file mode 100644 (file)
index 0000000..a1fbc27
--- /dev/null
@@ -0,0 +1,8 @@
+locales locales/default_environment_locale select de_DE.UTF-8
+locales locales/locales_to_be_generated multiselect de_DE.UTF-8 UTF-8
+keyboard-configuration  keyboard-configuration/modelcode        string  pc105
+keyboard-configuration  keyboard-configuration/xkb-keymap       select  de
+keyboard-configuration  keyboard-configuration/variant  select  Germany
+keyboard-configuration  keyboard-configuration/model    select  Generic 105-key (Intl) PC
+keyboard-configuration  keyboard-configuration/layoutcode       string  de
+keyboard-configuration  keyboard-configuration/optionscode      string  ctrl:nocaps,terminate:ctrl_alt_bksp
diff --git a/fai/config/disk_config/CENTOS b/fai/config/disk_config/CENTOS
new file mode 100644 (file)
index 0000000..99bf0b5
--- /dev/null
@@ -0,0 +1,17 @@
+# example of new config file for setup-storage
+#
+# <type> <mountpoint> <size>   <fs type> <mount options> <misc options>
+
+disk_config disk1 disklabel:msdos bootable:1 fstabkey:label
+
+# Note that the CentOS 5 version of GRUB cannot read from ext3 filesystems with inode_size > 128
+# CentOS 5.6 needs /boot as ext3, so we use ext3 for /
+
+#primary /      350      ext3  rw,noatime,errors=remount-ro createopts="-L ROOT -I 128"
+
+# use following line for CentOS 7
+primary /      4G-10G    ext4  rw,noatime,errors=remount-ro createopts="-L ROOT"
+
+logical swap   200-1000 swap  sw                           createopts="-L SWAP"
+logical /tmp   100-1G   ext4  rw,noatime,nosuid,nodev      createopts="-L TMP -m 0" tuneopts="-c 0 -i 0"
+logical /home  100-50%  ext4  rw,noatime,nosuid,nodev      createopts="-L HOME -m 1" tuneopts="-c 0 -i 0"
diff --git a/fai/config/disk_config/FAIBASE b/fai/config/disk_config/FAIBASE
new file mode 100644 (file)
index 0000000..c6d2d3e
--- /dev/null
@@ -0,0 +1,10 @@
+# example of new config file for setup-storage
+#
+# <type> <mountpoint> <size>   <fs type> <mount options> <misc options>
+
+disk_config disk1 disklabel:msdos bootable:1 fstabkey:uuid
+
+primary /      2G-15G   ext4  rw,noatime,errors=remount-ro
+logical swap   200-1G   swap  sw
+logical /tmp   100-1G   ext4  rw,noatime,nosuid,nodev createopts="-L tmp -m 0" tuneopts="-c 0 -i 0"
+logical /home  100-50%  ext4  rw,noatime,nosuid,nodev createopts="-L home -m 1" tuneopts="-c 0 -i 0"
diff --git a/fai/config/disk_config/FAISERVER b/fai/config/disk_config/FAISERVER
new file mode 100644 (file)
index 0000000..29bf219
--- /dev/null
@@ -0,0 +1,11 @@
+# config file for an FAI install server
+#
+# <type> <mountpoint> <size>   <fs type> <mount options> <misc options>
+
+disk_config disk1 disklabel:msdos fstabkey:uuid
+
+primary  /             2G-15G     ext4   rw,noatime,errors=remount-ro
+logical  swap          200-1000   swap   sw
+logical  /tmp          100-1000   ext4   rw,noatime,nosuid,nodev  createopts="-m 0" tuneopts="-c 0 -i 0"
+logical  /home         100-40%    ext4   rw,noatime,nosuid,nodev  createopts="-m 1" tuneopts="-c 0 -i 0"
+logical  /srv          1G-50%     ext4   rw,noatime               createopts="-m 1" tuneopts="-c 0 -i 0"
diff --git a/fai/config/disk_config/LVM b/fai/config/disk_config/LVM
new file mode 100644 (file)
index 0000000..f1b43fc
--- /dev/null
@@ -0,0 +1,15 @@
+# <type> <mountpoint> <size>   <fs type> <mount options> <misc options>
+
+# entire disk with LVM, separate /home
+
+disk_config disk1 fstabkey:uuid align-at:1M
+
+primary /boot  200     ext2    rw,noatime
+primary -       4G-    -       -
+
+disk_config lvm
+
+vg vg1  disk1.2
+vg1-root     /       3G-15G   ext4    noatime,rw
+vg1-swap     swap    200-4G   swap    sw
+vg1-home     /home   600-     ext4    noatime,nosuid,nodev,rw
index 764c62aa83676a57a29778356187fe21fe74427e..6640ab14dda034414494a3bed6ad94c2b90db1fd 100755 (executable)
@@ -26,7 +26,7 @@ echo "=================================" >/dev/console
 if [ ! -d "$FAI_CONFIGDIR/class" ]; then
     mkdir -p $FAI_CONFIGDIR
     cp -a /usr/share/doc/fai-doc/examples/simple/* $FAI_CONFIGDIR
-    ainsl /srv/fai/config/class/FAIBASE.var "LOGUSER=fai"
+    ainsl /srv/fai/config/class/FAIBASE.var "^LOGUSER=fai"
     myip=$(ip addr show up| grep -w inet | cut -d t -f 2 | cut -d ' ' -f 2 | cut -d / -f 1 | grep -v 127.0.0.1)
     echo "APTPROXY=http://$myip:3142" >> /srv/fai/config/class/DEBIAN.var
     # determine a fast mirror for Ubuntu
@@ -35,7 +35,7 @@ if [ ! -d "$FAI_CONFIGDIR/class" ]; then
     sed -i -e "s#MIRRORURL#$mirror#" /srv/fai/config/files/etc/apt/sources.list/UBUNTU
 fi
 # set the LOGUSER, wo we get all the logs from our install clients
-ainsl /etc/fai/fai.conf "LOGUSER=fai"
+ainsl /etc/fai/fai.conf "^LOGUSER=fai"
 
 # make index, then import the packages from the CD mirror
 apt-get update
index f036e2adc761e057d978a9719937a65c71f05fb9..c503a047d76a9f47514d5ca3f1910b06a513308f 100755 (executable)
@@ -8,7 +8,7 @@ if [ $FAI_ACTION != "install" ]; then
 fi
 
 fcopy -Bi /etc/apt/apt.conf.d/force_confdef
-ainsl -av /etc/ucf.conf "conf_force_conffold=YES"
+ainsl -av /etc/ucf.conf "^conf_force_conffold=YES"
 
 install_packages -l 2>/dev/null | egrep  -q  ' locales|locales '
 if [ $? -eq 0 ]; then
index 994a947b7e045f1bff65ccaf73f8ca9798e52afe..74aa116a609d5253924218f4f34133a3d252b52d 100755 (executable)
@@ -10,6 +10,7 @@ errfile=$LOGDIR/error.log
 globalerrorpatterns="error
 fail
 warn
+ bad
 bad
 no space
 syntax
index 711fa7f766a0a56866f0643a6cfe627d6587797b..bd9c3be892f27dea8c6aeeba99e662efff430e87 100755 (executable)
@@ -2,4 +2,10 @@
 
 # use short hostname instead of FQDN
 export HOSTNAME=${HOSTNAME%%.*}
-echo $HOSTNAME > /proc/sys/kernel/hostname
+# n.b. use $action instead of $FAI_ACTION
+# as the latter is apparently unset at this point in dirinstall
+if [ "$action" = "dirinstall" ] ; then
+  :
+else
+  echo $HOSTNAME > /proc/sys/kernel/hostname
+fi
index 226fb752218d91cf8b1553ffef8e679a67f5ef04..dadaa48693fef04a7db9d4b6f712e644980fcd1c 100755 (executable)
@@ -2,13 +2,11 @@
 
 # use external mirror, remove this script when using a mirror from CD
 
-dist=trusty
-
 cat <<EOM > $target/etc/apt/sources.list
 # external mirror
-deb MIRRORURL $dist main restricted universe multiverse
-deb MIRRORURL $dist-updates main restricted universe multiverse
-deb MIRRORURL $dist-security main restricted universe multiverse
+deb MIRRORURL $ubuntudist main restricted universe multiverse
+deb MIRRORURL $ubuntudist-updates main restricted universe multiverse
+deb MIRRORURL $ubuntudist-security main restricted universe multiverse
 EOM
 
 # determine a fast mirror for Ubuntu
index 96f87198851be707be00e0f4449475b5db64f064..a4ea3e04da42f169a7928e9b705d2dcf9c31620c 100644 (file)
@@ -9,7 +9,7 @@ gnome-desktop # CentOS 7
 PACKAGES yumi
 authconfig
 kernel
-# grub # CentOS 5 and 6
+# sysvinit-tools grub # CentOS 5 and 6
 grub2  # CentOS 7
 less
 openssh
@@ -26,3 +26,6 @@ pakchois
 ncurses-base # currently missing in the base file
 
 #sendmail # only for C5 and C6
+
+PACKAGES yumi LVM
+lvm2
diff --git a/fai/config/package_config/GERMAN b/fai/config/package_config/GERMAN
new file mode 100644 (file)
index 0000000..6ef01fa
--- /dev/null
@@ -0,0 +1,5 @@
+PACKAGES aptitude
+task-german
+
+PACKAGES aptitude GNOME
+iceweasel-l10n-de icedove-l10n-de
index a248674353feec5e75d0f4b84a03acdd24801499..965f5a01f85b4014a83022401391ca6eb484c737 100644 (file)
@@ -1,5 +1,5 @@
 PACKAGES aptitude
 xfce4 # base system
 xfce4-goodies # additional tools
-xdm
+lightdm
 iceweasel
index 89357b91f37806be79744df75cc159aae6e13546..cd114f9c179d6d9a5e9ef5c6d2a4d4b83fa98e2e 100755 (executable)
@@ -42,6 +42,11 @@ if [ -f $target/sbin/mkinitrd ]; then
     use_mkinitrd
 fi
 
+if [ -f $target/etc/lvm/lvm.conf ]; then
+     sed -i -e 's/use_lvmetad = 1/use_lvmetad = 0/' $target/etc/lvm/lvm.conf
+     ainsl -av /etc/dracut.conf.d/fai.conf 'add_dracutmodules+=" lvm "'
+fi
+
 # call dracut for CentOS 7
 if [ -f $target/usr/sbin/dracut ]; then
     # add filesystem driver into initrd
@@ -49,6 +54,11 @@ if [ -f $target/usr/sbin/dracut ]; then
     $ROOTCMD dracut -v --kver $version --force
 fi
 
-# for CentOS 6 we do not need to call dracut
+# call dracut for CentOS 6
+if [ -f $target/sbin/dracut ]; then
+    # add filesystem driver into initrd
+    ainsl -av /etc/dracut.conf.d/fai.conf 'filesystems+="ext4"'
+    $ROOTCMD dracut -v $version
+fi
 
 exit $error
index c3fbeaabe9fcecd5d80c0c148399fb57f7b2d557..9883731fd90efbaa728267d099d3755e6ebc554e 100755 (executable)
@@ -2,7 +2,7 @@
 
 error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code
 
-if ifclass DHCPC && [ $FAI_ACTION = "install" ]
+if ifclass DHCPC && [ $FAI_ACTION = "install" -o $FAI_ACTION = "dirinstall" ]
 then
     cat > $target/etc/network/interfaces <<-EOF
        # generated by FAI
@@ -10,7 +10,7 @@ then
        iface lo inet loopback
        iface $NIC1 inet dhcp
 EOF
-elif [ $FAI_ACTION = "install" ]
+elif [ $FAI_ACTION = "install" -o $FAI_ACTION = "dirinstall" ]
 then
       [ -n "$IPADDR" ] && cat > $target/etc/network/interfaces <<-EOF
        # generated by FAI
index 62c31db7b3a3ceafe726aa5ad180a387fcce75a8..25b6ce7e239bde45aa96af061dfcd133fe8fc919 100755 (executable)
@@ -4,20 +4,24 @@
 
 error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code
 
-# check if mdadm has been forgotten
-if grep -q active /proc/mdstat 2>/dev/null; then
+if [ "$FAI_ACTION" = "dirinstall" ] ; then
+  :
+else
+  # check if mdadm has been forgotten
+  if grep -q active /proc/mdstat 2>/dev/null; then
     if [ ! -d $target/etc/mdadm ]; then
        echo ERROR: Found Software RAID, but the mdadm package was not installed
        error=1
     fi
-fi
+  fi
 
-usedm=$(dmsetup ls | egrep -v '^live-rw|^live-base|^No devices found' | wc -l)
-if [ $usedm -ne 0 ]; then
+  usedm=$(dmsetup ls | egrep -v '^live-rw|^live-base|^No devices found' | wc -l)
+  if [ $usedm -ne 0 ]; then
     if [ ! -d $target/etc/lvm ]; then
        echo ERROR: Found lvm devices, but the lvm2 package was not installed
        error=1
     fi
+  fi
 fi
 
 # remove backup files from cfengine, but only if cfengine is installed
index 072e5603199f94dd25449857849f31e2d6920e3a..b75555b6de01cdf85480e11c83f05c250a165083 100755 (executable)
@@ -3,13 +3,11 @@
 # check if we already use an external mirror
 grep -q "external mirror" $target/etc/apt/sources.list && exit 0
 
-dist=trusty
-
 cat <<EOM > $target/etc/apt/sources.list
 # external mirror
-deb MIRRORURL $dist main restricted universe multiverse
-deb MIRRORURL $dist-updates main restricted universe multiverse
-deb MIRRORURL $dist-security main restricted universe multiverse
+deb MIRRORURL $ubuntudist main restricted universe multiverse
+deb MIRRORURL $ubuntudist-updates main restricted universe multiverse
+deb MIRRORURL $ubuntudist-security main restricted universe multiverse
 EOM
 
 # determine a fast mirror for Ubuntu