Skip to content

Commit c8fbe9e

Browse files
committed
refact: arm64 build process
1 parent 09785e4 commit c8fbe9e

4 files changed

Lines changed: 36 additions & 65 deletions

File tree

‎image-factory/Dockerfile‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ ENV container=docker
88
ENTRYPOINT ["/create_image.sh"]
99

1010
RUN apk add --no-cache \
11-
parted dosfstools btrfs-progs grub-efi grub-bios \
12-
gptfdisk qemu-img kpartx util-linux ovmf jq btrfs-progs bash
11+
parted dosfstools btrfs-progs \
12+
gptfdisk qemu-img kpartx util-linux jq btrfs-progs bash
1313

14+
RUN apk add --no-cache \
15+
grub-efi grub-bios ovmf || true
1416

1517
COPY image-factory/create_image.sh /create_image.sh
1618
COPY updater/*.sh /usr/local/updater/

‎system/Dockerfile‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,6 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
6161
&& apt-get clean && rm -rf /var/lib/apt/lists/* \
6262
&& systemctl enable systemd-timesyncd.service
6363

64-
# Install CuOS scripts (systemd required)
65-
COPY cuos/ /usr/local/cuos/
66-
RUN /usr/local/cuos/install.sh
67-
6864
# Install network services
6965
RUN apt-get update && apt-get install --no-install-recommends -y \
7066
hostname \
@@ -91,6 +87,10 @@ RUN mkdir -p /data && \
9187
ln -sf /data/shieldor /usr/local/shieldor && \
9288
rm -f /etc/ssh/ssh_host_*
9389

90+
# Install CuOS scripts (systemd required)
91+
COPY cuos/ /usr/local/cuos/
92+
RUN /usr/local/cuos/install.sh
93+
9494
# Set up SSH
9595
RUN echo 'root:root' | chpasswd && \
9696
sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config

‎system/Dockerfile.lxc‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
2727
vim \
2828
&& apt-get clean && rm -rf /var/lib/apt/lists/*
2929

30-
# Install CuOS scripts (systemd required)
31-
COPY cuos/ /usr/local/cuos/
32-
RUN /usr/local/cuos/install.sh
33-
3430
RUN apt-get update && apt-get install --no-install-recommends -y \
3531
hostname \
3632
ifupdown \
@@ -57,6 +53,10 @@ RUN mkdir -p /data && \
5753
rm -f /etc/ssh/ssh_host_* && \
5854
systemctl mask cgroupfs-mount.service sys-kernel-debug.mount
5955

56+
# Install CuOS scripts (systemd required)
57+
COPY cuos/ /usr/local/cuos/
58+
RUN /usr/local/cuos/install.sh
59+
6060
# Set up SSH
6161
RUN echo 'root:root' | chpasswd && \
6262
sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config

‎system/Dockerfile.rpi-arm64‎

Lines changed: 24 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,8 @@ dtoverlay=dwc2,dr_mode=host
3131
[all]
3232
EOF
3333

34-
RUN apt-get update && apt-get install --no-install-recommends -y \
35-
ca-certificates curl lsb-release apt-transport-https \
36-
busybox-static parted dosfstools e2fsprogs \
37-
coreutils findutils util-linux \
38-
&& apt-get clean && rm -rf /var/lib/apt/lists/*
39-
4034
# Add Raspberry Pi apt repository and key
41-
RUN echo "deb [signed-by=/etc/apt/keyrings/raspberrypi-archive.gpg] http://archive.raspberrypi.org/debian/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/raspi.list \
35+
RUN echo "deb [signed-by=/etc/apt/keyrings/raspberrypi-archive.gpg] http://archive.raspberrypi.org/debian/ $(grep -E '^VERSION_CODENAME=' /etc/os-release | cut -d= -f2 | tr -d '"') main" > /etc/apt/sources.list.d/raspi.list \
4236
&& apt-get update \
4337
&& apt-get full-upgrade -y \
4438
&& apt-get clean && rm -rf /var/lib/apt/lists/*
@@ -60,59 +54,37 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
6054
&& echo "RESUME=none" >>/etc/initramfs-tools/conf.d/resume \
6155
&& apt-get clean && rm -rf /var/lib/apt/lists/*
6256

63-
64-
# Install Raspberry Pi firmware, kernel and related packages
57+
# Install required packages
6558
RUN apt-get update && apt-get install --no-install-recommends -y \
59+
## Raspberry Pi packages \
60+
parted \
61+
dosfstools \
62+
e2fsprogs \
6663
linux-image-rpi-2712 \
6764
linux-image-rpi-v8 \
68-
raspberrypi-archive-keyring \
69-
raspberrypi-net-mods \
7065
raspberrypi-sys-mods \
71-
raspi-config \
7266
raspi-firmware \
73-
raspi-utils \
74-
raspi-utils-core \
75-
raspi-utils-dt \
76-
raspi-utils-eeprom \
77-
raspi-utils-otp \
78-
raspinfo \
79-
device-tree-compiler \
67+
raspberrypi-archive-keyring \
68+
#raspberrypi-net-mods \
69+
#raspi-utils \
70+
#raspi-utils-core # = pinctrl \
71+
#raspi-utils-dt \
72+
#device-tree-compiler \
8073
firmware-atheros \
8174
firmware-brcm80211 \
8275
firmware-libertas \
8376
firmware-linux-free \
8477
firmware-misc-nonfree \
8578
firmware-realtek \
86-
flashrom \
79+
#flashrom \
8780
gpiod \
8881
fake-hwclock \
89-
fakeroot \
90-
rpi-swap \
91-
rpi-eeprom \
92-
rpi-update \
93-
initramfs-tools \
94-
initramfs-tools-core \
95-
iw \
96-
kbd \
82+
# raspi-utils-eeprom \
83+
# rpi-eeprom \
84+
# rpi-swap \
85+
# iw \
9786
lsb-release \
98-
&& apt-get clean && rm -rf /var/lib/apt/lists/*
99-
100-
101-
#pigpio
102-
#pigpio-tools
103-
#pigpiod
104-
105-
106-
#linux-image-6.6.51+rpt-rpi-2712
107-
#linux-image-6.6.51+rpt-rpi-v8
108-
#linux-image-rpi-2712
109-
110-
# Regenerate initramfs for installed kernels (best-effort)
111-
#RUN update-initramfs -c -k all
112-
113-
114-
# Install required packages
115-
RUN apt-get update && apt-get install --no-install-recommends -y \
87+
## cuos system tools \
11688
btrfs-progs \
11789
busybox \
11890
ca-certificates \
@@ -139,15 +111,7 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
139111
systemd-timesyncd \
140112
vim \
141113
yq \
142-
&& apt-get clean && rm -rf /var/lib/apt/lists/* \
143-
&& systemctl enable systemd-timesyncd.service
144-
145-
# Install CuOS scripts (systemd required)
146-
COPY cuos/ /usr/local/cuos/
147-
RUN /usr/local/cuos/install.sh
148-
149-
# Install network services
150-
RUN apt-get update && apt-get install --no-install-recommends -y \
114+
## network tools \
151115
hostname \
152116
ifupdown \
153117
iproute2 \
@@ -156,6 +120,7 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
156120
isc-dhcp-common \
157121
openresolv \
158122
&& apt-get clean && rm -rf /var/lib/apt/lists/* \
123+
&& systemctl enable systemd-timesyncd.service \
159124
&& echo "net.ipv4.ip_forward=1" >>/etc/sysctl.conf
160125

161126
# Ensure persistence
@@ -172,6 +137,10 @@ RUN mkdir -p /data && \
172137
ln -sf /data/shieldor /usr/local/shieldor && \
173138
rm -f /etc/ssh/ssh_host_*
174139

140+
# Install CuOS scripts (systemd required)
141+
COPY cuos/ /usr/local/cuos/
142+
RUN /usr/local/cuos/install.sh
143+
175144
# Set up SSH
176145
RUN echo 'root:root' | chpasswd && \
177146
sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config

0 commit comments

Comments
 (0)