Linux compat / changing compat path

Stefan Esser se at
Wed Mar 21 08:45:14 UTC 2018

Am 21.03.18 um 09:09 schrieb Gary Jennejohn:
> On Tue, 20 Mar 2018 21:21:52 +0100
> Georg Bege <georg at> wrote:
>> Hello users,
>> Im not sure if this is actually the right mailing list for my question.
>> I was looking for something non-amd64 related - but somehow I didnt find that the other topics would be a better match too.
>> Im looking for a way to change the `default` linux compatibility userspace path /compat/linux to something else.
>> Basically right now, I've different jails (also Linux ones) where I keep software which is not compatible with my main system.
>> Also the pkg available linux-c* packages cant suit every thing I need, so I'd like to run programs I've installed (or compiled) from my jails.
>> It works if I change the above mentioned path with a symlink... however this is very unflexible.
>> What would be good is if I could change it per environment - is there a way? Any environment variable perhaps?
>> (And no LD_LIBRARY_PATH isnt cutting it in any cases)
> emulation would be the correct mailing list.
> This is defined in /usr/ports/Mk/ as
> 	LINUXBASE?=             /compat/linux
> so theoretically it could be overridden in /etc/make.conf.
> But you would have to recompile all your Linux ports.

And you want to change occurances of /compat/linux in the kernel (and possibly
some libraries and user programs), e.g. in /sys/amd64/linux/linux_sysvec.c ...

There is some magic that makes an exec of /bin/sh look up /compat/linux/bin/sh
first, if performed from within a program running under Linux emulation, and
if you need that behavior, you have to adjust at least the kernel sources.

Maybe the hard-coded "/compat/linux" should be replaced by a macro, to allow
easy modification without loss of functionality ...

Regards, STefan

More information about the freebsd-amd64 mailing list