Skip to content

Conversation

alexlarsson
Copy link
Contributor

This detects if a aboot.img is in the kernel module directory, and if so, adds an osbuild stage that writes it to the a slot boot partition. This currently supports traditional aboot (boot_a partition), and ukiboot with EFI (ukiboot_a partition).

Copy link
Collaborator

@mvo5 mvo5 left a comment

Choose a reason for hiding this comment

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

Thank you, this looks fine. I think we will need some sort of test though because this feature will move into the generic "images" library in the near future and without a test there is much more regression risk.

(unrelated rambling) I would actually really like to see this being declarative and tied into our imagestypes.yaml we have for non-bootc distros. I.e. the bootc image would contain a partition table YAML and we would have the ability to put payload path into that. This would allow people to build bootc images that contain arbitrary firmware files that then would be written to their (special) partitions (and tranditional images would support it in the same way as part of their normal imagetypes.yaml if we ever build imags for boards like the dragonboard that require this kind of partition payload on the written image) Doing aboot/ukiboot would just be a special case of this more general feature (I hope this extremly short summary makes sense, happy to expand if anything in unclear). But we are not there yet so having this to unblock you is fine.

@alexlarsson
Copy link
Contributor Author

I agree that long term we want to allow the image itself to be much more descriptive and flexible. That is however a long term plan, and I would really like to have this in for now as some kind of basic support so we can start moving towards bootc.

I will look into figuring out some test for this.

Copy link
Member

@achilleas-k achilleas-k left a comment

Choose a reason for hiding this comment

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

LGTM (but holding off until a test is added)

@achilleas-k
Copy link
Member

(unrelated rambling) [...]

I fully agree with this. It will be great to have for a lot of special SBC (and similar) scenarios that we don't cover well now.

@alexlarsson
Copy link
Contributor Author

Added a test in test_manifest.py

@alexlarsson alexlarsson force-pushed the aboot-support branch 2 times, most recently from d8e44bc to ffa413e Compare August 27, 2025 16:27
@achilleas-k achilleas-k changed the title Add support form aboot bootc images Add support for aboot bootc images Aug 27, 2025
@@ -251,6 +252,23 @@ func genPartitionTable(c *ManifestConfig, customizations *blueprint.Customizatio
}
}

if c.SourceInfo != nil && c.SourceInfo.KernelInfo != nil && c.SourceInfo.KernelInfo.HasAbootImg {
idx := slices.IndexFunc(partitionTable.Partitions, func(part disk.Partition) bool {
return part.Label == "aboot_a" || part.Label == "ukiboot_a" || part.Type == "46"
Copy link
Contributor

Choose a reason for hiding this comment

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

This all feels like it could use some comments with links to more information

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added some comments with links

Copy link
Collaborator

@mvo5 mvo5 left a comment

Choose a reason for hiding this comment

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

I like it, thanks for the test! Consider it approved please. I also like the suggestion from Colin to provide some link to the aboot/ukiboot in the comment and a little bit of background (it can be quite short)

testdata_path = tmp_path / "testdata"
testdata_path.write_text("some test data", encoding="utf-8")

# Create derived container with the custom partitioning with an aboot
Copy link
Collaborator

Choose a reason for hiding this comment

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

❤️

If the target image contains an aboot.img, then we automatically
write it to the A slot boot partition.
This adds a test that a write-device stage is correctly generated
if the partition table contains the right partition and an aboot.img
in the modules dir.
@achilleas-k achilleas-k added this pull request to the merge queue Aug 28, 2025
@mvo5
Copy link
Collaborator

mvo5 commented Aug 28, 2025

Reminder for myself - this will need to get ported to https://github.com/osbuild/images/tree/main/pkg/distro/bootc so that we can merge #1014

Merged via the queue into osbuild:main with commit bee702b Aug 28, 2025
21 of 22 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