regression in /etc/rc.d/linux

Sergey V. Dyatko sergey.dyatko at gmail.com
Tue Feb 9 15:00:07 UTC 2021


Hi,

Subj was introduced in  e40787f900f3c262d5134d342e5a16757dd2193c

compat.linux.emul_path isn't defined before kldload`ing linux/linux64 kernel. 

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

--
wbr, Sergey



More information about the freebsd-current mailing list