From nobody Wed Jan 05 08:17:59 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 8D87B192B7ED; Wed, 5 Jan 2022 08:18:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JTMmm1gTtz4X2w; Wed, 5 Jan 2022 08:18:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 15A48DC3; Wed, 5 Jan 2022 08:18:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2058HxDp063608; Wed, 5 Jan 2022 08:17:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2058HxCt063607; Wed, 5 Jan 2022 08:17:59 GMT (envelope-from git) Date: Wed, 5 Jan 2022 08:17:59 GMT Message-Id: <202201050817.2058HxCt063607@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Edward Tomasz Napierala Subject: git: bd8077ee84bd - main - linux(4): man page tweaks List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: trasz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bd8077ee84bd990d88607cc13f36f3da2a4dce10 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1641370680; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0s5WMe++MwZKyLseaURzTpuUrZNfOHtVJzhNa1q+6sU=; b=AM3B/qhuCjvx9TI+zTNdEVxDbNprcnXnbFVZmXYLQ5gr13XcJEQYzwsf76z8avkAWjC8If bpIUjzR7h5dgSKHBUwf8mhvI/ZpTqIxOEv5SYZz3+clpkcPQfGZ0jOoQRktEAEpRS4I3II 5fOQVBkDMqcqddOVDOaJtf64FftULm+oP5rV5bStm+HS2e+qR6UI0hfbBYA00O+SAje/b7 wfN2d355+fqCta4YG119+eNvBozqjuxDtaSQisT+D9oGWVDo4oRB9quedtbSKi+3CyxHoF AXXWTTaO19iBWZoRo+PMoHJAdPpaoBq+JL0jXr9SWFlJr+r/0oh/vBIZkEU4/A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1641370680; a=rsa-sha256; cv=none; b=E75Xw8sFvScgm/Vtd4Bzq0szT6OcpuzWSz++tx6CyLKJ9dDJbuwQq7iJZ52vjiDS8w3X+u GEn9bl/tlHMyxLbuUQEeMfw52rOpZlMF/GVCN1q2ZKTq7nqTDnp5UnAee4DBXWSIc8PytD ACtO9x5x2u90Nb0DX/qQCmO0YI9NoxLjHB5cZFAVANqBRVIecr9+WIPj7vb6D5ty0JeQBe PGoAJYXeRpHiAlfD3GTpLaEgQW9OipQlZIcsvTn5UBv7wRsFal5zuZJ39+la5ZJM0ekOaY p8Vw3qk+yNn+ldP/RGtGT1uKR1SDM+Otlkd/6Jqobu+5gIJRVN3TiMSTGRHy7Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=bd8077ee84bd990d88607cc13f36f3da2a4dce10 commit bd8077ee84bd990d88607cc13f36f3da2a4dce10 Author: Edward Tomasz Napierala AuthorDate: 2022-01-05 08:16:38 +0000 Commit: Edward Tomasz Napierala CommitDate: 2022-01-05 08:16:48 +0000 linux(4): man page tweaks Advertise rc.conf method as the right way to enable it, mention file system mapping... and change some wording. Reviewed By: emaste, debdrup, Pau Amma Sponsored By: EPSRC Differential Revision: https://reviews.freebsd.org/D33720 --- share/man/man4/linux.4 | 75 +++++++++++++++++++++++++++++++------------------- 1 file changed, 47 insertions(+), 28 deletions(-) diff --git a/share/man/man4/linux.4 b/share/man/man4/linux.4 index ce0240dd9f92..b24e3dbc9f79 100644 --- a/share/man/man4/linux.4 +++ b/share/man/man4/linux.4 @@ -24,56 +24,68 @@ .\" .\" $FreeBSD$ .\" -.Dd May 6, 2021 +.Dd January 2, 2022 .Dt LINUX 4 .Os .Sh NAME .Nm linux .Nd Linux ABI support .Sh SYNOPSIS -To load the ABI at boot time, place the following line in -.Xr loader.conf 5 : +To enable the Linux ABI at boot time, place the following line in +.Xr rc.conf 5 : .Bd -literal -offset indent -linux_load="YES" +linux_enable="YES" .Ed .Sh DESCRIPTION The .Nm module provides limited Linux ABI (application binary interface) compatibility, -making it possible to run many unmodified Linux applications and libraries +making it possible to run many unmodified Linux applications without the need for virtualization or emulation. Some of the facilities provided are: .Bl -bullet .It -An image activator -for correctly branded -.Xr elf 5 -executable images -.It -Special signal handling for activated images -.It Linux to native system call translation .It Linux-specific system calls +.It +Special signal handling for Linux processes +.It +Path translation mechanism +.It +Linux-specific virtual file systems .El .Pp -Note that dynamically linked Linux executables -will require a suitable environment in -.Pa /compat/linux . -This includes native Linux shared libraries, and Linux-specific virtual -filesystems. -To set it up, install the +The path translation mechanism makes Linux processes look up file paths +under +.Va emul_path +(defaulting to +.Pa /compat/linux ) +before +.Pa / . +For example, when Linux process attempts to open +.Pa /etc/passwd , +it will really access +.Pa /compat/linux/etc/passwd , +unless the latter does not exist. +This is used to make sure Linux processes load Linux shared libraries +instead of their similarly-named FreeBSD counterparts, and also +to provide alternative versions of certain other files and virtual +file systems. +.Pp +To install Linux shared libraries and system files into +.Pa /compat/linux , +use the .Pa emulators/linux_base-c7 -port or the linux_base-c7 -package, and add the following line to the +port or the +.Dv linux_base-c7 +package. +.Pp +To avoid mounting Linux-specific filesystems at startup, add the following +line to the .Xr rc.conf 5 file: .Pp -.Dl linux_enable="YES" -.Pp -To avoid mounting Linux-specific filesystems at startup, also add the following -line: -.Pp .Dl linux_mounts_enable="NO" .Sh SYSCTL VARIABLES The following variables are available as both @@ -101,14 +113,16 @@ Defaults to .Pa /compat/linux . .It Va compat.linux.osname Linux kernel operating system name. +Defaults to "Linux". .It Va compat.linux.osrelease Linux kernel operating system release. Changing this to something else is discouraged on non-development systems, because it may change the way Linux programs work. -Recent versions of GNU libc are known to use different syscalls depending +Some versions of GNU libc are known to use different syscalls depending on the value of this sysctl. .It Va compat.linux.oss_version Linux Open Sound System version. +Defaults to 198144. .It Va compat.linux.preserve_vstatus When set to 1, it prevents Linux applications from resetting the .Xr termios 4 @@ -121,9 +135,10 @@ Defaults to 0. Disable handling of set-user-ID and set-group-ID mode bits for the new process image file when image is to be executed under Linux ABI. When set, new Linux images always use credentials of the program -that issued +that issued the .Xr execve 2 call, regardless of the image file mode. +Defaults to 1. .Pp This might be reasonable or even required, because .Fx @@ -133,7 +148,7 @@ could become holes. .Sh FILES .Bl -tag -width /compat/linux/dev/shm -compact .It Pa /compat/linux -minimal Linux run-time environment +Linux run-time environment .It Pa /compat/linux/dev device file system, see .Xr devfs 5 @@ -163,6 +178,10 @@ Linux kernel objects file system, see .Sh HISTORY Linux ABI support first appeared in .Fx 2.1 . +Support for amd64 binaries first appeared in +.Fx 10.3 . +Support for arm64 binaries first appeared in +.Fx 12.0 . .Sh BUGS Support for some of the Linux-specific system calls and system call arguments is missing.