Skip to content

Commit fd466f7

Browse files
committed
fix
1 parent b0f2a42 commit fd466f7

4 files changed

Lines changed: 48 additions & 34 deletions

File tree

build_images.sh

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,10 @@ build_or_list_images() {
8989
for arch in "${architectures[@]}"; do
9090
for variant in "${variants[@]}"; do
9191
# apk apt dnf egoportage opkg pacman portage yum equo xbps zypper luet slackpkg
92-
if [[ "$run_funct" == "centos" || "$run_funct" == "fedora" || "$run_funct" == "openeuler" ]]; then
92+
if [[ "$run_funct" == "centos" || "$run_funct" == "openeuler" ]]; then
9393
manager="yum"
94+
elif [[ "$run_funct" == "fedora" ]]; then
95+
manager="dnf"
9496
elif [[ "$run_funct" == "kali" || "$run_funct" == "ubuntu" || "$run_funct" == "debian" ]]; then
9597
manager="apt"
9698
elif [[ "$run_funct" == "almalinux" || "$run_funct" == "rockylinux" || "$run_funct" == "oracle" ]]; then
@@ -262,34 +264,26 @@ centos)
262264
build_or_list_images "9-Stream" "9" "default cloud"
263265
;;
264266
almalinux)
265-
URL="https://raw.githubusercontent.com/lxc/lxc-ci/main/jenkins/jobs/image-almalinux.yaml"
266-
curl_output=$(curl -s "$URL" | awk '/name: release/{flag=1; next} /^$/{flag=0} flag && /^ *-/{if (!first) {printf "%s", $2; first=1} else {printf " %s", $2}}' | sed 's/"//g')
267-
build_or_list_images "$curl_output" "$curl_output" "default cloud"
267+
build_or_list_images "8 9 10" "8 9 10" "default cloud"
268268
;;
269269
rockylinux)
270-
URL="https://raw.githubusercontent.com/lxc/lxc-ci/main/jenkins/jobs/image-rockylinux.yaml"
271-
curl_output=$(curl -s "$URL" | awk '/name: release/{flag=1; next} /^$/{flag=0} flag && /^ *-/{if (!first) {printf "%s", $2; first=1} else {printf " %s", $2}}' | sed 's/"//g')
272-
build_or_list_images "$curl_output" "$curl_output" "default cloud"
270+
build_or_list_images "8 9 10" "8 9 10" "default cloud"
273271
;;
274272
alpine)
275273
URL="https://raw.githubusercontent.com/lxc/lxc-ci/main/jenkins/jobs/image-alpine.yaml"
276274
curl_output=$(curl -s "$URL" | awk '/name: release/{flag=1; next} /^$/{flag=0} flag && /^ *-/{if (!first) {printf "%s", $2; first=1} else {printf " %s", $2}}' | sed 's/"//g')
277275
build_or_list_images "$curl_output" "$curl_output" "default cloud"
278276
;;
279277
openwrt)
280-
URL="https://raw.githubusercontent.com/lxc/lxc-ci/main/jenkins/jobs/image-openwrt.yaml"
281-
curl_output=$(curl -s "$URL" | awk '/name: release/{flag=1; next} /^$/{flag=0} flag && /^ *-/{if (!first) {printf "%s", $2; first=1} else {printf " %s", $2}}' | sed 's/"//g')
282-
build_or_list_images "$curl_output" "$curl_output" "default cloud"
278+
build_or_list_images "23.05 24.10" "23.05 24.10" "default cloud"
283279
;;
284280
oracle)
285281
URL="https://raw.githubusercontent.com/lxc/lxc-ci/main/jenkins/jobs/image-oracle.yaml"
286282
curl_output=$(curl -s "$URL" | awk '/name: release/{flag=1; next} /^$/{flag=0} flag && /^ *-/{if (!first) {printf "%s", $2; first=1} else {printf " %s", $2}}' | sed 's/"//g')
287283
build_or_list_images "$curl_output" "$curl_output" "default cloud"
288284
;;
289285
fedora)
290-
URL="https://raw.githubusercontent.com/lxc/lxc-ci/main/jenkins/jobs/image-fedora.yaml"
291-
curl_output=$(curl -s "$URL" | awk '/name: release/{flag=1; next} /^$/{flag=0} flag && /^ *-/{if (!first) {printf "%s", $2; first=1} else {printf " %s", $2}}' | sed 's/"//g')
292-
build_or_list_images "$curl_output" "$curl_output" "default cloud"
286+
build_or_list_images "41 42" "41 42" "default cloud"
293287
;;
294288
opensuse)
295289
URL="https://raw.githubusercontent.com/lxc/lxc-ci/main/jenkins/jobs/image-opensuse.yaml"

