fixes, t11, install in ad-hoc network
[automated-distro-installer] / fai / config / scripts / IANK / 11-iank
index 47b97ad98720d08c4d48338369b413929180bbf5..e77eb8f8ca3081bd7f5ce0902c90d976f69c7d2d 100755 (executable)
@@ -24,15 +24,14 @@ fi
 # -r = recursive
 # -i = ignore non-matching class warnings, always exit 0
 # -B = no backup files
-fcopy -riBM /boot
+fcopy -riB /boot
 # this is also done by FAIBASE/10-misc by default (without B)
-fcopy -riBM /root
-fcopy -riBM /usr/local/bin
+fcopy -riB /usr/local/bin
 
 # this gets done by fai, but just happens too often that
 # I add sources due to new distros, whatever.
-fcopy -riBM /etc/apt/preferences.d
-fcopy -riBM /etc/apt/sources.list.d
+fcopy -riB /etc/apt/preferences.d
+fcopy -riB /etc/apt/sources.list.d
 
 
 src=$FAI/distro-install-common/shadow
@@ -53,10 +52,7 @@ $FAI/distro-install-common/end
 tmpfile1=$(mktemp)
 # this can fail if we need an apt update
 chroot $FAI_ROOT /usr/bin/apt-cache policy >$tmpfile1 ||:
-fcopy -riBM /etc/apt
-
-# get ubuntu key, for running from fai wrapper.
-apt-key add $FAI/package_config/UBUNTU.asc
+fcopy -riB /etc/apt
 
 tmpfile2=$(mktemp)
 chroot $FAI_ROOT /usr/bin/apt-cache policy >$tmpfile2
@@ -84,29 +80,9 @@ fi
 
 
 #### misc configurations
-chroot $FAI_ROOT bash <<'EOFOUTER'
-if getent group systemd-journal >/dev/null; then
-  # makes the journal be saved to disk.
-  mkdir -p /var/log/journal
-  chmod 755 /var/log/journal
-fi
-debconf-set-selections <<EOF
-kexec-tools kexec-tools/load_kexec boolean false
-EOF
-apt-get install -y pxe-kexec
-
-# this is usefull. Only thing reason I see this being disabled by default is
-# that a normal user can disrupt the system, eg cause a reboot.
-sed -i '$a kernel.sysrq=1
-/^kernel.sysrq=/d' /etc/sysctl.conf
-
-EOFOUTER
 
 
 if [[ $FAI_ACTION != dirinstall ]] && ! ifclass NOCRYPT; then
-  # luks options, see man systemd-cryptsetup-generator
-  # all i know is that with luks.crypttab=no, swap still timed out on boot.
-  # and with rd.luks.crypttab=no, it works.
   if ifclass LINODE; then
     speed=19200
     cmdline="rd.luks.crypttab=no net.ifnames=0 console=ttyS0,${speed}n8"
@@ -142,52 +118,6 @@ EOFOUTER
     esac
   fi
 
-  cat >$FAI_ROOT/etc/grub.d/40_custom <<EOF
-#!/bin/sh
-exec tail -n +3 \$0
-# This file provides an easy way to add custom menu entries.  Simply type the
-# menu entries you want to add after this comment.  Be careful not to change
-# the 'exec tail' line above.
-
-# https://www.coreboot.org/Serial_console # tty
-# but removed unneeded stuff
-
-serial --speed=$speed
-terminal_input --append  serial
-terminal_output --append serial
-EOF
-
-
-  chroot $FAI_ROOT bash <<EOF
-set -eE -o pipefail
-# https://askubuntu.com/questions/33416/how-do-i-disable-the-boot-splash-screen-and-only-show-kernel-and-boot-text-inst
-
-sed -ri 's/(^GRUB_CMDLINE_LINUX_DEFAULT=")quiet/\1/;s/^(GRUB_CMDLINE_LINUX_DEFAULT=".*) quiet([ "])/\1\2/' /etc/default/grub
-sed -ri 's/(^GRUB_CMDLINE_LINUX_DEFAULT=")splash/\1/;s/^(GRUB_CMDLINE_LINUX_DEFAULT=".*) splash([ "])/\1\2/' /etc/default/grub
-
-for arg in $cmdline; do
-  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
-  fi
-done
-
-if grep -qF "$cmdline" /etc/default/grub; then
-  # already set things, exit
-  exit 0
-fi
-sed -ri 's/^ *GRUB_CMDLINE_LINUX_DEFAULT=.*/GRUB_CMDLINE_LINUX_DEFAULT="$cmdline"/' /etc/default/grub
-# on xenial, no grub is displayed at all. fix that.
-# found just by noticing this in the config file, and a
-# warning about it in error.log
-sed -i '/^ *GRUB_HIDDEN_TIMEOUT/d' /etc/default/grub
-
-if type -P update-grub2 &>/dev/null; then
-  update-grub2
-else
-  update-grub
-fi
-
-EOF
 fi ##### end != dirinstall && != NOCRYPT
 
 
@@ -213,7 +143,9 @@ esac
 # 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
+# And now in t11, things got worse with a newer card also not loading
+# nouveau when it did in t10.
+if 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"
@@ -292,7 +224,6 @@ EOF
 
 
   if [[ $HOSTNAME == li ]]; then
-
     cat > $target/etc/network/interfaces <<-EOF
 # generated by FAI
 auto lo eth0
@@ -315,12 +246,6 @@ EOF
   fi
 fi
 
-# I prefer to stick with ifup/down for now. a. networkd is not in its
-# own package, so cant use in other init systems. b. it works fine.
-chroot $FAI_ROOT bash <<EOF
-systemctl disable systemd-networkd.socket systemd-networkd networkd-dispatcher systemd-networkd-wait-online
-systemctl mask systemd-networkd.socket systemd-networkd networkd-dispatcher systemd-networkd-wait-online
-EOF
 
 ##### end network setup  #####