-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
119 lines (60 loc) · 2.19 KB
/
Dockerfile
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
FROM voidlinux/voidlinux:latest
ENV WANT_32BIT=1
ENV WANT_64BIT=1
ENV WANT_PI4=1
ENV WANT_PI5=1
ENV REPO=https://repo-default.voidlinux.org/current
ENV ARCH=aarch64
ENV XBPS_ARCH=$ARCH
ENV TIMEZONE=UTC
ADD packages.txt /tmp/packages.txt
RUN xbps-install -S -u -y xbps
RUN xbps-pkgdb -m hold linux
RUN xbps-pkgdb -m hold linux-headers
RUN cat /tmp/packages.txt | xargs -i xbps-install -y -S -R "${REPO}" {} || true
RUN xbps-install -Su -y
RUN xbps-remove -yO
RUN xbps-remove -yo
RUN vkpurge rm all
ADD sudoers /etc/sudoers.d
ADD fstab /etc/fstab
RUN mkdir -p /home/pi
RUN mkdir -p /home/pi/.ssh
ADD profile /home/pi/.profile
RUN groupadd spi ; true
RUN groupadd i2c ; true
RUN groupadd gpio ; true
RUN groupadd -g 5000 pi
RUN useradd -u 4000 -g pi -s /bin/bash -d /home/pi -G video,adm,dialout,cdrom,audio,plugdev,users,input,spi,i2c,gpio,scanner,audio,bluetooth pi
RUN chown -R pi:pi /home/pi
WORKDIR /usr/local/bin
RUN wget https://raw.githubusercontent.com/raspberrypi/rpi-update/master/rpi-update
RUN mkdir -p /lib/modules
RUN chmod +x /usr/local/bin/rpi-update
RUN echo y | /usr/local/bin/rpi-update
ADD cmdline.txt /boot/cmdline.txt
ADD config.txt /boot/config.txt
RUN cd /tmp
ADD userland /usr/src/userland
WORKDIR /usr/src/userland
RUN ./buildme --aarch64
ADD linux /usr/src/linux
WORKDIR /usr/src/linux
RUN make ARCH=arm64 V=1 -j2 modules_install
RUN mkdir -p /boot/overlays
RUN sudo cp arch/arm64/boot/Image.gz /boot/kernel8.img
RUN sudo cp arch/arm64/boot/dts/broadcom/*.dtb /boot/
RUN sudo cp arch/arm64/boot/dts/overlays/*.dtb* /boot/overlays/
RUN sudo cp arch/arm64/boot/dts/overlays/README /boot/overlays/
RUN ln -sfv /etc/sv/socklog-unix /etc/runit/runsvdir/default/ ; true
RUN ln -sfv /etc/sv/nanoklogd /etc/runit/runsvdir/default/ ; true
RUN ln -sfv /etc/sv/wpa_supplicant /etc/runit/runsvdir/default/ ; true
RUN ln -sfv /etc/sv/chronyd /etc/runit/runsvdir/default/ ; true
RUN rm -f /etc/wpa_supplicant/wpa_supplicant.conf
RUN ln -sfv /mnt/sideload/wpa_supplicant.conf /etc/wpa_supplicant/wpa_supplicant.conf ; true
RUN usermod -U pi
RUN usermod -L root
RUN passwd -d pi
ADD 99-uconsole.rules /etc/udev/rules.d/99-uconsole.rules
WORKDIR /
RUN rm -rf /usr/src/linux