clone_modify_yaml.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,26 @@ echo "$insert_content_2" >> temp.yaml
114114
tail -n 2 archlinux.yaml >> temp.yaml
115115
mv temp.yaml archlinux.yaml
116116
sed -i -e '/mappings:/i \ ' archlinux.yaml
117+
# 修复 ARM 架构:移除会导致构建失败的 kernel/openssh remove 块,保留 openssh 安装
118+
python3 - <<'PYEOF'
119+
import re
120+
with open('archlinux.yaml', 'r') as f:
121+
content = f.read()
122+
# 移除 linux-aarch64 remove 块(ARM bootstrap 中内核依赖复杂,移除可能失败)
123+
content = re.sub(
124+
r'\n - packages:\n - linux-aarch64\n action: remove\n architectures:\n - aarch64\n types:\n - container',
125+
'', content)
126+
# 移除 linux-armv7 remove 块
127+
content = re.sub(
128+
r'\n - packages:\n - linux-armv7\n action: remove\n architectures:\n - armv7',
129+
'', content)
130+
# 从 ARM remove 块中去掉 openssh(aarch64/armv7 构建需要 openssh 提供 sshd)
131+
content = re.sub(
132+
r'(\n - packages:\n - libedit\n - net-tools)\n - openssh(\n action: remove\n architectures:\n - aarch64\n - armv7)',
133+
r'\1\2', content)
134+
with open('archlinux.yaml', 'w') as f:
135+
f.write(content)
136+
PYEOF
117137

118138
# gentoo
119139
rm -rf gentoo.yaml
@@ -143,6 +163,8 @@ cat fedora.yaml > temp.yaml
143163
echo "" >> temp.yaml
144164
echo "$insert_content_2" >> temp.yaml
145165
mv temp.yaml fedora.yaml
166+
# fipscheck 在 Fedora 28+ 已被移除,保留会导致构建失败
167+
sed -i '/^ - fipscheck$/d' fedora.yaml
146168

147169
# alpine
148170
rm -rf alpine.yaml

images_yaml/archlinux.yaml

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -205,27 +205,8 @@ packages:
205205
- vm
206206

207207
- packages:
208-
- linux-aarch64
209-
action: remove
210-
architectures:
211-
- aarch64
212-
types:
213-
- container
214-
215-
- packages:
216-
- linux-armv7
217-
action: remove
218-
architectures:
219-
- armv7
220-
221-
- packages:
222-
- libedit
223-
- net-tools
224208
- openssh
225-
action: remove
226-
architectures:
227-
- aarch64
228-
- armv7
209+
action: install
229210

230211
- packages:
231212
- linux-firmware
@@ -254,6 +235,24 @@ actions:
254235
# Update pacman-keyring to ensure package installs will not break because of GPG issues
255236
pacman -Sy --needed --noconfirm archlinux-keyring
256237
238+
- trigger: post-packages
239+
action: |-
240+
#!/bin/sh
241+
# Remove ARM bootstrap kernel packages from containers if present
242+
pacman -R --noconfirm linux-aarch64 2>/dev/null || true
243+
architectures:
244+
- aarch64
245+
types:
246+
- container
247+
248+
- trigger: post-packages
249+
action: |-
250+
#!/bin/sh
251+
# Remove ARM bootstrap kernel and unused packages if present
252+
pacman -R --noconfirm linux-armv7 libedit net-tools 2>/dev/null || true
253+
architectures:
254+
- armv7
255+
257256
- trigger: post-packages
258257
action: |-
259258
#!/bin/sh

images_yaml/fedora.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,6 @@ packages:
169169
- cpio
170170
- file
171171
- findutils
172-
- fipscheck
173172
- gettext
174173
- glibc-all-langpacks
175174
- hardlink

0 commit comments

Comments
 (0)