various fixes, support for small root drive
authorIan Kelling <iank@fsf.org>
Sun, 15 Feb 2026 23:47:54 +0000 (18:47 -0500)
committerIan Kelling <iank@fsf.org>
Sun, 15 Feb 2026 23:47:54 +0000 (18:47 -0500)
fai/config/files/etc/apt/preferences.d/ecne-missing/ECNE_MISSING
fai/config/hooks/partition.DEFAULT
fai/config/scripts/IANK/11-iank
faiserver-setup
grub.cfg.autodiscover

index 763e8979e444096421cf086c18b30325d47fd3d2..c348c9ee25ace6b5898861ae23c7d768cfabe611 100644 (file)
@@ -2,6 +2,6 @@ Package: *
 Pin: release n=noble,o=Ubuntu
 Pin-Priority: -100
 
-Package: 9menu acetoneiso b43-fwcutter bibledit bibledit-cloud bibledit-cloud-data bibledit-data bible-kjv bible-kjv-text bibletime bibletime-data boinc boinc-client boinc-client-nvidia-cuda boinc-client-opencl boinc-dev boinc-manager boinc-screensaver bumblebee cgpt debian-reference debian-reference-common debian-reference-de debian-reference-en debian-reference-es debian-reference-fr debian-reference-id debian-reference-it debian-reference-ja debian-reference-pt debian-reference-pt-br debian-reference-zh-cn debian-reference-zh-tw dh-modaliases epoptes epoptes-client fglrx-pxpress grub-efi-amd64 grub-efi-amd64-bin grub-efi-amd64-dbg grub-efi-amd64-signed kde-config-whoopsie kernel-wedge kodi-inputstream-adaptive kodi-inputstream-rtmp kopete kopete-data libbiblesync1.1 libbiblesync-dev libboinc7t64 libboinc-app7t64 libboinc-app-dev libkopete1 libkopete-dev libnvpair3linux libuutil3linux libzpool5linux linux-xilinx-headers-6.8.0-1008 linux-xilinx-tools-common linux-xilinx-tools-host localechooser-data ltsp minigalaxy nvidia-common nvidia-prime oem-qemu-meta ophcrack ophcrack-cli origami p7zip p7zip-full pipsi pvpgn python3-pip python3-pip-whl qsampler qstat r8168-dkms rman rtl8812au-dkms shim shim-dbg shim-signed simutrans simutrans-data simutrans-makeobj simutrans-pak64 smtube tatan torbrowser-launcher ubufox ubuntu-keyring user-mode-linux-doc vboot-kernel-utils vboot-utils w9wm winetricks xdrawchem xqf xul-ext-ubufox
+Package: 9menu acetoneiso b43-fwcutter bibledit bibledit-cloud bibledit-cloud-data bibledit-data bible-kjv bible-kjv-text bibletime bibletime-data boinc boinc-client boinc-client-nvidia-cuda boinc-client-opencl boinc-dev boinc-manager boinc-screensaver bumblebee debian-reference debian-reference-common debian-reference-de debian-reference-en debian-reference-es debian-reference-fr debian-reference-id debian-reference-it debian-reference-ja debian-reference-pt debian-reference-pt-br debian-reference-zh-cn debian-reference-zh-tw dh-modaliases fglrx-pxpress grub-efi-amd64-signed kde-config-whoopsie kodi-inputstream-adaptive kodi-inputstream-rtmp libbiblesync1.1 libbiblesync-dev libboinc7t64 libboinc-app7t64 libboinc-app-dev libnvpair3linux libuutil3linux libzpool5linux localechooser-data minigalaxy nvidia-common nvidia-prime ophcrack ophcrack-cli origami pipsi pvpgn python3-pip python3-pip-whl qsampler qstat r8168-dkms rman rtl8812au-dkms shim shim-dbg shim-signed simutrans simutrans-data simutrans-makeobj simutrans-pak64 smtube tatan torbrowser-launcher ubufox ubuntu-keyring user-mode-linux-doc w9wm winetricks xdrawchem xqf xul-ext-ubufox
 Pin: release n=noble,o=Ubuntu
 Pin-Priority: 500
