[Rpm-maint] [rpm-software-management/rpm] RPM with Copy on Write (#1470)
chantra
notifications at github.com
Wed Feb 9 20:43:31 UTC 2022
Thanks for the heads up @pmatilai !
> Decoupling the plugin rc's is probably a good thing anyhow, but as for the initial use-case of that I think we just need a better API instead, one that is designed to offload payload content handling to a plugin rather than shoehorn it into the clearly ill-fitting existing one.
Agreed, and I actually started iterating on this yesterday on my branch: https://github.com/chantra/rpm/commits/cow_signvalidation.
For this specific use-case, there is 2 entry points that we would need.
1. ability to "install a file"
1. ability to provide a RPM file iterator to `rpmPackageFilesInstall` and as we iterate through the content, possibly offload it to the plugin to install the file.
[file install hook](https://github.com/chantra/rpm/commit/e2d9754ebc769296817ec644a910afd799b3b261) and [its usage](https://github.com/chantra/rpm/commit/5b7749f9b0097bfc8776acebc5ad1026ad43da32) . Likewise [for the rpmfi](https://github.com/chantra/rpm/commit/11324a70924c14b192f2ad3eff33792a1b7ee635) and [its usage](https://github.com/chantra/rpm/commit/acfbb4c8d49463b1cbe8fed6468169bf5226c2d7)
A plugin hook should be able to:
- process or not a call
- whether it was processed or not, it should be able to pass the handling through the chain (which is the current behaviour)
- it should also be able to stop the chaining. This is the current attempt signal via `RPMRC_PLUGIN_CONTENT`
- when we run through
There is definitely ways to improve this API.
With those new hooks, @malmond77 's original patch is almost fully isolated outside of core RPM code. There is still some helper functions like `pgpStringVal`, `rpmteFd` (this is the next thing I want to look into), `rpmReadPackageRaw`, but other than that, no more special casing whether it is a standard cpio rpm or not.
Being able to have such hooks in the short term would at least help in easily developing a feature such as RPM CoW without getting too intermingled with RPM core code.
I would appreciate if we could come to an agreement on what those hooks could look like so those hooks could be addressed separately to the main PR and merged, allowing to then rebase this work off those hooks. Given that the API is currently internal only, it gives us some flexibility to experiment and iterate if needs be. https://github.com/rpm-software-management/rpm/pull/1909 is possibly a good place to start at?
As I was working on a (not perfect but better than nothing) signature validation solution, it feels like plugins should also be able to act on signature/digest verification.
The current work done on RPM CoW is at https://github.com/chantra/rpm/compare/master...cow_signvalidation .
I still have some rough edges to address, want to test fully in prod.... but your feedback would be very appreciated so I can make progress toward something sustainable and PR-able eventually when it is a better time.
I will take some time to summarize more thoughts in https://hackmd.io/@chantra/BJ1Hedw0F once I am done with experimenting with this WIP.
--
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1470#issuecomment-1034174402
You are receiving this because you are subscribed to this thread.
Message ID: <rpm-software-management/rpm/pull/1470/c1034174402 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20220209/bf21cb0a/attachment.html>
More information about the Rpm-maint
mailing list