@@ -, +, @@ --- init.d/Makefile.Linux | 4 ++-- init.d/binfmt.in | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 init.d/binfmt.in --- a/init.d/Makefile.Linux +++ a/init.d/Makefile.Linux @@ -1,7 +1,7 @@ NET_LO= net.lo -SRCS+= devfs.in dmesg.in hwclock.in consolefont.in keymaps.in killprocs.in \ - modules.in mount-ro.in mtab.in numlock.in procfs.in sysfs.in \ +SRCS+= binfmt.in devfs.in dmesg.in hwclock.in consolefont.in keymaps.in \ + killprocs.in modules.in mount-ro.in mtab.in numlock.in procfs.in sysfs.in \ termencoding.in .SUFFIXES: .Linux.in --- a/init.d/binfmt.in +++ a/init.d/binfmt.in @@ -0,0 +1,35 @@ +#!@PREFIX@/sbin/runscript +# Copyright (c) 2011 +# Released under the 2-clause BSD license. + +description='Associate binaries from binfmt.d using binfmt_misc' + +depend() +{ + need procfs + use localmount +} + +start() +{ + local f bn + + ebegin "Registering binfmt_misc executables" + eindent + for f in \ + /run/binfmt.d/*.conf \ + "@SYSCONFDIR@"/binfmt.d/*.conf \ + "@PREFIX@"/usr/lib/binfmt.d/*.conf + do + # XXX: we should check for duplicates + # right now, we just assume their names will collide and registrar + # will ignore them + + if [ -r "${f}" ]; then + ebegin "${f}" + grep '^[;#]' "${f}" > /proc/sys/fs/binfmt_misc/register + eend ${?} + fi + done + eoutdent +} --