index 4e1b851abeb71746deaf9d15a47590c1b628a30c..fc5e521a20c31cdba39c3bb186149de95c2c33cf 100755 (executable)
@@ -373,7 +373,7 @@ $first_boot_dev  /boot  btrfs        nofail,$fstabstd,noatime,subvol=$boot_vol
 $first_efi  /boot/efi  vfat          nofail,$fstabstd  0 0
 $first_boot_dev  /mnt/boot  btrfs    nofail,$fstabstd,noatime,subvolid=0  0 0
 EOF
-  if ! fsf; then
+  if ! fsf && ! $skip_o; then
     cat >> /tmp/fai/fstab <<EOF
 /dev/mapper/crypt-${vgs[0]}-o  /mnt/o  btrfs       nofail,$fstabstd,noatime,subvolid=0$mopts_o  0 0
 EOF
@@ -383,9 +383,13 @@ EOF
     if ! fsf; then
       cat >>/tmp/fai/crypttab <<EOF
 crypt-$vg-root /dev/$vg/root  none  keyscript=/root/keyscript,discard,luks,initramfs
-crypt-$vg-o    /dev/$vg/o     none  keyscript=/root/keyscript,discard,luks,initramfs
 crypt-$vg-swap /dev/$vg/swap  /dev/urandom  swap,cipher=aes-xts-plain64,size=256,hash=ripemd160
 EOF
+      if ! $skip_o; then
+      cat >>/tmp/fai/crypttab <<EOF
+crypt-$vg-o    /dev/$vg/o     none  keyscript=/root/keyscript,discard,luks,initramfs
+EOF
+      fi
     fi
     if fsf; then
       cat >> /tmp/fai/fstab <<EOF
@@ -574,6 +578,7 @@ devwipe() {
 
 ##### begin variable setup
 
+skip_o=false
 
 partition=false
 if ifclass REPARTITION; then
@@ -859,19 +864,22 @@ case $raid_level in
   1|10) boot_space=$(( boot_space / 2 )) ;;
   1c3) boot_space=$(( boot_space / 3 )) ;;
 esac
+if ! fsf && (( boot_space < 500000 )); then
+  skip_o=true
+fi
+
 if fsf; then
   boot_mib=6000
-elif (( boot_space > 900000 )); then
+elif (( boot_space > 80000 )); then
   # this is larger than needed for several /boot subvols,
   # becuase I keep a minimal debian install on it for
   # recovery needs and for doing pxe-kexec.
   boot_mib=10000
-  root2_mib=500000
+  root2_mib=$(( boot_space / 2 ))
+  if (( root2_mib > 500000 )); then
+    root2_mib=500000
+  fi
   boot2_mib=5000
-elif (( boot_space > 30000 )); then
-  boot_mib=$(( 5000 + (boot_space - 30000) / 2 ))
-  root2_mib=100
-  boot2_mib=100
 else
   # Small vms don't have room for /boot recovery.  With 3 kernels
   # installed, i'm using 132M on t8, so this seems like plenty of
@@ -1087,14 +1095,18 @@ if $partition; then
       # 600 = uefi 512 + grubext 8 + bios grub 3 + some extra cuz this is lvm
       #root_mib=$(( disk_mib - root2_part_mib - swap_mib - boot_part_mib - boot2_part_mib - 600 ))
 
-      # If we have extra devices, give /o some overhead so that we can
-      # remove & then add a device if needed.
-      o_factor=$devs_count
-      if (( o_factor >= 2 )); then
-        o_factor=$(( o_factor - 1 ))
+      if $skip_o; then
+        o_mib=0
+      else
+        # If we have extra devices, give /o some overhead so that we can
+        # remove & then add a device if needed.
+        o_factor=$devs_count
+        if (( o_factor >= 2 )); then
+          o_factor=$(( o_factor - 1 ))
+        fi
+        # note: math operations are left to right, so divide at the end.
+        o_mib=$(( 180 * 1000 * raid_duplication / o_factor ))
       fi
-      # note: math operations are left to right, so divide at the end.
-      o_mib=$(( 180 * 1000 * raid_duplication / o_factor ))
       # max minus o, minus a gig just for some extra space
       max_root_mib=$(( disk_mib - root2_part_mib - swap_mib - boot_part_mib - boot2_part_mib - 600 - o_mib - 1000 ))
       root_mib=$(( 1700 * 1000 )) # * 1000 to make it in gb.
