| Server IP : 82.208.35.60 / Your IP : 216.73.216.89 Web Server : Apache/2.4.55 (FreeBSD) OpenSSL/1.1.1q-freebsd PHP/7.3.31 System : FreeBSD server7.d2m.cz 12.4-RELEASE-p9 FreeBSD 12.4-RELEASE-p9 GENERIC amd64 User : studiokobylisy_cz ( 1008) PHP Version : 7.3.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /etc/rc.d/ |
Upload File : |
#!/bin/sh
#
# $FreeBSD: releng/12.4/libexec/rc/rc.d/linux 364985 2020-08-31 12:14:20Z trasz $
#
# PROVIDE: linux
# REQUIRE: archdep
# KEYWORD: nojail
. /etc/rc.subr
name="linux"
desc="Enable Linux ABI"
rcvar="linux_enable"
start_cmd="${name}_start"
stop_cmd=":"
unmounted()
{
[ `stat -f "%d" "$1"` == `stat -f "%d" "$1/.."` -a \
`stat -f "%i" "$1"` != `stat -f "%i" "$1/.."` ]
}
linux_start()
{
local _emul_path _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
# Linux uses the pre-pts(4) tty naming scheme.
load_kld pty
# Handle unbranded ELF executables by defaulting to ELFOSABI_LINUX.
if [ `sysctl -ni kern.elf64.fallback_brand` -eq "-1" ]; then
sysctl kern.elf64.fallback_brand=3 > /dev/null
fi
if [ `sysctl -ni kern.elf32.fallback_brand` -eq "-1" ]; then
sysctl kern.elf32.fallback_brand=3 > /dev/null
fi
if checkyesno linux_mounts_enable; then
_emul_path="/compat/linux"
unmounted "${_emul_path}/proc" && mount -t linprocfs linprocfs "${_emul_path}/proc"
unmounted "${_emul_path}/sys" && mount -t linsysfs linsysfs "${_emul_path}/sys"
unmounted "${_emul_path}/dev" && mount -t devfs devfs "${_emul_path}/dev"
unmounted "${_emul_path}/dev/fd" && mount -o linrdlnk -t fdescfs fdescfs "${_emul_path}/dev/fd"
unmounted "${_emul_path}/dev/shm" && mount -o mode=1777 -t tmpfs tmpfs "${_emul_path}/dev/shm"
true
fi
}
load_rc_config $name
run_rc_command "$1"