4 trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
6 if [[ $EUID != 0 ]]; then
7 echo "$0: error: expected to be root."
12 # fcopy -i = ignore nonmatching class error, always return 0.
15 chroot
$FAI_ROOT bash
<<'EOFOUTER'
16 debconf-set-selections <<EOF
17 kexec-tools kexec-tools/load_kexec boolean false
19 apt-get install -y pxe-kexec
22 if ifclass STABLE_BOOTSTRAP
; then
26 if ! type -t fcopy
&>/dev
/null
; then
27 sudo apt-get
-y install fai-client
31 fai_shadow
=$FAI/distro-install-common
/shadow
32 if [[ ! -e $dir && -e $fai_shadow ]]; then
34 mount
-o bind $fai_shadow $dir
36 $FAI/distro-install-common
/end
38 if ifclass STABLE || ifclass LINODESTABLE
; then
39 fcopy
-M /etc
/apt
/preferences
42 if ifclass DEBIAN
; then
43 fcopy
-M /etc
/apt
/preferences.d
/unstable
45 fcopy
-riM /etc
/apt
/sources.list.d
46 $ROOTCMD apt-get update
51 rm -f $FAI_ROOT/etc
/apt
/sources.list
53 chroot
$FAI_ROOT bash
<<'EOF'
55 mkdir -p /home/ian/.ssh
56 f=/root/.ssh/authorized_keys
60 chown -R 1000:1000 /home/ian/.ssh
61 chmod -R u=Xrw,og= /home/ian/.ssh
63 cp -rL /home/ian/.ssh /root
64 chown -R root:root /root/.ssh
68 # default jessie groups + kvm, systemd-journal, adm
69 usermod -aG adm,cdrom,floppy,sudo,audio,dip,video,plugdev,netdev ian
71 if getent group systemd-journal >/dev/null; then
72 usermod -aG systemd-journal ian
73 # makes the journal be saved to disk.
74 mkdir -p /var/log/journal
75 chmod 755 /var/log/journal
77 # https://askubuntu.com/questions/33416/how-do-i-disable-the-boot-splash-screen-and-only-show-kernel-and-boot-text-inst
78 # it suggests not having plymouth-theme-ubuntu-text, but
79 # making it not installed then kills plymouth, then makes
80 # the system not boot.
81 sed -ri 's/(^ *GRUB_CMDLINE_LINUX.*)quiet splash/\1/' /etc/default/grub
82 # on xenial, no grub is displayed at all. fix that.
83 # found just by noticing this in the config file, and a
84 # warning about it in error.log
85 sed -i '/^ *GRUB_HIDDEN_TIMEOUT/d' /etc/default/grub
90 # reading through the groups that ian is in but traci isn't,
91 for g
in plugdev audio video cdrom
; do
92 $ROOTCMD usermod
-a -G $g traci