@@ -1108,7 +1120,7 @@ if $partition; then
     else
       # -L unit default mebibyte
       lvcreate -y -L $root_mib $vg -n root
-      if ! fsf; then
+      if ! fsf && ! $skip_o; then
         lvcreate -y -L $o_mib $vg -n o
       fi
       lvcreate -y -L $swap_mib $vg -n swap
@@ -1196,7 +1208,9 @@ if $partition; then
     # sensitive data.
     if ! fsf; then
       luks-setup /dev/$vg/root crypt-$vg-root
-      luks-setup /dev/$vg/o crypt-$vg-o
+      if ! $skip_o; then
+        luks-setup /dev/$vg/o crypt-$vg-o
+      fi
     fi
 
     if [[ $special_disk ]]; then
@@ -1208,7 +1222,7 @@ if $partition; then
   sleep 1
 
   bpart ${root_devs[@]}
-  if ! fsf; then
+  if ! fsf && ! $skip_o; then
     bpart ${o_devs[@]}
   fi
   bpart ${boot_devs[@]}
@@ -1225,8 +1239,10 @@ else ## end if $partition ##
       else
         cryptsetup luksOpen /dev/$vg/root crypt-$vg-root \
                    --key-file $luks_file
-        cryptsetup luksOpen /dev/$vg/o crypt-$vg-o \
-                   --key-file $luks_file
+        if ! $skip_o; then
+          cryptsetup luksOpen /dev/$vg/o crypt-$vg-o \
+                     --key-file $luks_file
+        fi
       fi
     done
   fi
index fc273aadaf083b9fca1cb8805b7115171ebed1a1..c469efa255af0199d5b6be6eb3f85b2dcba1b0ef 100755 (executable)
@@ -157,7 +157,7 @@ esac
 # https://nouveau.freedesktop.org/InstallNouveau.html
 # And now in t11, things got worse with a newer card also not loading
 # nouveau when it did in t10.
-if [[ $HOSTNAME != frodo ]] && lspci|grep -q 'VGA compatible controller: NVIDIA'; then
+if [[ $HOSTNAME != frodo && $HOSTNAME != kd ]] && lspci|grep -q 'VGA compatible controller: NVIDIA'; then
   mkdir -p $target/etc/X11/xorg.conf.d/
   cat >$target/etc/X11/xorg.conf.d/10-nouveau.conf <<'EOF'
 Section "Device"
@@ -354,16 +354,20 @@ if [[ $HOSTNAME == li ]]; then
 fi
 
 ## begin get new kernel and btrfs-progs ##
+apt-get -y install wget
+
 case $HOSTNAME in
   sy|so)
     # note, on sy t11, severe wifi degredation on mainline 6.8
     $ROOTCMD apt-get -y install linux-image-generic
     ;;
-  frodo) : ;;
+  frodo|kd) : ;;
   *)
     if ! $ROOTCMD dpkg -s -- freesh-archive-keyring  2>&1 | grep -Fx "Status: install ok installed" &>/dev/null; then
-      apt-get -y install wget
-      wget -O $target/tmp/x.deb https://linux-libre.fsfla.org/pub/linux-libre/freesh/pool/main/f/freesh-archive-keyring/freesh-archive-keyring_1.1_all.deb
+      if ! wget -O $target/tmp/x.deb https://linux-libre.fsfla.org/pub/linux-libre/freesh/pool/main/f/freesh-archive-keyring/freesh-archive-keyring_1.3_all.deb; then
+        echo "error: check freesh keyring url at https://www.fsfla.org/ikiwiki/selibre/linux-libre/freesh.en.html" >&2
+        exit 1
+      fi
       $ROOTCMD dpkg -i $target/tmp/x.deb
       $ROOTCMD apt-get update
       $ROOTCMD apt-get -y install linux-libre
index 4ecff541053758408d3974aefb7c643557e622fd..6bf7295ef00a3aa7e9bc9638c7fb9bd181b012ad 100755 (executable)
@@ -297,9 +297,6 @@ EOF
 fi
 
 rm -f /srv/fai/nfsroot/root/.ssh/known_hosts
-if [[ $HOSTNAME == kd ]]; then
-  keyscan_arg="-p 8989"
-fi
 key=$(ssh-keyscan $keyscan_arg localhost |& grep -o "ecdsa-sha2-nistp256.*")
 for ip in faiserver.b8.nz $(ip addr show up| grep -w '^ *inet' | awk '{print $2}'| cut -d / -f 1 | grep -vF 127.0.0.1); do
   echo "$ip $key" >>/srv/fai/nfsroot/root/.ssh/known_hosts
