Merge branch 'upstream'
authorIan Kelling <iank@fsf.org>
Wed, 18 Aug 2021 04:03:04 +0000 (00:03 -0400)
committerIan Kelling <iank@fsf.org>
Wed, 18 Aug 2021 04:03:04 +0000 (00:03 -0400)
18 files changed:
fai/config/basefiles/mk-basefile
fai/config/class/20-hwdetect.sh
fai/config/class/85-efi-classes
fai/config/class/DEBIAN.var
fai/config/class/example.profile
fai/config/disk_config/XENIAL [deleted file]
fai/config/disk_config/XENIAL_EFI [deleted file]
fai/config/files/etc/fai/nfsroot.conf/FAISERVER
fai/config/files/etc/rc.local/FAISERVER
fai/config/hooks/savelog.LAST.sh
fai/config/package_config/DEBIAN
fai/config/package_config/GNOME
fai/config/package_config/STANDARD
fai/config/scripts/DEBIAN/10-rootpw
fai/config/scripts/FAISERVER/10-conffiles
fai/config/scripts/GRUB_EFI/10-setup
fai/config/scripts/GRUB_PC/10-setup
fai/config/scripts/LAST/50-misc

index e4fd05d4b951691d237aa8401d69dce32b635408..39471d83ae7cbff6e8416731ba7066a2707b4d5d 100755 (executable)
@@ -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
index 510be75fcab28f78fd80b4fe21c753c5d62643cd..57374c8c9f1cb24b86cb9fd071e519e8b40c510c 100755 (executable)
@@ -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
 
index ee2f04b97187789f1b6dc1006f4ef22ac5d80234..d61db7e88b29077dc59f2ad5598ae57813c493c4 100755 (executable)
@@ -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
index 367c2e3743706e68c2621d4d26c74cdb7474f2ae..a00d0f86720bdea4cef033144ea7965a1319b236 100644 (file)
@@ -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
index 5dc8f3ef02bf45854b35c487bd91fa8addafb4bc..cbcbf826afcabb33f9b2bab6979409ceafa5340e 100644 (file)
@@ -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 (file)
index 22ab65c..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-# example of new config file for setup-storage
-#
-# <type> <mountpoint> <size>   <fs type> <mount options> <misc options>
-
-# 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 (file)
index d72f130..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-# example of new config file for setup-storage
-#
-# <type> <mountpoint> <size>   <fs type> <mount options> <misc options>
-
-# 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"
index dfa5c1fbcc37129e12ca12475643ebdbff62140b..72491fddb31939a4e294ec91f55e61ce5c06559c 100644 (file)
@@ -1,7 +1,7 @@
 # For a detailed description see nfsroot.conf(5)
 
 # "<suite> <mirror>" 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
index fddf54aae51e8b8687687efe38a9a549afbda86a..2c255cced71b0a12ee807b48ea7c75cdce854852 100755 (executable)
@@ -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
index 7af0d338fd39a54ab75ff5f2c30174110f990032..65468144c6cb4168d5fb5fa32a23026f4c2bdcc3 100755 (executable)
@@ -13,7 +13,6 @@ warn
  bad
 bad
 no space
-syntax
 Couldn't stat
 Cannot access
  conflict
index 25e9d9e4cb4ea7b606bbeff677431714e7ad9b38..c1cb0bf77d09275dce20d6c8bed9643ef031a066 100644 (file)
@@ -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
index 4ddd3a8e6ca9428687dc79d06c60471d9dc469da..a7ac9088be125a2f5ec3149a641cd484dc1067f8 100644 (file)
@@ -4,6 +4,5 @@ firefox-esr
 #thunderbird
 menu gdm3
 gnome-core
-gconf-editor
 gnome-screensaver gnome-system-monitor gnome-system-tools
 network-manager-gnome
index 00376cbf1758629f325131fa55a782dfffaf1b43..413254f958391b5386813a11f4aac0801d047eca 100644 (file)
@@ -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
index 7a7f6177a30e398311f8b1659f61114487947767..539f2eb6c3badfe173022b0f7fc0e05959bdfebd 100755 (executable)
@@ -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
 
index 578255f8fc8a4d58098f9367891309df2f2e2302..92b17fc87d6c40d3a2f90f7c8367db6b351494aa 100755 (executable)
@@ -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"
index fa8dd514b3dd62997b8c70687f0ae12a8302d739..7dd92d4f000ebc8a44569cc4b7be5c11d66fb98a 100755 (executable)
@@ -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
index 85e90d2d08b4f2822d41f42149c34ad16593e154..e26aa2671180c03eccc373cac1c9845eef818688 100755 (executable)
@@ -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
index 2b41683cdc664e6033efaed5241fbd685580ae26..687700a6a5c112f79b5be81459456ba6eac24bdd 100755 (executable)
@@ -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 <<EOF > $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