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

Ignition Kernel Argument Support #752

Closed
arithx opened this issue Feb 23, 2021 · 8 comments
Closed

Ignition Kernel Argument Support #752

arithx opened this issue Feb 23, 2021 · 8 comments

Comments

@arithx
Copy link
Contributor

arithx commented Feb 23, 2021

Overview

Ignition is planning to add kernel argument support (coreos/ignition#1168) which expects that the distribution is both providing a binary which can perform the kernel argument modification as well as enabling the new stage at the desired ordering.

Binary

Ignition expects the following constraints from the binary:

  1. Adds should be done in an append if missing manner
  2. Deletes should NOT fail if they are not present
  3. Rebooting the system if necessary

Currently Fedora CoreOS is using rdcore to set some kernel arguments inside of the initrd, however I believe that 1 & 2 might be slightly different than the current rdcore functionality so we might need to make slight modifications there. Additionally we'll need to implement the detection of kernel arguments in the Ignition spec & perform the reboot.

New Ignition Stage Ordering

The Ignition recommendation is to order the new stage some time after the fetch stage and before the disks stage. We'll also likely want to run before ignition-ostree-transposefs-detect/ignition-ostree-transposefs-save to avoid potentially copying the root disk in memory before a reboot when kernel arguments are set.

@cgwalters
Copy link
Member

This is somewhat tangential but we debated ostree kargs over in ostreedev/ostree#2217 but one thing I think we may need to try harder to handle is the "reset to default" case, perhaps in a CoreOS specific way. One idea here is
that when we boot, we e.g. write the exact kargs from the BLS config we used to e.g. /boot/loader/.coreos-orig.conf or something.

Or (and this gets somewhat ostree-specific) we generalize some support for retaining the pristine booted deployment, which would also help for the #399 case.

Anyways, either or both of these can be separate stages in rdcore. But it would also greatly help the MCO code because then the day 2 kargs support could always be "start from CoreOS defaults and add shouldExist kargs, validate shouldNotExist doesn't".

@bgilbert
Copy link
Contributor

Resetting the kernel arguments seems inherently risky, since any user-specified kargs may be necessary for the machine to boot successfully. (And in particular, we'd need to account for rootfs kargs added by rootmap.) Other than #399 and extending the MCO's kargs support, are there other use cases where that functionality is important?

@cgwalters
Copy link
Member

Resetting the kernel arguments seems inherently risky, since any user-specified kargs may be necessary for the machine to boot successfully.

If the user does a factory reset and doesn't provide those kargs again, that's their problem?

(And in particular, we'd need to account for rootfs kargs added by rootmap.)

Right; rootmap-generated kargs blur this. I think if we capture the kargs after that's done but before Ignition that's what's desired.

Other than #399 and extending the MCO's kargs support, are there other use cases where that functionality is important?

I can't think of any, but the factory reset problem is fairly general.

@bgilbert
Copy link
Contributor

Ah, I hadn't understood that you meant "reset to default" only in the context of a full system reset. I think it could make sense for the helper program to save the original kargs somewhere if it's easy, but we could probably also defer that functionality until #399 is implemented.

I think if we capture the kargs after that's done but before Ignition that's what's desired.

Ignition kargs will run before rootmap — on an earlier boot, in fact.

@jlebon
Copy link
Member

jlebon commented May 25, 2021

This is done now in coreos/ignition#1178 and coreos/fedora-coreos-config#938.

@jlebon jlebon closed this as completed May 25, 2021
@arithx
Copy link
Contributor Author

arithx commented May 25, 2021

Closed in coreos/fedora-coreos-config#938

@dustymabe dustymabe added the status/pending-testing-release Fixed upstream. Waiting on a testing release. label May 25, 2021
@dustymabe
Copy link
Member

The fix for this went into testing stream release 34.20210529.2.0. Please try out the new release and report issues.

@dustymabe dustymabe added status/pending-stable-release Fixed upstream and in testing. Waiting on stable release. and removed status/pending-testing-release Fixed upstream. Waiting on a testing release. labels Jun 2, 2021
@dustymabe
Copy link
Member

The fix for this went into stable stream release 34.20210529.3.0.

@dustymabe dustymabe removed the status/pending-stable-release Fixed upstream and in testing. Waiting on stable release. label Jun 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants