Skip to content

dracut: Add ignition-ostree-mount-sysroot.service#187

Merged
jlebon merged 3 commits intocoreos:testing-develfrom
cgwalters:ignition-ostree-rootfs-prep
Oct 18, 2019
Merged

dracut: Add ignition-ostree-mount-sysroot.service#187
jlebon merged 3 commits intocoreos:testing-develfrom
cgwalters:ignition-ostree-rootfs-prep

Conversation

@cgwalters
Copy link
Member

This is inert by default because coreos-assembler adds the root=
kernel argument today. But the intention is to drop those and
allow integration with Ignition rootfs replacement.

We only want to pass the prjquota flag for our default XFS filesystem,
so this can't be a static [Mount] unit type, it has to be determined
after ignition-fetch.service.

I'm going to extend it to handle `/sysroot` in the initrd
in prep for Ignition+OSTree rootfs replacement.
This doesn't do anything, but I think it's a general best practice.
Maybe for example at some point these units end up in the `ignition` RPM
that someone mistakenly installs on a yum-based system.
cgwalters added a commit to cgwalters/coreos-assembler that referenced this pull request Sep 27, 2019
This is prep for reprovisioning the rootfs:
coreos/fedora-coreos-tracker#94

Requires: coreos/fedora-coreos-config#187
(Do not merge until RHCOS has also rebased to FCOS with that change)

Closes: coreos#781
@cgwalters
Copy link
Member Author

Tested both with and without coreos/coreos-assembler#786

Copy link
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 to me.

This is inert by default because coreos-assembler adds the `root=`
kernel argument today.  But the intention is to drop those and
allow integration with Ignition rootfs replacement.

We only want to pass the `prjquota` flag for our default XFS filesystem,
so this can't be a static `[Mount]` unit type, it has to be determined
after `ignition-fetch.service`.
@cgwalters cgwalters force-pushed the ignition-ostree-rootfs-prep branch from 2a1ac6b to a6fe374 Compare October 1, 2019 20:23
ConditionPathExists=!/run/ostree-live

Before=initrd-root-fs.target
After=ignition-disks.service
Copy link
Member

Choose a reason for hiding this comment

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

I think we want After=initrd-root-device.target here instead? (Which ignition-disks.service is already ordered against too.)

Copy link
Member Author

Choose a reason for hiding this comment

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

Hum...as far as I can see, initrd-root-device.target is only referenced by the systemd fstab generator's handling of the root= kernel argument.

I don't see any references to initrd-root-device.target in the ignition-dracut git. How is ignition-disks.service ordered against it?

Copy link
Member Author

Choose a reason for hiding this comment

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

Also a tricky thing in this is that since we want to support reprovisioning the rootfs...I don't think we could e.g. say that we've reached initrd-root-device.target when /dev/disk/by-label/root appears - because we may need to tear it down and make a new one.

Oh but hm I see coreos/ignition-dracut@4cdd024 is what you were talking about, I missed that before.

Copy link
Member Author

Choose a reason for hiding this comment

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

OK yeah, I think we need to take over initrd-root-device.target as part of supporting reprovisioning. But we can't do it in this PR because we don't do reprovisioning yet.

I think...let's keep this PR as is, and try to implement the target in the later reprovisioning PR, and change this dependency then?

Copy link
Member

Choose a reason for hiding this comment

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

Will ignition-ostree-mount-sysroot.service play a different role once reprovisioning is supported? Or will it always be the thing that mounts the final possibly-reprovisioned root? If so, seems like we can settle on this ordering right now and just change the "backing" for initrd-root-device.target independently, no?

Copy link
Member Author

Choose a reason for hiding this comment

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

So with reprovisioning, there's two three mounts of the root device. The way I have things currently in the PR is that the reprovisioner uses a private mount namespace, to help ensure that nothing else sees it, i.e. it "owns" that mount until this unit comes through.

Copy link
Member

Choose a reason for hiding this comment

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

OK right, so systemd generates this:

# cat /run/systemd/generator/initrd-root-device.target.d/50-root-device.conf

# Automatically generated by systemd-fstab-generator

[Unit]
Requires=dev-disk-by\x2dlabel-root.device
After=dev-disk-by\x2dlabel-root.device

Which yeah, we'll want to do something better here.
Anyway, let's get this one in!

@jlebon jlebon merged commit b29bf79 into coreos:testing-devel Oct 18, 2019
cgwalters added a commit to cgwalters/coreos-assembler that referenced this pull request Oct 27, 2019
This is prep for reprovisioning the rootfs:
coreos/fedora-coreos-tracker#94

Requires: coreos/fedora-coreos-config#187
(Do not merge until RHCOS has also rebased to FCOS with that change)

Closes: coreos#781
cgwalters added a commit to cgwalters/coreos-assembler that referenced this pull request Oct 29, 2019
This is prep for reprovisioning the rootfs:
coreos/fedora-coreos-tracker#94

Requires: coreos/fedora-coreos-config#187
(Do not merge until RHCOS has also rebased to FCOS with that change)

Closes: coreos#781
cgwalters added a commit to cgwalters/coreos-assembler that referenced this pull request Oct 30, 2019
This is prep for reprovisioning the rootfs:
coreos/fedora-coreos-tracker#94

Requires: coreos/fedora-coreos-config#187
(Do not merge until RHCOS has also rebased to FCOS with that change)

Closes: coreos#781
jlebon pushed a commit to coreos/coreos-assembler that referenced this pull request Oct 30, 2019
This is prep for reprovisioning the rootfs:
coreos/fedora-coreos-tracker#94

Requires: coreos/fedora-coreos-config#187
(Do not merge until RHCOS has also rebased to FCOS with that change)

Closes: #781
cgwalters added a commit to cgwalters/coreos-assembler that referenced this pull request Mar 20, 2020
I was looking at this to figure out why `console` was omitted,
and noticed we could trim some cruft here.  We no longer use
`root` or `rootflags` etc. since we reworked rootfs discovery
in coreos/fedora-coreos-config#187
etc.
openshift-merge-robot pushed a commit to coreos/coreos-assembler that referenced this pull request Mar 20, 2020
I was looking at this to figure out why `console` was omitted,
and noticed we could trim some cruft here.  We no longer use
`root` or `rootflags` etc. since we reworked rootfs discovery
in coreos/fedora-coreos-config#187
etc.
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.

4 participants