diff options
Diffstat (limited to 'init.d')
-rw-r--r-- | init.d/Makefile | 2 | ||||
-rw-r--r-- | init.d/binfmt.in | 20 | ||||
-rw-r--r-- | init.d/procfs.in | 13 |
3 files changed, 22 insertions, 13 deletions
diff --git a/init.d/Makefile b/init.d/Makefile index 85925b15..0bd3651b 100644 --- a/init.d/Makefile +++ b/init.d/Makefile @@ -21,7 +21,7 @@ SRCS-FreeBSD= hostid.in moused.in newsyslog.in pf.in rarpd.in rc-enabled.in \ SRCS-FreeBSD+= adjkerntz.in devd.in dumpon.in encswap.in ipfw.in \ mixer.in nscd.in powerd.in syscons.in -SRCS-Linux= devfs.in dmesg.in hwclock.in consolefont.in keymaps.in \ +SRCS-Linux= 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 tmpfiles.dev.in diff --git a/init.d/binfmt.in b/init.d/binfmt.in new file mode 100644 index 00000000..651b1315 --- /dev/null +++ b/init.d/binfmt.in @@ -0,0 +1,20 @@ +#!@SBINDIR@/openrc-run +# Copyright 2015 William Hubbs <w.d.hubbs@gmail.com> +# Released under the 2-clause BSD license. + +description="Register misc binary format handlers" + +depend() +{ + after procfs + use modules devfs + keyword -openvz -prefix -vserver -lxc +} + +start() +{ + ebegin "Loading custom binary format handlers" + "$RC_LIBEXECDIR"/sh/binfmt.sh + eend $? +return 0 +} diff --git a/init.d/procfs.in b/init.d/procfs.in index dfe58cb6..167a1aa3 100644 --- a/init.d/procfs.in +++ b/init.d/procfs.in @@ -15,24 +15,13 @@ start() { # Setup Kernel Support for miscellaneous Binary Formats if [ -d /proc/sys/fs/binfmt_misc -a ! -e /proc/sys/fs/binfmt_misc/register ]; then + modprobe -q binfmt-misc if grep -qs binfmt_misc /proc/filesystems; then ebegin "Mounting misc binary format filesystem" mount -t binfmt_misc -o nodev,noexec,nosuid \ binfmt_misc /proc/sys/fs/binfmt_misc - 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 - return 0 } |