#!/bin/bash -x set -eE -o pipefail trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR if [[ $EUID != 0 ]]; then echo "$0: error: expected to be root." exit 1 fi if ! type -t fcopy &>/dev/null; then sudo apt-get -y install fai-client 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 </dev/null; then usermod -aG systemd-journal iank fi # 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 EOF if [[ $FAI_ACTION != dirinstall ]]; then if ifclass BUSTER_LINODE; then speed=19200 # luks.crypttab=no see man systemd-cryptsetup-generator cmdline="luks.crypttab=no console=ttyS0,${speed}n8" else speed=115200 cmdline="luks.crypttab=no console=ttyS0,${speed} console=tty0" fi cat >$FAI_ROOT/etc/grub.d/40_custom </etc/initramfs-tools/modules update-initramfs -u -k all EOF fi # reading through the groups that iank is in but user2 isn't, for g in plugdev audio video cdrom; do $ROOTCMD usermod -a -G $g user2 done