From owner-svn-doc-head@FreeBSD.ORG Thu Mar 20 14:40:53 2014 Return-Path: Delivered-To: svn-doc-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3ED6FA8E; Thu, 20 Mar 2014 14:40:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2AA3FD7D; Thu, 20 Mar 2014 14:40:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2KEerm7065756; Thu, 20 Mar 2014 14:40:53 GMT (envelope-from dru@svn.freebsd.org) Received: (from dru@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2KEercY065755; Thu, 20 Mar 2014 14:40:53 GMT (envelope-from dru@svn.freebsd.org) Message-Id: <201403201440.s2KEercY065755@svn.freebsd.org> From: Dru Lavigne Date: Thu, 20 Mar 2014 14:40:52 +0000 (UTC) To: doc-committers@freebsd.org, svn-doc-all@freebsd.org, svn-doc-head@freebsd.org Subject: svn commit: r44294 - head/en_US.ISO8859-1/books/handbook/linuxemu X-SVN-Group: doc-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-doc-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the doc tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Mar 2014 14:40:53 -0000 Author: dru Date: Thu Mar 20 14:40:52 2014 New Revision: 44294 URL: http://svnweb.freebsd.org/changeset/doc/44294 Log: Some more edits to Linux Emulation. Sponsored by: iXsystems Modified: head/en_US.ISO8859-1/books/handbook/linuxemu/chapter.xml Modified: head/en_US.ISO8859-1/books/handbook/linuxemu/chapter.xml ============================================================================== --- head/en_US.ISO8859-1/books/handbook/linuxemu/chapter.xml Thu Mar 20 04:13:05 2014 (r44293) +++ head/en_US.ISO8859-1/books/handbook/linuxemu/chapter.xml Thu Mar 20 14:40:52 2014 (r44294) @@ -146,52 +146,24 @@ Id Refs Address Size Name described in . - Installing Libraries Manually - - While using the Ports Collection is recommended, &linux; - libraries can be installed manually. The &linux; shared - libraries required by a program and the runtime linker should - be copied to /compat/linux. Any shared - libraries opened by &linux; programs run under &os; will look - in this directory first. For example, if a &linux; program - loads /lib/libc.so, &os; will first try - to open /compat/linux/lib/libc.so, and if - that does not exist, it will then try - /lib/libc.so. Shared libraries should be - installed to /compat/linux/lib rather - than to the paths that the &linux; ld.so - reports. - - Generally, one will need to look for the shared - libraries that &linux; binaries depend on only the first few - times that a &linux; program is installed on &os;. After a - while, there will be a sufficient set of &linux; shared - libraries on the system to be able to run newly imported - &linux; binaries without any extra work. - - - How to Install Additional Shared Libraries + Installing Additional Libraries Manually shared libraries - If the linux_base port is installed - and an application still complains about missing shared - libraries, there are two methods - root can use to - determine which shared libraries the &linux; binaries - need. - - If a &linux; system is available, determine which shared - libraries the application needs, and copy them to the &os; - system. - - - In this example, FTP was used to download the &linux; - binary of Doom on a &linux; - system . To check which shared libraries it needs, run - ldd linuxdoom: + If a &linux; + application complains about missing shared + libraries after configuring &linux; binary compatibility, + determine which shared libraries the &linux; binary + needs and install them manually. + + From a &linux; system, + ldd can be used to determine which shared + libraries the application needs. For example, to + check which shared libraries linuxdoom needs, run + this command from a &linux; system that has + Doom installed: &prompt.user; ldd linuxdoom libXt.so.3 (DLL Jump 3.1) => /usr/X11/lib/libXt.so.3.1.0 @@ -201,10 +173,10 @@ libc.so.4 (DLL Jump 4.5pl26) => /lib/ symbolic links - Copy all the files in the last column into + Then, copy all the files in the last column of the output from the &linux; system into /compat/linux on - the &os; system, with the names in the first column as - symbolic links pointing to them. This example will result + the &os; system. Once copied, create symbolic links to the names in the first column. + This example will result in the following files on the &os; system: /compat/linux/usr/X11/lib/libXt.so.3.1.0 @@ -214,8 +186,6 @@ libc.so.4 (DLL Jump 4.5pl26) => /lib/ /compat/linux/lib/libc.so.4.6.29 /compat/linux/lib/libc.so.4 -> libc.so.4.6.29 -
- If a &linux; shared library already exists with a matching major revision number to the first column of the ldd output, it does not need to @@ -223,61 +193,53 @@ libc.so.4 (DLL Jump 4.5pl26) => /lib/ existing library should work. It is advisable to copy the shared library if it is a newer version, though. The old one can be removed, as long as the symbolic - link points to the new one. For example, these - libraries exist on the system: + link points to the new one. + + For example, these + libraries already exist on the &os; system: /compat/linux/lib/libc.so.4.6.27 /compat/linux/lib/libc.so.4 -> libc.so.4.6.27 - and a binary claims to require a later version - according to the output of - ldd: + and ldd indicates that a binary requires a later version: libc.so.4 (DLL Jump 4.5pl26) -> libc.so.4.6.29 - If it is only one or two versions out of date - in the trailing digit, do not worry about copying - /lib/libc.so.4.6.29, because - the program should work fine with the slightly older + Since the existing library is only one or two versions out of date + in the last digit, + the program should still work with the slightly older version. However, it is safe to replace the - libc.so: + existing libc.so with the newer version: /compat/linux/lib/libc.so.4.6.29 /compat/linux/lib/libc.so.4 -> libc.so.4.6.29 - -
-
- - The symbolic link mechanism is - only needed for &linux; binaries - as the &os; runtime linker takes care of looking for - matching major revision numbers. - -
-
-
+ Generally, one will need to look for the shared + libraries that &linux; binaries depend on only the first few + times that a &linux; program is installed on &os;. After a + while, there will be a sufficient set of &linux; shared + libraries on the system to be able to run newly installed + &linux; binaries without any extra work.
- Installing &linux; ELF Binaries + Installing &linux; <acronym>ELF</acronym> Binaries Linux ELF binaries - ELF binaries sometimes require an extra step of - branding. If an unbranded ELF binary is - executed, it will generate an error message like the - following: + ELF binaries sometimes require an extra step. + When an unbranded ELF binary is + executed, it will generate an error message: &prompt.user; ./my-linux-elf-binary ELF binary type not known Abort To help the &os; kernel distinguish between a &os; - ELF binary and a &linux; binary, use &man.brandelf.1;: + ELF binary and a &linux; binary, use &man.brandelf.1;: &prompt.user; brandelf -t Linux my-linux-elf-binary @@ -285,49 +247,44 @@ Abort GNU toolchain Since the GNU toolchain places the appropriate branding - information into ELF binaries automatically, this step is + information into ELF binaries automatically, this step is usually not necessary. - Installing a &linux; RPM Based Application + Installing a &linux; <acronym>RPM</acronym> Based Application - &os; uses its own package database to track all software - installed from the Ports Collection. However, the &linux; RPM - database is not supported. - - In order to install a &linux; RPM-based application, first + In order to install a &linux; RPM-based application, first install the archivers/rpm2cpio package or port. Once installed, root can use this - command to install a .rpm as - follows: + command to install a .rpm: &prompt.root; cd /compat/linux &prompt.root; rpm2cpio -q < /path/to/linux.archive.rpm | cpio -id If necessary, brandelf the installed - ELF binaries, but not the libraries. + ELF binaries. Note that this will prevent a clean uninstall. Configuring the Hostname Resolver - If DNS does not work or this error appears: + If DNS does not work or this error appears: resolv+: "bind" is an invalid keyword resolv+: "hosts" is an invalid keyword - Configure + configure /compat/linux/etc/host.conf as follows: order hosts, bind multi on - This order specifies that /etc/hosts - is searched first and DNS is searched second. When + This specifies that /etc/hosts + is searched first and DNS is searched second. When /compat/linux/etc/host.conf does not exist, &linux; applications use /etc/host.conf and complain about the