-
Notifications
You must be signed in to change notification settings - Fork 293
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
Enable sysroot.readonly at initrd time #2115
Comments
When we remount `/sysroot` as read-only, we also make `/etc` read-only. This is usually OK because we then remount `/var` read-write, which also flips `/etc` back to read-write... unless `/var` is a separate filesystem and not a bind-mount to the stateroot `/var`. Fix this by just remounting `/etc` read-write in the read-only sysroot case. Eventually, I think we should rework this to set everything up the way we want from the initramfs (ostreedev#2115). This would also eliminate the window during which `/etc` is read-only while `ostree-remount` runs.
When we remount `/sysroot` as read-only, we also make `/etc` read-only. This is usually OK because we then remount `/var` read-write, which also flips `/etc` back to read-write... unless `/var` is a separate filesystem and not a bind-mount to the stateroot `/var`. Fix this by just remounting `/etc` read-write in the read-only sysroot case. Eventually, I think we should rework this to set everything up the way we want from the initramfs (ostreedev#2115). This would also eliminate the window during which `/etc` is read-only while `ostree-remount` runs.
Let's ensure things are right from the start in the initramfs; this closes off various race conditions. Followup to ostreedev@3564225 Closes: ostreedev#2115
Let's ensure things are right from the start in the initramfs; this closes off various race conditions. Followup to ostreedev@3564225 Closes: ostreedev#2115
Let's ensure things are right from the start in the initramfs; this closes off various race conditions. Followup to ostreedev@3564225 Closes: ostreedev#2115
The `systemd-rfkill.*` service falls in the category of things that need write access to `/etc` and `/var`, so we need to make sure we run before or it might hit the read-only sysroot. The long-term fix for this is ostreedev#2115. Closes: coreos/fedora-coreos-tracker#746
The `systemd-rfkill.*` service falls in the category of early things that need write access to `/var`, so we need to make sure we run before or it might hit the read-only sysroot. The long-term fix for this is ostreedev#2115. Closes: coreos/fedora-coreos-tracker#746
This is still affecting users due to several possible races, so it would be good to push it a bit forward. I started considering placing this into a systemd-generator instead, and put together a quick bash generator to explore that path. It's up at coreos/fedora-coreos-config#1257 and passes FCOS CI. These are my findings so far:
|
I think the initramfs is a much more constrained environment and the entire goal of the initramfs is to prepare Another argument for doing so is it's similar to what we do for the CoreOS live environment today: https://github.com/coreos/fedora-coreos-config/blob/08954efa915abd3e52240935d7e27235388f5533/overlay.d/05core/usr/lib/dracut/modules.d/35coreos-live/live-generator#L173
But, yes this is a strictly more powerful way of doing things in the real root. We actually already have a generator to do exactly this type of stuff https://github.com/ostreedev/ostree/blob/main/src/switchroot/ostree-system-generator.c So that generator could be enhanced to control the timing of But it's not clear to me that this really helps versus moving it to the initramfs. |
Can you expand on this? If we set up Conceptually, I think this would be equivalent to upstreaming |
Let's ensure things are right from the start in the initramfs; this closes off various race conditions. Followup to ostreedev@3564225 Closes: ostreedev#2115
Yes, the idea was to redistribute the logic across |
I did explore the idea of mounting and leaking One problem I discovered though is that systemd cannot be tricked into performing stacked mounts (possibly because they aren't really sane to handle anyway, and they can't be modeled through mount units). So even with a config fragment like this:
Once the system is fully booted the mount which is active on
|
Instead of leaking |
Another half-baked thought: What if we had the initramfs mount
or so? |
Heh, I was thinking about I think the issue with doing it from the generator is that it'd be pretty hard to be sure we've detected all the possible ways a |
Let's ensure things are right from the start in the initramfs; this closes off various race conditions. Followup to ostreedev@3564225 Closes: ostreedev#2115
Indeed I didn't see a systemd-friendly path for the mount-moving approach. Instead, the idea of making stateroot /var
I pushed a further commit on top of #2187. |
Yeah, what that test is doing is clearly a hack we don't need to support. But the idea of what it's testing is clearly valuable too. Hmm. I think we can make it a kola test since external tests support provisioning additional disks. |
I opened #2468 to separately tweak the test and make sure it passes both before and after landing the prepare-root rework. |
Let's ensure things are right from the start in the initramfs; this closes off various race conditions. Followup to ostreedev@3564225 Closes: ostreedev#2115
Let's ensure things are right from the start in the initramfs; this closes off various race conditions. Followup to ostreedev@3564225 Closes: ostreedev#2115
Today I somehow lost the sane path when rebasing #2187 one more time, and accidentally ended up discovering that we can have a working system where both
Chatting a bit more about that, it works mainly because |
Let's ensure things are right from the start in the initramfs; this closes off various race conditions. Followup to ostreedev@3564225 Closes: ostreedev#2115
Let's ensure things are right from the start in the initramfs; this closes off various race conditions. Followup to ostreedev@3564225 Closes: ostreedev#2115
Follow-up from #2113. Instead of enforcing it at
ostree-remount
time, which runs in the real root, we should try to have it already be read-only from the start.The text was updated successfully, but these errors were encountered: