-
Notifications
You must be signed in to change notification settings - Fork 198
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
WIP: Add /etc/rpm-ostree/roothooks.d #1882
Conversation
Container Linux had a similar (but less powerful) hooking point in update-engine, which was the last running logic before marking an update as locally available. |
Hmm, if we're running the hooks directly without any containerization, then doesn't that undermine all the safeties we enforce to prevent runtime modifications? Another approach is to require all hooks to run in containers where we pass only the target rootfs through a bind-mount? Edit: more discussions in coreos/fedora-coreos-tracker#249 (comment). |
The hook should only operate on the target root. We still have e.g. the baseline ostree protections like the read-only
I would expect most hooks to run containers, but requiring it would be quite a jump in interface complexity. Would we have something like pod spec YAML? This would also tie us quite closely to docker/OCI and make hooks unusable without that. I guess with this the vision is more that we add an interface with ultimate flexibility - but we'd document a good best practice for hooks would be a simple shell script that did |
☔ The latest upstream changes (presumably c279f92) made this pull request unmergeable. Please resolve the merge conflicts. |
Though, a downside of this is we'll be running without |
This is somewhat nasty to implement though, our rofiles-fuse code is tied into the bwrap stuff; and if we use that we make it way harder to have your script invoke Another option is to make the new tree read-only, and require the hook to output a manual "overlay" into a new directory. It is actually tempting to try to match containers/storage and use the dual overlayfs (when running as root) and fuse-overlayfs path (when running unpriv)...but that's some unknown-difficulty probably-invasive work. |
One interesting thing about this hook is that in rpm-ostree there's a distinction between "check for updates" and "apply updates" - for example, if you That's a hugely important property. Another way to say this is that we go to a lot of effort to handle this instead of just having an imperative Anyways, this hook doesn't support that kind of thing - it can only mutate or block an already created tree. I was thinking about trying to generalize this to do so...but it's not necessary for kernel module work. And the more I think about it...what we could do for that is add an But we'd need a more sophisticated "protocol" to do that with an external process. Hmm. Maybe not too bad to do so. On the other hand again, not needed for kmods, and this should straightforwardly help that. |
And...we'd need to track which overlay layers were created by hooks, to properly handle garbage collection. Maybe...one idea is that we write |
The "less powerful" here being e.g. that it can't mutate the OS filesystem right? |
@cgwalters partially. I was referring to the facts that:
|
That's a big exception of course (and a big difference between ostree and update_engine).
Ah, but this is also true of this PR; do you think that's OK? What code in that script runs new binaries? Is it everything referencing |
This is intended to support kernel module systems like [atomic-wireguard](https://github.com/jdoss/atomic-wireguard). See the Fedora CoreOS tracker issue: coreos/fedora-coreos-tracker#249 With a "roothook", one can perform arbitrary modifications to the *new* root filesystem; if a hook exits with an error, that also stops the upgrade. Specifically with this, atomic-wireguard could *block* an upgrade if the new kernel isn't compatible with a module.
OK, there's a lot of context here and I may be missing some still. So here are my main concerns with a general hook like this:
That said, I definitely agree with the need for "strong binding" mentioned in this comment. If we want to solve the kmod issue, can we instead work on defining semantics around how rpm-ostree can support that specifically, optionally even building the kmod itself? (E.g. I think it'd be pretty cool if |
Yeah, and as noted above declarative is a necessity to integrate with But, those things are not necessary for kmods.
Right. But...such a thing would require driving a lot of "policy" into rpm-ostree that doesn't exist today. We'd have to make decisions around how kernel modules are built in a way that would influence how people build rpm-ostree using operating systems. (On this topic of course, Silverblue already shipped parts of this, in a way that I'm not sure we want to do for FCOS derivatives, although it's not out of the question I guess) |
☔ The latest upstream changes (presumably 553be6e) made this pull request unmergeable. Please resolve the merge conflicts. |
Ultimately I guess the question is: should |
This is intended to support kernel module systems like
atomic-wireguard.
See the Fedora CoreOS tracker issue:
coreos/fedora-coreos-tracker#249
With a "roothook", one can perform arbitrary modifications to the new root
filesystem; if a hook exits with an error, that also stops the upgrade.
Specifically with this, atomic-wireguard could block an upgrade if
the new kernel isn't compatible with a module.