From owner-freebsd-amd64@freebsd.org Wed Mar 21 11:57:48 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 ED71DF61447 for ; Wed, 21 Mar 2018 11:57:47 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lf0-f41.google.com (mail-lf0-f41.google.com [209.85.215.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 546AA6B572; Wed, 21 Mar 2018 11:57:47 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lf0-f41.google.com with SMTP id o102-v6so7412447lfg.8; Wed, 21 Mar 2018 04:57:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=i6wgBWmlVWEliOAw9Q98dtnjGfR4zMMjXIyt0Fb+Xrw=; b=F5/xbHwcepY8pEWzSRpye4zJMH87tb4XBcAiP1K9O5GHmBigJIAhaHsUoaXRLKXJHa QrVUTAAeD2I+XzTXThFZhRuWxQa1Vhn0eDv4YOMPfNPoFCjj6wZOBRvVE243A2k9qYqh aUb5ADAeCbZEaimOVzpD+TYjuTrf4mgcQvpeg0S79JzI3yrIyAf3Y7F7c2ZYtFIK06NT ah5/5AUFV1tKCuSFAYjg24yxH0+ktX/ZDJon5QopwbztbnrbqlymRi8P9L8y0Lne4OEg +aZr/qcHc9LTCRfFGKiat5pVx9f0NwAjDU+rzvDH525f7oNW0nkUb/ZAe6DUWZxkrL6W XveA== X-Gm-Message-State: AElRT7FpEQNjWImmZpWek75Slsmjc+bodBZ+rgtp87fMuURzQo9Sia9d 5/dg9WDbJAU9C5cUUB2zh92GWk0b X-Google-Smtp-Source: AG47ELuzEGmUgCGRCjdiW50vD4yXArU7FuASqTmlKyROh7KrmNn/3TngaZYjHqv6Xkk6i3gy0rOU7w== X-Received: by 10.46.117.2 with SMTP id q2mr2291172ljc.12.1521633459929; Wed, 21 Mar 2018 04:57:39 -0700 (PDT) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id h68-v6sm1003257lfk.67.2018.03.21.04.57.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Mar 2018 04:57:39 -0700 (PDT) Subject: Re: Linux compat / changing compat path To: Stefan Esser , freebsd-amd64@freebsd.org References: <20180321090911.4d1059c2@ernst.home> From: Andriy Gapon Message-ID: <75bf1e70-b43a-5642-f69a-cc085c50225a@FreeBSD.org> Date: Wed, 21 Mar 2018 13:57:37 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Wed, 21 Mar 2018 12:10:20 +0000 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 11:57:48 -0000 On 21/03/2018 10:39, Stefan Esser wrote: > 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 ... I am not sure what would actually happen in the following case. Create a jail and make it "pure Linux". That is, install only Linux binaries there, no FreeBSD at all. And install them under the root of the jail, that is, no /compat/linux within the jail. Would that work? Would I be able to start such a jail (processes in it) ? Would they be able to correctly find their libraries and other executables they might want to exec? If this works or could be made to work, then I am sure that some people would it useful. -- Andriy Gapon