Tested with flidas vm.
dist=${DIST%%[0-9][0-9]}
local exc="EXCLUDE_$dist"
+ [ -n "${!exc}" ] && exc="--exclude=${!exc}" || unset exc
dist=${dist,,}
check
fi
if [ -n "$arch" ]; then
- qemu-debootstrap --arch $arch --exclude=${!exc} $inc $dist $xtmp $mirror
+ qemu-debootstrap --arch $arch ${exc} $inc $dist $xtmp $mirror
target="${target}_${arch^^}"
else
if [[ $DIST =~ 64 ]]; then
else
arch=i386
fi
- debootstrap --arch $arch --exclude=${!exc} $dist $xtmp $mirror
+ debootstrap --arch $arch ${exc} $inc $dist $xtmp $mirror
fi
cleanup-deb
tarit
# here, you can load modules depending on the kernel version
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" ;;
- 4*) kernelmodules="$kernelmodules mptspi dm-mod md-mod aes dm-crypt" ;;
+ [3456]*) kernelmodules="$kernelmodules mptspi dm-mod md-mod aes dm-crypt" ;;
esac
for mod in $kernelmodules; do
#! /bin/bash
ifclass -o CENTOS SLC && exit 0
-if ifclass -o I386 AMD64 ; then
- ifclass -o GRUB_PC GRUB_EFI ||echo GRUB_PC
+
+ifclass -o GRUB_PC GRUB_EFI && exit 0
+
+if [ -d /sys/firmware/efi ]; then
+ echo GRUB_EFI
+elif ifclass -o I386 AMD64 ; then
+ echo GRUB_PC
fi
-release=stretch
+release=buster
apt_cdn=http://deb.debian.org
security_cdn=http://security.debian.org
--- /dev/null
+Default: Xfce
+
+Name: Simple
+Description: My first FAI installation
+Short: just a very simple example, no xorg, an account called demo
+Long: This is the demohost example of FAI.
+Additional account called demo with password: fai, root password: fai
+All needed packages are already on the CD or USB stick.
+Classes: INSTALL FAIBASE DEBIAN DEMO
+
+Name: Xfce
+Description: Xfce desktop, LVM partitioning
+Short: A fancy Xfce desktop will be installed, the user account is demo
+Long: This is the Xfce desktop example. Additional account called
+demo with password: fai, root password: fai
+All needed packages are already on the CD or USB stick.
+Classes: INSTALL FAIBASE DEBIAN DEMO XORG XFCE LVM
+
+Name: Gnome
+Description: Gnome desktop installation
+Short: A Gnome desktop, no LVM, You will get an account called demo
+Long: This is the Gnome desktop example. Additional account called
+demo with password: fai, root password: fai
+You should have a fast network connection, because most packages are
+downloaded from the internet.
+Classes: INSTALL FAIBASE DEBIAN DEMO XORG GNOME
+
+Name: CentOS 7
+Description: CentOS 7 with Xfce desktop
+Short: A normal Xfce desktop, running CentOS 7
+Long: We use the Debian nfsroot for installing the CentOS 7 OS.
+You should have a fast network connection, because most packages are
+downloaded from the internet.
+Classes: INSTALL FAIBASE CENTOS CENTOS7_64 XORG
+
+Name: Ubuntu
+Description: Ubuntu 18.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 BIONIC BIONIC64 XORG
+
+Name: Inventory
+Description: Show hardware info
+Short: Show some basic hardware infos
+Long: Execute commands for showing hardware info
+Classes: INVENTORY
+
+Name: Sysinfo
+Description: Show defailed system information
+Short: Show detailed hardware and system information
+Long: Execute a lot of commands for collecting system information
+Classes: SYSINFO
# Linux command line:
-grub-pc grub2/linux_cmdline_default string elevator=noop quiet
+grub-pc grub2/linux_cmdline_default string elevator=noop quiet
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
-keyboard-configuration keyboard-configuration/modelcode string pc105
-keyboard-configuration keyboard-configuration/xkb-keymap select us
-keyboard-configuration keyboard-configuration/variant select USA
-keyboard-configuration keyboard-configuration/model select Generic 105-key (Intl) PC
-keyboard-configuration keyboard-configuration/layoutcode string us
-keyboard-configuration keyboard-configuration/optionscode string ctrl:nocaps,terminate:ctrl_alt_bksp
+keyboard-configuration keyboard-configuration/modelcode string pc105
+keyboard-configuration keyboard-configuration/xkb-keymap select us
+keyboard-configuration keyboard-configuration/variant select USA
+keyboard-configuration keyboard-configuration/model select Generic 105-key (Intl) PC
+keyboard-configuration keyboard-configuration/layoutcode string us
+keyboard-configuration keyboard-configuration/optionscode string ctrl:nocaps,terminate:ctrl_alt_bksp
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
+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
# option ntp-servers faiserver;
server-name faiserver;
next-server faiserver;
- filename "fai/pxelinux.0";
+ if substring(option vendor-class-identifier, 0, 20) = "PXEClient:Arch:00000" {
+ filename "fai/pxelinux.0";
+ }
+ if substring(option vendor-class-identifier, 0, 20) = "PXEClient:Arch:00007" {
+ filename "fai/syslinux.efi";
+ }
allow unknown-clients;
pool {
range 192.168.33.100 192.168.33.150;
# For a detailed description see nfsroot.conf(5)
# "<suite> <mirror>" for debootstrap
-FAI_DEBOOTSTRAP="stretch http://deb.debian.org/debian"
+FAI_DEBOOTSTRAP="buster http://deb.debian.org/debian"
FAI_ROOTPW='$1$kBnWcO.E$djxB128U7dMkrltJHPf6d1'
NFSROOT=/srv/fai/nfsroot
mkdir -p $FAI_CONFIGDIR
cp -a /usr/share/doc/fai-doc/examples/simple/* $FAI_CONFIGDIR
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)
+ myip=$(ip addr show up| grep -P -o '(?<=inet )[^/]+' | grep -v 127.0.0.1)
echo "APTPROXY=http://$myip:3142" >> /srv/fai/config/class/DEBIAN.var
fi
# set the LOGUSER, wo we get all the logs from our install clients
fai-chboot -o default
# create a template for booting the installation
-fai-chboot -Iv -f verbose,sshd,createvt,menu -u nfs://faiserver/srv/fai/config stretch.tmpl
+fai-chboot -Iv -f verbose,sshd,createvt,menu -u nfs://faiserver/srv/fai/config buster.tmpl
# Since we do not know the MAC address, our DHCP cannot provide the hostname.
# Therefore we do explicitly set the hostname
fcopy -Bi /etc/apt/apt.conf.d/force_confdef
-# ian: on flidas this gives an error: update-locale: Error: invalid locale settings: LANG=en_US.UTF-8
-# # in case the locales are already included inside the base file (Ubuntu)
-# if [ -f $target/usr/sbin/locale-gen ]; then
-# $ROOTCMD dpkg-reconfigure -fnoninteractive locales
-# exit
-# fi
+# in case the locales are already included inside the base file (Ubuntu)
+if [ -f $target/usr/sbin/locale-gen ]; then
+ exit
+fi
# if we want to install locales, install them now
install_packages -l 2>/dev/null | egrep -q ' locales|locales '
gstreamer.\+-plugins-really-bad
liberrors.so
liberrors-samba
+libsamba-errors
gsambad
libad
libtest-nowarnings-perl
WARNING: Failed to connect to lvmetad. Falling back to device scanning
Warning: The home dir /var/lib/usbmux you specified
diff: /var/lib/apparmor/profiles/.apparmor.md5sums: No such file or directory
+error reporting disabled
+Enabling Firmware First mode for corrected errors
+errors: 0
+ 0 errors
+Memory Error Correction:
+Memory Controller 0 - Channel . Error
+IIO RAS/Control Status/Global Errors
+__stack_chk_fail
+grub.cfg.new: Directory nonexistent
update-rc.d: warning: start and stop actions are no longer supported"
# add pattern on some conditions
nscd psmisc
bind9 dnsutils
iptables-persistent
-emacs25-nox
+zile
PACKAGES install FLIDAS64 XENIAL64
linux-image-generic-hwe-8.0
-PACKAGES install XORG
-ubuntu-desktop
-ubuntu-standard
-ubuntu-minimal
+PACKAGES install GERMAN
+language-pack-gnome-de
xfce4-goodies # additional tools
lightdm
firefox-esr
+network-manager-gnome
xscreensaver-gl
xterm
desktop-base
+
+PACKAGES install UBUNTU
+ubuntu-server-
+ubuntu-standard
+ubuntu-desktop
$ROOTCMD usermod -p "$ROOTPW" root
else
$ROOTCMD usermod -L root
+ # enable sudo for user
+ ainsl /etc/sudoers "$username ALL = ALL"
fi
exit $error
# modified from upstream fai example
error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code
+netplan_yaml() {
+ # network configuration using ubuntu's netplan.io
+ local IFNAME="$1"
+ local METHOD="$2"
+ echo "Generating netplan configuration for $IFNAME ($METHOD)" >&2
+ echo "# generated by FAI"
+ echo "network:"
+ echo " version: 2"
+ echo " renderer: $RENDERER"
+ case "$RENDERER" in
+ networkd)
+ echo " ethernets:"
+ echo " $IFNAME:"
+ case "$METHOD" in
+ dhcp)
+ echo " dhcp4: true"
+ ;;
+ static)
+ echo " addresses: [$CIDR]"
+ echo " gateway4: $GATEWAYS_1"
+ echo " nameservers:"
+ echo " search: [$DOMAIN]"
+ echo " addresses: [${DNSSRVS// /, }]"
+ ;;
+ esac
+ esac
+}
+
+iface_stanza() {
+ # classic network configuration using /etc/network/interfaces
+ local IFNAME="$1"
+ local METHOD="$2"
+ echo "Generating interface configuration for $IFNAME ($METHOD)" >&2
+ echo "# generated by FAI"
+ echo "auto $IFNAME"
+ echo "iface $IFNAME inet $METHOD"
+ case "$METHOD" in
+ static)
+ echo " address $IPADDR"
+ echo " netmask $NETMASK"
+ echo " broadcast $BROADCAST"
+ echo " gateway $GATEWAYS"
+ ;;
+ esac
+}
+
newnicnames() {
# determine predictable network names only for stretch and above
[ $do_init_tasks -eq 0 ] && return
-
+ [ -z "$NIC1" ] && return
ver=$($ROOTCMD dpkg-query --showformat='${Version}' --show udev)
if dpkg --compare-versions $ver lt 220-7; then
return
fi
- [ -z "$NIC1" ] && return
fields="ID_NET_NAME_FROM_DATABASE ID_NET_NAME_ONBOARD ID_NET_NAME_SLOT ID_NET_NAME_PATH"
for field in $fields; do
}
if [ -z "$NIC1" ]; then
- echo "ERROR: \$NIC1 is not defined. Cannot configure /etc/network/interfaces properly."
+ echo "WARNING: \$NIC1 is not defined. Cannot add ethernet to /etc/network/interfaces."
fi
-newnicnames
CIDR=$(ip -o -f inet addr show $NIC1 | awk '{print $4}')
-if ifclass DHCPC && [ $FAI_ACTION = "install" -o $FAI_ACTION = "dirinstall" ]; then
+newnicnames
+
+case "$FAI_ACTION" in
+ install|dirinstall)
+ ifclass DHCPC && METHOD=dhcp || METHOD=static
+ ifclass XORG && RENDERER=NetworkManager || RENDERER=networkd
- if ifclass VM; then
+ if [ -d $target/etc/netplan ]; then
+ # Ubuntu >= 17.10 with netplan.io
+ if [ -n "$NIC1" ]; then
+ netplan_yaml $NIC1 $METHOD > $target/etc/netplan/01-${NIC1}.yaml
+ fi
+ elif [ -d $target/etc/network/interfaces.d ]; then
+ # ifupdown >= 0.7.41 (Debian >= 8, Ubuntu >= 14.04)
+
+ if ifclass VM; then
# note, this condition would apply to the elif below too,
# but I don't specify a static ip in fai, so not bothering
cat > $target/etc/network/interfaces <<-EOF
iface lo inet loopback
iface $NIC1 inet dhcp
EOF
- else
+ else
cat > $target/etc/network/interfaces <<-EOF
# generated by FAI
auto lo br0
bridge_stp off
bridge_maxwait 0
EOF
+ fi
+ else
+ (
+ iface_stanza lo loopback
+ iface_stanza $NIC1 $METHOD
+ ) > $target/etc/network/interfaces
fi
-elif [ $FAI_ACTION = "install" -o $FAI_ACTION = "dirinstall" ]; then
- [ -n "$CIDR" ] && cat > $target/etc/network/interfaces <<-EOF
- # generated by FAI
- auto lo $NIC1
- iface lo inet loopback
- iface $NIC1 inet static
- address $CIDR
- gateway $GATEWAYS
-EOF
- [ -n "$NETWORK" ] && echo "localnet $NETWORK" > $target/etc/networks
- if [ ! -L $target/etc/resolv.conf -a -e /etc/resolv.conf ]; then
- cp -p /etc/resolv.conf $target/etc
+
+ if ! ifclass DHCPC ; then
+ [ -n "$NETWORK" ] && echo "localnet $NETWORK" > $target/etc/networks
+ if [ ! -L $target/etc/resolv.conf -a -e /etc/resolv.conf ]; then
+ cp -p /etc/resolv.conf $target/etc
+ fi
fi
-fi
+ ;;
+esac
# here fcopy is mostly used, when installing a client for running in a
# different subnet than during the installation
ainsl -av /etc/apt/apt.conf.d/02proxy 'Acquire::http::Proxy "http://127.0.0.1:3142";'
# create some host entries
- 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)
+ myip=$(ip addr show up| grep -P -o '(?<=inet )[^/]+' | grep -v 127.0.0.1)
ainsl /etc/hosts "$myip faiserver" # that's me
ainsl /etc/hosts "192.168.33.100 demohost"
ainsl /etc/hosts "192.168.33.101 xfcehost"
GROOT=$($ROOTCMD grub-probe -tdrive -d $BOOT_DEVICE)
+# handle /boot in lvm-on-md
+_bdev=$(readlink -f $BOOT_DEVICE)
+if [ "${_bdev%%-*}" = "/dev/dm" ]; then
+ BOOT_DEVICE=$( lvs --noheadings -o devices $BOOT_DEVICE | sed -e 's/^*\([^(]*\)(.*$/\1/' )
+fi
# Check if RAID is used for the boot device
if [[ $BOOT_DEVICE =~ '/dev/md' ]]; then
$ROOTCMD grub-install --no-floppy --force-extra-removable "/dev/$device"
done
-elif [[ $GROOT =~ 'hostdisk' ]]; then
+elif [[ $BOOT_DEVICE =~ '/dev/loop' ]]; then
+ # do not update vmram when using a loop device
$ROOTCMD grub-install --no-floppy --force-extra-removable --modules=part_gpt --no-nvram $BOOT_DEVICE
if [ $? -eq 0 ]; then
echo "Grub installed on hostdisk $BOOT_DEVICE"
GROOT=$($ROOTCMD grub-probe -tdrive -d $BOOT_DEVICE)
+# handle /boot in lvm-on-md
+_bdev=$(readlink -f $BOOT_DEVICE)
+if [ "${_bdev%%-*}" = "/dev/dm" ]; then
+ BOOT_DEVICE=$( lvs --noheadings -o devices $BOOT_DEVICE | sed -e 's/^*\([^(]*\)(.*$/\1/' )
+fi
# Check if RAID is used for the boot device
if [[ $BOOT_DEVICE =~ '/dev/md' ]]; then
echo Install grub on /dev/$device
$ROOTCMD grub-install --no-floppy "/dev/$device"
done
-
-elif [[ $GROOT =~ 'hostdisk' ]]; then
- for dev in $BOOT_DEVICE; do
- $ROOTCMD grub-install --no-floppy --modules=part_msdos $dev
- if [ $? -eq 0 ]; then
- echo "Grub installed on hostdisk $BOOT_DEVICE"
- fi
- done
else
for dev in $BOOT_DEVICE; do
GROOT=$($ROOTCMD grub-probe -tdrive -d $dev)
return
fi
- dists="jessie stretch buster xenial trusty"
+ dists="jessie stretch buster bullseye bookworm bionic xenial trusty"
for d in $dists; do
if grep -iq $d $target/etc/os-release; then
release=$d
--- /dev/null
+#! /bin/bash
+
+# disable the first login screen
+$ROOTCMD dpkg-divert --local --rename --add /etc/xdg/autostart/gnome-initial-setup-first-login.desktop
+$ROOTCMD dpkg-divert --local --rename --add /etc/xdg/autostart/gnome-initial-setup-copy-worker.desktop
+$ROOTCMD deluser --system gnome-initial-setup
+$ROOTCMD dpkg-reconfigure keyboard-configuration