From: Ian Kelling Date: Wed, 18 Aug 2021 03:51:13 +0000 (-0400) Subject: update to 72d79e141d3aaf430bb44f6036a2980f3f5865bd X-Git-Url: https://iankelling.org/git/?p=automated-distro-installer;a=commitdiff_plain;h=490334746631a6c956eee47947f3ab8f8a451666 update to 72d79e141d3aaf430bb44f6036a2980f3f5865bd Sat May 22 18:19:22 2021 --- diff --git a/fai/config/basefiles/mk-basefile b/fai/config/basefiles/mk-basefile index be00fe2..085b9a4 100755 --- a/fai/config/basefiles/mk-basefile +++ b/fai/config/basefiles/mk-basefile @@ -2,7 +2,7 @@ # mk-basefile, create basefiles for some distributions # -# Thomas Lange, Uni Koeln, 2011-2020 +# Thomas Lange, Uni Koeln, 2011-2021 # based on the Makefile implementation of Michael Goetze # # Usage example: mk-basefile -J STRETCH64 @@ -30,6 +30,8 @@ EXCLUDE_JESSIE=info EXCLUDE_STRETCH=info EXCLUDE_BUSTER= EXCLUDE_BULLSEYE= +EXCLUDE_BOOKWORM= +EXCLUDE_TRIXIE= EXCLUDE_SID= EXCLUDE_TRUSTY=dhcp3-client,dhcp3-common,info @@ -220,6 +222,8 @@ prtdists() { STRETCH32 STRETCH64 BUSTER32 BUSTER64 BULLSEYE32 BULLSEYE64 + BOOKWORM32 BOOKWORM64 + TRIXIE32 TRIXIE64 SID32 SID64 " } @@ -296,7 +300,7 @@ case "$target" in SLC7_64) slc amd64 7 ;; TRUSTY*|XENIAL*|BIONIC*|FOCAL*) debgeneric $target $MIRROR_UBUNTU ;; - SQUEEZE*|WHEEZY*|JESSIE*|STRETCH*|BUSTER*|BULLSEYE*|SID*) + SQUEEZE*|WHEEZY*|JESSIE*|STRETCH*|BUSTER*|BULLSEYE*|BOOKWORM*|TRIXIE*|SID*) debgeneric $target $MIRROR_DEBIAN $ARCH;; *) echo "Unknown distribution. Aborting." prtdists diff --git a/fai/config/class/20-hwdetect.sh b/fai/config/class/20-hwdetect.sh index 510be75..57374c8 100755 --- a/fai/config/class/20-hwdetect.sh +++ b/fai/config/class/20-hwdetect.sh @@ -20,7 +20,8 @@ for mod in $kernelmodules; do modprobe -a $mod 1>/dev/null 2>&1 done -ip ad show up | egrep -iv 'loopback|127.0.0.1|::1/128|_lft' +# show the basic information about the network interface +ip -br li show up|egrep -v ^lo; ip -br a show up|egrep -v ^lo echo $printk > /proc/sys/kernel/printk diff --git a/fai/config/class/85-efi-classes b/fai/config/class/85-efi-classes index ee2f04b..d61db7e 100755 --- a/fai/config/class/85-efi-classes +++ b/fai/config/class/85-efi-classes @@ -6,12 +6,9 @@ if [ ! -d /sys/firmware/efi ]; then exit 0 fi -if ifclass FAIBASE; then - echo FAIBASE_EFI -elif ifclass FAISERVER; then - echo FAISERVER_EFI -elif ifclass LVM; then - echo LVM_EFI -elif ifclass XENIAL; then - echo XENIAL_EFI -fi +for c in LVM FAISERVER FAIBASE; do + if ifclass $c; then + echo ${c}_EFI + break + fi +done diff --git a/fai/config/class/DEBIAN.var b/fai/config/class/DEBIAN.var index e9a2756..dc133a5 100644 --- a/fai/config/class/DEBIAN.var +++ b/fai/config/class/DEBIAN.var @@ -1,7 +1,14 @@ -release=buster +release=bullseye apt_cdn=http://deb.debian.org security_cdn=http://security.debian.org +# since bullseye Debian changed the suite name for security +if [ $release = buster ]; then + secsuite=buster/updates +else + secsuite=$release-security +fi + CONSOLEFONT= KEYMAP=us-latin1 diff --git a/fai/config/class/example.profile b/fai/config/class/example.profile index 5dc8f3e..cbcbf82 100644 --- a/fai/config/class/example.profile +++ b/fai/config/class/example.profile @@ -34,7 +34,7 @@ downloaded from the internet. Classes: INSTALL FAIBASE CENTOS CENTOS8_64 XORG Name: Ubuntu -Description: Ubuntu 20.04 desktop installation +Description: Ubuntu 20.04 LTS 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 diff --git a/fai/config/disk_config/XENIAL b/fai/config/disk_config/XENIAL deleted file mode 100644 index 22ab65c..0000000 --- a/fai/config/disk_config/XENIAL +++ /dev/null @@ -1,12 +0,0 @@ -# example of new config file for setup-storage -# -# - -# this is a copy of FAIBASE, but with metadata_csum disabled. -# Ubuntu XENIAL does not yet suport this option - -disk_config disk1 disklabel:msdos bootable:1 fstabkey:uuid - -primary / 2G-50G ext4 rw,noatime,errors=remount-ro createopts="-O ^metadata_csum" -logical swap 200-1G swap sw -logical /home 100- ext4 rw,noatime,nosuid,nodev createopts="-L home -m 1 -O ^metadata_csum" tuneopts="-c 0 -i 0" diff --git a/fai/config/disk_config/XENIAL_EFI b/fai/config/disk_config/XENIAL_EFI deleted file mode 100644 index d72f130..0000000 --- a/fai/config/disk_config/XENIAL_EFI +++ /dev/null @@ -1,13 +0,0 @@ -# example of new config file for setup-storage -# -# - -# this is a copy of FAIBASE, but with metadata_csum disabled. -# Ubuntu XENIAL does not yet suport this option - -disk_config disk1 disklabel:gpt bootable:1 fstabkey:uuid - -primary /boot/efi 512M vfat rw -primary / 2G-50G ext4 rw,noatime,errors=remount-ro createopts="-O ^metadata_csum" -primary swap 200-1G swap sw -primary /home 100- ext4 rw,noatime,nosuid,nodev createopts="-L home -m 1 -O ^metadata_csum" tuneopts="-c 0 -i 0" diff --git a/fai/config/files/etc/apt/sources.list/GNOME b/fai/config/files/etc/apt/sources.list/GNOME index f016a99..20861df 100644 --- a/fai/config/files/etc/apt/sources.list/GNOME +++ b/fai/config/files/etc/apt/sources.list/GNOME @@ -1,3 +1,3 @@ deb {%apt_cdn%}/debian {%release%} main -deb {%security_cdn%}/debian-security {%release%}/updates main +deb {%security_cdn%}/debian-security {%secsuite%} main deb {%apt_cdn%}/debian {%release%}-updates main diff --git a/fai/config/files/etc/fai/nfsroot.conf/FAISERVER b/fai/config/files/etc/fai/nfsroot.conf/FAISERVER index dfa5c1f..72491fd 100644 --- a/fai/config/files/etc/fai/nfsroot.conf/FAISERVER +++ b/fai/config/files/etc/fai/nfsroot.conf/FAISERVER @@ -1,7 +1,7 @@ # For a detailed description see nfsroot.conf(5) # " " for debootstrap -FAI_DEBOOTSTRAP="buster http://deb.debian.org/debian" +FAI_DEBOOTSTRAP="bullseye http://deb.debian.org/debian" FAI_ROOTPW='$1$kBnWcO.E$djxB128U7dMkrltJHPf6d1' NFSROOT=/srv/fai/nfsroot diff --git a/fai/config/files/etc/rc.local/FAISERVER b/fai/config/files/etc/rc.local/FAISERVER index fddf54a..2c255cc 100755 --- a/fai/config/files/etc/rc.local/FAISERVER +++ b/fai/config/files/etc/rc.local/FAISERVER @@ -35,7 +35,9 @@ 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" - myip=$(ip addr show up| grep -P -o '(?<=inet )[^/]+' | grep -v 127.0.0.1) + _nic=$(ip route | awk '/^default/ {print $5}'|head -1) + myip=$(ip -br ad sh $_nic | awk '{print $3}') + myip=${myip%/*} 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 @@ -81,7 +83,7 @@ EOF 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 buster.tmpl +fai-chboot -Iv -f verbose,sshd,createvt,menu -u nfs://faiserver/srv/fai/config bullseye.tmpl # Since we do not know the MAC address, our DHCP cannot provide the hostname. # Therefore we do explicitly set the hostname diff --git a/fai/config/hooks/savelog.LAST.sh b/fai/config/hooks/savelog.LAST.sh index 7af0d33..6546814 100755 --- a/fai/config/hooks/savelog.LAST.sh +++ b/fai/config/hooks/savelog.LAST.sh @@ -13,7 +13,6 @@ warn bad bad no space -syntax Couldn't stat Cannot access conflict diff --git a/fai/config/package_config/DEBIAN b/fai/config/package_config/DEBIAN index 539b71f..fe7cff7 100644 --- a/fai/config/package_config/DEBIAN +++ b/fai/config/package_config/DEBIAN @@ -19,6 +19,13 @@ PACKAGES install NONFREE # you may want these non-free kernel drivers firmware-bnx2 firmware-bnx2x firmware-realtek firmware-linux-nonfree +# a list of firmware for wifi/wireless +atmel-firmware firmware-atheros firmware-brcm80211 +firmware-iwlwifi firmware-libertas firmware-ralink firmware-zd1211 +firmware-brcm80211 firmware-ti-connectivity +firmware-netronome firmware-netxen firmware-realtek +firmware-cavium +# firmware-ipw2x00 # needs a debconf question PACKAGES install I386 linux-image-686-pae @@ -44,6 +51,3 @@ grub-efi PACKAGES install LVM lvm2 - -PACKAGES install CLOUD -unattended-upgrades diff --git a/fai/config/package_config/GNOME b/fai/config/package_config/GNOME index 4ddd3a8..a7ac908 100644 --- a/fai/config/package_config/GNOME +++ b/fai/config/package_config/GNOME @@ -4,6 +4,5 @@ firefox-esr #thunderbird menu gdm3 gnome-core -gconf-editor gnome-screensaver gnome-system-monitor gnome-system-tools network-manager-gnome diff --git a/fai/config/package_config/STANDARD b/fai/config/package_config/STANDARD index 6760e7d..de178ae 100644 --- a/fai/config/package_config/STANDARD +++ b/fai/config/package_config/STANDARD @@ -22,10 +22,16 @@ netcat-traditional openssh-client pciutils perl -python -python-minimal reportbug telnet traceroute ucf xz-utils + +PACKAGES install-norec STRETCH BUSTER +python +python-minimal + +PACKAGES install-norec BULLSEYE +python3 +python3-minimal diff --git a/fai/config/scripts/DEBIAN/10-rootpw b/fai/config/scripts/DEBIAN/10-rootpw index bb77d1a..329e2f6 100755 --- a/fai/config/scripts/DEBIAN/10-rootpw +++ b/fai/config/scripts/DEBIAN/10-rootpw @@ -4,11 +4,14 @@ error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code # set root password if [ -n "$ROOTPW" ]; then - $ROOTCMD usermod -p "$ROOTPW" root -else + $ROOTCMD chpasswd --encrypted <<< "root:${ROOTPW}" +elif [ -n "$username" ]; then $ROOTCMD usermod -L root # enable sudo for user ainsl /etc/sudoers "$username ALL = ALL" + if [ ! -f $target/usr/bin/sudo ]; then + echo "WARNING. Package sudo is not installed" + fi fi exit $error diff --git a/fai/config/scripts/DEBIAN/30-interface b/fai/config/scripts/DEBIAN/30-interface index bff6863..4b0dcf4 100755 --- a/fai/config/scripts/DEBIAN/30-interface +++ b/fai/config/scripts/DEBIAN/30-interface @@ -38,9 +38,7 @@ iface_stanza() { echo "iface $IFNAME inet $METHOD" case "$METHOD" in static) - echo " address $IPADDR" - echo " netmask $NETMASK" - echo " broadcast $BROADCAST" + echo " address $CIDR" echo " gateway $GATEWAYS" ;; esac @@ -53,11 +51,6 @@ newnicnames() { [ $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 - fields="ID_NET_NAME_FROM_DATABASE ID_NET_NAME_ONBOARD ID_NET_NAME_SLOT ID_NET_NAME_PATH" for field in $fields; do @@ -81,7 +74,7 @@ newnicnames() { if [ -z "$NIC1" ]; then echo "WARNING: \$NIC1 is not defined. Cannot add ethernet to /etc/network/interfaces." fi -CIDR=$(ip -o -f inet addr show $NIC1 | awk '{print $4}') +CIDR=$(ip --br ad sh $NIC1|awk '{print $3}') newnicnames case "$FAI_ACTION" in diff --git a/fai/config/scripts/FAISERVER/10-conffiles b/fai/config/scripts/FAISERVER/10-conffiles index 578255f..92b17fc 100755 --- a/fai/config/scripts/FAISERVER/10-conffiles +++ b/fai/config/scripts/FAISERVER/10-conffiles @@ -18,7 +18,9 @@ if [ $FAI_ACTION = "install" -o $FAI_ACTION = "dirinstall" ] ; then 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 -P -o '(?<=inet )[^/]+' | grep -v 127.0.0.1) + _nic=$(ip route | awk '/^default/ {print $5}'|head -1) + myip=$(ip -br ad sh $_nic | awk '{print $3}') + myip=${myip%/*} ainsl /etc/hosts "$myip faiserver" # that's me ainsl /etc/hosts "192.168.33.100 demohost" ainsl /etc/hosts "192.168.33.101 xfcehost" diff --git a/fai/config/scripts/GRUB_EFI/10-setup b/fai/config/scripts/GRUB_EFI/10-setup index fa8dd51..7dd92d4 100755 --- a/fai/config/scripts/GRUB_EFI/10-setup +++ b/fai/config/scripts/GRUB_EFI/10-setup @@ -24,7 +24,7 @@ if [ -z "$BOOT_DEVICE" ]; then exit 189 fi -# disable os-prober because of #788062 +# disable os-prober because of #802717 ainsl /etc/default/grub 'GRUB_DISABLE_OS_PROBER=true' # skip the rest, if not an initial installation diff --git a/fai/config/scripts/GRUB_PC/10-setup b/fai/config/scripts/GRUB_PC/10-setup index cbff2d8..270b356 100755 --- a/fai/config/scripts/GRUB_PC/10-setup +++ b/fai/config/scripts/GRUB_PC/10-setup @@ -16,7 +16,7 @@ if [ -z "$BOOT_DEVICE" ]; then exit 189 fi -# disable os-prober because of #788062 +# disable os-prober because of #802717 ainsl /etc/default/grub 'GRUB_DISABLE_OS_PROBER=true' # skip the rest, if not an initial installation @@ -25,7 +25,27 @@ if [ $FAI_ACTION != "install" ]; then exit $error fi -GROOT=$($ROOTCMD grub-probe -tdrive -d $BOOT_DEVICE) +get_stable_devname() { + + local _DEV="$1" + local i + declare -a _RES + + # prefer SCSI over ATA over WWN over path + # do not use by-path + + for i in $($ROOTCMD udevadm info -r --query=symlink "$_DEV"); do + if [[ "$i" =~ /by-id/scsi ]]; then + _RES[10]="$i" + elif [[ "$i" =~ /by-id/ata ]]; then + _RES[20]="$i" + elif [[ "$i" =~ /by-id/wwn ]]; then + _RES[99]="$i" + fi + done + + echo "${_RES[@]::1}" +} # handle /boot in lvm-on-md _bdev=$(readlink -f $BOOT_DEVICE) @@ -38,15 +58,27 @@ if [[ $BOOT_DEVICE =~ '/dev/md' ]]; then raiddev=${BOOT_DEVICE#/dev/} # install grub on all members of RAID for device in $(LC_ALL=C perl -ne 'if(/^'$raiddev'\s.+raid\d+\s(.+)/){ $_=$1; s/\d+\[\d+\]//g; s/(nvme.+?)p/$1/g; print }' /proc/mdstat); do - echo Install grub on /dev/$device + pdevice=$(get_stable_devname /dev/$device) + if [ -z "$pdevice" ]; then + # if we cannot find a persistent name (for e.g. in a VM) use old name + pdevice="/dev/$device" + fi + mbrdevices+="$pdevice, " + echo Installing grub on /dev/$device = $pdevice $ROOTCMD grub-install --no-floppy "/dev/$device" done + # remove last , + mbrdevices=${mbrdevices%, } else - $ROOTCMD grub-install --no-floppy "$GROOT" - if [ $? -eq 0 ]; then - echo "Grub installed on $BOOT_DEVICE = $GROOT" + mbrdevices=$(get_stable_devname $BOOT_DEVICE) + if [ -z "$mbrdevices" ]; then + # if we cannot find a persistent name (for e.g. in a VM) use old name + mbrdevices=$BOOT_DEVICE fi + echo "Installing grub on $BOOT_DEVICE = $mbrdevices" + $ROOTCMD grub-install --no-floppy "$mbrdevices" fi -$ROOTCMD update-grub +echo "grub-pc grub-pc/install_devices multiselect $mbrdevices" | $ROOTCMD debconf-set-selections +$ROOTCMD dpkg-reconfigure grub-pc exit $error diff --git a/fai/config/scripts/LAST/50-misc b/fai/config/scripts/LAST/50-misc index 5b34f7b..a573f50 100755 --- a/fai/config/scripts/LAST/50-misc +++ b/fai/config/scripts/LAST/50-misc @@ -72,7 +72,7 @@ setrel() { return fi - dists="jessie stretch buster bullseye bookworm focal bionic xenial trusty" + dists="jessie stretch buster bullseye bookworm trixie focal bionic xenial trusty" for d in $dists; do if grep -iq $d $target/etc/os-release; then release=$d @@ -86,7 +86,7 @@ setrel if [ -f $target/etc/apt/sources.list -a -n "$release" ]; then grep -q 'file generated by fai-cd' $target/etc/apt/sources.list && cat < $target/etc/apt/sources.list deb $apt_cdn/debian $release main contrib non-free -deb $apt_cdn/debian-security $release/updates main contrib non-free +deb $security_cdn/debian-security ${secsuite} main contrib non-free #deb [trusted=yes] http://fai-project.org/download $release koeln EOF # if the package fai-server was installed, enable the project's repository