+if type -P update-grub2 &>/dev/null; then
+ update-grub2
+else
+ update-grub
+fi
+
+EOF
+fi ##### end != dirinstall && != NOCRYPT
+
+
+###### begin network setup ####
+
+# use old names. the idea of them changing between boots has never
+# happened to me and I usually only have 1 wired or other type.
+# If I ever do need to care about it, I will.
+# Strangely this didn't work on kw, so I added kernel cmdline parameter.
+# https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/
+ln -sf /dev/null $target/etc/systemd/network/99-default.link
+
+
+# bitfolk installer handles the rest
+case $HOSTNAME in
+ bk|je) exit 0 ;;
+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 [[ $HOSTNAME == bo ]] || type -p iw &>/dev/null && [[ $(iw dev) ]]; then
+ chroot $FAI_ROOT bash <<EOF
+apt-get -y install network-manager
+EOF
+
+ # allow networkmanager to manage interfaces
+ #https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/1638842
+ touch $target/etc/NetworkManager/conf.d/10-globally-managed-devices.conf
+ # in a default desktop install, it looks like netplan creates this file under
+ # run/NetworkManager/conf.d in early boot.
+
+ # By default, dns=default is set in etiona, and dns is just broken.
+ # Maybe with resolvconf it would work, but theres no need for that.
+ # https://wiki.gnome.org/Projects/NetworkManager/DNS
+ cat >$target/etc/NetworkManager/conf.d/99-iank.conf <<'EOF'
+[main]
+dns=systemd-resolved
+EOF
+ if [[ $HOSTNAME == frodo ]]; then
+ cat > $target/etc/network/interfaces <<-EOF
+# generated by FAI
+auto lo eth0
+iface lo inet loopback
+iface eth0 inet static
+address 10.3.0.2/16
+
+source-directory /etc/network/interfaces.d
+EOF
+ fi
+
+else
+ cat > $target/etc/network/interfaces <<-EOF
+# generated by FAI
+auto lo eth0
+iface lo inet loopback
+iface eth0 inet dhcp
+iface eth0 inet6 auto
+
+source-directory /etc/network/interfaces.d