freebsd-dev/etc/rc.d/abi

57 lines
921 B
Plaintext
Raw Normal View History

#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: abi
# REQUIRE: archdep
# KEYWORD: nojail
. /etc/rc.subr
name="abi"
start_precmd="${name}_prestart"
start_cmd=":"
sysv_start()
{
echo -n ' sysvipc'
load_kld sysvmsg
load_kld sysvsem
load_kld sysvshm
}
linux_start()
{
echo -n ' linux'
load_kld -e 'linux(aout|elf)' linux
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_prestart()
{
echo -n 'Additional ABI support:'
checkyesno sysvipc_enable && sysv_start
checkyesno linux_enable && linux_start
checkyesno svr4_enable && svr4_start
echo '.'
}
load_rc_config $name
run_rc_command "$1"