Skip to content

Conversation

@danzatt
Copy link
Contributor

@danzatt danzatt commented Jan 7, 2026

Move OEM sysext build from vms phase to build_image

Signing sysexts with ephemeral keys showed an issue during prod builds due to the ephemeral keys being wiped between image and vms build (reverted in #3567). The OEM sysexts are built on demand during vms build, but the ephemeral keys are no longer on the system. This PR fixes that by prebuilding all OEM sysexts during image build. The VM image build then just pulls the prebuilt OEM sysext.

This PR also re-introduces the sysext signing feature reverted in #3567.

CI job:
http://jenkins.infra.kinvolk.io:8080/job/container/job/packages_all_arches/7218/

How to use

[ describe what reviewers need to do in order to validate this PR ]

Testing done

[Describe the testing you have done before submitting this PR. Please include both the commands you issued as well as the output you got.]

  • Changelog entries added in the respective changelog/ directory (user-facing change, bug fix, security fix, update)
  • Inspected CI output for image differences: /boot and /usr size, packages, list files for any missing binaries, kernel modules, config files, kernel modules, etc.

The cryptsetup useflag is required for signing sysexts built with
systemd-repart.

Signed-off-by: Daniel Zatovic <[email protected]>
Generate an ephemeral sysext signing key, that is injected into the
image's sysext root of trust. All OS-dependent sysexts will be signed by
this key and the private key (stored in /tmp) will be discarded on SDK
container exit.

Signed-off-by: Daniel Zatovic <[email protected]>
We removed the sysext compression, because we double-compression is
redundant for sysexts stored in already coimpressed BTRFS /usr. However,
OS-dependent sysexts that are downloaded on-demand were now also
uncompressed. This commit brings back the compression via
SYSTEMD_REPART_MKFS_OPTIONS_EROFS option.

Signed-off-by: Daniel Zatovic <[email protected]>
Move OEM sysext building from the vms phase to the image phase. This
ensures OEM sysexts are signed with the same ephemeral key as other
sysexts, which is generated during image build and discarded afterward.

- Add create_oem_sysexts() to build all OEM sysexts during image build
- Add oem_sysexts.sh with OEM sysext definitions
- Update install_oem_sysext() to use prebuilt sysexts
- Add OEM sysext download to vms.sh for CI builds

Signed-off-by: Daniel Zatovic <[email protected]>
@danzatt danzatt requested a review from a team as a code owner January 7, 2026 13:20
@danzatt danzatt changed the title Move sysex Move OEM sysext build from vms phase to build_image Jan 7, 2026
@danzatt
Copy link
Contributor Author

danzatt commented Jan 7, 2026

The tests are failing on arm64 azure, but they are also failing for nightly: http://jenkins.infra.kinvolk.io:8080/job/container/job/test/43566/console

(The packages/sys-block/open-iscsi test fails)

Update the changelog entry to include information about OEM sysexts
being signed and built during the image phase.

Signed-off-by: Daniel Zatovic <[email protected]>
@danzatt danzatt force-pushed the danzatt/fix-oem-sysexts branch from 9bc330e to 5b87e64 Compare January 8, 2026 09:09
@danzatt
Copy link
Contributor Author

danzatt commented Jan 8, 2026

Done.

@danzatt
Copy link
Contributor Author

danzatt commented Jan 8, 2026

Verification steps to compare build artifacts with latest nightly:

rclone ls :http: --http-url "https://bincache.flatcar-linux.net/images/amd64/9999.0.1+fix-oem-sysexts/" 2>/dev/null | awk '{print $2}' | sort > /tmp/fix-oem-sysexts.txt
rclone ls :http: --http-url "https://bincache.flatcar-linux.net/images/amd64/4572.0.0+nightly-20260106-2100/" 2>/dev/null | awk '{print $2}' | sort > /tmp/latest-nightly.txt
diff /tmp/fix-oem-sysexts.txt /tmp/latest-nightly.txt

I've tried this and the output is the same (1400 files, no diff), so the OEM sysexts are uploded just fine and seem to be in the right place.

Comment on lines +122 to +134
local sysext name arches arch_array
for sysext in "${OEM_SYSEXTS[@]}"; do
IFS="|" read -r name _ _ arches <<< "$sysext"
# Skip if sysext doesn't support this architecture
if [[ -n "$arches" ]]; then
arch_array=(${arches//,/ })
local should_skip=1
local a
for a in "${arch_array[@]}"; do
[[ "$a" == "$arch" ]] && should_skip=0
done
[[ $should_skip -eq 1 ]] && continue
fi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
local sysext name arches arch_array
for sysext in "${OEM_SYSEXTS[@]}"; do
IFS="|" read -r name _ _ arches <<< "$sysext"
# Skip if sysext doesn't support this architecture
if [[ -n "$arches" ]]; then
arch_array=(${arches//,/ })
local should_skip=1
local a
for a in "${arch_array[@]}"; do
[[ "$a" == "$arch" ]] && should_skip=0
done
[[ $should_skip -eq 1 ]] && continue
fi
local sysext name arches
for sysext in "${OEM_SYSEXTS[@]}"; do
IFS="|" read -r name _ _ arches <<< "$sysext"
# Skip if sysext doesn't support this architecture
[[ ,${arches}, == *,"${arch}",* ]] || continue

done
if [[ $should_skip -eq 1 ]]; then
continue
fi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As with vms.sh:

    local sysext_name package_atoms useflags arches
    IFS="|" read -r sysext_name package_atoms useflags arches <<< "$sysext"
    [[ ,${arches}, == *,"${ARCH}",* ]] || continue

Comment on lines +290 to +302
local arch_array=(${arches//,/ })

if [[ -n "$arches" ]]; then
local should_skip=1
for arch in "${arch_array[@]}"; do
if [[ $arch == "$ARCH" ]]; then
should_skip=0
fi
done
if [[ $should_skip -eq 1 ]]; then
continue
fi
fi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
local arch_array=(${arches//,/ })
if [[ -n "$arches" ]]; then
local should_skip=1
for arch in "${arch_array[@]}"; do
if [[ $arch == "$ARCH" ]]; then
should_skip=0
fi
done
if [[ $should_skip -eq 1 ]]; then
continue
fi
fi
[[ ,${arches}, == *,"${ARCH}",* ]] || continue

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently, you can get the list of OEMs for each architecture via get_oem_id_list? It looks a bit weird, but maybe it just works, and then you probably wouldn't need this new file. The helper is in the wrong place, under ci-automation, but maybe it could be moved? It doesn't give you the USE flags, but I'm not even sure those are needed, and the common-oem-files ebuild just assumes the flags match the OEM names anyway.

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.

4 participants