forked from sensorgnome-org/sensorgnome-build
-
Notifications
You must be signed in to change notification settings - Fork 0
/
base-armv7-rpi-bookworm.pifile
95 lines (83 loc) · 4.13 KB
/
base-armv7-rpi-bookworm.pifile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# Create ARMv7 bookworm image for RaspberryPi Sensorgnome
FROM images/$IMAGE_IMG
TO images/base-$TYPE-temp.img
PUMP 2G
# Set-up nodejs repository so we can get a modern version
RUN bash -c "curl -1sLf https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /usr/share/keyrings/nodesource.gpg"
RUN bash -c "echo 'deb [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main' >/etc/apt/sources.list.d/nodesource.list"
# Set-up repository for caddy (web server)
RUN apt-get install -y debian-keyring debian-archive-keyring apt-transport-https
RUN bash -c "curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg"
RUN bash -c "curl -1sLf -o /etc/apt/sources.list.d/caddy-stable.list 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt'"
# Set-up repository for telegraf (monitoring agent)
RUN bash -c "curl -1sLf 'https://repos.influxdata.com/influxdata-archive_compat.key' | gpg --dearmor -o /usr/share/keyrings/influxdata.gpg"
RUN bash -c "echo 'deb [signed-by=/usr/share/keyrings/influxdata.gpg] https://repos.influxdata.com/debian stable main' >/etc/apt/sources.list.d/influxdata.list"
# Set-up bookworm backports (we need dhcpcd from there specifically)
# apt only installs packages from this repo if -t bookworm-backports is specified
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 648ACFD622F3D138 0E98404D386FA1D9
RUN bash -c "echo 'deb http://deb.debian.org/debian/ bookworm-backports main' >/etc/apt/sources.list.d/bookworm-backports.list"
# Set-up repository for tailscale VPN client
RUN bash -c "curl -1sLf https://pkgs.tailscale.com/stable/raspbian/bookworm.noarmor.gpg >/usr/share/keyrings/tailscale-archive-keyring.gpg"
RUN bash -c "echo 'deb [signed-by=/usr/share/keyrings/tailscale-archive-keyring.gpg] https://pkgs.tailscale.com/stable/raspbian bookworm main' >/etc/apt/sources.list.d/tailscale.list"
# Update OS and sources
RUN apt-get update
RUN apt-get upgrade -y
# Install libqmi
RUN apt-get install -y devscripts meson bash-completion gobject-introspection \
libgirepository1.0-dev libglib2.0-dev libgudev-1.0-dev libmbim-glib-dev \
libqrtr-glib-dev gtk-doc-tools help2man glib-2.0 libglib2.0 libglib2.0-doc
WORKDIR /root
RUN git clone https://gitlab.freedesktop.org/mobile-broadband/libqmi.git
WORKDIR /root/libqmi
RUN git checkout 1.35.6-dev
RUN meson setup build --prefix=/usr -Dmbim_qmux=false -Dqrtr=false -Dbash_completion=false --buildtype=release
RUN ninja -C build install
# Install modemmanager
RUN apt-get install -y meson cmake bash-completion gnome-common gobject-introspection intltool \
libdbus-1-dev libgirepository1.0-dev libgudev-1.0-dev libpolkit-gobject-1-dev \
libsystemd-dev python3-dbus python3-gi
# Remove plugins that didn't build 'cause they depend on mbim
#RUN bash -c "cd /usr/lib/arm-linux-gnueabihf/ModemManager/; rm *foxconn* *fibocom*"
WORKDIR /root
RUN bash -c 'curl https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/archive/1.23.12-dev/ModemManager-1.23.12-dev.tar.gz | tar zxf -'
WORKDIR /root/ModemManager-1.23.12-dev
RUN meson setup build --prefix=/usr --buildtype=release --sysconfdir=/etc -Dmbim=false -Dqrtr=false -Dgtk_doc=false -Dbash_completion=false -Dsystemd_suspend_resume=false
RUN ninja -C build install
WORKDIR /root
RUN rm -rf libqmi ModemManager*
# Install from backports
RUN apt-get install -y dhcpcd -t bookworm-backports
# Install some apps, they should be pulled in via dependencies but doing it here causes the
# installation time to be absorbed into the base build.
RUN apt-get remove npm network-manager -y
RUN apt-get install -y \
udhcpc \
autossh \
sqlite3 \
gpsd \
gpsd-tools \
chrony \
libjson-perl \
libpam0g-dev \
nodejs \
caddy \
telegraf \
vim \
tmux \
tcpdump \
traceroute \
fish \
libnss3-tools \
iptables \
git \
libqmi-utils \
lshw \
ifmetric \
python3-pip \
vnstat \
usbtop \
rsyslog \
logrotate \
openresolv \
tailscale
RUN cp /usr/share/dhcpcd/hooks/10-wpa_supplicant /lib/dhcpcd/dhcpcd-hooks/10-wpa_supplicant