13 desc="Enable Linux ABI"
15 start_cmd="${name}_start"
20 local _emul_path _tmpdir
22 load_kld -e 'linux(aout|elf)' linux
23 case `sysctl -n hw.machine_arch` in
25 load_kld -e 'linux64elf' linux64
28 if [ -x /compat/linux/sbin/ldconfigDisabled ]; then
29 _tmpdir=`mktemp -d -t linux-ldconfig`
30 /compat/linux/sbin/ldconfig -C ${_tmpdir}/ld.so.cache
31 if ! cmp -s ${_tmpdir}/ld.so.cache /compat/linux/etc/ld.so.cache; then
32 cat ${_tmpdir}/ld.so.cache > /compat/linux/etc/ld.so.cache
37 # Linux uses the pre-pts(4) tty naming scheme.
40 # Handle unbranded ELF executables by defaulting to ELFOSABI_LINUX.
41 if [ `sysctl -ni kern.elf64.fallback_brand` -eq "-1" ]; then
42 sysctl kern.elf64.fallback_brand=3 > /dev/null
45 if [ `sysctl -ni kern.elf32.fallback_brand` -eq "-1" ]; then
46 sysctl kern.elf32.fallback_brand=3 > /dev/null
49 if checkyesno linux_mounts_enable; then
50 _emul_path="/compat/linux"
51 mount -t linprocfs linprocfs "${_emul_path}/proc"
52 mount -t linsysfs linsysfs "${_emul_path}/sys"
53 mount -t devfs devfs "${_emul_path}/dev"
54 mount -o linrdlnk -t fdescfs fdescfs "${_emul_path}/dev/fd"
55 mount -o mode=1777 -t tmpfs tmpfs "${_emul_path}/dev/shm"