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

Add ignition-subsequent.target for non-Ignition boots#131

Merged
jlebon merged 1 commit intocoreos:masterfrom
cgwalters:subsequent
Oct 31, 2019
Merged

Add ignition-subsequent.target for non-Ignition boots#131
jlebon merged 1 commit intocoreos:masterfrom
cgwalters:subsequent

Conversation

@cgwalters
Copy link
Copy Markdown
Member

This is needed for Fedora CoreOS work on reprovisioning
the rootfs. We tried to split out a systemd unit to handle
mounting the root in this commit:
coreos/fedora-coreos-config@a6fe374
with ignition-ostree-mount-sysroot.service but the problem
is that needs to have different dependencies/ordering if we're
doing the "Ignition boot" versus a "subsequent" boot.

Add a new target that's queued up if we detect we're doing
a "subsequent" boot.

This is needed for Fedora CoreOS work on reprovisioning
the rootfs.  We tried to split out a systemd unit to handle
mounting the root in this commit:
coreos/fedora-coreos-config@a6fe374
with `ignition-ostree-mount-sysroot.service` but the problem
is that needs to have different dependencies/ordering if we're
doing the "Ignition boot" versus a "subsequent" boot.

Add a new target that's queued up if we detect we're doing
a "subsequent" boot.
cgwalters added a commit to cgwalters/fedora-coreos-config that referenced this pull request Oct 31, 2019
The unit to mount sysroot only worked the *first* boot
because it was integrated with Ignition.  We need to have
separate units with different dependencies (but that execute
the same code) for the "Ignition boot" compared with "subsequent"
boots.

Depends coreos/ignition-dracut#131
@cgwalters
Copy link
Copy Markdown
Member Author

Required by coreos/fedora-coreos-config#210

cgwalters added a commit to cgwalters/fedora-coreos-config that referenced this pull request Oct 31, 2019
The unit to mount sysroot only worked the *first* boot
because it was integrated with Ignition.  We need to have
separate units with different dependencies (but that execute
the same code) for the "Ignition boot" compared with "subsequent"
boots.

Depends coreos/ignition-dracut#131
Copy link
Copy Markdown
Contributor

@darkmuggle darkmuggle left a comment

Choose a reason for hiding this comment

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

LGTM. I was working out a separate PR, but your landed first

@jlebon
Copy link
Copy Markdown
Member

jlebon commented Oct 31, 2019

Hmm, though coreos/fedora-coreos-config#210 already has ConditionKernelCommandLine=!ignition.firstboot. That should be enough, no?

@jlebon
Copy link
Copy Markdown
Member

jlebon commented Oct 31, 2019

OK I see, the firstboot unit also ties into -complete. So this is complementary to that.

Copy link
Copy Markdown
Member

@jlebon jlebon left a comment

Choose a reason for hiding this comment

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

LGTM! I'm a little wary of shipping a unit here which isn't actually needed by Ignition itself. Though it's definitely useful to have those semantics handy.

@jlebon jlebon merged commit 3d08487 into coreos:master Oct 31, 2019
@ajeddeloh
Copy link
Copy Markdown
Contributor

I'm playing a bit of catch up here so I probably missed something, why couldn't the sysroot mount service just have the same deps/ordering as the old sysroot.mount unit?

@cgwalters
Copy link
Copy Markdown
Member Author

the old sysroot.mount unit

What we had before is what systemd-fstab-generator creates out of the root= kernel cmdline.
Conceptually, our rootfs is owned by us, and where it's found will be defined eventually by Ignition configs.

The systemd generated sysroot.mount binds together requiring /dev/disk/by-label/root with mounting /sysroot.

We're taking over that role.

@ajeddeloh
Copy link
Copy Markdown
Contributor

Conceptually, our rootfs is owned by us, and where it's found will be defined eventually by Ignition configs.

Well it will always be at /dev/disk/by-label/root (except pxe), right?

The systemd generated sysroot.mount binds together requiring /dev/disk/by-label/root with mounting /sysroot.

Right, why not do that with the service as well?

@cgwalters
Copy link
Copy Markdown
Member Author

cgwalters commented Oct 31, 2019

Well it will always be at /dev/disk/by-label/root (except pxe), right?

I think that works today yeah. That said, requirements may drive us to later do something like ensure we've "bound" our config to something more like "the label root on the disk whose UUID=(uuid we generated at Ignition time)".

Right, why not do that with the service as well?

coreos/fedora-coreos-config#187 (comment)

@ajeddeloh
Copy link
Copy Markdown
Contributor

I think that works today yeah. That said, requirements may drive us to later do something like ensure we've "bound" our config to something more like "the label root on the disk whose UUID=(uuid we generated at Ignition time)".

I thought we'd decided that the interface was "root is by label and you can only have one label with root". We don't need to design around non-problems, especially when it introduces more complexity. We should keep it simple unless we have a concrete reason to make it more complex.

coreos/fedora-coreos-config#187 (comment)

Gotcha.

cgwalters added a commit to cgwalters/fedora-coreos-config that referenced this pull request Oct 31, 2019
The unit to mount sysroot only worked the *first* boot
because it was integrated with Ignition.  We need to have
separate units with different dependencies (but that execute
the same code) for the "Ignition boot" compared with "subsequent"
boots.

Depends coreos/ignition-dracut#131
cgwalters added a commit to cgwalters/fedora-coreos-config that referenced this pull request Oct 31, 2019
The unit to mount sysroot only worked the *first* boot
because it was integrated with Ignition.  We need to have
separate units with different dependencies (but that execute
the same code) for the "Ignition boot" compared with "subsequent"
boots.

Depends coreos/ignition-dracut#131
jlebon pushed a commit to coreos/fedora-coreos-config that referenced this pull request Oct 31, 2019
The unit to mount sysroot only worked the *first* boot
because it was integrated with Ignition.  We need to have
separate units with different dependencies (but that execute
the same code) for the "Ignition boot" compared with "subsequent"
boots.

Depends coreos/ignition-dracut#131
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.

4 participants