-
Notifications
You must be signed in to change notification settings - Fork 87
Add support for aboot bootc images #1033
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
Conversation
There was a problem hiding this 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.
5565830
to
820fffd
Compare
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. |
There was a problem hiding this 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)
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. |
820fffd
to
b6704ce
Compare
Added a test in test_manifest.py |
d8e44bc
to
ffa413e
Compare
bib/cmd/bootc-image-builder/image.go
Outdated
@@ -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" |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this 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 |
There was a problem hiding this comment.
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.
ffa413e
to
b2683b6
Compare
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 |
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).