aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Tomasz Napierala <trasz@FreeBSD.org>2021-02-08 21:52:31 +0000
committerEdward Tomasz Napierala <trasz@FreeBSD.org>2021-03-04 23:29:15 +0000
commit9d39df7bd9c03cca8ad9f90e08f1577db55e4449 (patch)
tree6c23275f8351c797dee324f5032ea3165461be1d
parentf122a871922561b7857ec80745f3e2d9531a8862 (diff)
downloadsrc-9d39df7bd9c03cca8ad9f90e08f1577db55e4449.tar.gz
src-9d39df7bd9c03cca8ad9f90e08f1577db55e4449.zip
Don't check compat.linux.emul_path before loading linux(4)
Fix e40787f900f to make libexec/rc/rc.d/linux retrieve the sysctl after loading the kernel module which provides it, not before. Approved by: re (gjb) Reported By: jkim Sponsored By: The FreeBSD Foundation (cherry picked from commit 07cac176fba947381c8111b8e02e8067e7fa542a) (cherry picked from commit 5dc2e1bcf41f853b31b6d08a5c2d643408e890f3)
-rwxr-xr-xlibexec/rc/rc.d/linux4
1 files changed, 3 insertions, 1 deletions
diff --git a/libexec/rc/rc.d/linux b/libexec/rc/rc.d/linux
index 4381b62cc660..f44a9d02fc8d 100755
--- a/libexec/rc/rc.d/linux
+++ b/libexec/rc/rc.d/linux
@@ -18,7 +18,6 @@ stop_cmd=":"
linux_start()
{
local _emul_path _tmpdir
- _emul_path="$(sysctl -n compat.linux.emul_path)"
load_kld -e 'linux(aout|elf)' linux
case `sysctl -n hw.machine_arch` in
@@ -26,6 +25,9 @@ linux_start()
load_kld -e 'linux64elf' linux64
;;
esac
+
+ _emul_path="$(sysctl -n compat.linux.emul_path)"
+
if [ -x ${_emul_path}/sbin/ldconfigDisabled ]; then
_tmpdir=`mktemp -d -t linux-ldconfig`
${_emul_path}/sbin/ldconfig -C ${_tmpdir}/ld.so.cache