4 trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
6 $ROOTCMD adduser
--disabled-password --gecos ian ian
8 if [[ ! $ROOTPW ]]; then
9 echo "$0: error: empty \$ROOTPW"
13 $ROOTCMD usermod
-p "$ROOTPW" ian
15 if ifclass STABLE
; then
16 fcopy
-M /etc
/apt
/preferences
19 if ifclass DEBIAN
; then
20 fcopy
-M /etc
/apt
/preferences.d
/unstable
21 fcopy
-riM /etc
/apt
/sources.list.d
26 # fcopy -i = ignore nonmatching class error, always return 0.
28 f
=/target
/home
/ian
/.ssh
/authorized_keys
29 if [[ ! -L $f ||
-e $f ]]; then
30 fcopy
-r -M /home
/ian
/.
ssh
32 /var
/lib
/fai
/config
/distro-install-common
/end
34 rm -f /target
/etc
/apt
/sources.list
36 chroot
/target bash
<<'EOF'
38 chown -R 1000:1000 /home/ian/.ssh
39 chmod -R u=Xrw,og= /home/ian/.ssh
41 cp -rL /home/ian/.ssh /root
42 chown -R root:root /root/.ssh
44 # default jessie groups + kvm & systemd-journal
45 usermod -aG cdrom,floppy,sudo,audio,dip,video,plugdev,netdev,kvm,systemd-journal ian
49 $ROOTCMD apt-get
-y install unison-gtk
50 if ifclass STABLE
; then
51 # don't think this is needed since I figured out how to
52 # deal with mismatching unison compilers, but I don't
53 # see any reason to revert it, since it only installs
54 # a single package which is primarily a single binary
55 $ROOTCMD apt-get
-y install unison-gtk
/testing
60 $ROOTCMD adduser
--disabled-password --gecos traci traci
61 $ROOTCMD usermod
-a -G traci ian
62 # reading through the groups that ian is in but traci isn't,
63 for g
in plugdev audio video cdrom
; do
64 $ROOTCMD usermod
-a -G $g traci
67 if ifclass frodo
; then
68 $ROOTCMD usermod
-p "$(cat /var/lib/fai/config/distro-install-common/shadow/traci-simple)" traci
72 # makes the journal be saved to disk.
73 $ROOTCMD mkdir
-p /target
/var
/log
/journal
74 $ROOTCMD chmod 755 /target
/var
/log
/journal