From owner-freebsd-amd64@freebsd.org Wed Mar 21 08:45:14 2018 Return-Path: Delivered-To: freebsd-amd64@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1DB6DF54842 for ; Wed, 21 Mar 2018 08:45:14 +0000 (UTC) (envelope-from se@freebsd.org) Received: from mailout12.t-online.de (mailout12.t-online.de [194.25.134.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mailout00.t-online.de", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ACFE1838C6 for ; Wed, 21 Mar 2018 08:45:13 +0000 (UTC) (envelope-from se@freebsd.org) Received: from fwd06.aul.t-online.de (fwd06.aul.t-online.de [172.20.26.150]) by mailout12.t-online.de (Postfix) with SMTP id CAE6041E9D15 for ; Wed, 21 Mar 2018 09:39:12 +0100 (CET) Received: from Stefans-MBP-LAN.fritz.box (TETFk4ZOwhVQ1nlghtH04uijEd8W8QfFSQvYs48zHNdmAKe2vJUyIfaZ4-wxcJ3Qz9@[84.154.103.83]) by fwd06.t-online.de with (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384 encrypted) esmtp id 1eyZH3-0u3mBk0; Wed, 21 Mar 2018 09:39:09 +0100 Subject: Re: Linux compat / changing compat path To: freebsd-amd64@freebsd.org References: <20180321090911.4d1059c2@ernst.home> From: Stefan Esser Message-ID: Date: Wed, 21 Mar 2018 09:39:09 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180321090911.4d1059c2@ernst.home> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit X-ID: TETFk4ZOwhVQ1nlghtH04uijEd8W8QfFSQvYs48zHNdmAKe2vJUyIfaZ4-wxcJ3Qz9 X-TOI-MSGID: af745da8-86b9-4003-a074-3391c513ea03 X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2018 08:45:14 -0000 Am 21.03.18 um 09:09 schrieb Gary Jennejohn: > On Tue, 20 Mar 2018 21:21:52 +0100 > Georg Bege 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/bsd.port.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