X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=fai%2Fconfig%2Fscripts%2FGRUB_PC%2F11-iank;h=deab6797c5e5ca4c225d35f2438a426dc01083d8;hb=4d23584c79e6c519f24042b11bc2cb5cd04ea284;hp=8a9eab792b8ebd230366dae0b40df959de60ff2c;hpb=61c3a58fcfadab7c333487f887b3f9f3a53bb93a;p=automated-distro-installer diff --git a/fai/config/scripts/GRUB_PC/11-iank b/fai/config/scripts/GRUB_PC/11-iank index 8a9eab7..deab679 100755 --- a/fai/config/scripts/GRUB_PC/11-iank +++ b/fai/config/scripts/GRUB_PC/11-iank @@ -24,9 +24,10 @@ fi # -r = recursive # -i = ignore non-matching class warnings, always exit 0 # -B = no backup files -fcopy -riB /boot +fcopy -riBM /boot # this is also done by FABASE/10-misc by default (without B) -fcopy -riB /root +fcopy -riBM /root +fcopy -riBM /usr/local/bin src=$FAI/distro-install-common/shadow @@ -48,6 +49,14 @@ tmpfile1=$(mktemp) # this can fail if we need an apt update chroot $FAI_ROOT /usr/bin/apt-cache policy >$tmpfile1 ||: fcopy -riBM /etc/apt + +# vps that didnt start with fai need the key +case $HOSTNAME in + je|bk|li) + apt-key add /a/bin/fai/fai/config/package_config/UBUNTU.asc + ;; +esac + tmpfile2=$(mktemp) chroot $FAI_ROOT /usr/bin/apt-cache policy >$tmpfile2 if ! diff -q $tmpfile1 $tmpfile2; then @@ -104,10 +113,29 @@ if [[ $FAI_ACTION != dirinstall ]] && ! ifclass NOCRYPT; then speed=115200 cmdline="rd.luks.crypttab=no net.ifnames=0 console=ttyS0,${speed}n8 console=tty0" case $HOSTNAME in - # https://wiki.archlinux.org/index.php/Solid_state_drive#Resolving_NCQ_errors - # evo-870 doesnt get along well with d16 with etiona. - # the number is based on dmesg errors - kd) cmdline+=" libata.force=4.00:noncq" ;; + kd) + fcopy -v /usr/bin/myncq + + cat >$target/etc/systemd/system/myncq.service <<'EOF' +[Unit] +Description=fix ncq errors + +[Service] +Type=oneshot +ExecStart=/usr/bin/myncq +TimeoutStartSec=20 + +[Install] +# https://www.enricozini.org/blog/2017/debian/systemd-07-devices/ +WantedBy=dev-disk-by\x2did-ata\x2dSamsung_SSD_870_QVO_8TB_S5VUNG0N900656V.device +EOF + + 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 @@ -132,7 +160,15 @@ EOF chroot $FAI_ROOT bash </dev/null; then + update-grub2 +else + update-grub +fi + EOF fi ##### end != dirinstall && != NOCRYPT @@ -165,8 +206,24 @@ 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 +if [[ $HOSTNAME == bo ]] || type -p iw &>/dev/null && [[ $(iw dev) ]]; then chroot $FAI_ROOT bash </dev/null; then +# default debian groups (jessie through buster) + adm, root, admin +for g in cdrom floppy audio dip video plugdev netdev adm sudo admin; do + if getent group $g >/dev/null; then usermod -aG $g iank fi done