summaryrefslogtreecommitdiffstats
path: root/etc/rc.d/abi
blob: 3765b058114fbef64a1111d0076cde40bdea0163 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/sh
#
# $FreeBSD$
#

# PROVIDE: abi
# REQUIRE: archdep
# KEYWORD: nojail

. /etc/rc.subr

name="abi"
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
	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"
OpenPOWER on IntegriCloud