Skip to content

feat(eif): add EIF image format support for Nitro Enclaves#673

Open
jmt-lab wants to merge 1 commit into
bottlerocket-os:developfrom
jmt-lab:feat/eif
Open

feat(eif): add EIF image format support for Nitro Enclaves#673
jmt-lab wants to merge 1 commit into
bottlerocket-os:developfrom
jmt-lab:feat/eif

Conversation

@jmt-lab

@jmt-lab jmt-lab commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Introduce a new image-format = "eif" variant type that produces an AWS Nitro Enclaves Image Format (kernel + cmdline + ramdisk + metadata) alongside a GPT disk image and bare kernel.

  • Add tools/eif-builder crate implementing the EIF v4 container format
  • Add twoliter/embedded/rpm2eif build script and wire it into build.Dockerfile, branching on IMAGE_FORMAT=eif to skip rpm2img's partitioning/secure-boot flags (rpm2eif owns the layout)
  • Extend buildsys::manifest::ImageFormat with Eif and plumb it through DockerBuild; reject repack-variant for EIF with a clear error
  • Teach pubsys fetch_variant to fetch the .eif, -disk.img, and -kernel artifacts published by EIF variants
  • Bundle eif-builder as a twoliter embedded tool
  • Add hello-eif test variant and manifest-parsing tests

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.

Comment thread twoliter/embedded/rpm2eif Outdated
Comment thread tools/eif-builder/src/lib.rs Outdated
Comment thread twoliter/embedded/rpm2eif Outdated
Comment thread twoliter/embedded/rpm2eif Outdated
Comment thread twoliter/embedded/rpm2eif Outdated
Comment thread twoliter/embedded/rpm2eif Outdated
@jmt-lab

jmt-lab commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

Updated per comments and reference eif file.

"KernelVersion": kernel_version,
},
"DockerInfo": {},
"CustomMetadata": serde_json::Value::Null,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

It looks like actually null is the correct setting here, it matches nitro-cli's enclave_build which sets custom_info = json!(null) when no --metadata is provided.

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.

codesnippet from aws-nitro-enclaves-cli enclave_build/src/lib.rs:122

let mut custom_info = json!(null);
if let Some(ref path) = self.metadata_path {
    custom_info = parse_custom_metadata(path).map_err(Docker2EifError::MetadataError)?
}

Comment thread twoliter/embedded/rpm2eif
@@ -0,0 +1,239 @@
#!/usr/bin/env bash

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.

Let's generate an application-inventory.json file for EIFs as well

@jmt-lab jmt-lab force-pushed the feat/eif branch 3 times, most recently from 6691787 to 60004af Compare July 9, 2026 20:23
Introduce a new `image-format = "eif"` variant type that produces an AWS
Nitro Enclaves Image Format (kernel + cmdline + ramdisk + metadata)
alongside a GPT disk image and bare kernel.

- Add `tools/eif-builder` crate implementing the EIF v4 container format
- Add `twoliter/embedded/rpm2eif` build script and wire it into
  `build.Dockerfile`, branching on `IMAGE_FORMAT=eif` to skip rpm2img's
  partitioning/secure-boot flags (rpm2eif owns the layout)
- Extend `buildsys::manifest::ImageFormat` with `Eif` and plumb it through
  `DockerBuild`; reject `repack-variant` for EIF with a clear error
- Teach `pubsys fetch_variant` to fetch the `.eif`, `-disk.img`, and
  `-kernel` artifacts published by EIF variants
- Bundle `eif-builder` as a twoliter embedded tool
- Add `hello-eif` test variant and manifest-parsing tests
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.

3 participants