From: Ian Kelling Date: Wed, 18 Aug 2021 04:03:04 +0000 (-0400) Subject: Merge branch 'upstream' X-Git-Url: https://iankelling.org/git/?p=automated-distro-installer;a=commitdiff_plain;h=591c84435e22df12f2b5121c08578bff7c6bb047;hp=92bc3e8554ea8442307a69e59619248dda974926 Merge branch 'upstream' --- diff --git a/fai/config/basefiles/mk-basefile b/fai/config/basefiles/mk-basefile index e4fd05d..39471d8 100755 --- a/fai/config/basefiles/mk-basefile +++ b/fai/config/basefiles/mk-basefile @@ -1,7 +1,7 @@ #! /bin/bash # 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_BELENOS=dhcp3-client,dhcp3-common,info @@ -235,6 +237,8 @@ prtdists() { STRETCH32 STRETCH64 BUSTER32 BUSTER64 BULLSEYE32 BULLSEYE64 + BOOKWORM32 BOOKWORM64 + TRIXIE32 TRIXIE64 SID32 SID64 " } @@ -316,7 +320,7 @@ case "$target" in debgeneric $target $MIRROR_TRISQUEL ;; 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 367c2e3..a00d0f8 100644 --- a/fai/config/class/DEBIAN.var +++ b/fai/config/class/DEBIAN.var @@ -1,7 +1,14 @@ -# sources are set with fcopy -#release=buster -#apt_cdn=http://deb.debian.org -#security_cdn=http://security.debian.org +# ian, commented, sources are set with fcopy +# 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/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 25e9d9e..c1cb0bf 100644 --- a/fai/config/package_config/DEBIAN +++ b/fai/config/package_config/DEBIAN @@ -6,6 +6,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 @@ -35,6 +42,3 @@ linux-image-arm64 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 00376cb..413254f 100644 --- a/fai/config/package_config/STANDARD +++ b/fai/config/package_config/STANDARD @@ -21,7 +21,7 @@ ncurses-term openssh-client pciutils perl -# newer distros dont have python, it gets naturally removed +# ian: newer distros dont have python, it gets naturally removed python python-minimal python3 @@ -79,5 +79,3 @@ PACKAGES install GRUB_EFI # a version in security, but theres a later version in updates that the system # really wants to install. grub-efi-amd64 - -PACKAGES install NABIA FOCAL diff --git a/fai/config/scripts/DEBIAN/10-rootpw b/fai/config/scripts/DEBIAN/10-rootpw index 7a7f617..539f2eb 100755 --- a/fai/config/scripts/DEBIAN/10-rootpw +++ b/fai/config/scripts/DEBIAN/10-rootpw @@ -4,8 +4,8 @@ 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 fi 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 85e90d2..e26aa26 100755 --- a/fai/config/scripts/GRUB_PC/10-setup +++ b/fai/config/scripts/GRUB_PC/10-setup @@ -17,7 +17,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 @@ -26,7 +26,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) @@ -40,18 +60,29 @@ 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 - for dev in $BOOT_DEVICE; do - GROOT=$($ROOTCMD grub-probe -tdrive -d $dev) - $ROOTCMD grub-install --no-floppy "$GROOT" - if [ $? -eq 0 ]; then - echo "Grub installed on $dev = $GROOT" - fi - done + for dev in $BOOT_DEVICE; do + mbrdevices=$(get_stable_devname $dev) + if [ -z "$mbrdevices" ]; then + # if we cannot find a persistent name (for e.g. in a VM) use old name + mbrdevices=$dev + fi + echo "Installing grub on $dev = $mbrdevices" + $ROOTCMD grub-install --no-floppy "$mbrdevices" + done 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 2b41683..687700a 100755 --- a/fai/config/scripts/LAST/50-misc +++ b/fai/config/scripts/LAST/50-misc @@ -74,7 +74,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 @@ -88,7 +88,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