Skip to content

Conversation

@chaserhkj
Copy link

This PR changes cfsctl to use sha512-addressed composefs repo by default, this confronts to the behavior of bootc, making the two tools compatible with each other. An additional flag --use-sha256-object-id is also added to enable cfsctl to work with legacy repos.

kernel cmdline parse logic in composefs-setup-root is also changed, both sha256 and sha512 length addresses would be attempted before returning an error, improving robustness within initramfs.

Fixes #197

Copy link
Collaborator

@Johan-Liebert1 Johan-Liebert1 left a comment

Choose a reason for hiding this comment

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

I had reviewed earlier, but forgot to press submit :|

@chaserhkj
Copy link
Author

Sorry missed another cargo fmt that pulled in another CI failure. Just fixed. I'll just add cargo fmt as my git hook

…etup-root

Signed-off-by: Chaser Huang <huangkangjing@gmail.com>
Copy link
Collaborator

@cgwalters cgwalters left a comment

Choose a reason for hiding this comment

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

So I'm OK with this, but I do think we should add the repo metadata at some point.

In practice...because we're not shipping this project even on crates.io (much less as a standalone package/component) making "breaking" changes like this doesn't matter much.

But...we do want to eventually do that I think in order to replace the composefs-c project. But when we do that there will probably be deeper changes anyways.

};
let (image, insecure) = get_cmdline_composefs::<Sha256HashValue>(cmdline)?;

let (image_addr, insecure) = parse_image_address(cmdline)?;
Copy link
Collaborator

Choose a reason for hiding this comment

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

This also relates to the repo metadata thing. If we had that, then we would know precisely what sha digest length we should be expecting here.

#[derive(Debug, Copy, Clone, PartialEq, Eq, ValueEnum, Default)]
enum HashType {
Sha256,
#[default]
Copy link
Collaborator

Choose a reason for hiding this comment

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

So...this will increase compatibility with bootc when using the raw CLI, but it will also have the effect of changing the default here too, including AFAIK all CI jobs here. I think that's probably fine...but worth noting.

@cgwalters
Copy link
Collaborator

Most of the CI here was already broken for other reasons, but this creates a new problem:

++ cfsctl --repo /tmp/sysroot compute-id --bootable /mnt/base
error: one or more required arguments were not provided

I think it might be because it's missing default_value_t in the clap metadata?

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.

cfsctl digests are incompatible with recent bootc

3 participants