aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2011-09-18 15:29:01 -0400
committerMike Frysinger <vapier@gentoo.org>2011-09-18 16:01:26 -0400
commit47d305d2af41a6105824bd704a0f0f958b35871d (patch)
tree7a823afde90fb5bb2d936935d7f3f2192a11f9d1
parent95adeb85bad458d3eb41c6c88289fdb462594641 (diff)
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 <vapier@gentoo.org>
-rw-r--r--init.d/procfs.in13
1 files changed, 12 insertions, 1 deletions
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