Skip to content

Commit 9cb0d0c

Browse files
committed
sysext: allow for architecture-specific sysexts
1 parent 894c794 commit 9cb0d0c

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

build_library/prod_image_util.sh

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -213,20 +213,30 @@ create_prod_sysexts() {
213213
local image_name="$1"
214214
local image_sysext_base="${image_name%.bin}_sysext.squashfs"
215215
for sysext in "${EXTRA_SYSEXTS[@]}"; do
216-
local name="flatcar-${sysext%%|*}"
217-
local pkgs_and_useflags="${sysext#*|}"
218-
local pkgs="${pkgs_and_useflags%%|*}"
216+
local name pkgs useflags arches
217+
IFS="|" read -r name pkgs useflags arches <<< "$sysext"
218+
name="flatcar-$name"
219219
local pkg_array=(${pkgs//,/ })
220-
local useflags=""
221-
if [[ "$pkgs_and_useflags" == *\|* ]]; then
222-
useflags="${pkgs_and_useflags#*|}"
223-
fi
220+
local arch_array=(${arches//,/ })
224221
local useflags_array=(${useflags//,/ })
225222

226223
local mangle_script="${BUILD_LIBRARY_DIR}/sysext_mangle_${name}"
227224
if [[ ! -x "${mangle_script}" ]]; then
228225
mangle_script=
229226
fi
227+
228+
if [[ -n "$arches" ]]; then
229+
should_skip=1
230+
for arch in "${arch_array[@]}"; do
231+
if [[ $arch == "$ARCH" ]]; then
232+
should_skip=0
233+
fi
234+
done
235+
if [[ $should_skip -eq 1 ]]; then
236+
continue
237+
fi
238+
fi
239+
230240
sudo rm -f "${BUILD_DIR}/${name}.raw" \
231241
"${BUILD_DIR}/flatcar-test-update-${name}.gz" \
232242
"${BUILD_DIR}/${name}_*"

0 commit comments

Comments
 (0)