Changeset View
Standalone View
share/man/man4/linux.4
Show First 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | |||||
module at boot time, place the following line in | module at boot time, place the following line in | ||||
.Xr loader.conf 5 : | .Xr loader.conf 5 : | ||||
.Bd -literal -offset indent | .Bd -literal -offset indent | ||||
linux_load="YES" | linux_load="YES" | ||||
.Ed | .Ed | ||||
.Sh DESCRIPTION | .Sh DESCRIPTION | ||||
The | The | ||||
.Nm | .Nm | ||||
module provides limited | module provides Linux ABI (application binary interface) compatibility, | ||||
Linux ABI (application binary interface) compatibility | making it possible to run unmodified Linux applications and libraries | ||||
for userland applications. | without the need for virtualization or emulation. | ||||
emaste: It probably is worth leaving in some statment about this not being 100% | |||||
The module provides the following significant facilities: | Some of the facilities provided are: | ||||
.Bl -bullet | .Bl -bullet | ||||
.It | .It | ||||
An image activator | An image activator | ||||
for correctly branded | for correctly branded | ||||
.Xr elf 5 | .Xr elf 5 | ||||
executable images | executable images | ||||
.It | .It | ||||
Special signal handling for activated images | Special signal handling for activated images | ||||
.It | .It | ||||
Linux to native system call translation | Linux to native system call translation | ||||
.It | |||||
Linux-specific system calls | |||||
.El | .El | ||||
.Pp | .Pp | ||||
It is important to note that the Linux ABI support | Note that dynamically linked Linux executables | ||||
it not provided through an emulator. | will require a suitable environment in | ||||
Rather, a true (albeit limited) ABI implementation is provided. | .Pa /compat/linux . | ||||
This includes native Linux shared libraries, and Linux-specific virtual | |||||
filesystems. | |||||
To set it up, install the compat/linux_base-c7 port or the linux_base-c7 | |||||
Done Inline Actionss/compat/emulators/ tijl: s/compat/emulators/ | |||||
Done Inline ActionsWe mark up ports paths with .Pa if I recall correctly. brueffer: We mark up ports paths with .Pa if I recall correctly. | |||||
package, and add the following line to the | |||||
Xr rc.conf 5 | |||||
file: | |||||
.Pp | .Pp | ||||
The following | .Dl linux_enable="YES" | ||||
.Pp | |||||
Done Inline ActionsUnneeded .Pp, this macro has no effect before/after .Sh brueffer: Unneeded .Pp, this macro has no effect before/after .Sh | |||||
.Sh SYSCTL VARIABLES | |||||
The following variables are available as both | |||||
Not Done Inline ActionsThe linux_base ports run some Linux programs on installation, e.g. Linux ldconfig to create /compat/linux/etc/ld.so.cache. So I would change the order here. First add linux_enable to /etc/rc.conf, then enable Linux compatibility using 'service linux start', and then install linux_base-c7. That also means that /etc/rc.d/linux should create /compat/linux and /compat/linux/{dev,proc,sys} before mounting file systems because these directories might not exist. tijl: The linux_base ports run some Linux programs on installation, e.g. Linux ldconfig to create… | |||||
Done Inline ActionsGood point, but can... we move it to another review? What you're suggesting also touches the rc script itself, and there might be different ways it could be solved. trasz: Good point, but can... we move it to another review? What you're suggesting also touches the… | |||||
Done Inline ActionsPerhaps here: https://reviews.freebsd.org/Z15 trasz: Perhaps here: https://reviews.freebsd.org/Z15 | |||||
Not Done Inline ActionsSure. tijl: Sure. | |||||
.Xr sysctl 8 | .Xr sysctl 8 | ||||
tunable variables are available: | variables and | ||||
.Bl -tag -width compat.linux.oss_version | .Xr loader 8 | ||||
.It compat.linux.osname | tunables: | ||||
.Bl -tag -width indent | |||||
.It Va compat.linux.osname | |||||
Linux kernel operating system name. | Linux kernel operating system name. | ||||
.It 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 | Recent versions of GNU libc are known to use different syscalls depending | ||||
on the value of this sysctl. | on the value of this sysctl. | ||||
.It compat.linux.oss_version | .It Va compat.linux.oss_version | ||||
Linux Open Sound System version. | Linux Open Sound System version. | ||||
.El | |||||
.Pp | |||||
The | |||||
.Nm | |||||
module can be linked into the kernel statically with the | |||||
.Dv COMPAT_LINUX | |||||
kernel configuration option | |||||
or loaded as required. | |||||
The following command will load the module | |||||
if it is neither linked into the kernel | |||||
nor already loaded as a module: | |||||
.Bd -literal -offset indent | |||||
if ! kldstat -v | grep -E 'linux(aout|elf)' > /dev/null; then | |||||
kldload linux > /dev/null 2>&1 | |||||
fi | |||||
.Ed | |||||
.Pp | |||||
Note that dynamically linked Linux executables | |||||
will require a suitable environment in | |||||
.Pa /compat/linux . | |||||
Specifically, the Linux run-time linker's hints files | |||||
should be correctly initialized. | |||||
For this reason, it is common to execute the following commands | |||||
to prepare the system to correctly run Linux executables: | |||||
.Bd -literal -offset indent | |||||
if [ -x /compat/linux/sbin/ldconfig ]; then | |||||
/compat/linux/sbin/ldconfig -r /compat/linux | |||||
fi | |||||
.Ed | |||||
.Pp | |||||
For information on loading the | |||||
.Nm | |||||
kernel loadable module automatically on system startup, | |||||
see | |||||
.Xr rc.conf 5 . | |||||
This information applies | |||||
regardless of whether the | |||||
.Nm | |||||
module is statically linked into the kernel | |||||
or loaded as a module. | |||||
.Sh FILES | .Sh FILES | ||||
.Bl -tag -width /compat/linux/dev/fd -compact | .Bl -tag -width /compat/linux/dev/shm -compact | ||||
.It Pa /compat/linux | .It Pa /compat/linux | ||||
minimal Linux run-time environment | minimal Linux run-time environment | ||||
.It Pa /compat/linux/dev/fd | .It Pa /compat/linux/dev/fd | ||||
limited Linux file-descriptor file system | file-descriptor file system, see | ||||
.Xr fdescfs 5 | |||||
.It Pa /compat/linux/dev/shm | |||||
in-memory file system, see | |||||
.Xr tmpfs 5 | |||||
.It Pa /compat/linux/proc | .It Pa /compat/linux/proc | ||||
limited Linux process file system | Linux process file system, see | ||||
.Xr linprocfs 5 | |||||
.It Pa /compat/linux/sys | .It Pa /compat/linux/sys | ||||
limited Linux system file system | Linux kernel objects file system, see | ||||
.Xr linsysfs 5 | |||||
.El | .El | ||||
.Sh SEE ALSO | .Sh SEE ALSO | ||||
.Xr brandelf 1 , | .Xr brandelf 1 , | ||||
.Xr pty 4 , | .Xr pty 4 , | ||||
.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 | |||||
.Sh HISTORY | .Sh HISTORY | ||||
Linux ABI support first appeared in | Linux ABI support first appeared in | ||||
.Fx 2.1 . | .Fx 2.1 . |
It probably is worth leaving in some statment about this not being 100%