4 trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
6 if [[ $EUID != 0 ]]; then
7 echo "$0: error: expected to be root."
13 if [[ ! -e $dir ]]; then
16 ls -la $FAI/distro-install-common
/shadow
17 mount
-o bind $FAI/distro-install-common
/shadow
$dir
19 $FAI/distro-install-common
/end
21 if ifclass STABLE
; then
22 fcopy
-M /etc
/apt
/preferences
25 if ifclass DEBIAN
; then
26 fcopy
-M /etc
/apt
/preferences.d
/unstable
27 fcopy
-riM /etc
/apt
/sources.list.d
32 # fcopy -i = ignore nonmatching class error, always return 0.
34 f
=$FAI_ROOT/home
/ian
/.ssh
/authorized_keys
35 if [[ ! -L $f ||
-e $f ]]; then
36 fcopy
-r -M /home
/ian
/.
ssh
38 echo "$0: info: $f exists"
41 rm -f $FAI_ROOT/etc
/apt
/sources.list
43 chroot
$FAI_ROOT bash
<<'EOF'
45 chown -R 1000:1000 /home/ian/.ssh
46 chmod -R u=Xrw,og= /home/ian/.ssh
48 cp -rL /home/ian/.ssh /root
49 chown -R root:root /root/.ssh
52 # default jessie groups + kvm & systemd-journal
53 usermod -aG cdrom,floppy,sudo,audio,dip,video,plugdev,netdev,systemd-journal ian
57 # reading through the groups that ian is in but traci isn't,
58 for g
in plugdev audio video cdrom
; do
59 $ROOTCMD usermod
-a -G $g traci
62 # makes the journal be saved to disk.
63 $ROOTCMD mkdir
-p $FAI_ROOT/var
/log
/journal
64 $ROOTCMD chmod 755 $FAI_ROOT/var
/log
/journal