-
Notifications
You must be signed in to change notification settings - Fork 290
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
ostree-prepare-root.service: Run earlier in initrd #1759
Conversation
For the same reasons as ostreedev#1697. This is especially important in services that are likely to be used as an `After/Before=` target in other units. `ostree-prepare-root.service` is one such service.
Previously, we were preparing the root very late in the boot process; right before we switch root. The issue with that is that most services in the initrd that run `After=initrd-root-fs.target` expect that `/sysroot` already points to the rootfs we'll be pivoting to. Running this late violates that assumption. This patch fixes this by making `ostree-prepare-root.service` instead run right after `sysroot.mount` (the physical sysroot mounted by systemd) but still before `initrd-root-fs.target` (which is the target signalling that `/sysroot` is now valid and ready). This should make it easier to integrate OSTree with other initrd services such as Ignition. Related: https://github.com/dustymabe/ignition-dracut/issues/20
Marking as WIP for now, still need to test this on some more platforms. |
OK, I've now tested this on FAH, CAHC, FCOS, and RHCOS! ✔️ |
@ramcq If you have some time, would be nice to sanity check that this doesn't cause any weird regressions on EOS either. |
⚡ Test exempted: merge already tested. |
Previously, we were preparing the root very late in the boot process; right before we switch root. The issue with that is that most services in the initrd that run `After=initrd-root-fs.target` expect that `/sysroot` already points to the rootfs we'll be pivoting to. Running this late violates that assumption. This patch fixes this by making `ostree-prepare-root.service` instead run right after `sysroot.mount` (the physical sysroot mounted by systemd) but still before `initrd-root-fs.target` (which is the target signalling that `/sysroot` is now valid and ready). This should make it easier to integrate OSTree with other initrd services such as Ignition. Related: https://github.com/dustymabe/ignition-dracut/issues/20 Closes: #1759 Approved by: cgwalters
We do have a couple initrd services in https://github.com/endlessm/eos-boot-helper/tree/master/dracut that depend on the mount ordering. I haven't looked closely at the ordering yet. @dsd FYI. |
- Fixes systemd failing to determine if `/sysroot` is valid because of `/etc/os-release` not being available yet. - Related: ostreedev#1759
Previously, we were preparing the root very late in the boot process;
right before we switch root. The issue with that is that most services
in the initrd that run
After=initrd-root-fs.target
expect that/sysroot
already points to the rootfs we'll be pivoting to. Runningthis late violates that assumption.
This patch fixes this by making
ostree-prepare-root.service
insteadrun right after
sysroot.mount
(the physical sysroot mounted bysystemd) but still before
initrd-root-fs.target
(which is the targetsignalling that
/sysroot
is now valid and ready).This should make it easier to integrate OSTree with other initrd
services such as Ignition.
Related: dustymabe/ignition-dracut#20