Summary: | sys-apps/openrc: support /etc/binfmt.d/ | ||
---|---|---|---|
Product: | Gentoo Hosted Projects | Reporter: | Michał Górny <mgorny> |
Component: | OpenRC | Assignee: | OpenRC Team <openrc> |
Status: | RESOLVED FIXED | ||
Severity: | enhancement | ||
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 382299, 383529 | ||
Attachments: | Patch adding a simple script for it |
Description
Michał Górny
![]() ![]() ![]() ![]() Ah, and a particular example consumer would be dev-dotnet/pe-format which would happily drop its long and boring init.d script. /etc/binfmt.d/ sounds find. i wanted this in the past on my own machines for use with qemu ... not sure we need to split binfmt_misc out of the existing procfs script though Created attachment 286533 [details, diff]
Patch adding a simple script for it
It should basically do the thing; I don't have any OpenRC machine to test it.
Comment on attachment 286533 [details, diff]
Patch adding a simple script for it
looks way more complicated than necessary. one liner to add to procfs:
grep -qsv -e '^[#;]' -e '^[[:space:]]*$' \
/run/binfmt.d/*.conf \
"@SYSCONFDIR@"/binfmt.d/*.conf \
"@PREFIX@"/usr/lib/binfmt.d/*.conf \
> /proc/sys/fs/binfmt_misc/register
(In reply to comment #4) > Comment on attachment 286533 [details, diff] > Patch adding a simple script for it > > looks way more complicated than necessary. one liner to add to procfs: > grep -qsv -e '^[#;]' -e '^[[:space:]]*$' \ > /run/binfmt.d/*.conf \ > "@SYSCONFDIR@"/binfmt.d/*.conf \ > "@PREFIX@"/usr/lib/binfmt.d/*.conf \ > > /proc/sys/fs/binfmt_misc/register Issues with your solution: 1) no sane error handling, 2) no possibility of filtering duplicate files, 3) no possibility of disabling/reloading binfmt.d rules. (In reply to comment #5) (1) you write an error in your config file, it's your fault (2) yours didn't handle duplicates either, but i'm not sure it's really necessary at this point (3) true, but yours lacks any restart support as well, and doing it cleanly is non-trivial to the point where i'm not sure it's worth it: clobbering all registrations at restart time (write -1 to status) is unacceptable; cleanly maintaining a list of registered handlers at start time and removing them at stop time is non-trivial and unsure if that's really what the user wants further, on the duplicate side, i dont see the point of handling any dir beyond /etc/binfmt.d/, and no one will be installing files into that that are unconditionally enabled. so if the user enables a duplicate, well that's a user error. we can ship this now and see if anyone complains. if no one does, then obviously it's not that big of a deal. (In reply to comment #6) > further, on the duplicate side, i dont see the point of handling any dir beyond > /etc/binfmt.d/, and no one will be installing files into that that are > unconditionally enabled. so if the user enables a duplicate, well that's a > user error. That was intended for compatibility with systemd. There's no reason to re-invent the same thing just for the sake of reinvention. And /usr location is much better for apps to install those descriptions than /etc. I wouldn't treat them as config file. packages don't get to decide what random files are now executable ... users do. i'll leave in the additional paths for now to see what kind of hell breaks loose. http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commitdiff;h=47d305d2af41a6105824bd704a0f0f958b35871d |