Skip to content

Add support for Unified Kernel Images and Ephemeral Encryption Keys - #701

Merged
arnaldo2792 merged 6 commits into
bottlerocket-os:developfrom
arnaldo2792:uki-support/twoliter
Aug 14, 2026
Merged

Add support for Unified Kernel Images and Ephemeral Encryption Keys#701
arnaldo2792 merged 6 commits into
bottlerocket-os:developfrom
arnaldo2792:uki-support/twoliter

Conversation

@arnaldo2792

@arnaldo2792 arnaldo2792 commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Description of changes:

This adds support to build Unified Kernel Images for Bottlerocket. It also includes changes to support ephemeral encryption keys to encrypt the private and data partitions at runtime with LUKS.

Unlike GRUB based images, UKIs must be installed in a VFAT filesystem as systemd-boot lacks ext4 support. The UKIs are installed in the XBOOTLDR partition rather than the EFI partition. This is to be as close as possible to the GRUB based support, where the kernel is shipped as a separate partition.

In-place upgrades are not supported. And there is a pending change to update the re-pack workflow and pcrsys measurements. They will come as separate PRs.

Testing done:

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

@arnaldo2792
arnaldo2792 requested a review from jmt-lab August 11, 2026 01:54
@arnaldo2792
arnaldo2792 force-pushed the uki-support/twoliter branch from 5bbae92 to b3338cf Compare August 11, 2026 06:49
@arnaldo2792

Copy link
Copy Markdown
Contributor Author

(Forced push simplifies commit history and adds missing changes lost in rebase)

@jmt-lab jmt-lab left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If some of these are inaccurate feel free to comment with explanation. I think if they aren't accurate it will help me get through my second pass if i know why since this is a rather large change.

Comment thread tools/buildsys/src/manifest.rs Outdated
Comment thread tools/buildsys/src/manifest.rs Outdated
Comment thread tools/buildsys/src/manifest.rs Outdated
Comment thread tools/pubsys/src/repo/fetch_variant/mod.rs
Comment thread twoliter/embedded/rpm2img
Comment thread twoliter/embedded/rpm2img
Comment thread twoliter/embedded/rpm2img
Comment thread twoliter/embedded/imghelper
Comment thread twoliter/embedded/imghelper
Comment thread twoliter/embedded/partyplanner
Comment thread tools/buildsys/src/builder.rs Outdated
// the sections of the existing UKI so that the kernel command line
// carries the new dm-verity root hash, and recreates the partition.
// See `repack_uki` in `twoliter/embedded/img2img`.
Some(ImageFormat::Uki) => {}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: why is this on its own line? can be lumped in with the other supported formats

Comment thread twoliter/embedded/build.Dockerfile
Comment thread twoliter/embedded/rpm2eif Outdated
Comment thread twoliter/embedded/rpm2img Outdated
-- \\
systemd.log_target=journal-or-kmsg \\
systemd.log_color=0 \\
linux (\$root)/vmlinuz \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this change seems strange. since IIUC this only affects grub, I'd prefer not to touch this unless it fixes some known bug

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yup, the AI was fixing shellchecks, I'll drop it.

Comment thread tools/buildsys/src/manifest.rs
@arnaldo2792
arnaldo2792 force-pushed the uki-support/twoliter branch from 68aeb23 to 83475d8 Compare August 12, 2026 18:16
@piyush-jena

Copy link
Copy Markdown
Contributor

The force push above addresses missing unit tests for ephemeral-encryption-keys and a formatting issue.

@arnaldo2792
arnaldo2792 force-pushed the uki-support/twoliter branch from 83475d8 to ddeccaf Compare August 12, 2026 21:00
Comment thread tools/buildsys/src/manifest.rs Outdated
@arnaldo2792

Copy link
Copy Markdown
Contributor Author

(Forced push includes a change to generate the correct hmac for the UKIs)

Introduce a new opt-in image feature that skips seeding a persistent
boot configuration, so encryption keys used for encrypted storage do
not survive a reboot.

This feature depends on encrypted storage being enabled and is
rejected for EIF and standalone images, which lack the private data
partition it relies on.

Signed-off-by: Piyush Jena <jepiyush@amazon.com>
@arnaldo2792
arnaldo2792 force-pushed the uki-support/twoliter branch from 898e4bc to fce19ac Compare August 14, 2026 21:25
@arnaldo2792

Copy link
Copy Markdown
Contributor Author

(Forced push to fix conflict)

@arnaldo2792
arnaldo2792 marked this pull request as ready for review August 14, 2026 21:25
Comment thread tools/buildsys/src/manifest.rs Outdated
Comment on lines +1180 to +1181
/// error the moment the user
/// opts into EIF.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: this comment should remain on one line

Comment thread twoliter/embedded/imghelper Outdated

# Copy the systemd-boot configuration onto the EFI system partition.
#
# systemd-boot reads exactly one configuration file, `\loader\loader.conf`, and

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit:

Suggested change
# systemd-boot reads exactly one configuration file, `\loader\loader.conf`, and
# systemd-boot reads exactly one configuration file, `/loader/loader.conf`, and

@arnaldo2792
arnaldo2792 force-pushed the uki-support/twoliter branch from fce19ac to ac7a6bc Compare August 14, 2026 22:16
Introduce a new image-format option, uki, for building Unified
Kernel Image based Bottlerocket variants using systemd-boot instead
of GRUB.

Since UKI images use a single-bank boot layout with no B partition
set, in-place updates are rejected for this format at manifest
validation time. Image builds gain support for the systemd-boot
chain-loading path, including secure boot signing, an XBOOTLDR
partition for boot entry discovery, and a runtime image-format file
so consumers can distinguish UKI images from the rest of the A/B
partition logic they otherwise rely on.

Signed-off-by: Arnaldo Garcia Rincon <agarrcia@amazon.com>
Signed-off-by: Arnaldo Garcia Rincon <agarrcia@amazon.com>
Fail the UKI builds when none of the packages provided a systemd-boot
configuration.

Add integration test to validate the error.

Signed-off-by: Arnaldo Garcia Rincon <agarrcia@amazon.com>
Signed-off-by: Arnaldo Garcia Rincon <agarrcia@amazon.com>
Generate hard-coded boot parameters for UKI-based variants, until
parsing bootconfigs in twoliter is supported.

Signed-off-by: Arnaldo Garcia Rincon <agarrcia@amazon.com>
@arnaldo2792
arnaldo2792 force-pushed the uki-support/twoliter branch from ac7a6bc to a7b0306 Compare August 14, 2026 22:34
@arnaldo2792

Copy link
Copy Markdown
Contributor Author

Forced push includes:

  • Address feedback on menuentry generation shellcheck fixes
  • re-format comment
  • Use / instead of \ in comment

@arnaldo2792
arnaldo2792 merged commit 89907d1 into bottlerocket-os:develop Aug 14, 2026
3 checks passed
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