Skip to content
This repository has been archived by the owner on Aug 25, 2021. It is now read-only.

dracut: Add 31ignition-ostree module #112

Closed
wants to merge 1 commit into from

Conversation

cgwalters
Copy link
Member

I'm working on supporting reprovisioning the rootfs with Ignition
on OSTree based systems like Fedora CoreOS, and this will add
a lot of tricky logic that relates the two.

While we want to support Ignition independent of OSTree and vice
versa, it will be a lot cleaner if we centralize the dracut
logic in one place.

This adds a 31ignition-ostree module that imports the code
from
https://github.com/coreos/fedora-coreos-config/tree/092f680a5c75324e3efcd5e50374a2c1b5d4b057/overlay.d/05core/usr/lib/dracut/modules.d/40coreos-var

Most notably, this is:

  1. A separate dracut module easily skippable
  2. The units use ConditionKernelCommandline=ostree so will be harmless even if included

The units imported here also do this:

ConditionPathExists=!/usr/sbin/coreos-mount-var

So this change can be safely merged, built and shipped as an RPM,
then we can drop the FCOS config bits and enable it later.

Tested both ways (inert and enabled).

And to clarify, the later ignition-ostree-rootfs stuff will land
in this same dracut module.

cgwalters added a commit to cgwalters/fedora-coreos-config that referenced this pull request Sep 25, 2019
Will move to coreos/ignition-dracut#112
because it's cleaner to have the ignition+ostree in one place.
@cgwalters
Copy link
Member Author

Dependency: coreos/fedora-coreos-config#182

I'm working on supporting reprovisioning the rootfs with Ignition
on OSTree based systems like Fedora CoreOS, and this will add
a lot of tricky logic that relates the two.

While we want to support Ignition independent of OSTree and vice
versa, it will be a lot cleaner if we centralize the dracut
logic in one place.

This adds a `31ignition-ostree` module that imports the code
from
https://github.com/coreos/fedora-coreos-config/tree/092f680a5c75324e3efcd5e50374a2c1b5d4b057/overlay.d/05core/usr/lib/dracut/modules.d/40coreos-var

Most notably, this is:

 1) A separate dracut module easily skippable
 2) The units use `ConditionKernelCommandline=ostree` so will be harmless even if included

The units imported here also do this:

```
ConditionPathExists=!/usr/sbin/coreos-mount-var
```

So this change can be safely merged, built and shipped as an RPM,
then we can drop the FCOS config bits and enable it later.

Tested both ways (inert and enabled).

And to clarify, the later ignition-ostree-rootfs stuff will land
in this same dracut module.
@cgwalters cgwalters force-pushed the add-ostree-integration branch from 42b15b0 to e3f2359 Compare September 25, 2019 11:55
@cgwalters
Copy link
Member Author

coreos/rpm-ostree#1911

@cgwalters
Copy link
Member Author

To emphasize this bit:

and this will add a lot of tricky logic that relates the two.

The new rootfs code adds a lot of dependencies between ostree and Ignition and more generally on "Fedora CoreOS API specifics" like the label=root mounts. The unit dependencies get deeply entangled and having them split across two repositories is just a lot harder to understand.

@bgilbert
Copy link
Contributor

In principle I can see adding generic ostree support here as an optional module. But "Fedora CoreOS API specifics" seems like exactly the sort of thing that belongs in fedora-coreos-config, no?

What is the nature of the entanglement? Can we refactor ignition-dracut (perhaps by adding synchronization points such as intermediate targets) to reduce it?

@cgwalters
Copy link
Member Author

But "Fedora CoreOS API specifics" seems like exactly the sort of thing that belongs in fedora-coreos-config, no?

Mmm...okay. It feels cleaner to me if fedora-coreos-config is mostly "config" and "core infrastructure" like "ignition+ostree" lives somewhere else.

I guess though in the end, now that I've landed the fetch stage here, it wouldn't be too difficult to move the units for this to fedora-coreos-config if people prefer that.

@bgilbert
Copy link
Contributor

fedora-coreos-config seems preferable to me. We can always refactor later if it becomes too much of a problem.

@cgwalters
Copy link
Member Author

Moved to coreos/fedora-coreos-config#184

@cgwalters cgwalters closed this Sep 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants