freebsd-dev/etc/rc.d/abi
Lars Engels 6c1a5e837d - Add descriptions to most of the rc scripts. Those are mostly taken from their
daemon's manpage and probably improved.
- Consistently use "filesystem" not "file system".

Approved by:	bapt, brueffer
Differential Revision:	D452
2016-04-23 16:10:54 +00:00

71 lines
1.2 KiB
Bash
Executable File

#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: abi
# REQUIRE: archdep
# KEYWORD: nojail
. /etc/rc.subr
name="abi"
desc="Enable foreign ABIs"
start_cmd="${name}_start"
stop_cmd=":"
sysv_start()
{
echo -n ' sysvipc'
load_kld sysvmsg
load_kld sysvsem
load_kld sysvshm
}
linux_start()
{
local _tmpdir
echo -n ' linux'
load_kld -e 'linux(aout|elf)' linux
case `sysctl -n hw.machine_arch` in
amd64)
load_kld -e 'linux64elf' linux64
;;
esac
if [ -x /compat/linux/sbin/ldconfigDisabled ]; then
_tmpdir=`mktemp -d -t linux-ldconfig`
/compat/linux/sbin/ldconfig -C ${_tmpdir}/ld.so.cache
if ! cmp -s ${_tmpdir}/ld.so.cache /compat/linux/etc/ld.so.cache; then
cat ${_tmpdir}/ld.so.cache > /compat/linux/etc/ld.so.cache
fi
rm -rf ${_tmpdir}
fi
}
svr4_start()
{
echo -n ' svr4'
load_kld -m svr4elf svr4
}
abi_start()
{
local _echostop
_echostop=
if checkyesno sysvipc_enable || checkyesno linux_enable || checkyesno svr4_enable; then
echo -n 'Additional ABI support:'
_echostop=yes
fi
checkyesno sysvipc_enable && sysv_start
checkyesno linux_enable && linux_start
checkyesno svr4_enable && svr4_start
[ -n "${_echostop}" ] && echo '.'
}
load_rc_config $name
run_rc_command "$1"