2013-12-21 14:51:11 -06:00
|
|
|
#!@SBINDIR@/openrc-run
|
2015-12-04 16:52:19 -06:00
|
|
|
# Copyright (c) 2007-2015 The OpenRC Authors.
|
|
|
|
# See the Authors file at the top-level directory of this distribution and
|
2021-12-20 20:07:00 -05:00
|
|
|
# https://github.com/OpenRC/openrc/blob/HEAD/AUTHORS
|
2015-12-04 16:52:19 -06:00
|
|
|
#
|
|
|
|
# This file is part of OpenRC. It is subject to the license terms in
|
|
|
|
# the LICENSE file found in the top-level directory of this
|
2021-12-20 20:07:00 -05:00
|
|
|
# distribution and at https://github.com/OpenRC/openrc/blob/HEAD/LICENSE
|
2015-12-04 16:52:19 -06:00
|
|
|
# This file may not be copied, modified, propagated, or distributed
|
|
|
|
# except according to the terms contained in the LICENSE file.
|
2007-11-23 12:04:11 +00:00
|
|
|
|
|
|
|
description="Mounts misc filesystems in /proc."
|
|
|
|
|
2008-01-11 12:13:46 +00:00
|
|
|
depend()
|
|
|
|
{
|
2017-03-16 10:16:39 -05:00
|
|
|
after clock
|
2016-08-18 16:25:56 -05:00
|
|
|
use devfs
|
|
|
|
want modules
|
2016-07-31 13:01:17 -05:00
|
|
|
keyword -docker -lxc -openvz -prefix -systemd-nspawn -vserver
|
2007-11-23 12:04:11 +00:00
|
|
|
}
|
|
|
|
|
2008-01-11 12:13:46 +00:00
|
|
|
start()
|
|
|
|
{
|
2007-11-23 12:04:11 +00:00
|
|
|
# Setup Kernel Support for miscellaneous Binary Formats
|
2016-09-06 18:15:27 -05:00
|
|
|
if [ -d /proc/sys/fs/binfmt_misc ] &&
|
2016-09-12 12:58:01 -05:00
|
|
|
[ ! -e /proc/sys/fs/binfmt_misc/register ]; then
|
2016-09-06 18:15:27 -05:00
|
|
|
if ! grep -qs binfmt_misc /proc/filesystems &&
|
|
|
|
modprobe -q binfmt-misc; then
|
2017-12-14 17:31:57 -06:00
|
|
|
ewarn "The binfmt-misc module needs to be loaded by" \
|
|
|
|
"the modules service or built in."
|
2016-08-18 16:25:56 -05:00
|
|
|
fi
|
2007-11-28 15:45:03 +00:00
|
|
|
if grep -qs binfmt_misc /proc/filesystems; then
|
2007-11-23 12:04:11 +00:00
|
|
|
ebegin "Mounting misc binary format filesystem"
|
|
|
|
mount -t binfmt_misc -o nodev,noexec,nosuid \
|
|
|
|
binfmt_misc /proc/sys/fs/binfmt_misc
|
2011-09-18 15:29:01 -04:00
|
|
|
eend $?
|
2007-11-23 12:04:11 +00:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
return 0
|
|
|
|
}
|