From 47d305d2af41a6105824bd704a0f0f958b35871d Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sun, 18 Sep 2011 15:29:01 -0400 Subject: procfs: load config files from binfmt.d into /proc/sys/fs/binfmt_misc/register This is a KISS version. Let's see where we go from here in terms of complexity. Maybe nowhere! X-Gentoo-Bug: 382723 X-Gentoo-Bug-URL: https://bugs.gentoo.org/382723 Signed-off-by: Mike Frysinger --- init.d/procfs.in | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/init.d/procfs.in b/init.d/procfs.in index 43ba45a4..d86814c6 100644 --- a/init.d/procfs.in +++ b/init.d/procfs.in @@ -54,7 +54,18 @@ start() ebegin "Mounting misc binary format filesystem" mount -t binfmt_misc -o nodev,noexec,nosuid \ binfmt_misc /proc/sys/fs/binfmt_misc - eend $? + if eend $? ; then + local fmts + ebegin "Loading custom binary format handlers" + fmts=$(grep -hsv -e '^[#;]' -e '^[[:space:]]*$' \ + /run/binfmt.d/*.conf \ + "/etc"/binfmt.d/*.conf \ + ""/usr/lib/binfmt.d/*.conf) + if [ -n "${fmts}" ]; then + echo "${fmts}" > /proc/sys/fs/binfmt_misc/register + fi + eend $? + fi fi fi -- cgit v1.2.3