Merge pull request #2056 from flatcar/t-lo/fix-build-id-mismatch

sysext_prod_builder: fix build id mismatch
This commit is contained in:
Thilo Fromm 2024-06-25 11:47:23 +02:00 committed by GitHub
commit 83456ca21e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -56,7 +56,10 @@ create_prod_sysext() {
info "${msg}." info "${msg}."
sudo "${SCRIPTS_DIR}/build_sysext" \ # Pass the build ID extracted from root FS to build_sysext. This prevents common.sh
# in build_sysext to generate a (timestamp based) build ID during a DEV build of a
# release tag (which breaks its version check).
sudo "FLATCAR_BUILD_ID=$FLATCAR_BUILD_ID" "${SCRIPTS_DIR}/build_sysext" \
--board="${BOARD}" \ --board="${BOARD}" \
--image_builddir="${workdir}/sysext-build" \ --image_builddir="${workdir}/sysext-build" \
--squashfs_base="${base_sysext}" \ --squashfs_base="${base_sysext}" \
@ -104,6 +107,13 @@ mkdir "${sysext_workdir}" "${sysext_output_dir}"
info "creating temporary base OS squashfs" info "creating temporary base OS squashfs"
sudo mksquashfs "${root_fs_dir}" "${sysext_base}" -noappend -xattrs-exclude '^btrfs.' sudo mksquashfs "${root_fs_dir}" "${sysext_base}" -noappend -xattrs-exclude '^btrfs.'
# Set build ID from root fs for later use by create_prod_sysext().
# This prevents common.sh in build_sysext to generate its own build ID which might cause
# its build ID check to fail.
unset FLATCAR_BUILD_ID
FLATCAR_BUILD_ID=$(source "${root_fs_dir}/usr/lib/os-release" && echo -n "$BUILD_ID")
export FLATCAR_BUILD_ID
# Build sysexts on top of root fs and mount sysexts' squashfs + pkginfo squashfs # Build sysexts on top of root fs and mount sysexts' squashfs + pkginfo squashfs
# for combined overlay later. # for combined overlay later.
prev_pkginfo="" prev_pkginfo=""