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

Conversation

t-lo
Copy link
Member

@t-lo t-lo commented Aug 28, 2024

build_sysext uses a base squashfs (basically a full snapshot of the Flatcar OS image) to build custom sysexts on top. Before building it ensures the base image actualy matches the OS version in the repository root.

The version string includes a BUILD_ID which might be auto-generated (by including common.sh) if it is not present in the version file - e.g. when the version is an official release (tag). This build ID auto-generation causes issues with the version check when image build and sysext build scripts run independently - each will generate its own build ID, and this will cause build_sysext's version check to fail.

build_sysext will now use the build id from the base squashfs when it is not set in the source tree's version.txt to work around that issue. This is a more general solution than 361eda2 (which this patch reverts) as it directly addresses the issue in build_sysext instead of working around it in sysext_prod_builder.

How to use

  • Check out this branch
    git clone https://github.com/flatcar/scripts.git
    cd scripts
    git checkout t-lo/fix-sysext-build-id-issue-in-image-to-vm
  • Build it
    ./run_sdk_container -t
           ./build_packages
           ./build_image
           ./image_to_vm.sh --from ../build/images/amd64-usr/latest/ --format' 'qemu_uefi'
    

Testing done

Ran the above builds.

Cherry-pick / backport

To all active mainenance branches except LTS (which doesn't use sysext), i.e. flatcar-3975 flatcar-4012 flatcar-4054

@t-lo t-lo requested review from a team, krnowak and chewi August 28, 2024 10:24
build_sysext Show resolved Hide resolved
build_sysext Show resolved Hide resolved
build_sysext Show resolved Hide resolved
Copy link

github-actions bot commented Aug 28, 2024

build_sysext uses a base squashfs (basically a full snapshot of the
Flatcar OS image) to build custom sysexts on top. Before building it
ensures the base image actualy matches the OS version in the repository
root.

The version string includes a BUILD_ID which might be auto-generated (by
including common.sh) if it is not present in the version file - e.g.
when the version is an official release (tag). This build ID
auto-generation causes issues with the version check when image build
and sysext build scripts run independently - each will generate its own
build ID, and this will cause build_sysext's version check to fail.

build_sysext will now use the build id from the base squashfs when it is
not set in the source tree's version.txt to work around that issue. This
is a more general solution than 361eda2
(which this patch reverts) as it directly addresses the issue in
build_sysext instead of working around it in sysext_prod_builder.

Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
@t-lo t-lo force-pushed the t-lo/fix-sysext-build-id-issue-in-image-to-vm branch from 5b70e83 to 6b3d60e Compare August 28, 2024 14:55
@t-lo
Copy link
Member Author

t-lo commented Aug 29, 2024

Tests are green and PR is approved, but main has moved on. Will force rebase and merge since it's a small change and well understood.

@t-lo t-lo merged commit 1b7c0c2 into main Aug 29, 2024
7 checks passed
t-lo added a commit that referenced this pull request Aug 29, 2024
build_sysext: Detect dev rebuild of release tag, fix build ID issue
t-lo added a commit that referenced this pull request Aug 29, 2024
build_sysext: Detect dev rebuild of release tag, fix build ID issue
t-lo added a commit that referenced this pull request Aug 29, 2024
build_sysext: Detect dev rebuild of release tag, fix build ID issue
@t-lo
Copy link
Member Author

t-lo commented Aug 29, 2024

Merged and cherry-picked for flatcar-3975, flatcar-4012, flatcar-4054.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants