dracut: Add ignition-ostree-mount-sysroot.service#187
dracut: Add ignition-ostree-mount-sysroot.service#187jlebon merged 3 commits intocoreos:testing-develfrom
Conversation
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.
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
|
Tested both with and without coreos/coreos-assembler#786 |
overlay.d/05core/usr/lib/dracut/modules.d/40ignition-ostree/ignition-ostree-mount-sysroot.sh
Show resolved
Hide resolved
overlay.d/05core/usr/lib/dracut/modules.d/40ignition-ostree/ignition-ostree-mount-sysroot.sh
Outdated
Show resolved
Hide resolved
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`.
2a1ac6b to
a6fe374
Compare
overlay.d/05core/usr/lib/dracut/modules.d/40ignition-ostree/ignition-ostree-mount-var.service
Show resolved
Hide resolved
| ConditionPathExists=!/run/ostree-live | ||
|
|
||
| Before=initrd-root-fs.target | ||
| After=ignition-disks.service |
There was a problem hiding this comment.
I think we want After=initrd-root-device.target here instead? (Which ignition-disks.service is already ordered against too.)
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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!
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
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
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
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
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.
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.
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
prjquotaflag for our default XFS filesystem,so this can't be a static
[Mount]unit type, it has to be determinedafter
ignition-fetch.service.