2013-12-22 02:21:11 +05:30
|
|
|
#!@SBINDIR@/openrc-run
|
2009-05-01 19:41:40 +05:30
|
|
|
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
|
2011-06-30 05:16:31 +05:30
|
|
|
# Released under the 2-clause BSD license.
|
2007-11-23 17:34:11 +05:30
|
|
|
|
|
|
|
description="Mounts misc filesystems in /proc."
|
|
|
|
|
2008-01-11 17:43:46 +05:30
|
|
|
depend()
|
|
|
|
{
|
2009-05-11 20:01:52 +05:30
|
|
|
use modules devfs
|
2008-03-03 02:43:21 +05:30
|
|
|
need localmount
|
2012-07-03 08:34:22 +05:30
|
|
|
keyword -openvz -prefix -vserver -lxc
|
2007-11-23 17:34:11 +05:30
|
|
|
}
|
|
|
|
|
2008-01-11 17:43:46 +05:30
|
|
|
start()
|
|
|
|
{
|
2007-11-23 17:34:11 +05:30
|
|
|
# Setup Kernel Support for miscellaneous Binary Formats
|
2011-09-19 01:20:12 +05:30
|
|
|
if [ -d /proc/sys/fs/binfmt_misc -a ! -e /proc/sys/fs/binfmt_misc/register ]; then
|
2007-11-28 21:15:03 +05:30
|
|
|
if grep -qs binfmt_misc /proc/filesystems; then
|
2007-11-23 17:34:11 +05:30
|
|
|
ebegin "Mounting misc binary format filesystem"
|
|
|
|
mount -t binfmt_misc -o nodev,noexec,nosuid \
|
|
|
|
binfmt_misc /proc/sys/fs/binfmt_misc
|
2011-09-19 00:59:01 +05:30
|
|
|
if eend $? ; then
|
|
|
|
local fmts
|
|
|
|
ebegin "Loading custom binary format handlers"
|
|
|
|
fmts=$(grep -hsv -e '^[#;]' -e '^[[:space:]]*$' \
|
|
|
|
/run/binfmt.d/*.conf \
|
2013-02-12 08:43:30 +05:30
|
|
|
/etc/binfmt.d/*.conf \
|
2011-09-19 00:59:01 +05:30
|
|
|
""/usr/lib/binfmt.d/*.conf)
|
|
|
|
if [ -n "${fmts}" ]; then
|
|
|
|
echo "${fmts}" > /proc/sys/fs/binfmt_misc/register
|
|
|
|
fi
|
|
|
|
eend $?
|
|
|
|
fi
|
2007-11-23 17:34:11 +05:30
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
return 0
|
|
|
|
}
|