4 trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
6 if [[ $EUID != 0 ]]; then
7 echo "$0: error: expected to be root."
11 if ! type -t fcopy
&>/dev
/null
; then
12 sudo apt-get
-y install fai-client
15 chroot
$FAI_ROOT bash
<<'EOFOUTER'
16 if getent group systemd-journal >/dev/null; then
17 # makes the journal be saved to disk.
18 mkdir -p /var/log/journal
19 chmod 755 /var/log/journal
21 debconf-set-selections <<EOF
22 kexec-tools kexec-tools/load_kexec boolean false
24 apt-get install -y pxe-kexec
28 # -i = ignore non-matching class warnings, always exit 0
29 # -B = no backup files
31 # this is also done by FABASE/10-misc by default.
35 src
=$FAI/distro-install-common
/shadow
37 if [[ ! -e $dst && -e $src ]]; then
38 # outside of fai context, we skip this
40 mount
-o bind $src $dst
42 # todo, port this over to the arch install script.
43 src
=$FAI/distro-install-common
/p
/c
/machine_specific
/$HOSTNAME/filesystem
/etc
/ssh
45 if [[ -e $src && -e $dst ]]; then
46 # outside of fai context, we skip this
52 if ifclass VOL_STABLE_BOOTSTRAP
; then
53 fcopy
-ri /etc
/systemd
/system
54 chroot
$FAI_ROOT bash
<<'EOFOUTER'
55 systemctl enable fai_check.service
61 $FAI/distro-install-common
/end
63 # these get copied in an earlier stage by fai, but leaving it here since
64 # I run this as a single post-fai script to update things that have changed.
66 # outside of fai, this seems to regularly lead to
67 # E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)
68 # so add a sleep. 1 sec is probably way more than needed.
70 $ROOTCMD apt-get update
73 chroot
$FAI_ROOT bash
<<'EOF'
75 mkdir -p /home/ian/.ssh
76 f=/root/.ssh/authorized_keys
80 chown -R 1000:1000 /home/ian/.ssh
81 chmod -R u=Xrw,og= /home/ian/.ssh
83 cp -rL /home/ian/.ssh /root
84 chown -R root:root /root/.ssh
88 # default jessie groups + kvm, systemd-journal, adm
89 usermod -aG adm,cdrom,floppy,sudo,audio,dip,video,plugdev,netdev ian
91 if getent group systemd-journal >/dev/null; then
92 usermod -aG systemd-journal ian
94 # https://askubuntu.com/questions/33416/how-do-i-disable-the-boot-splash-screen-and-only-show-kernel-and-boot-text-inst
95 # it suggests not having plymouth-theme-ubuntu-text, but
96 # making it not installed then kills plymouth, then makes
97 # the system not boot.
98 sed -ri 's/(^ *GRUB_CMDLINE_LINUX.*)quiet splash/\1/' /etc/default/grub
99 # on xenial, no grub is displayed at all. fix that.
100 # found just by noticing this in the config file, and a
101 # warning about it in error.log
102 sed -i '/^ *GRUB_HIDDEN_TIMEOUT/d' /etc/default/grub
107 # reading through the groups that ian is in but traci isn't,
108 for g
in plugdev audio video cdrom
; do
109 $ROOTCMD usermod
-a -G $g traci