From 6315fdaa029f0f107d98fde18ab584f958e06108 Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Sat, 3 Jul 2021 00:03:27 -0400 Subject: [PATCH] fixes and updates for t10 --- .../files/root/fai-check/VOL_BUSTER_BOOTSTRAP | 6 ++++-- fai/config/files/usr/bin/myncq/kd | 2 +- fai/config/hooks/partition.DEFAULT | 15 ++++++++------ fai/config/package_config/DEBIAN | 9 +++++---- fai/config/package_config/STANDARD | 6 +++++- fai/config/scripts/GRUB_PC/11-iank | 20 +++++++++++++++++-- faiserver-setup | 7 +++++++ grub.cfg.autodiscover | 8 ++++++++ pxe-server | 8 ++++---- 9 files changed, 61 insertions(+), 20 deletions(-) diff --git a/fai/config/files/root/fai-check/VOL_BUSTER_BOOTSTRAP b/fai/config/files/root/fai-check/VOL_BUSTER_BOOTSTRAP index cff15ed..e063ab2 100755 --- a/fai/config/files/root/fai-check/VOL_BUSTER_BOOTSTRAP +++ b/fai/config/files/root/fai-check/VOL_BUSTER_BOOTSTRAP @@ -52,8 +52,10 @@ first=true for dev in $(btrfs fi show / | sed -rn 's#^\s*devid\s.*\s([^0-9 ]+)\S+$#\1#p' \ |sort); do - if [[ $(blockdev --getsize64 ${boot_disk}4) == 8388608 ]]; then - # old partition scheme + # Decide which is my grub_ext partition. see partition.DEFAULT file + # for details + if [[ $(blockdev --getsize64 ${dev}4) == 8388608 ]]; then + # Old partition scheme dev+=4 else dev+=5 diff --git a/fai/config/files/usr/bin/myncq/kd b/fai/config/files/usr/bin/myncq/kd index e2b6494..2d65edb 100755 --- a/fai/config/files/usr/bin/myncq/kd +++ b/fai/config/files/usr/bin/myncq/kd @@ -45,7 +45,7 @@ ata=${ata%%/*} arg=libata.force=${ata}.00:noncq if ! grep "^GRUB_CMDLINE_LINUX_DEFAULT=.*[\" ]${arg//./\\.}[\" ]" /etc/default/grub; then - sed -ri "s/^GRUB_CMDLINE_LINUX_DEFAULT=\"(.*)/GRUB_CMDLINE_LINUX_DEFAULT=\"$arg \1/" /etc/default/grub + sed -ri "s/([\" ])libata.force=[^ ]+ */\1/g;s/^GRUB_CMDLINE_LINUX_DEFAULT=\"(.*)/GRUB_CMDLINE_LINUX_DEFAULT=\"$arg \1/" /etc/default/grub if $upgrub; then echo "$0: warning: grub updated. you may want to reboot" if type -P update-grub2 &>/dev/null; then diff --git a/fai/config/hooks/partition.DEFAULT b/fai/config/hooks/partition.DEFAULT index 09020d2..534e1fa 100755 --- a/fai/config/hooks/partition.DEFAULT +++ b/fai/config/hooks/partition.DEFAULT @@ -608,12 +608,15 @@ if $wipe && [[ $DISTRO != debianbuster_bootstrap ]]; then # btrfs subvolume set-default \ # $(btrfs subvolume list . | grep "root_$DISTRO$" | awk '{print $2}') . - # no cow on the root filesystem. it's setup is fully scripted, - # if it's messed up, we will just recreated it, - # and we can get better perf with this. - # I can't remember exactly why, but this is preferable to mounting with - # -o nodatacow, I think because subvolumes inherit that. - chattr -Rf +C root_$DISTRO + # For raid systems, cow allows for error correction, for non-raid systems, + # protects root fs from having the plug pulled. Reprovisioning a root + # subvol is not my favorite thing to do. + # # no cow on the root filesystem. it's setup is fully scripted, + # # if it's messed up, we will just recreated it, + # # and we can get better perf with this. + # # I can't remember exactly why, but this is preferable to mounting with + # # -o nodatacow, I think because subvolumes inherit that. + # chattr -Rf +C root_$DISTRO cd / umount /mnt fi diff --git a/fai/config/package_config/DEBIAN b/fai/config/package_config/DEBIAN index 88dc034..25e9d9e 100644 --- a/fai/config/package_config/DEBIAN +++ b/fai/config/package_config/DEBIAN @@ -25,11 +25,12 @@ PACKAGES install ARM64 grub-efi-arm64 linux-image-arm64 -PACKAGES install GRUB_PC -grub-pc +# this is duplicate with STANDARD. +#PACKAGES install GRUB_PC +#grub-pc -PACKAGES install GRUB_EFI -grub-efi +#PACKAGES install GRUB_EFI +#grub-efi PACKAGES install LVM diff --git a/fai/config/package_config/STANDARD b/fai/config/package_config/STANDARD index 95086d0..12ef2b0 100644 --- a/fai/config/package_config/STANDARD +++ b/fai/config/package_config/STANDARD @@ -72,6 +72,10 @@ PACKAGES install GRUB_PC grub-pc PACKAGES install GRUB_EFI -grub-efi +# normally would have just grub-efi +# but theres a dependency problem with it in nabia: for some reason it depends on +# 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/GRUB_PC/11-iank b/fai/config/scripts/GRUB_PC/11-iank index aaebc82..8143d4e 100755 --- a/fai/config/scripts/GRUB_PC/11-iank +++ b/fai/config/scripts/GRUB_PC/11-iank @@ -121,12 +121,12 @@ TimeoutStartSec=20 WantedBy=dev-disk-by\x2did-ata\x2dSamsung_SSD_870_QVO_8TB_S5VUNG0N900656V.device EOF - chroot $FAI_ROOT bash <<'EOFOUTER' + chroot $FAI_ROOT bash <<'EOFOUTER' systemctl enable myncq.service /usr/bin/myncq no-upgrub EOFOUTER - ;; + ;; # per rubens suggestion to make a d16 more stable kd|kw) cmdline+=" pci=realloc=off" ;; esac @@ -197,6 +197,22 @@ case $HOSTNAME in esac +# bug fix, somewhere between t9's xorg 1.19.6 +# and 1.20.1-3ubuntu2 +# xserver-xorg-video-nouveau 1:1.0.15-3 +# xorg stopped load nouveau +# https://www.linuxquestions.org/questions/slackware-14/kernel-modules-conflicting-with-nouveau-driver-4175623867/ +# https://nouveau.freedesktop.org/InstallNouveau.html +if lspci|grep -q 'GeForce GTX 6[0-9][0-9]\]'; then + mkdir -p $target/etc/X11/xorg.conf.d/ + cat >$target/etc/X11/xorg.conf.d/10-nouveau.conf <<'EOF' +Section "Device" +Identifier "Device0" +Driver "nouveau" +EndSection +EOF +fi + # use networkmanager if this host has wireless. if type -p iw &>/dev/null && [[ $(iw dev) ]]; then chroot $FAI_ROOT bash <