Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build_sysext: Detect dev rebuild of release tag, fix build ID issue #2259

Merged
merged 1 commit into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions build_library/sysext_prod_builder
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,6 @@ mkdir "${sysext_workdir}" "${sysext_output_dir}"
info "creating temporary base OS squashfs"
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
# for combined overlay later.
prev_pkginfo=""
Expand Down
14 changes: 13 additions & 1 deletion build_sysext
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# Script to generate sysext. See systemd-sysext(8). Prerequisite is
# that you've run build_packages and build_image.


SCRIPT_ROOT=$(dirname "$(readlink -f "$0")")
. "${SCRIPT_ROOT}/common.sh" || exit 1

Expand Down Expand Up @@ -183,7 +184,18 @@ mkdir "${BUILD_DIR}/install-root"
mkdir "${BUILD_DIR}/workdir"
mount -t overlay overlay -o lowerdir="${BUILD_DIR}/fs-root${pkginfo_lowerdirs}",upperdir="${BUILD_DIR}/install-root",workdir="${BUILD_DIR}/workdir" "${BUILD_DIR}/install-root"

VERSION_BOARD=$(grep "^VERSION=" ${BUILD_DIR}/fs-root/usr/lib/os-release | cut -d = -f 2-)
REPO_BUILD_ID="$(source "${REPO_MANIFESTS_DIR}/version.txt"; echo "$FLATCAR_BUILD_ID")"
REPO_FLATCAR_VERSION="$(source "${REPO_MANIFESTS_DIR}/version.txt"; echo "$FLATCAR_VERSION")"
t-lo marked this conversation as resolved.
Show resolved Hide resolved
VERSION_BOARD=$(source "${BUILD_DIR}/fs-root/usr/lib/os-release" && echo "$VERSION")

if [ -z "$REPO_BUILD_ID" ] ; then
t-lo marked this conversation as resolved.
Show resolved Hide resolved
BASE_SQUASHFS_BUILD_ID=$(source "${BUILD_DIR}/fs-root/usr/lib/os-release" && echo -n "$BUILD_ID")
info "This is a dev rebuild of an official release tag: No BUILD ID set in '${REPO_MANIFESTS_DIR}/version.txt'. Will use base squasfs BUILD ID for version check."
info "Repo root FLATCAR_VERSION is '$REPO_FLATCAR_VERSION', squashfs build ID is '$BASE_SQUASHFS_BUILD_ID'"
FLATCAR_VERSION="${REPO_FLATCAR_VERSION}+${BASE_SQUASHFS_BUILD_ID}"
t-lo marked this conversation as resolved.
Show resolved Hide resolved
info "Setting FLATCAR_VERSION to '$FLATCAR_VERSION'"
fi

if [ "$VERSION_BOARD" != "$FLATCAR_VERSION" ]; then
warn "Base squashfs version: $VERSION_BOARD"
warn "SDK board packages version: $FLATCAR_VERSION"
Expand Down