Changeset View
Standalone View
share/man/man4/linux.4
Show All 18 Lines | |||||||||
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||||||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||||||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||||||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||||||
.\" SUCH DAMAGE. | .\" SUCH DAMAGE. | ||||||||
.\" | .\" | ||||||||
.\" $FreeBSD$ | .\" $FreeBSD$ | ||||||||
.\" | .\" | ||||||||
.Dd May 6, 2021 | .Dd January 2, 2022 | ||||||||
.Dt LINUX 4 | .Dt LINUX 4 | ||||||||
.Os | .Os | ||||||||
.Sh NAME | .Sh NAME | ||||||||
.Nm linux | .Nm linux | ||||||||
.Nd Linux ABI support | .Nd Linux ABI support | ||||||||
.Sh SYNOPSIS | .Sh SYNOPSIS | ||||||||
To load the ABI at boot time, place the following line in | To enable the Linux ABI at boot time, place the following line in | ||||||||
.Xr loader.conf 5 : | .Xr rc.conf 5 : | ||||||||
emaste: maybe `the Linux ABI at boot time`? | |||||||||
.Bd -literal -offset indent | .Bd -literal -offset indent | ||||||||
linux_load="YES" | linux_enable="YES" | ||||||||
.Ed | .Ed | ||||||||
.Sh DESCRIPTION | .Sh DESCRIPTION | ||||||||
The | The | ||||||||
.Nm | .Nm | ||||||||
module provides limited Linux ABI (application binary interface) compatibility, | 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. | without the need for virtualization or emulation. | ||||||||
Some of the facilities provided are: | Some of the facilities provided are: | ||||||||
.Bl -bullet | .Bl -bullet | ||||||||
.It | .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 | Linux to native system call translation | ||||||||
.It | .It | ||||||||
Linux-specific system calls | Linux-specific system calls | ||||||||
.It | |||||||||
Special signal handling for Linux processes | |||||||||
.It | |||||||||
Path translation mechanism | |||||||||
.It | |||||||||
Linux-specific virtual file systems | |||||||||
Not Done Inline ActionsI think the , isn't needed here emaste: I think the , isn't needed here | |||||||||
Done Inline ActionsHow about just removing this part altogether? It's redundant, might be confusing (because there are more than those two involved), and isn't even technically true (because those two are separate kernel modules). trasz: How about just removing this part altogether? It's redundant, might be confusing (because… | |||||||||
Not Done Inline ActionsOh I replied after seeing your update but before seeing your comments. I think that's fine too. emaste: Oh I replied after seeing your update but before seeing your comments. I think that's fine too. | |||||||||
Not Done Inline ActionsOh, I think the filesystems themselves were fine to list just the comma wasn't necessary. emaste: Oh, I think the filesystems themselves were fine to list just the comma wasn't necessary. | |||||||||
.El | .El | ||||||||
.Pp | .Pp | ||||||||
Note that dynamically linked Linux executables | The path translation mechanism makes Linux processes look up file paths | ||||||||
will require a suitable environment in | under | ||||||||
.Pa /compat/linux . | .Va emul_path | ||||||||
This includes native Linux shared libraries, and Linux-specific virtual | (defaulting to | ||||||||
.Pa /compat/linux ) | |||||||||
before | |||||||||
.Pa / . | |||||||||
Done Inline Actionscomma splice - make it a ., and start a new sentence with the next part. Can expand e.g. to For example, when Linux... to make it a reasonable start to the sentence emaste: comma splice - make it a ., and start a new sentence with the next part.
Can expand //e.g.//… | |||||||||
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 | |||||||||
Not Done Inline Actions"an alternative version" or "alternative versions" pauamma_gundo.com: "an alternative version" or "alternative versions" | |||||||||
filesystems. | file systems. | ||||||||
To set it up, install the | .Pp | ||||||||
To install Linux shared libraries and system files into | |||||||||
.Pa /compat/linux , | |||||||||
use the | |||||||||
Done Inline ActionsI might get rid of try to. Whether or not the translated path was found, they do perform the look up. Or "try to access file paths" or "try to reference file paths" or some such? emaste: I might get rid of //try to//. Whether or not the translated path was found, they do perform… | |||||||||
.Pa emulators/linux_base-c7 | .Pa emulators/linux_base-c7 | ||||||||
port or the linux_base-c7 | port or the | ||||||||
package, and add the following line to the | .Dv linux_base-c7 | ||||||||
package. | |||||||||
Not Done Inline ActionsWe have some other linux packages in the works too, right? emaste: We have some other linux packages in the works too, right? | |||||||||
Done Inline ActionsWe do, we should document https://reviews.freebsd.org/D33652, also debootstrap. But let's do that in a separate commit. trasz: We do, we should document https://reviews.freebsd.org/D33652, also debootstrap. But let's do… | |||||||||
Not Done Inline ActionsSounds good. emaste: Sounds good. | |||||||||
.Pp | |||||||||
To avoid mounting Linux-specific filesystems at startup, add the following | |||||||||
line to the | |||||||||
.Xr rc.conf 5 | .Xr rc.conf 5 | ||||||||
file: | file: | ||||||||
.Pp | .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" | .Dl linux_mounts_enable="NO" | ||||||||
.Sh SYSCTL VARIABLES | .Sh SYSCTL VARIABLES | ||||||||
The following variables are available as both | The following variables are available as both | ||||||||
.Xr sysctl 8 | .Xr sysctl 8 | ||||||||
variables and | variables and | ||||||||
.Xr loader 8 | .Xr loader 8 | ||||||||
tunables: | tunables: | ||||||||
.Bl -tag -width indent | .Bl -tag -width indent | ||||||||
Show All 11 Lines | |||||||||
Set to -1 to disable the limit. | Set to -1 to disable the limit. | ||||||||
Defaults to 1024. | Defaults to 1024. | ||||||||
.It Va compat.linux.emul_path | .It Va compat.linux.emul_path | ||||||||
Path to the Linux run-time environment. | Path to the Linux run-time environment. | ||||||||
Defaults to | Defaults to | ||||||||
.Pa /compat/linux . | .Pa /compat/linux . | ||||||||
.It Va compat.linux.osname | .It Va compat.linux.osname | ||||||||
Linux kernel operating system name. | Linux kernel operating system name. | ||||||||
Defaults to "Linux". | |||||||||
.It Va compat.linux.osrelease | .It Va compat.linux.osrelease | ||||||||
Linux kernel operating system release. | Linux kernel operating system release. | ||||||||
Changing this to something else is discouraged on non-development systems, | Changing this to something else is discouraged on non-development systems, | ||||||||
because it may change the way Linux programs work. | 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. | on the value of this sysctl. | ||||||||
.It Va compat.linux.oss_version | .It Va compat.linux.oss_version | ||||||||
Linux Open Sound System version. | Linux Open Sound System version. | ||||||||
Defaults to 198144. | |||||||||
Not Done Inline ActionsWe should perhaps leave a note in the source with a reference back to this man page, such that if someone ever changed it they would find a hint to update here too. emaste: We should perhaps leave a note in the source with a reference back to this man page, such that… | |||||||||
Done Inline ActionsI don't think this will ever change, this looks more like a magic number. One that will change is the kernel version, and that's why I've left it undocumented for now. trasz: I don't think this will ever change, this looks more like a magic number. One that will change… | |||||||||
.It Va compat.linux.preserve_vstatus | .It Va compat.linux.preserve_vstatus | ||||||||
When set to 1, it prevents Linux applications from resetting the | When set to 1, it prevents Linux applications from resetting the | ||||||||
.Xr termios 4 | .Xr termios 4 | ||||||||
VSTATUS setting. | VSTATUS setting. | ||||||||
From a user perspective, this makes | From a user perspective, this makes | ||||||||
.Va SIGINFO | .Va SIGINFO | ||||||||
work for Linux executables. | work for Linux executables. | ||||||||
Defaults to 0. | Defaults to 0. | ||||||||
.It Va compat.linux.setid_allowed | .It Va compat.linux.setid_allowed | ||||||||
Disable handling of set-user-ID and set-group-ID mode bits for the new | 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. | process image file when image is to be executed under Linux ABI. | ||||||||
When set, new Linux images always use credentials of the program | When set, new Linux images always use credentials of the program | ||||||||
that issued | that issued the | ||||||||
Not Done Inline Actions
pauamma_gundo.com: | |||||||||
.Xr execve 2 | .Xr execve 2 | ||||||||
call, regardless of the image file mode. | call, regardless of the image file mode. | ||||||||
Defaults to 1. | |||||||||
.Pp | .Pp | ||||||||
This might be reasonable or even required, because | This might be reasonable or even required, because | ||||||||
.Fx | .Fx | ||||||||
does not emulate Linux environment completely, and missed features | does not emulate Linux environment completely, and missed features | ||||||||
could become holes. | could become holes. | ||||||||
.El | .El | ||||||||
.Sh FILES | .Sh FILES | ||||||||
.Bl -tag -width /compat/linux/dev/shm -compact | .Bl -tag -width /compat/linux/dev/shm -compact | ||||||||
.It Pa /compat/linux | .It Pa /compat/linux | ||||||||
minimal Linux run-time environment | Linux run-time environment | ||||||||
.It Pa /compat/linux/dev | .It Pa /compat/linux/dev | ||||||||
device file system, see | device file system, see | ||||||||
.Xr devfs 5 | .Xr devfs 5 | ||||||||
.It Pa /compat/linux/dev/fd | .It Pa /compat/linux/dev/fd | ||||||||
file descriptor file system mounted with the | file descriptor file system mounted with the | ||||||||
.Cm linrdlnk | .Cm linrdlnk | ||||||||
option, see | option, see | ||||||||
.Xr fdescfs 5 | .Xr fdescfs 5 | ||||||||
Show All 13 Lines | |||||||||
.Xr elf 5 , | .Xr elf 5 , | ||||||||
.Xr fdescfs 5 , | .Xr fdescfs 5 , | ||||||||
.Xr linprocfs 5 , | .Xr linprocfs 5 , | ||||||||
.Xr linsysfs 5 , | .Xr linsysfs 5 , | ||||||||
.Xr tmpfs 5 | .Xr tmpfs 5 | ||||||||
.Sh HISTORY | .Sh HISTORY | ||||||||
Linux ABI support first appeared in | Linux ABI support first appeared in | ||||||||
.Fx 2.1 . | .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 | .Sh BUGS | ||||||||
Support for some of the Linux-specific system calls and system call arguments | Support for some of the Linux-specific system calls and system call arguments | ||||||||
is missing. | is missing. |
maybe the Linux ABI at boot time?