abi revision 302408
1#!/bin/sh 2# 3# $FreeBSD: stable/11/etc/rc.d/abi 298514 2016-04-23 16:10:54Z lme $ 4# 5 6# PROVIDE: abi 7# REQUIRE: archdep 8# KEYWORD: nojail 9 10. /etc/rc.subr 11 12name="abi" 13desc="Enable foreign ABIs" 14start_cmd="${name}_start" 15stop_cmd=":" 16 17sysv_start() 18{ 19 echo -n ' sysvipc' 20 load_kld sysvmsg 21 load_kld sysvsem 22 load_kld sysvshm 23} 24 25linux_start() 26{ 27 local _tmpdir 28 29 echo -n ' linux' 30 load_kld -e 'linux(aout|elf)' linux 31 case `sysctl -n hw.machine_arch` in 32 amd64) 33 load_kld -e 'linux64elf' linux64 34 ;; 35 esac 36 if [ -x /compat/linux/sbin/ldconfigDisabled ]; then 37 _tmpdir=`mktemp -d -t linux-ldconfig` 38 /compat/linux/sbin/ldconfig -C ${_tmpdir}/ld.so.cache 39 if ! cmp -s ${_tmpdir}/ld.so.cache /compat/linux/etc/ld.so.cache; then 40 cat ${_tmpdir}/ld.so.cache > /compat/linux/etc/ld.so.cache 41 fi 42 rm -rf ${_tmpdir} 43 fi 44} 45 46svr4_start() 47{ 48 echo -n ' svr4' 49 load_kld -m svr4elf svr4 50} 51 52abi_start() 53{ 54 local _echostop 55 56 _echostop= 57 if checkyesno sysvipc_enable || checkyesno linux_enable || checkyesno svr4_enable; then 58 echo -n 'Additional ABI support:' 59 _echostop=yes 60 fi 61 62 checkyesno sysvipc_enable && sysv_start 63 checkyesno linux_enable && linux_start 64 checkyesno svr4_enable && svr4_start 65 66 [ -n "${_echostop}" ] && echo '.' 67} 68 69load_rc_config $name 70run_rc_command "$1" 71