@@ -7,86 +7,111 @@ export LC_ALL=C
7
7
8
8
source /common.sh
9
9
10
-
11
10
unpack /filesystem/home/pi /home/" ${BASE_USER} " " ${BASE_USER} "
12
11
unpack /filesystem/home/root /root root
13
12
unpack /filesystem/boot /boot
14
13
15
- # /boot/version.txt
16
- version=" $DIST_NAME -$DIST_VERSION "
17
- echo " writing version.txt: $version "
18
- echo " $version " > /boot/version.txt
19
-
20
- # cgroup for kubernetes
21
- sed -i -e ' s#$# cgroup_memory=1 cgroup_enable=memory#' /boot/cmdline.txt
22
-
23
-
24
- # # TODO better alternative enable by cli on first boot
25
- # # because wifi country problem
26
14
# Enable wifi by default
27
15
for filename in /var/lib/systemd/rfkill/* :wlan ; do
28
16
echo 0 > $filename
29
17
done
30
18
31
- apt update
32
-
33
19
# in case we are building from a regular raspbian image instead of the lite one...
34
- remove_extra=$( remove_if_installed scratch squeak-plugins-scratch squeak-vm wolfram-engine python-minecraftpi minecraft-pi sonic-pi oracle-java8-jdk bluej libreoffice-common libreoffice-core freepats greenfoot nodered)
35
- echo " removing:" $remove_extra
36
- apt remove -y --purge $remove_extra
20
+ apt update
21
+ remove=(
22
+ scratch squeak-vm
23
+ wolfram-engine
24
+ sonic-pi
25
+ libreoffice-common libreoffice-core
26
+ freepats
27
+ nodered
28
+ )
29
+ apt remove -y --purge " ${remove[@]} "
37
30
apt autoremove -y
38
31
32
+ # docker-ce
33
+ install -m 0755 -d /etc/apt/keyrings
34
+ curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
35
+ chmod a+r /etc/apt/keyrings/docker.gpg
36
+ echo \
37
+ " deb [arch=$( dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
38
+ $( . /etc/os-release && echo " $VERSION_CODENAME " ) stable" | \
39
+ sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
40
+ # nodejs
41
+ curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
42
+ # kubernetes
43
+ # curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.30/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg
44
+ # chmod a+r /etc/apt/keyrings/kubernetes-apt-keyring.gpg
45
+ # echo "deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.30/deb/ /" | tee /etc/apt/sources.list.d/kubernetes.list
46
+
47
+ # install
48
+ apt update
39
49
install=(
40
- curl apt-transport-https # apt essentials
41
- jq # @treehouses/cli
42
- git vim screen # terminal development
43
- autossh tor # tunnel
44
- netcat avahi-daemon # network
45
- docker.io # container
46
- minicom bluez-tools libbluetooth-dev python3-pip python3-dbus # bluetooth
50
+ jq # @treehouses/cli
51
+ git vim screen dos2unix # terminal development
52
+ autossh tor # tunnel
53
+ netcat-openbsd avahi-daemon rfkill # network
54
+ minicom bluez bluez-tools libbluetooth-dev python3-pip python3-dbus # bluetooth
55
+ docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin # docker-ce
56
+ nodejs # node
57
+ dhcpcd5 # network
58
+ # kubectl kubeadm kubelet # kube
47
59
)
48
- apt install -y --force-yes " ${install[@]} "
60
+ apt install -y --allow-change-held-packages " ${install[@]} "
49
61
50
62
# bluetooth for treehouses remote
51
63
curl --silent --show-error --fail " https://raw.githubusercontent.com/treehouses/control/master/server.py" -o /usr/local/bin/bluetooth-server.py
52
64
cat /usr/local/bin/bluetooth-server.py | grep ^class
53
65
echo " switching bluetooth device class to 0x00010c - computer"
54
66
sed -i -e ' s/#Class = .*/Class = 0x00010c/g' /etc/bluetooth/main.conf
55
- pip3 install ' pybluez==0.23'
56
-
57
- curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
58
- curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
59
- echo " deb https://apt.kubernetes.io/ kubernetes-xenial main" | tee /etc/apt/sources.list.d/kubernetes.list
60
- apt update
61
- apt install -y nodejs kubectl kubeadm kubelet
62
- pip3 install docker-compose
67
+ pip3 install git+https://github.com/pybluez/pybluez.git#egg=pybluez --break-system-packages
63
68
69
+ # @treehouses/cli
64
70
mkdir -p /etc/bash_completion.d
65
71
npm i -g @treehouses/cli
72
+
73
+ # ssh
74
+ ssh-keygen -A
75
+ ls -al /etc/ssh/
76
+ systemctl enable ssh
77
+ systemctl status ssh
78
+
79
+ # team
66
80
mkdir -p /root/.ssh
67
81
chmod go-rwx /root/.ssh
68
82
treehouses sshkey github adduser dogi
69
- treehouses sshkey github adduser louhdy
70
- treehouses sshkey github adduser lanxel97
71
- treehouses sshkey github adduser wesitos
72
- treehouses sshkey github adduser lmmrssa
83
+ treehouses sshkey github adduser mutugiii
84
+ treehouses sshkey github adduser okuro3499
85
+ treehouses sshkey github adduser xyb994
73
86
treehouses sshkey github adduser hirotochigi
74
- treehouses sshkey github adduser jlkwong
75
87
treehouses sshkey github adduser BryanGazali
76
88
cp -R /root/.ssh /home/" ${BASE_USER} "
77
89
chown -R " ${BASE_USER} " : /home/" ${BASE_USER} " /.ssh
78
90
79
- echo " - reinstall iputils-ping"
80
- apt install --reinstall iputils-ping
91
+ unpack /filesystem/root /
92
+
93
+ # hack
94
+ systemctl enable rpibluetooth
81
95
82
- # disable GUI at start
83
- # systemctl_if_exists disable lightdm.service || true
96
+ # unstable
97
+ # echo "deb http://deb.debian.org/debian/ sid main" > /etc/apt/sources.list.d/sid.list
98
+ # apt update
99
+ # unstable=(
100
+ # )
101
+ # apt install -y "${unstable[@]}"
102
+ # rm /etc/apt/sources.list.d/sid.list
103
+ # apt update
84
104
85
105
# cleanup
86
106
apt clean
87
107
apt autoremove -y
88
108
89
- unpack /filesystem/root /
109
+ # /boot/version.txt
110
+ version=" $DIST_NAME -$DIST_VERSION "
111
+ echo " writing version.txt: $version "
112
+ mkdir -p slashboot
113
+ echo " $version " > slashboot/version.txt
114
+ unpack slashboot /boot
90
115
91
- # hack
92
- systemctl enable rpibluetooth
116
+ # cgroup for kubernetes
117
+ sed -i -e ' s#$# cgroup_memory=1 cgroup_enable=memory# ' /boot/cmdline.txt
0 commit comments