diff options
author | Pierre Labastie <pieere@linuxfromscratch.org> | 2020-05-03 21:02:51 +0000 |
---|---|---|
committer | Pierre Labastie <pieere@linuxfromscratch.org> | 2020-05-03 21:02:51 +0000 |
commit | efcb3933433838b71f3a4a53ec1ac6d899aaec0b (patch) | |
tree | f0b1fb24d5ac7ebb93cc2deddefbc16938ea49d0 /chapter06 | |
parent | 9d719e24c33f9a2ecf8a5582cd811c43a8fa46c2 (diff) |
Make the new book
git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/cross-chap5@11831 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
Diffstat (limited to 'chapter06')
-rw-r--r-- | chapter06/acl.xml | 3 | ||||
-rw-r--r-- | chapter06/attr.xml | 6 | ||||
-rw-r--r-- | chapter06/bc.xml | 60 | ||||
-rw-r--r-- | chapter06/bzip2.xml | 5 | ||||
-rw-r--r-- | chapter06/chapter06.xml | 8 | ||||
-rw-r--r-- | chapter06/check.xml | 6 | ||||
-rw-r--r-- | chapter06/chroot.xml | 63 | ||||
-rw-r--r-- | chapter06/coreutils.xml | 3 | ||||
-rw-r--r-- | chapter06/createfiles.xml | 365 | ||||
-rw-r--r-- | chapter06/creatingdirs.xml | 65 | ||||
-rw-r--r-- | chapter06/e2fsprogs.xml | 22 | ||||
-rw-r--r-- | chapter06/flex.xml | 2 | ||||
-rw-r--r-- | chapter06/gcc.xml | 27 | ||||
-rw-r--r-- | chapter06/glibc.xml | 42 | ||||
-rw-r--r-- | chapter06/introduction.xml | 9 | ||||
-rw-r--r-- | chapter06/kbd.xml | 23 | ||||
-rw-r--r-- | chapter06/kernfs.xml | 115 | ||||
-rw-r--r-- | chapter06/libpipeline.xml | 16 | ||||
-rw-r--r-- | chapter06/linux-headers.xml | 209 | ||||
-rw-r--r-- | chapter06/readline.xml | 6 | ||||
-rw-r--r-- | chapter06/revisedchroot.xml | 15 | ||||
-rw-r--r-- | chapter06/sed.xml | 14 | ||||
-rw-r--r-- | chapter06/shadow.xml | 3 | ||||
-rw-r--r-- | chapter06/strippingagain.xml | 34 | ||||
-rw-r--r-- | chapter06/systemd.xml | 6 | ||||
-rw-r--r-- | chapter06/util-linux.xml | 12 |
26 files changed, 63 insertions, 1076 deletions
diff --git a/chapter06/acl.xml b/chapter06/acl.xml index cb5be400e..f9f2eddbe 100644 --- a/chapter06/acl.xml +++ b/chapter06/acl.xml @@ -50,7 +50,8 @@ --libexecdir=/usr/lib \ --docdir=/usr/share/doc/acl-&acl-version;</userinput></screen> -<screen revision="systemd"><userinput remap="configure">./configure --prefix=/usr \ +<screen revision="systemd"><userinput remap="configure"> +./configure --prefix=/usr \ --disable-static \ --libexecdir=/usr/lib \ --docdir=/usr/share/doc/acl-&acl-version;</userinput></screen> diff --git a/chapter06/attr.xml b/chapter06/attr.xml index de93a2b43..10c6eec53 100644 --- a/chapter06/attr.xml +++ b/chapter06/attr.xml @@ -43,13 +43,15 @@ <para>Prepare Attr for compilation:</para> -<screen revision="sysv"><userinput remap="configure">./configure --prefix=/usr \ +<screen revision="sysv"><userinput remap="configure"> +./configure --prefix=/usr \ --bindir=/bin \ --disable-static \ --sysconfdir=/etc \ --docdir=/usr/share/doc/attr-&attr-version;</userinput></screen> -<screen revision="systemd"><userinput remap="configure">./configure --prefix=/usr \ +<screen revision="systemd"><userinput remap="configure"> +./configure --prefix=/usr \ --disable-static \ --sysconfdir=/etc \ --docdir=/usr/share/doc/attr-&attr-version;</userinput></screen> diff --git a/chapter06/bc.xml b/chapter06/bc.xml index f78bd270e..d848ad365 100644 --- a/chapter06/bc.xml +++ b/chapter06/bc.xml @@ -40,62 +40,18 @@ <sect2 role="installation"> <title>Installation of Bc</title> -<!-- - <para>First, change an internal script to use <command>sed</command> instead - of <command>ed</command>:</para> - -<screen><userinput remap="pre">cat > bc/fix-libmath_h << "EOF" -#! /bin/bash -sed -e '1 s/^/{"/' \ - -e 's/$/",/' \ - -e '2,$ s/^/"/' \ - -e '$ d' \ - -i libmath.h - -sed -e '$ s/$/0}/' \ - -i libmath.h -EOF</userinput></screen> - - <para>Create temporary symbolic links so the package can find - the readline library and confirm that its required libncurses - library is available. Even though the libraries are in /tools/lib - at this point, the system will use /usr/lib at the end of - this chapter.</para> - -<screen><userinput remap="pre">ln -sv /tools/lib/libncursesw.so.6 /usr/lib/libncursesw.so.6 -ln -sfv libncursesw.so.6 /usr/lib/libncurses.so</userinput></screen> - - <para>Fix an issue in <command>configure</command> due to missing - files in the early stages of LFS:</para> - -<screen><userinput remap="pre">sed -i -e '/flex/s/as_fn_error/: ;; # &/' configure</userinput></screen> ---> + <para>Prepare Bc for compilation:</para> -<!-- -<screen><userinput remap="configure">./configure - -prefix=/usr \ - - -with-readline \ - - -mandir=/usr/share/man \ - - -infodir=/usr/share/info</userinput></screen> ---> + <screen><userinput remap="configure">PREFIX=/usr CC=gcc CFLAGS="-std=c99" ./configure.sh -G -O3</userinput></screen> <variablelist> <title>The meaning of the configure options:</title> -<!-- - <varlistentry> - <term><parameter>- -with-readline</parameter></term> - <listitem> - <para>This option tells Bc to use the <filename - class="libraryfile">readline</filename> library that is already - installed on the system rather than using its own readline - version.</para> - </listitem> - </varlistentry> ---> + <varlistentry> <term><parameter>CC=gcc CFLAGS="-std=c99"</parameter></term> <listitem> - <para>These parameters specify the compiler and C standard to use.</para> + <para>These parameters specify the compiler and the C standard to use.</para> </listitem> </varlistentry> @@ -118,14 +74,6 @@ ln -sfv libncursesw.so.6 /usr/lib/libncurses.so</userinput></screen> <para>Compile the package:</para> <screen><userinput remap="make">make</userinput></screen> -<!-- - <para>To test bc, run the commands below. There is quite a bit of output, - so you may want to redirect it to a file. There are a very small percentage - of tests (10 of 12,144) that will indicate a round off error at the last - digit.</para> - -<screen><userinput remap="test">echo "quit" | ./bc/bc -l Test/checklib.b</userinput></screen> ---> <para>To test bc, run:</para> diff --git a/chapter06/bzip2.xml b/chapter06/bzip2.xml index 761bd7abb..c42096ea3 100644 --- a/chapter06/bzip2.xml +++ b/chapter06/bzip2.xml @@ -90,10 +90,7 @@ make clean</userinput></screen> <screen><userinput remap="install">cp -v bzip2-shared /bin/bzip2 cp -av libbz2.so* /lib -ln -sv ../../lib/libbz2.so.1.0 /usr/lib/libbz2.so -rm -v /usr/bin/{bunzip2,bzcat,bzip2} -ln -sv bzip2 /bin/bunzip2 -ln -sv bzip2 /bin/bzcat</userinput></screen> +rm -v /usr/bin/{bunzip2,bzcat,bzip2}</userinput></screen> </sect2> diff --git a/chapter06/chapter06.xml b/chapter06/chapter06.xml index 346df82cd..9a5ca1fc5 100644 --- a/chapter06/chapter06.xml +++ b/chapter06/chapter06.xml @@ -12,15 +12,11 @@ <title>Installing Basic System Software</title> <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="introduction.xml"/> - <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="kernfs.xml"/> <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="pkgmgt.xml"/> - <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="chroot.xml"/> - <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="creatingdirs.xml"/> - <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="createfiles.xml"/> - <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="linux-headers.xml"/> +<!-- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="linux-headers.xml"/>--> <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="man-pages.xml"/> +<!-- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="adjusting.xml"/>--> <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="glibc.xml"/> - <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="adjusting.xml"/> <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="zlib.xml"/> <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="bzip2.xml"/> <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="xz.xml"/> diff --git a/chapter06/check.xml b/chapter06/check.xml index e7936f6b2..bd4306b28 100644 --- a/chapter06/check.xml +++ b/chapter06/check.xml @@ -56,11 +56,9 @@ <para>Note that the Check test suite may take a relatively long (up to 4 SBU) time.</para> - <para>Install the package and fix a script:</para> + <para>Install the package:</para> - <screen><userinput remap="install">make docdir=/usr/share/doc/check-&check-version; install && -sed -i '1 s/tools/usr/' /usr/bin/checkmk</userinput></screen> -<!-- Removes a hardcoded call to /tools/bin/gawk at line 1 of checkmk. --> + <screen><userinput remap="install">make docdir=/usr/share/doc/check-&check-version; install</userinput></screen> </sect2> diff --git a/chapter06/chroot.xml b/chapter06/chroot.xml deleted file mode 100644 index c4a66bf00..000000000 --- a/chapter06/chroot.xml +++ /dev/null @@ -1,63 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" - "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ - <!ENTITY % general-entities SYSTEM "../general.ent"> - %general-entities; -]> - -<sect1 id="ch-system-chroot"> - <?dbhtml filename="chroot.html"?> - - <title>Entering the Chroot Environment</title> - - <para>It is time to enter the chroot environment to begin building and - installing the final LFS system. As user <systemitem - class="username">root</systemitem>, run the following command to enter the - realm that is, at the moment, populated with only the temporary tools:</para> - -<screen role="nodump"><userinput>chroot "$LFS" /tools/bin/env -i \ - HOME=/root \ - TERM="$TERM" \ - PS1='(lfs chroot) \u:\w\$ ' \ - PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin \ - /tools/bin/bash --login +h</userinput></screen> - - <para>The <parameter>-i</parameter> option given to the <command>env</command> - command will clear all variables of the chroot environment. After that, only - the <envar>HOME</envar>, <envar>TERM</envar>, <envar>PS1</envar>, and - <envar>PATH</envar> variables are set again. The - <parameter>TERM=$TERM</parameter> construct will set the <envar>TERM</envar> - variable inside chroot to the same value as outside chroot. This variable is - needed for programs like <command>vim</command> and <command>less</command> - to operate properly. If other variables are needed, such as - <envar>CFLAGS</envar> or <envar>CXXFLAGS</envar>, this is a good place to set - them again.</para> - - <para>From this point on, there is no need to use the - <envar>LFS</envar> variable anymore, because all work will be restricted - to the LFS file system. This is because the Bash shell is told that - <filename class="directory">$LFS</filename> is now the root - (<filename class="directory">/</filename>) directory.</para> - - <para>Notice that <filename class="directory">/tools/bin</filename> comes last - in the <envar>PATH</envar>. This means that a temporary tool will no longer be - used once its final version is installed. This occurs when the shell does not - <quote>remember</quote> the locations of executed binaries—for this - reason, hashing is switched off by passing the <parameter>+h</parameter> option - to <command>bash</command>.</para> - - <para>Note that the <command>bash</command> prompt will say - <computeroutput>I have no name!</computeroutput> This is normal because the - <filename>/etc/passwd</filename> file has not been created yet.</para> - - <note> - <para>It is important that all the commands throughout the remainder of this - chapter and the following chapters are run from within the chroot - environment. If you leave this environment for any reason (rebooting for - example), ensure that the virtual kernel filesystems are mounted as - explained in <xref linkend="ch-system-bindmount"/> and <xref - linkend="ch-system-kernfsmount"/> and enter chroot again before continuing - with the installation.</para> - </note> - -</sect1> diff --git a/chapter06/coreutils.xml b/chapter06/coreutils.xml index 42ea98b0d..f383623a2 100644 --- a/chapter06/coreutils.xml +++ b/chapter06/coreutils.xml @@ -123,8 +123,7 @@ FORCE_UNSAFE_CONFIGURE=1 ./configure \ <screen><userinput remap="test">chown -Rv nobody . </userinput></screen> - <para>Now run the tests. Make sure the PATH in the <userinput>su</userinput> - environment includes /tools/bin.</para> + <para>Now run the tests:</para> <screen><userinput remap="test">su nobody -s /bin/bash \ -c "PATH=$PATH make RUN_EXPENSIVE_TESTS=yes check"</userinput></screen> diff --git a/chapter06/createfiles.xml b/chapter06/createfiles.xml deleted file mode 100644 index ac2805597..000000000 --- a/chapter06/createfiles.xml +++ /dev/null @@ -1,365 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" - "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ - <!ENTITY % general-entities SYSTEM "../general.ent"> - %general-entities; -]> - -<sect1 id="ch-system-createfiles"> - <?dbhtml filename="createfiles.html"?> - - <title>Creating Essential Files and Symlinks</title> - - <indexterm zone="ch-system-createfiles"> - <primary sortas="e-/etc/passwd">/etc/passwd</primary> - </indexterm> - - <indexterm zone="ch-system-createfiles"> - <primary sortas="e-/etc/group">/etc/group</primary> - </indexterm> - - <indexterm zone="ch-system-createfiles"> - <primary sortas="e-/var/run/utmp">/var/run/utmp</primary> - </indexterm> - - <indexterm zone="ch-system-createfiles"> - <primary sortas="e-/var/log/btmp">/var/log/btmp</primary> - </indexterm> - - <indexterm zone="ch-system-createfiles"> - <primary sortas="e-/var/log/lastlog">/var/log/lastlog</primary> - </indexterm> - - <indexterm zone="ch-system-createfiles"> - <primary sortas="e-/var/log/wtmp">/var/log/wtmp</primary> - </indexterm> - - <para>Some programs use hard-wired paths to programs which do not exist yet. - In order to satisfy these programs, create a number of symbolic links which - will be replaced by real files throughout the course of this chapter after the - software has been installed:</para> - -<screen><userinput>ln -sv /tools/bin/{bash,cat,chmod,dd,echo,ln,mkdir,pwd,rm,stty,touch} /bin -ln -sv /tools/bin/{env,install,perl,printf} /usr/bin -ln -sv /tools/lib/libgcc_s.so{,.1} /usr/lib -ln -sv /tools/lib/libstdc++.{a,so{,.6}} /usr/lib -ln -sv /tools/lib/libfl.so* /usr/lib - -ln -sv bash /bin/sh - -for lib in blkid mount uuid fdisk -do - ln -sv /tools/lib/lib$lib.so* /usr/lib - sed 's|/tools|/usr|' /tools/lib/pkgconfig/${lib}.pc \ - > /usr/lib/pkgconfig/${lib}.pc -done -for incdir in blkid libmount uuid libfdisk -do - ln -svf /tools/include/$incdir /usr/include -done</userinput></screen> - - <variablelist> - <title>The purpose of each link:</title> - - <varlistentry> - <term><parameter><filename>/bin/bash</filename></parameter></term> - <listitem> - <para>Many <command>bash</command> scripts specify - <filename>/bin/bash</filename>.</para> - </listitem> - </varlistentry> - - <varlistentry> - <term><parameter><filename>/bin/cat</filename></parameter></term> - <listitem> - <para>This pathname is hard-coded into Glibc's configure script.</para> - </listitem> - </varlistentry> - - <varlistentry> - <term><parameter><filename>/bin/dd</filename></parameter></term> - <listitem> - <para>The path to <filename>dd</filename> will be hard-coded into the - <filename>/usr/bin/libtool</filename> utility.</para> - </listitem> - </varlistentry> - - <varlistentry> - <term><parameter><filename>/bin/echo</filename></parameter></term> - <listitem> - <para>This is to satisfy one of the tests in Glibc's test suite, which - expects <filename>/bin/echo</filename>.</para> - </listitem> - </varlistentry> - - <varlistentry> - <term><parameter><filename>/usr/bin/env</filename></parameter></term> - <listitem> - <para>This pathname is hard-coded into some packages build procedures. - <!-- systemd This may not be needed if we move sysd to the end--></para> - </listitem> - </varlistentry> - - <varlistentry> - <term><parameter><filename>/usr/bin/install</filename></parameter></term> - <listitem> - <para>The path to <filename>install</filename> will be hard-coded into - the <filename>/usr/lib/bash/Makefile.inc</filename> file.</para> - </listitem> - </varlistentry> - - <varlistentry> - <term><parameter><filename>/bin/ln</filename></parameter></term> - <listitem> - <para>The path to <filename>ln</filename> will be hard-coded into the - <filename>/usr/lib/perl5/&perl-version;/<target-triplet>/Config_heavy.pl</filename> - file.</para> - </listitem> - </varlistentry> - - <varlistentry> - <term><parameter><filename>/bin/pwd</filename></parameter></term> - <listitem> - <para>Some <command>configure</command> scripts, particularly Glibc's, - have this pathname hard-coded.</para> - </listitem> - </varlistentry> - - <varlistentry> - <term><parameter><filename>/bin/rm</filename></parameter></term> - <listitem> - <para>The path to <filename>rm</filename> will be hard-coded into the - <filename>/usr/lib/perl5/&perl-version;/<target-triplet>/Config_heavy.pl</filename> - file.</para> - </listitem> - </varlistentry> - - <varlistentry> - <term><parameter><filename>/bin/stty</filename></parameter></term> - <listitem> - <para>This pathname is hard-coded into Expect, therefore it is needed - for Binutils and GCC test suites to pass.</para> - </listitem> - </varlistentry> - - <varlistentry> - <term><parameter><filename>/usr/bin/perl</filename></parameter></term> - <listitem> - <para>Many Perl scripts hard-code this path to the - <command>perl</command> program.</para> - </listitem> - </varlistentry> - - <varlistentry> - <term><parameter><filename>/usr/lib/libgcc_s.so{,.1}</filename></parameter></term> - <listitem> - <para>Glibc needs this for the pthreads library to work.</para> - </listitem> - </varlistentry> - - <varlistentry> - <term><parameter><filename>/usr/lib/libstdc++{,.6}</filename></parameter></term> - <listitem> - <para>This is needed by several tests in Glibc's test suite, as well as - for C++ support in GMP.</para> - </listitem> - </varlistentry> - - <varlistentry> - <term><parameter><filename>/bin/sh</filename></parameter></term> - <listitem> - <para>Many shell scripts hard-code <filename>/bin/sh</filename>.</para> - </listitem> - </varlistentry> - - <varlistentry> - <term> - <parameter><filename>/usr/lib/libfl.so*</filename></parameter> - </term> - <listitem> - <para>This link allows binutils to find the flex library, and to - build enhanced versions of ar and ranlib.</para> - </listitem> - </varlistentry> - - <varlistentry> - <term> - <parameter> - <filename>/usr/lib/lib{blkid,fdisk,mount,uuid}.so*</filename>, - <filename>/usr/include/{blkid,libfdisk,libmount,uuid}</filename>, - <filename>/usr/lib/pkgconfig/{blkid,fdisk,mount,uuid}.pc</filename> - </parameter> - </term> - <listitem> - <para>These links and files allow - <phrase revision="sysv">eudev</phrase> - <phrase revision="systemd">systemd</phrase> to find the - util-linux libraries installed in chapter 5, without creating - wrong references to /tools. The uuid library is also needed for - building a python module.</para> - </listitem> - </varlistentry> - - </variablelist> - - <para>Historically, Linux maintains a list of the mounted file systems in the - file <filename>/etc/mtab</filename>. Modern kernels maintain this list - internally and exposes it to the user via the <filename - class="directory">/proc</filename> filesystem. To satisfy utilities that - expect the presence of <filename>/etc/mtab</filename>, create the following - symbolic link:</para> - -<screen><userinput>ln -sv /proc/self/mounts /etc/mtab</userinput></screen> - - <para>In order for user <systemitem class="username">root</systemitem> to be - able to login and for the name <quote>root</quote> to be recognized, there - must be relevant entries in the <filename>/etc/passwd</filename> and - <filename>/etc/group</filename> files.</para> - - <para>Create the <filename>/etc/passwd</filename> file by running the following - command:</para> - -<screen revision="sysv"><userinput>cat > /etc/passwd << "EOF" -<literal>root:x:0:0:root:/root:/bin/bash -bin:x:1:1:bin:/dev/null:/bin/false -daemon:x:6:6:Daemon User:/dev/null:/bin/false -messagebus:x:18:18:D-Bus Message Daemon User:/var/run/dbus:/bin/false -nobody:x:99:99:Unprivileged User:/dev/null:/bin/false</literal> -EOF</userinput></screen> - -<screen revision="systemd"><userinput>cat > /etc/passwd << "EOF" -<literal>root:x:0:0:root:/root:/bin/bash -bin:x:1:1:bin:/dev/null:/bin/false -daemon:x:6:6:Daemon User:/dev/null:/bin/false -messagebus:x:18:18:D-Bus Message Daemon User:/var/run/dbus:/bin/false -systemd-bus-proxy:x:72:72:systemd Bus Proxy:/:/bin/false -systemd-journal-gateway:x:73:73:systemd Journal Gateway:/:/bin/false -systemd-journal-remote:x:74:74:systemd Journal Remote:/:/bin/false -systemd-journal-upload:x:75:75:systemd Journal Upload:/:/bin/false -systemd-network:x:76:76:systemd Network Management:/:/bin/false -systemd-resolve:x:77:77:systemd Resolver:/:/bin/false -systemd-timesync:x:78:78:systemd Time Synchronization:/:/bin/false -systemd-coredump:x:79:79:systemd Core Dumper:/:/bin/false -nobody:x:99:99:Unprivileged User:/dev/null:/bin/false</literal> -EOF</userinput></screen> - - <para>The actual password for <systemitem class="username">root</systemitem> - (the <quote>x</quote> used here is just a placeholder) will be set later.</para> - - <para>Create the <filename>/etc/group</filename> file by running the following - command:</para> - -<screen revision="sysv"><userinput>cat > /etc/group << "EOF" -<literal>root:x:0: -bin:x:1:daemon -sys:x:2: -kmem:x:3: -tape:x:4: -tty:x:5: -daemon:x:6: -floppy:x:7: -disk:x:8: -lp:x:9: -dialout:x:10: -audio:x:11: -video:x:12: -utmp:x:13: -usb:x:14: -cdrom:x:15: -adm:x:16: -messagebus:x:18: -input:x:24: -mail:x:34: -kvm:x:61: -wheel:x:97: -nogroup:x:99: -users:x:999:</literal> -EOF</userinput></screen> - -<screen revision="systemd"><userinput>cat > /etc/group << "EOF" -<literal>root:x:0: -bin:x:1:daemon -sys:x:2: -kmem:x:3: -tape:x:4: -tty:x:5: -daemon:x:6: -floppy:x:7: -disk:x:8: -lp:x:9: -dialout:x:10: -audio:x:11: -video:x:12: -utmp:x:13: -usb:x:14: -cdrom:x:15: -adm:x:16: -messagebus:x:18: -systemd-journal:x:23: -input:x:24: -mail:x:34: -kvm:x:61: -systemd-bus-proxy:x:72: -systemd-journal-gateway:x:73: -systemd-journal-remote:x:74: -systemd-journal-upload:x:75: -systemd-network:x:76: -systemd-resolve:x:77: -systemd-timesync:x:78: -systemd-coredump:x:79: -wheel:x:97: -nogroup:x:99: -users:x:999:</literal> -EOF</userinput></screen> - - <para>The created groups are not part of any standard—they are groups - decided on in part by the requirements of the Udev configuration in this - chapter, and in part by common convention employed by a number of existing - Linux distributions. In addition, some test suites rely on specific users - or groups. The Linux Standard Base (LSB, available at <ulink - url="http://www.linuxbase.org"/>) recommends only that, besides the group - <systemitem class="groupname">root</systemitem> with a Group ID (GID) of 0, - a group <systemitem class="groupname">bin</systemitem> with a GID of 1 be - present. All other group names and GIDs can be chosen freely by the system - administrator since well-written programs do not depend on GID numbers, but - rather use the group's name.</para> - - <para>To remove the <quote>I have no name!</quote> prompt, start a new - shell. Since a full Glibc was installed in <xref - linkend="chapter-temporary-tools"/> and the - <filename>/etc/passwd</filename> and <filename>/etc/group</filename> - files have been created, user name and group name resolution will now - work:</para> - -<screen role="nodump"><userinput>exec /tools/bin/bash --login +h</userinput></screen> - - <para>Note the use of the <parameter>+h</parameter> directive. This tells - <command>bash</command> not to use its internal path hashing. Without this - directive, <command>bash</command> would remember the paths to binaries it has - executed. To ensure the use of the newly compiled binaries as soon as they are - installed, the <parameter>+h</parameter> directive will be used for the duration - of this chapter.</para> - - <para>The <command>login</command>, <command>agetty</command>, and - <command>init</command> programs (and others) use a number of log - files to record information such as who was logged into the system and - when. However, these programs will not write to the log files if they - do not already exist. Initialize the log files and give them - proper permissions:</para> - -<screen><userinput>touch /var/log/{btmp,lastlog,faillog,wtmp} -chgrp -v utmp /var/log/lastlog -chmod -v 664 /var/log/lastlog -chmod -v 600 /var/log/btmp</userinput></screen> - - <para>The <filename>/var/log/wtmp</filename> file records all logins and - logouts. The <filename>/var/log/lastlog</filename> file records when each - user last logged in. The <filename>/var/log/faillog</filename> file records - failed login attempts. The <filename>/var/log/btmp</filename> file records - the bad login attempts.</para> - - <note><para>The <filename>/run/utmp</filename> file records the users that - are currently logged in. This file is created dynamically in the boot - scripts.</para></note> - -</sect1> diff --git a/chapter06/creatingdirs.xml b/chapter06/creatingdirs.xml deleted file mode 100644 index 129e94f18..000000000 --- a/chapter06/creatingdirs.xml +++ /dev/null @@ -1,65 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" - "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ - <!ENTITY % general-entities SYSTEM "../general.ent"> - %general-entities; -]> - -<sect1 id="ch-system-creatingdirs"> - <?dbhtml filename="creatingdirs.html"?> - - <title>Creating Directories</title> - - <para>It is time to create some structure in the LFS file system. Create a - standard directory tree by issuing the following commands:</para> - -<screen><userinput>mkdir -pv /{bin,boot,etc/{opt,sysconfig},home,lib/firmware,mnt,opt} -mkdir -pv /{media/{floppy,cdrom},sbin,srv,var} -install -dv -m 0750 /root -install -dv -m 1777 /tmp /var/tmp -mkdir -pv /usr/{,local/}{bin,include,lib,sbin,src} -mkdir -pv /usr/{,local/}share/{color,dict,doc,info,locale,man} -mkdir -v /usr/{,local/}share/{misc,terminfo,zoneinfo} -mkdir -v /usr/libexec -mkdir -pv /usr/{,local/}share/man/man{1..8} -mkdir -v /usr/lib/pkgconfig - -case $(uname -m) in - x86_64) mkdir -v /lib64 ;; -esac - -mkdir -v /var/{log,mail,spool} -ln -sv /run /var/run -ln -sv /run/lock /var/lock -mkdir -pv /var/{opt,cache,lib/{color,misc,locate},local}</userinput></screen> - - <para>Directories are, by default, created with permission mode 755, but - this is not desirable for all directories. In the commands above, two - changes are made—one to the home directory of user <systemitem - class="username">root</systemitem>, and another to the directories for - temporary files.</para> - - <para>The first mode change ensures that not just anybody can enter - the <filename class="directory">/root</filename> directory—the - same as a normal user would do with his or her home directory. The - second mode change makes sure that any user can write to the - <filename class="directory">/tmp</filename> and <filename - class="directory">/var/tmp</filename> directories, but cannot remove - another user's files from them. The latter is prohibited by the so-called - <quote>sticky bit,</quote> the highest bit (1) in the 1777 bit mask.</para> - - <sect2> - <title>FHS Compliance Note</title> - - <para>The directory tree is based on the Filesystem Hierarchy Standard - (FHS) (available at <ulink - url="https://refspecs.linuxfoundation.org/fhs.shtml"/>). The FHS also specifies - the optional existence of some directories such as <filename - class="directory">/usr/local/games</filename> and <filename - class="directory">/usr/share/games</filename>. We create only the - directories that are needed. However, feel free to create these - directories. </para> - - </sect2> - -</sect1> diff --git a/chapter06/e2fsprogs.xml b/chapter06/e2fsprogs.xml index 08612ab3f..daa9bb91f 100644 --- a/chapter06/e2fsprogs.xml +++ b/chapter06/e2fsprogs.xml @@ -52,11 +52,6 @@ cd build</userinput></screen> <para>Prepare E2fsprogs for compilation:</para> -<!--<screen><userinput remap="configure">LIBS=-L/tools/lib \ -CFLAGS=-I/tools/include \ -CFLAGS=-I/tools/include \ -PKG_CONFIG_PATH=/tools/lib/pkgconfig \ -../configure - -prefix=/usr \--> <screen><userinput remap="configure">../configure --prefix=/usr \ --bindir=/bin \ --with-root-prefix="" \ @@ -68,15 +63,7 @@ PKG_CONFIG_PATH=/tools/lib/pkgconfig \ <variablelist> <title>The meaning of the environment variable and configure options:</title> -<!-- - <varlistentry> - <term><parameter>PKG_CONFIG_PATH, LIBS, CFLAGS</parameter></term> - <listitem> - <para>These variables enable e2fsprogs to be built using the - <xref linkend="ch-tools-util-linux"/> package built earlier.</para> - </listitem> - </varlistentry> ---> + <varlistentry> <term><parameter>--with-root-prefix=""</parameter> and <parameter>--bindir=/bin</parameter></term> @@ -117,17 +104,10 @@ PKG_CONFIG_PATH=/tools/lib/pkgconfig \ <para>Compile the package:</para> <screen><userinput remap="make">make</userinput></screen> -<!-- - <para>To set up and run the test suite we need to first link some - libraries from /tools/lib to a location where the test programs look. - To run the tests, issue:</para> ---> <para>To run the tests, issue:</para> <screen><userinput remap="test">make check</userinput></screen> -<!--ln -sfv /tools/lib/lib{blk,uu}id.so.1 lib --> -<!--make LD_LIBRARY_PATH=/tools/lib check</userinput></screen>--> <para>One of the E2fsprogs tests will attempt to allocate 256 MB of memory. If you do not have significantly more RAM than this, be sure to enable diff --git a/chapter06/flex.xml b/chapter06/flex.xml index 2e12dabac..7bd8954ac 100644 --- a/chapter06/flex.xml +++ b/chapter06/flex.xml @@ -50,7 +50,7 @@ This is not present, so we use an environment variable to skip this process. Now, prepare Flex for compilation:</para> -<screen><userinput remap="configure">HELP2MAN=/tools/bin/true \ +<screen><userinput remap="configure">HELP2MAN=/bin/true \ ./configure --prefix=/usr --docdir=/usr/share/doc/flex-&flex-version;</userinput></screen> <para>Compile the package:</para> diff --git a/chapter06/gcc.xml b/chapter06/gcc.xml index a9c8fa16c..952e3cca7 100644 --- a/chapter06/gcc.xml +++ b/chapter06/gcc.xml @@ -58,8 +58,8 @@ cd build</userinput></screen> <para>Prepare GCC for compilation:</para> -<screen><userinput remap="configure">SED=sed \ -../configure --prefix=/usr \ +<screen><userinput remap="configure">../configure --prefix=/usr \ + LD=ld \ --enable-languages=c,c++ \ --disable-multilib \ --disable-bootstrap \ @@ -71,26 +71,9 @@ cd build</userinput></screen> for instructions on how to build all of GCC's supported languages.</para> <variablelist> - <title>The meaning of the new configure parameters:</title> + <title>The meaning of the new configure parameter:</title> <varlistentry> - <term><envar>SED=sed</envar></term> - <listitem> - <para>Setting this environment variable prevents a hard-coded - path to /tools/bin/sed.</para> - </listitem> - </varlistentry> - <!-- - <varlistentry> - <term><parameter>- -disable-libmpx</parameter></term> - <listitem> - <para>This switch tells GCC to not build mpx (Memory Protection - Extensions) that can cause problems on some processors. It has - been removed from the next version of gcc.</para> - </listitem> - </varlistentry> - --> - <varlistentry> <term><parameter>--with-system-zlib</parameter></term> <listitem> <para>This switch tells GCC to link to the system installed copy of @@ -170,12 +153,12 @@ rm -rf /usr/lib/gcc/$(gcc -dumpmachine)/&gcc-version;/include-fixed/bits/</useri for "historical" reasons.</para> <screen><userinput remap="install">ln -sv ../usr/bin/cpp /lib</userinput></screen> - + <!-- already done earlier <para>Many packages use the name <command>cc</command> to call the C compiler. To satisfy those packages, create a symlink:</para> <screen><userinput remap="install">ln -sv gcc /usr/bin/cc</userinput></screen> - + --> <para>Add a compatibility symlink to enable building programs with Link Time Optimization (LTO):</para> diff --git a/chapter06/glibc.xml b/chapter06/glibc.xml index d1e8086b2..a422c8d3c 100644 --- a/chapter06/glibc.xml +++ b/chapter06/glibc.xml @@ -43,13 +43,6 @@ <sect2 role="installation"> <title>Installation of Glibc</title> - <note><para>The Glibc build system is self-contained and will install - perfectly, even though the compiler specs file and linker are still - pointing to <filename class="directory">/tools</filename>. The specs - and linker cannot be adjusted before the Glibc install because the - Glibc autoconf tests would give false results and defeat the goal - of achieving a clean build.</para></note> - <para>Some of the Glibc programs use the non-FHS compliant <filename class="directory">/var/db</filename> directory to store their runtime data. Apply the following patch to make such programs @@ -66,7 +59,7 @@ <screen><userinput remap="pre">sed -i '/asm.socket.h/a# include <linux/sockios.h>' \ sysdeps/unix/sysv/linux/bits/socket.h</userinput></screen> ---> +=== already done === <para>Create a symlink for LSB compliance. Additionally, for x86_64, create a compatibility symlink required for the dynamic loader to function correctly:</para> @@ -78,7 +71,7 @@ ln -sfv ../lib/ld-linux-x86-64.so.2 /lib64/ld-lsb-x86-64.so.3 ;; esac</userinput></screen> -<!-- + <para>Remove a file that may be left over from a previous build attempt: </para> @@ -92,23 +85,25 @@ cd build</userinput></screen> <para>Prepare Glibc for compilation:</para> -<screen><userinput remap="configure">CC="gcc -ffile-prefix-map=/tools=/usr" \ -../configure --prefix=/usr \ - --disable-werror \ - --enable-kernel=&min-kernel; \ - --enable-stack-protector=strong \ - --with-headers=/usr/include \ +<screen><userinput remap="configure">../configure --prefix=/usr \ + --disable-werror \ + --enable-kernel=&min-kernel; \ + --enable-stack-protector=strong \ + --with-headers=/usr/include \ libc_cv_slibdir=/lib</userinput></screen> - - <variablelist> + <!-- WIP --> + <variablelist> <title>The meaning of the options and new configure parameters:</title> <varlistentry> - <term><parameter>CC="gcc -ffile-prefix-map=/tools=/usr"</parameter></term> + <term><parameter>CC="gcc -ffile-prefix-map=$LFS_DIR=$DIR"</parameter></term> <listitem> - <para>Make GCC record any references to files in /tools in result - of the compilation as if the files resided in /usr. This avoids - introduction of invalid paths in debugging symbols.</para> + <para>Make GCC record any references to files in <filename + class="directory">/usr/lib/gcc/x86_64-lfs-linux-gnu</filename> + in result of the compilation as if the files resided in <filename + class="directory">/usr/lib/gcc/x86_64-pc-linux-gnu</filename>. + This avoids introduction of invalid paths in debugging + symbols.</para> </listitem> </varlistentry> @@ -128,13 +123,12 @@ cd build</userinput></screen> smashing attacks.</para> </listitem> </varlistentry> - +<!-- do we need this one? --> <varlistentry> <term><parameter>--with-headers=/usr/include</parameter></term> <listitem> <para>This option tells the build system where to find the - kernel API headers. By default, those headers are sought in - <filename class="directory">/tools/include</filename>.</para> + kernel API headers.</para> </listitem> </varlistentry> diff --git a/chapter06/introduction.xml b/chapter06/introduction.xml index 876112796..c8ccb3908 100644 --- a/chapter06/introduction.xml +++ b/chapter06/introduction.xml @@ -36,15 +36,6 @@ optimizations. The subsequent system will still run very fast and be stable at the same time.</para> - <para>The order that packages are installed in this chapter needs to be - strictly followed to ensure that no program accidentally acquires a path - referring to <filename class="directory">/tools</filename> hard-wired into - it. For the same reason, do not compile separate packages in parallel. - Compiling in parallel may save time (especially on dual-CPU machines), but it - could result in a program containing a hard-wired path to <filename - class="directory">/tools</filename>, which will cause the program to stop - working when that directory is removed.</para> - <para>Before the installation instructions, each installation page provides information about the package, including a concise description of what it contains, approximately how long it will take to build, and how much disk diff --git a/chapter06/kbd.xml b/chapter06/kbd.xml index 2bf0853f7..2f9cfd3f1 100644 --- a/chapter06/kbd.xml +++ b/chapter06/kbd.xml @@ -60,20 +60,11 @@ sed -i 's/resizecons.8 //' docs/man/man8/Makefile.in</userinput></screen> <para>Prepare Kbd for compilation:</para> -<screen><userinput remap="configure">PKG_CONFIG_PATH=/tools/lib/pkgconfig ./configure --prefix=/usr --disable-vlock</userinput></screen> +<screen><userinput remap="configure">./configure --prefix=/usr --disable-vlock</userinput></screen> <variablelist> <title>The meaning of the configure options:</title> -<!-- - <varlistentry> - <term><parameter>- -datadir=/lib/kbd</parameter></term> - <listitem> - <para>This option puts keyboard layout data in a directory that will - always be on the root partition instead of the default <filename - class="directory">/usr/share/kbd</filename>.</para> - </listitem> - </varlistentry> ---> + <varlistentry> <term><parameter>--disable-vlock</parameter></term> <listitem> @@ -104,16 +95,6 @@ sed -i 's/resizecons.8 //' docs/man/man8/Makefile.in</userinput></screen> such languages have to download working keymaps separately.</para> </note> -<!-- - <para>Some of the scripts in the LFS-Bootscripts package depend on - <command>kbd_mode</command>, <command>loadkeys</command>, - <command>openvt</command>, and - <command>setfont</command>. As <filename class="directory">/usr</filename> - may not be available during the early stages of booting, those binaries - need to be on the root partition:</para> - -<screen><userinput remap="install">mv -v /usr/bin/{kbd_mode,loadkeys,openvt,setfont} /bin</userinput></screen> ---> <para>If desired, install the documentation:</para> <screen><userinput remap="install">mkdir -v /usr/share/doc/kbd-&kbd-version; diff --git a/chapter06/kernfs.xml b/chapter06/kernfs.xml deleted file mode 100644 index 860cdfc00..000000000 --- a/chapter06/kernfs.xml +++ /dev/null @@ -1,115 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" - "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ - <!ENTITY % general-entities SYSTEM "../general.ent"> - %general-entities; -]> - -<sect1 id="ch-system-kernfs"> - <?dbhtml filename="kernfs.html"?> - - <title>Preparing Virtual Kernel File Systems</title> - - <indexterm zone="ch-system-kernfs"> - <primary sortas="e-/dev/">/dev/*</primary> - </indexterm> - - <para>Various file systems exported by the kernel are used to communicate to - and from the kernel itself. These file systems are virtual in that no disk - space is used for them. The content of the file systems resides in - memory.</para> - - <para>Begin by creating directories onto which the file systems will be - mounted:</para> - -<screen><userinput>mkdir -pv $LFS/{dev,proc,sys,run}</userinput></screen> - - <sect2> - <title>Creating Initial Device Nodes</title> - - <para>When the kernel boots the system, it requires the presence of a few - device nodes, in particular the <filename - class="devicefile">console</filename> and <filename - class="devicefile">null</filename> devices. The device nodes must be created - on the hard disk so that they are available before <command>udevd</command> - has been started, and additionally when Linux is started with - <parameter>init=/bin/bash</parameter>. Create the devices by running the - following commands:</para> - -<screen><userinput>mknod -m 600 $LFS/dev/console c 5 1 -mknod -m 666 $LFS/dev/null c 1 3</userinput></screen> - - </sect2> - - <sect2 id="ch-system-bindmount"> - <title>Mounting and Populating /dev</title> - - <para>The recommended method of populating the <filename - class="directory">/dev</filename> directory with devices is to mount a - virtual filesystem (such as <systemitem - class="filesystem">tmpfs</systemitem>) on the <filename - class="directory">/dev</filename> directory, and allow the devices to be - created dynamically on that virtual filesystem as they are detected or - accessed. Device creation is generally done during the boot process - by Udev. Since this new system does not yet have Udev and has not yet - been booted, it is necessary to mount and populate <filename - class="directory">/dev</filename> manually. This is accomplished by bind - mounting the host system's <filename class="directory">/dev</filename> - directory. A bind mount is a special type of mount that allows you to - create a mirror of a directory or mount point to some other location. Use - the following command to achieve this:</para> - -<screen><userinput>mount -v --bind /dev $LFS/dev</userinput></screen> - - </sect2> - - <sect2 id="ch-system-kernfsmount"> - <title>Mounting Virtual Kernel File Systems</title> - - <para>Now mount the remaining virtual kernel filesystems:</para> - -<screen><userinput>mount -vt devpts devpts $LFS/dev/pts -o gid=5,mode=620 -mount -vt proc proc $LFS/proc -mount -vt sysfs sysfs $LFS/sys -mount -vt tmpfs tmpfs $LFS/run</userinput></screen> - - <variablelist> - <title>The meaning of the mount options for devpts:</title> - - <varlistentry> - <term><parameter>gid=5</parameter></term> - <listitem> - <para>This ensures that all devpts-created device nodes are owned by - group ID 5. This is the ID we will use later on for the <systemitem - class="groupname">tty</systemitem> group. We use the group ID instead - of a name, since the host system might use a different ID for its - <systemitem class="groupname">tty</systemitem> group.</para> - </listitem> - </varlistentry> - - <varlistentry> - <term><parameter>mode=0620</parameter></term> - <listitem> - <para>This ensures that all devpts-created device nodes have mode 0620 - (user readable and writable, group writable). Together with the - option above, this ensures that devpts will create device nodes that - meet the requirements of grantpt(), meaning the Glibc - <command>pt_chown</command> helper binary (which is not installed by - default) is not necessary.</para> - </listitem> - </varlistentry> - - </variablelist> - - <para>In some host systems, <filename>/dev/shm</filename> is a - symbolic link to <filename class="directory">/run/shm</filename>. - The /run tmpfs was mounted above so in this case only a - directory needs to be created.</para> - -<screen><userinput>if [ -h $LFS/dev/shm ]; then - mkdir -pv $LFS/$(readlink $LFS/dev/shm) -fi</userinput></screen> - - </sect2> - -</sect1> diff --git a/chapter06/libpipeline.xml b/chapter06/libpipeline.xml index 6496e792d..eb5a19438 100644 --- a/chapter06/libpipeline.xml +++ b/chapter06/libpipeline.xml @@ -45,22 +45,6 @@ <screen><userinput remap="configure">./configure --prefix=/usr</userinput></screen> -<!-- -<screen><userinput remap="configure">PKG_CONFIG_PATH=/tools/lib/pkgconfig ./configure - -prefix=/usr</userinput></screen> - - <variablelist> - <title>The meaning of the configure options:</title> - - <varlistentry> - <term><parameter>PKG_CONFIG_PATH</parameter></term> - <listitem> - <para>Use pkg-config to obtain the location of the test - library metadata built in <xref linkend="ch-system-check"/>.</para> - </listitem> - </varlistentry> - - </variablelist> ---> <para>Compile the package:</para> <screen><userinput remap="make">make</userinput></screen> diff --git a/chapter06/linux-headers.xml b/chapter06/linux-headers.xml deleted file mode 100644 index f1d4cb14e..000000000 --- a/chapter06/linux-headers.xml +++ /dev/null @@ -1,209 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" - "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ - <!ENTITY % general-entities SYSTEM "../general.ent"> - %general-entities; -]> - -<sect1 id="ch-system-linux-headers" role="wrap"> - <?dbhtml filename="linux-headers.html"?> - - <sect1info condition="script"> - <productname>linux-headers</productname> - <productnumber>&linux-version;</productnumber> - <address>&linux-url;</address> - </sect1info> - - <title>Linux-&linux-version; API Headers</title> - - <indexterm zone="ch-system-linux-headers"> - <primary sortas="a-Linux">Linux</primary> - <secondary>API headers</secondary> - </indexterm> - - <sect2 role="package"> - <title/> - - <para>The Linux API Headers (in linux-&linux-version;.tar.xz) expose the - kernel's API for use by Glibc.</para> - - <segmentedlist> - <segtitle>&buildtime;</segtitle> - <segtitle>&diskspace;</segtitle> - - <seglistitem> - <seg>&linux-headers-ch6-sbu;</seg> - <seg>&linux-headers-ch6-du;</seg> - </seglistitem> - </segmentedlist> - - </sect2> - - <sect2 role="installation"> - <title>Installation of Linux API Headers</title> - - <para>The Linux kernel needs to expose an Application Programming Interface - (API) for the system's C library (Glibc in LFS) to use. This is done - by way of sanitizing various C header files that are shipped in the Linux - kernel source tarball.</para> - - <para>Make sure there are no stale files and dependencies lying around - from previous activity:</para> - -<screen><userinput remap="pre">make mrproper</userinput></screen> - - <para>Now extract the user-visible kernel headers from the source. - The recommended make target <quote>headers_install</quote> cannot be - used, because it requires <application>rsync</application>, which is - not available in <filename class="directory">/tools</filename>. The - headers are first placed in <filename class="directory">./usr</filename>, - then some files used by the kernel developers are removed, then - the files are copied to their final location.</para> - -<screen><userinput remap="make">make headers -find usr/include -name '.*' -delete -rm usr/include/Makefile -</userinput><userinput remap="install">cp -rv usr/include/* /usr/include</userinput></screen> - - </sect2> - - <sect2 id="contents-linux-headers" role="content"> - <title>Contents of Linux API Headers</title> - - <segmentedlist> - <segtitle>Installed headers</segtitle> - <segtitle>Installed directories</segtitle> - - <seglistitem> - <seg>/usr/include/asm/*.h, /usr/include/asm-generic/*.h, - /usr/include/drm/*.h, /usr/include/linux/*.h, /usr/include/misc/*.h, - /usr/include/mtd/*.h, /usr/include/rdma/*.h, /usr/include/scsi/*.h, - /usr/include/sound/*.h, /usr/include/video/*.h, - and /usr/include/xen/*.h</seg> - <seg>/usr/include/asm, /usr/include/asm-generic, /usr/include/drm, - /usr/include/linux, /usr/include/misc, /usr/include/mtd, - /usr/include/rdma, /usr/include/scsi, /usr/include/sound, - /usr/include/video, and /usr/include/xen</seg> - </seglistitem> - </segmentedlist> - - <variablelist> - <bridgehead renderas="sect3">Short Descriptions</bridgehead> - <?dbfo list-presentation="list"?> - <?dbhtml list-presentation="table"?> - - <varlistentry id="asm"> - <term><filename class="headerfile">/usr/include/asm/*.h</filename></term> - <listitem> - <para>The Linux API ASM Headers</para> - <indexterm zone="ch-system-linux-headers asm"> - <primary sortas="e-/usr/include/asm/*.h">/usr/include/asm/*.h</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="asm-generic"> - <term><filename class="headerfile">/usr/include/asm-generic/*.h</filename></term> - <listitem> - <para>The Linux API ASM Generic Headers</para> - <indexterm zone="ch-system-linux-headers asm-generic"> - <primary sortas="e-/usr/include/asm-generic/*.h">/usr/include/asm-generic/*.h</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="drm"> - <term><filename class="headerfile">/usr/include/drm/*.h</filename></term> - <listitem> - <para>The Linux API DRM Headers</para> - <indexterm zone="ch-system-linux-headers drm"> - <primary sortas="e-/usr/include/drm/*.h">/usr/include/drm/*.h</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="linux"> - <term><filename class="headerfile">/usr/include/linux/*.h</filename></term> - <listitem> - <para>The Linux API Linux Headers</para> - <indexterm zone="ch-system-linux-headers linux"> - <primary sortas="e-/usr/include/linux/*.h">/usr/include/linux/*.h</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="misc"> - <term><filename class="headerfile">/usr/include/misc/*.h</filename></term> - <listitem> - <para>The Linux API Miscellaneous Headers</para> - <indexterm zone="ch-system-linux-headers misc"> - <primary sortas="e-/usr/include/misc/*.h">/usr/include/misc/*.h</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="mtd"> - <term><filename class="headerfile">/usr/include/mtd/*.h</filename></term> - <listitem> - <para>The Linux API MTD Headers</para> - <indexterm zone="ch-system-linux-headers mtd"> - <primary sortas="e-/usr/include/mtd/*.h">/usr/include/mtd/*.h</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="rdma"> - <term><filename class="headerfile">/usr/include/rdma/*.h</filename></term> - <listitem> - <para>The Linux API RDMA Headers</para> - <indexterm zone="ch-system-linux-headers rdma"> - <primary sortas="e-/usr/include/rdma/*.h">/usr/include/rdma/*.h</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="scsi"> - <term><filename class="headerfile">/usr/include/scsi/*.h</filename></term> - <listitem> - <para>The Linux API SCSI Headers</para> - <indexterm zone="ch-system-linux-headers scsi"> - <primary sortas="e-/usr/include/scsi/*.h">/usr/include/scsi/*.h</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="sound"> - <term><filename class="headerfile">/usr/include/sound/*.h</filename></term> - <listitem> - <para>The Linux API Sound Headers</para> - <indexterm zone="ch-system-linux-headers sound"> - <primary sortas="e-/usr/include/sound/*.h">/usr/include/sound/*.h</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="video"> - <term><filename class="headerfile">/usr/include/video/*.h</filename></term> - <listitem> - <para>The Linux API Video Headers</para> - <indexterm zone="ch-system-linux-headers video"> - <primary sortas="e-/usr/include/video/*.h">/usr/include/video/*.h</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="xen"> - <term><filename class="headerfile">/usr/include/xen/*.h</filename></term> - <listitem> - <para>The Linux API Xen Headers</para> - <indexterm zone="ch-system-linux-headers xen"> - <primary sortas="e-/usr/include/xen/*.h">/usr/include/xen/*.h</primary> - </indexterm> - </listitem> - </varlistentry> - - </variablelist> - - </sect2> - -</sect1> diff --git a/chapter06/readline.xml b/chapter06/readline.xml index bcefab042..87571ea9d 100644 --- a/chapter06/readline.xml +++ b/chapter06/readline.xml @@ -73,13 +73,13 @@ sed -i '/{OLDSUFF}/c:' support/shlib-install</userinput></screen> <para>Compile the package:</para> -<screen><userinput remap="make">make SHLIB_LIBS="-L/tools/lib -lncursesw"</userinput></screen> +<screen><userinput remap="make">make SHLIB_LIBS="-lncursesw"</userinput></screen> <variablelist> <title>The meaning of the make option:</title> <varlistentry> - <term><parameter>SHLIB_LIBS="-L/tools/lib -lncursesw"</parameter></term> + <term><parameter>SHLIB_LIBS="-lncursesw"</parameter></term> <listitem> <para>This option forces Readline to link against the <filename class="libraryfile">libncursesw</filename> library.</para> @@ -92,7 +92,7 @@ sed -i '/{OLDSUFF}/c:' support/shlib-install</userinput></screen> <para>Install the package:</para> -<screen><userinput remap="install">make SHLIB_LIBS="-L/tools/lib -lncursesw" install</userinput></screen> +<screen><userinput remap="install">make SHLIB_LIBS="-lncursesw" install</userinput></screen> <para>Now move the dynamic libraries to a more appropriate location and fix up some permissions and symbolic links:</para> diff --git a/chapter06/revisedchroot.xml b/chapter06/revisedchroot.xml index eb40fb7ce..882fbd3d5 100644 --- a/chapter06/revisedchroot.xml +++ b/chapter06/revisedchroot.xml @@ -26,18 +26,9 @@ chroot "$LFS" /usr/bin/env -i \ PATH=/bin:/usr/bin:/sbin:/usr/sbin \ /bin/bash --login</userinput></screen> - <para>The reason for this is that the programs in <filename - class="directory">/tools</filename> are no longer needed. For this reason - you can delete the <filename class="directory">/tools</filename> - directory if so desired.</para> - - <note> - <para>Removing <filename class="directory">/tools</filename> will also - remove the temporary copies of Tcl, Expect, and DejaGNU which were used - for running the toolchain tests. If you need these programs later on, - they will need to be recompiled and re-installed. The BLFS book has - instructions for this (see <ulink url="&blfs-root;"/>).</para> - </note> + <para>Here the <parameter>+h</parameter> option is not used anymore, since + all the previous programs have been replaced: hashing is therefore + possible.</para> <para>If the virtual kernel file systems have been unmounted, either manually or through a reboot, ensure that the virtual kernel file systems are mounted diff --git a/chapter06/sed.xml b/chapter06/sed.xml index aa6ac177c..bebd49d14 100644 --- a/chapter06/sed.xml +++ b/chapter06/sed.xml @@ -42,24 +42,12 @@ <para>First fix an issue in the LFS environment and remove a failing test:</para> -<screen><userinput remap="pre">sed -i 's/usr/tools/' build-aux/help2man -sed -i 's/testsuite.panic-tests.sh//' Makefile.in</userinput></screen> +<screen><userinput remap="pre">sed -i 's/testsuite.panic-tests.sh//' Makefile.in</userinput></screen> <para>Prepare Sed for compilation:</para> <screen><userinput remap="configure">./configure --prefix=/usr --bindir=/bin</userinput></screen> -<!-- - <variablelist> - <title>The meaning of the new configure option:</title> - <varlistentry> - <term><parameter>-i -htmldir</parameter></term> - <listitem> - <para>This sets the installation directory for the HTML documentation.</para> - </listitem> - </varlistentry> - </variablelist> ---> <para>Compile the package and generate the HTML documentation:</para> <screen><userinput remap="make">make diff --git a/chapter06/shadow.xml b/chapter06/shadow.xml index 7fd621bdb..425112cbd 100644 --- a/chapter06/shadow.xml +++ b/chapter06/shadow.xml @@ -84,7 +84,8 @@ find man -name Makefile.in -exec sed -i 's/passwd\.5 / /' {} \;</userinput></s <para>Prepare Shadow for compilation:</para> <screen><userinput remap="configure">touch /usr/bin/passwd -./configure --sysconfdir=/etc --with-group-name-max-length=32</userinput></screen> +./configure --sysconfdir=/etc \ + --with-group-name-max-length=32</userinput></screen> <variablelist> <title>The meaning of the configure option:</title> diff --git a/chapter06/strippingagain.xml b/chapter06/strippingagain.xml index eef553173..fb2a1b55f 100644 --- a/chapter06/strippingagain.xml +++ b/chapter06/strippingagain.xml @@ -56,38 +56,22 @@ done unset LIB save_lib save_usrlib</userinput></screen> - <para>Before performing the stripping, take special care to ensure that +<!-- <para>Before performing the stripping, take special care to ensure that none of the binaries that are about to be stripped are running:</para> <screen role="nodump"><userinput>exec /tools/bin/bash</userinput></screen> - <!-- - If - unsure whether the user entered chroot with the command given in - <xref linkend="ch-system-chroot" role=","/> first use the version - of bash we created in - chroot:</para> - -<screen role="nodump"><userinput>logout</userinput></screen> - - <para>Then reenter it with:</para> - -<screen role="nodump"><userinput>chroot $LFS /tools/bin/env -i \ - HOME=/root TERM=$TERM \ - PS1='(lfs chroot) \u:\w\$ ' \ - PATH=/bin:/usr/bin:/sbin:/usr/sbin \ - /tools/bin/bash - -login</userinput></screen>--> - <para>Now the binaries and libraries can be safely stripped:</para> +--> + <para>Now the binaries and libraries can be stripped:</para> +<screen><userinput>find /usr/lib -type f -name \*.a \ + -exec strip --strip-debug {} ';' -<screen><userinput>/tools/bin/find /usr/lib -type f -name \*.a \ - -exec /tools/bin/strip --strip-debug {} ';' - -/tools/bin/find /lib /usr/lib -type f \( -name \*.so* -a ! -name \*dbg \) \ - -exec /tools/bin/strip --strip-unneeded {} ';' +find /lib /usr/lib -type f -name \*.so* ! -name \*dbg \ + -exec strip --strip-unneeded {} ';' -/tools/bin/find /{bin,sbin} /usr/{bin,sbin,libexec} -type f \ - -exec /tools/bin/strip --strip-all {} ';'</userinput></screen> +find /{bin,sbin} /usr/{bin,sbin,libexec} -type f \ + -exec strip --strip-all {} ';'</userinput></screen> <para>A large number of files will be reported as having their file format not recognized. These warnings can be safely ignored. These diff --git a/chapter06/systemd.xml b/chapter06/systemd.xml index 1010c43ea..2870c3846 100644 --- a/chapter06/systemd.xml +++ b/chapter06/systemd.xml @@ -48,7 +48,7 @@ <para>Create a symlink to work around missing xsltproc:</para> -<screen><userinput remap="pre">ln -sf /tools/bin/true /usr/bin/xsltproc</userinput></screen> +<screen><userinput remap="pre">ln -sf /bin/true /usr/bin/xsltproc</userinput></screen> <para>Set up the man pages:</para> @@ -101,9 +101,7 @@ meson --prefix=/usr \ <term><parameter>-D*-path=*</parameter></term> <listitem> <para>These switches provide location of binaries needed by - systemd at runtime that have not yet been installed, or who's - pkgconfig files are currently only in - <filename>/tools/lib/pkgconfig</filename>.</para> + systemd at runtime that have not yet been installed.</para> </listitem> </varlistentry> diff --git a/chapter06/util-linux.xml b/chapter06/util-linux.xml index 6a6a5bcc5..bc328e8bb 100644 --- a/chapter06/util-linux.xml +++ b/chapter06/util-linux.xml @@ -54,18 +54,6 @@ <sect2 role="installation"> <title>Installation of Util-linux</title> -<!-- - <para>First, fix one of the regression tests:</para> - -<screen><userinput remap="pre">sed -e 's/2^64/(2^64/' -e 's/E </E) <=/' -e 's/ne /eq /' \ - -i tests/ts/ipcs/limits2</userinput></screen> ---> - - <para>Remove the earlier created symlinks and files:</para> - -<screen><userinput remap="pre">rm -vf /usr/include/{blkid,libfdisk,libmount,uuid} -rm -vf /usr/lib/lib{blkid,fdisk,mount,uuid}.so* -rm -vf /usr/lib/pkgconfig/{blkid,fdisk,mount,uuid}.pc</userinput></screen> <para>Prepare Util-linux for compilation:</para> |