}
fi
-chroot $FAI_ROOT bash <<'EOFOUTER'
-set -eE -o pipefail
-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
-EOFOUTER
+
# -r = recursive
# -i = ignore non-matching class warnings, always exit 0
fi
-chroot $FAI_ROOT bash <<'EOF'
+
+#### 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
+
+
#### begin .ssh setup ###
set -x
set -eE -o pipefail
sudo -u iank ln -sf /usr/lib/systemd/user/ssh-agent.service $d
#### end .ssh setup ###
-### duplicated in ssh-emacs-setup
+
+## duplicated in ssh-emacs-setup
# done here so its setup earlier for convenience
line='AcceptEnv INSIDE_EMACS BRC COLUMNS'
f=/etc/ssh/sshd_config
grep -xFq "$line" $f || tee -a $f <<<"$line"
-
-
# default jessie groups + kvm, systemd-journal, adm
for g in adm cdrom floppy sudo audio dip video plugdev netdev; do
if getent gropu $g >/dev/null; then
# that a normal user can disrupt the system, eg cause a reboot.
sed -i '$a kernel.sysrq=1
/^kernel.sysrq=/d' /etc/sysctl.conf
-EOF
+EOFOUTER
if [[ $FAI_ACTION != dirinstall ]]; 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.
cmdline="rd.luks.crypttab=no net.ifnames=0 console=ttyS0,${speed}n8"
else
speed=115200
- cmdline="rd.luks.crypttab=no net.ifnames=0 console=ttyS0,${speed}n8 console=tty0"
+ cmdline="rd.luks.crypttab=no net.ifnames=0 console=ttyS0,${speed}n8 console=tty0"
fi
cat >$FAI_ROOT/etc/grub.d/40_custom <<EOF
update-grub2
EOF
-fi # end != dirinstall
+fi ##### end != dirinstall
# reading through the groups that iank is in but user2 isn't,
done
-## begin network setup
+
+###### 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.
iface eth0 inet6 auto
EOF
-# previously had an else condition after
-#elif ifclass VM || ifclass LINODE; then
-# iface br0 inet dhcp
-# bridge_ports $NIC1
-# bridge_stp off
-# bridge_maxwait 0
-# however, on t9, on startup, br0, became
-# rename1 and didn't come up. i dunno why,
-# but the bridge is for vms that I rarely use,
-# so not bothering to figure it out.
+ # previously had an else condition after
+ #elif ifclass VM || ifclass LINODE; then
+ # iface $NIC1 inet manual
+ # iface br0 inet dhcp
+ # bridge_ports $NIC1
+ # bridge_stp off
+ # bridge_maxwait 0
+ # however, on t9, on startup, br0, became
+ # rename1 and didn't come up. i dunno why,
+ # but the bridge is for vms that I rarely use,
+ # so not bothering to figure it out.
fi
+rm -f $target/etc/resolv.conf
+ln -s ../run/systemd/resolve/stub-resolv.conf $target/etc/resolv.conf
+
if ifclass LINODE; then
mkdir -p $target/etc/initramfs-tools/conf.d
cat >$target/etc/initramfs-tools/conf.d/mine <<EOF
systemctl mask systemd-networkd.socket systemd-networkd networkd-dispatcher systemd-networkd-wait-online
EOF
-
-## end network setup
+##### end network setup #####