]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - etc/rc.d/abi
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / etc / rc.d / abi
1 #!/bin/sh
2 #
3 # $FreeBSD$
4 #
5
6 # PROVIDE: abi
7 # REQUIRE: archdep
8 # KEYWORD: nojail
9
10 . /etc/rc.subr
11
12 name="abi"
13 start_cmd="${name}_start"
14 stop_cmd=":"
15
16 sysv_start()
17 {
18         echo -n ' sysvipc'
19         load_kld sysvmsg
20         load_kld sysvsem
21         load_kld sysvshm
22 }
23
24 linux_start()
25 {
26         local _tmpdir
27
28         echo -n ' linux'
29         load_kld -e 'linux(aout|elf)' linux
30         if [ -x /compat/linux/sbin/ldconfigDisabled ]; then
31                 _tmpdir=`mktemp -d -t linux-ldconfig`
32                 /compat/linux/sbin/ldconfig -C ${_tmpdir}/ld.so.cache
33                 if ! cmp -s ${_tmpdir}/ld.so.cache /compat/linux/etc/ld.so.cache; then
34                         cat ${_tmpdir}/ld.so.cache > /compat/linux/etc/ld.so.cache
35                 fi
36                 rm -rf ${_tmpdir}
37         fi
38 }
39
40 svr4_start()
41 {
42         echo -n ' svr4'
43         load_kld -m svr4elf svr4
44 }
45
46 abi_start()
47 {
48         local _echostop
49
50         _echostop=
51         if checkyesno sysvipc_enable || checkyesno linux_enable || checkyesno svr4_enable; then
52                 echo -n 'Additional ABI support:'
53                 _echostop=yes
54         fi
55
56         checkyesno sysvipc_enable && sysv_start
57         checkyesno linux_enable && linux_start
58         checkyesno svr4_enable && svr4_start
59
60         [ -n "${_echostop}" ] && echo '.'
61 }
62
63 load_rc_config $name
64 run_rc_command "$1"