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

kernel-install wrap should include any dracut arguments being set in the manifest. #3799

Open
jmarrero opened this issue Jun 28, 2022 · 7 comments
Assignees

Comments

@jmarrero
Copy link
Member

jmarrero commented Jun 28, 2022

Opening this issue based on the discussion on #3364 #3689 (comment)
We want to support any dracut arguments being specified in the manifest/tree file when running kernel-install even when wrapped.

@jmarrero jmarrero self-assigned this Jun 28, 2022
@jmarrero jmarrero changed the title kernel-install wrap should include any kargs being set in the manifest. kernel-install wrap should include any dracut arguments being set in the manifest. Jul 1, 2022
@cgwalters
Copy link
Member

cgwalters commented Jul 1, 2022

Moving this comment here:

I think we want to use the same logic in the sysroot upgrader, i.e.: check for initramfs args specified,

So this is an interesting issue. Today on the host/client side, we have access to the ostree commit object directly - everything works using that as a base.

But here in the container flow, we would need to load the commit object, and...that doesn't yet have a precedent. It would make total sense to do so - we have the commit object in /ostree/repo/objects/00/abcde.commit etc, but actually as far as I know we don't know which commit we're using - that's in the container image metadata.

We could read /usr/share/rpm-ostree/treefile.json but so far we also haven't been processing that client side. This gets into #2326

I would lean actually that we should instead of having initramfs-args we should have from the start been writing config files into /etc/dracut.conf.d - that's the way it also works the same way on traditional yum systems too, etc. So to flesh this out a bit, we'd add /etc/dracut.conf.d/ignition.conf in fedora-coreos-config instead of initramfs-args.

Another way to say this is: dracut already has a declarative way to specify its configuration via config files - and crucially that same mechanism should work the same in rpm-ostree compose tree and the container override flow. So let's use that instead of carrying forward our own custom declarative config format. (We shouldn't drop support for initramfs-args in rpm-ostree today, but we can just stop using it for FCOS etc.)

@jlebon
Copy link
Member

jlebon commented Jul 7, 2022

But here in the container flow, we would need to load the commit object, and...that doesn't yet have a precedent. It would make total sense to do so - we have the commit object in /ostree/repo/objects/00/abcde.commit etc, but actually as far as I know we don't know which commit we're using - that's in the container image metadata.

Hmm, independent of this, I think it might be worth adding a ref like base in that repo to make it easier to access. Should we file an issue for that in https://github.com/ostreedev/ostree-rs-ext ?

Another way to say this is: dracut already has a declarative way to specify its configuration via config files - and crucially that same mechanism should work the same in rpm-ostree compose tree and the container override flow. So let's use that instead of carrying forward our own custom declarative config format. (We shouldn't drop support for initramfs-args in rpm-ostree today, but we can just stop using it for FCOS etc.)

This sounds reasonable to me, and makes a lot of sense long-term. Maybe we should then deprecate initramfs-args? I'd rather drop support for it eventually if it's not fully plumbed through in all the paths. Hmm, it'd be nice if we could auto-convert it to /etc/dracut.conf.d dropins, but that doesn't seem straightforward.

