use disk/by-id if possibe, other small fixes
[automated-distro-installer] / fai / config / scripts / GRUB_PC / 11-ian
1 #!/bin/bash -x
2
3 set -eE -o pipefail
4 trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?"' ERR
5
6 $ROOTCMD adduser --disabled-password --gecos ian ian
7 $ROOTCMD usermod -p "$ROOTPW" ian
8
9 if ifclass STABLE; then
10 fcopy -M /etc/apt/preferences
11 fi
12
13 if ifclass DEBIAN; then
14 fcopy -M /etc/apt/preferences.d/unstable
15 fcopy -riM /etc/apt/sources.list.d
16 fi
17
18
19 # -i, ignore nonmatching class error, always return 0.
20 fcopy -r -M -i /home/ian/.ssh
21 /var/lib/fai/config/distro-install-common/end
22
23 rm -f /target/etc/apt/sources.list
24
25 chroot /target bash <<'EOF'
26 chown -R 1000:1000 /home/ian/.ssh
27 chmod -R u=Xrw,og= /home/ian/.ssh
28 cp -ar /home/ian/.ssh /root
29 chown -R root:root /root/.ssh
30
31 # default jessie groups + kvm & systemd-journal
32 usermod -aG cdrom,floppy,sudo,audio,dip,video,plugdev,netdev,kvm,systemd-journal ian
33 EOF
34
35
36 $ROOTCMD apt-get -y install unison-gtk
37 if ifclass STABLE; then
38 # don't think this is needed since I figured out how to
39 # deal with mismatching unison compilers, but I don't
40 # see any reason to revert it, since it only installs
41 # a single package which is primarily a single binary
42 $ROOTCMD apt-get -y install unison-gtk/testing
43 fi