Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 545162

Summary: sys-apps/openrc: fix binfmt.d processing
Product: Gentoo Hosted Projects Reporter: William Hubbs <williamh>
Component: OpenRCAssignee: OpenRC Team <openrc>
Status: RESOLVED FIXED    
Severity: normal CC: floppym
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 544150, 520144    
Attachments: 0001-Fix-binfmt-processing.patch
0001-Fix-binfmt-processing.patch
0001-Fix-binfmt-processing.patch

Description William Hubbs gentoo-dev 2015-03-31 14:55:51 UTC
The current binfnt.d processing does not quite follow the spec.
It should be identical to how tmpfiles.d files are processed [1].

In particular, notice the rules of precedence on the referenced page.

[1] http://man7.org/linux/man-pages/man5/binfmt.d.5.html
Comment 1 William Hubbs gentoo-dev 2015-03-31 15:20:30 UTC
Actually above is the wrong reference for the spec; it is here [1].

In a nutshell, all  vendor-provided binfmt files go in
/usr/lib/binfmt.d/*.conf, and if a sys admin wants to disable them
zero-length versions of them go in /etc/binfmt.d/*.conf.

[1] http://0pointer.de/public/systemd-man/binfmt.d.html
Comment 2 William Hubbs gentoo-dev 2015-03-31 15:22:50 UTC
I am working on this bug as we speak.
Comment 3 Mike Gilbert gentoo-dev 2015-03-31 15:35:27 UTC
Thanks for working on this.

I believe the canonical reference would be the current manpage from systemd, available here:

http://www.freedesktop.org/software/systemd/man/binfmt.d.html

As of this writing, it is identical to the version on Lennart's website (0pointer.de).
Comment 4 William Hubbs gentoo-dev 2015-03-31 21:07:04 UTC
Created attachment 400300 [details, diff]
0001-Fix-binfmt-processing.patch

This patch should take care of making sure binfmt files are loaded
correctly.
correctly.  I do not use this facility, so I need testers.

Thanks,

William
Comment 5 William Hubbs gentoo-dev 2015-03-31 21:35:10 UTC
Created attachment 400304 [details, diff]
0001-Fix-binfmt-processing.patch

This is an updated version of the patch with a couple of small fixes.

- only increment error once and make sure that dryrun actually works.
Comment 6 William Hubbs gentoo-dev 2015-03-31 21:41:40 UTC
Created attachment 400306 [details, diff]
0001-Fix-binfmt-processing.patch

One more typo fix.
Comment 7 William Hubbs gentoo-dev 2015-03-31 22:25:44 UTC
The latest code for this is in a pull request on github so we don't spam
the bug with changes [1].

https://github.com/OpenRC/openrc/pull/48
Comment 8 William Hubbs gentoo-dev 2015-04-21 15:17:25 UTC
This will be included in openrc-0.14.