Short-term though, WDYT on just continuing to read from the commit metadata? I don't think we're talking about a lot of code. (Though we'd have to solve the ref issue mentioned above, which I think would be good to do regardless.)

cgwalters added a commit to cgwalters/fedora-coreos-config that referenced this issue Jul 7, 2022
See coreos/rpm-ostree#3799

This way when we run dracut in a container build, we naturally
pick up the same config we used for server side builds.
@cgwalters
Copy link
Member

This [dracut.conf.d] sounds reasonable to me, and makes a lot of sense long-term.

Long term can be now 😄 - PR in coreos/fedora-coreos-config#1828

Maybe we should then deprecate initramfs-args?

Yeah, no urgency to remove it, but indeed we should deprecate.

Hmm, independent of this, I think it might be worth adding a ref like base in that repo to make it easier to access. Should we file an issue for that in https://github.com/ostreedev/ostree-rs-ext ?

I think I'd vote for an API to "fetch me the single commit object in a repo" but that said...

Short-term though, WDYT on just continuing to read from the commit metadata? I don't think we're talking about a lot of code.

Not using initramfs-args anymore is also quite easy I think, so...why not do that?

@jlebon
Copy link
Member

jlebon commented Jul 7, 2022

Short-term though, WDYT on just continuing to read from the commit metadata? I don't think we're talking about a lot of code.

Not using initramfs-args anymore is also quite easy I think, so...why not do that?

Because other potential users of CoreOS layering (or maybe I should just say "layering"? not sure how much we care about such users right now, but the tech is pretty CoreOS-agnostic) outside FCOS could equally hit this. :)

@cgwalters
Copy link
Member

For sure, though there aren't many of these things. It looks like there is no usage of initramfs-args in workstation:

walters@toolbox /v/s/w/s/p/workstation-ostree-config (main) [1]> git rev-parse HEAD
082755c17ff0568a37ce59cdcffd81036bfe21ab
walters@toolbox /v/s/w/s/p/workstation-ostree-config (main)> rg initramfs-args
walters@toolbox /v/s/w/s/p/workstation-ostree-config (main) [1]> 

There is in fedora-iot/ostree but that's something equally easily fixed.

@jmarrero
Copy link
Member Author

jmarrero commented Jul 8, 2022

I agree with moving now to dracut.conf.d and moving away from initramfs-args. If dracut already provides us a way of doing this, I don't see why we should duplicate the effort.

jlebon added a commit to jlebon/rpm-ostree that referenced this issue Jul 8, 2022
Users should use `/etc/dracut.conf.d` instead. This option does not work
when regenerating the initramfs in the container flow.

We'll want to keep supporting it internally for a while in the upgrade
code, until all known composers have moved away from it, and reasonably
enough time for client systems to get the resulting updated trees.

See discussions in coreos#3799.
@jlebon
Copy link
Member

jlebon commented Jul 8, 2022

Opened #3834.

jlebon added a commit to jlebon/rpm-ostree that referenced this issue Jul 8, 2022
Users should use `/etc/dracut.conf.d` instead. This option does not work
when regenerating the initramfs in the container flow.

We'll want to keep supporting it internally for a while in the upgrade
code, until all known composers have moved away from it, and reasonably
enough time for client systems to get the resulting updated trees.

See discussions in coreos#3799.
cgwalters added a commit to cgwalters/fedora-coreos-config that referenced this issue Jul 8, 2022
See coreos/rpm-ostree#3799

This way when we run dracut in a container build, we naturally
pick up the same config we used for server side builds.
jlebon added a commit to jlebon/rpm-ostree that referenced this issue Jul 9, 2022
Users should use `/etc/dracut.conf.d` instead. This option does not work
when regenerating the initramfs in the container flow.

We'll want to keep supporting it internally for a while in the upgrade
code, until all known composers have moved away from it, and reasonably
enough time for client systems to get the resulting updated trees.

See discussions in coreos#3799.
cgwalters added a commit to coreos/fedora-coreos-config that referenced this issue Jul 11, 2022
See coreos/rpm-ostree#3799

This way when we run dracut in a container build, we naturally
pick up the same config we used for server side builds.
HuijingHei pushed a commit to HuijingHei/fedora-coreos-config that referenced this issue Oct 10, 2023
See coreos/rpm-ostree#3799

This way when we run dracut in a container build, we naturally
pick up the same config we used for server side builds.
HuijingHei pushed a commit to HuijingHei/fedora-coreos-config that referenced this issue Oct 10, 2023
See coreos/rpm-ostree#3799

This way when we run dracut in a container build, we naturally
pick up the same config we used for server side builds.
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

No branches or pull requests

3 participants