index fac9ef779ae1fd45534c0adc8f6fbe04d7f9aac2..b52bd53e31098df745980a3d30ce31540e6fd9ab 100644 (file)
@@ -1,5 +1,5 @@
 ## grub2 configuration
-set default="FAI server via dns"
+set default="FAI server via dns, no reboot"
 set timeout=20
 
 # make sure we can access partitions
@@ -23,21 +23,21 @@ set menu_color_highlight=black/yellow
 menuentry "FAI server via dns to faiserver.b8.nz" {
     set gfxpayload=$resolution
     search --set=root --file /FAI-CD
-    linux   /boot/vmlinuz libata.force=noncq FAI_FLAGS=verbose,sshd,createvt,reboot FAI_CONFIG_SRC=nfs://faiserver.b8.nz/srv/fai/config root=/dev/nfs nfsroot=faiserver.b8.nz:/srv/fai/nfsroot,vers=3,nolock rootovl ip=dhcp
+    linux   /boot/vmlinuz libata.force=noncq FAI_FLAGS=verbose,sshd,createvt,reboot FAI_CONFIG_SRC=nfs://faiserver.b8.nz/srv/fai/config root=/dev/nfs nfsroot=faiserver.b8.nz:/srv/fai/nfsroot,vers=3,nolock rootovl ip=dhcp console=ttyS0,115200
     initrd  /boot/initrd.img
 }
 
 menuentry "FAI server via dns, no reboot" {
     set gfxpayload=$resolution
     search --set=root --file /FAI-CD
-    linux   /boot/vmlinuz libata.force=noncq FAI_FLAGS=verbose,sshd,createvt FAI_CONFIG_SRC=nfs://faiserver.b8.nz/srv/fai/config root=/dev/nfs nfsroot=faiserver.b8.nz:/srv/fai/nfsroot,vers=3,nolock rootovl ip=dhcp
+    linux   /boot/vmlinuz libata.force=noncq FAI_FLAGS=verbose,sshd,createvt FAI_CONFIG_SRC=nfs://faiserver.b8.nz/srv/fai/config root=/dev/nfs nfsroot=faiserver.b8.nz:/srv/fai/nfsroot,vers=3,nolock rootovl ip=dhcp console=ttyS0,115200
     initrd  /boot/initrd.img
 }
 
 menuentry "FAI server via 192.168.122.1, no reboot" {
     set gfxpayload=$resolution
     search --set=root --file /FAI-CD
-    linux   /boot/vmlinuz libata.force=noncq FAI_FLAGS=verbose,sshd,createvt FAI_CONFIG_SRC=nfs://192.168.122.1/srv/fai/config root=/dev/nfs nfsroot=192.168.122.1:/srv/fai/nfsroot,vers=3,nolock rootovl ip=dhcp
+    linux   /boot/vmlinuz libata.force=noncq FAI_FLAGS=verbose,sshd,createvt FAI_CONFIG_SRC=nfs://192.168.122.1/srv/fai/config root=/dev/nfs nfsroot=192.168.122.1:/srv/fai/nfsroot,vers=3,nolock rootovl ip=dhcp console=ttyS0,115200
     initrd  /boot/initrd.img
 }
 
@@ -45,7 +45,7 @@ menuentry "FAI server via 192.168.122.1, no reboot" {
 # ro,noatime,vers=3,rsize=1048576,wsize=same,namelen=255,hard,nolock,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=10.2.0.2,nountvers=3,mountport=49179,mountproto=udp,lock_lock=all,addr=10.2.0.2
 menuentry "Autodiscover the FAI server" {
     search --set=root --file /FAI-CD
-    linux   /boot/vmlinuz libata.force=noncq FAI_FLAGS="menu,verbose,createvt" fai.discover rootovl root=/dev/nfs ip=dhcp quiet
+    linux   /boot/vmlinuz libata.force=noncq FAI_FLAGS="menu,verbose,createvt" fai.discover rootovl root=/dev/nfs ip=dhcp quiet console=ttyS0,115200
     initrd  /boot/initrd.img
 }