Skip to content
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

Add ostree=aboot for signed Android Boot Images #2877

Merged
merged 2 commits into from
Jun 9, 2023

Conversation

ericcurtin
Copy link
Collaborator

Some kernel images are delivered in a signed kernel + cmdline + initramfs + dtb blob. When this is added to the commit server side, only after this do you know what the cmdline is, this creates a recursion issue. To avoid this, in the case where we have ostree=aboot karg set, create a symlink after deploy to the correct ostree target in the rootfs, as the cmdline can't be malleable and secured client-side at the same time.

@openshift-ci
Copy link

openshift-ci bot commented Jun 8, 2023

Hi @ericcurtin. Thanks for your PR.

I'm waiting for a ostreedev member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@ericcurtin
Copy link
Collaborator Author

So this is #2844 reworked, much simpler

@alexlarsson
Copy link
Member

So, where are the symlinks created?

@ericcurtin
Copy link
Collaborator Author

ericcurtin commented Jun 8, 2023

So at deploy time on the client-side, we shell out to aboot-deploy, this knows where to symlink to and can create the symlink. Doesn't need a change in this repo directly, I think that's a good thing, it means I don't have to poke @cgwalters to update ostree in CentOS Steam 9 and wait a few months for it to land.

@ericcurtin
Copy link
Collaborator Author

All review comments addressed

@ericcurtin
Copy link
Collaborator Author

ericcurtin commented Jun 8, 2023

On a slightly related note, I was thinking of replacing https://github.com/ostreedev/ostree/blob/main/src/libostree/ostree-bootloader-aboot.c with a generic c file that calls a systemd unit, I thought of doing something similar and I actually saw a comment that hinted towards that in the code base here somewhere....

Would mean you don't have to write a load of bolierplate C to shell out to something, it would just become a systemd unit file you can modify, edit, etc...

Some kernel images are delivered in a signed kernel + cmdline +
initramfs + dtb blob. When this is added to the commit server side, only
after this do you know what the cmdline is, this creates a recursion
issue. To avoid this, in the case where we have ostree=aboot karg
set, create a symlink after deploy to the correct ostree target in the
rootfs, as the cmdline can't be malleable and secured client-side at
the same time.
Make it an autofree_char rather than a char
Copy link
Member

@alexlarsson alexlarsson left a comment

Choose a reason for hiding this comment

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

LGTM

@cgwalters
Copy link
Member

/ok-to-test

@cgwalters
Copy link
Member

I gave this a quick skim and it looks sane. I do have a vague feeling it might be nicer to try to abstract away from aboot in some way because there's certain to be some alignment as discussed between UKIs and aboot (and potentially other A/B bootloaders) but this is fine.

A procedural note: In this organization we only need one approving reviewer, so in the general case it's not just me that can merge things. I'm certainly fine if Alex or Dan had merged this too.

@cgwalters cgwalters merged commit 05faa1d into ostreedev:main Jun 9, 2023
19 checks passed
@ericcurtin ericcurtin deleted the ostree-aboot branch June 28, 2023 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants