# 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
#
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
tarit
}
+xenial() {
+
+ local arch=$1
+
+ check
+ debootstrap --arch $arch --exclude=${EXCLUDE_XENIAL} --include=${INCLUDE_DEBIAN} xenial $xtmp ${MIRROR_UBUNTU}
+ cleanup-deb
+ tarit
+}
+
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
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 ;;
# 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
--- /dev/null
+# german environment (for Debian)
+KEYMAP=de-latin1-nodeadkeys
--- /dev/null
+ubuntudist=xenial
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
--- /dev/null
+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
--- /dev/null
+# 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"
--- /dev/null
+# 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"
--- /dev/null
+# 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"
--- /dev/null
+# <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
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
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
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
globalerrorpatterns="error
fail
warn
+ bad
bad
no space
syntax
# 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
# 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
PACKAGES yumi
authconfig
kernel
-# grub # CentOS 5 and 6
+# sysvinit-tools grub # CentOS 5 and 6
grub2 # CentOS 7
less
openssh
ncurses-base # currently missing in the base file
#sendmail # only for C5 and C6
+
+PACKAGES yumi LVM
+lvm2
--- /dev/null
+PACKAGES aptitude
+task-german
+
+PACKAGES aptitude GNOME
+iceweasel-l10n-de icedove-l10n-de
PACKAGES aptitude
xfce4 # base system
xfce4-goodies # additional tools
-xdm
+lightdm
iceweasel
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
$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
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
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
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
# 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