opnsense-src/libexec/rc/rc.d/linux
Edward Tomasz Napierala ee0ee18c9c Add rcvar back to the linux rc script. Without it it was enabled
unconditionally.

Reported by:	Michael Butler <imb at protected-networks dot net>
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2019-10-03 16:38:44 +00:00

39 lines
713 B
Bash
Executable file

#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: linux
# REQUIRE: archdep
# KEYWORD: nojail
. /etc/rc.subr
name="linux"
desc="Enable Linux ABI"
rcvar="linux_enable"
start_cmd="${name}_start"
stop_cmd=":"
linux_start()
{
local _tmpdir
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
}
load_rc_config $name
run_rc_command "$1"