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 /chapter04 | |
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 'chapter04')
-rw-r--r-- | chapter04/abouttestsuites.xml | 12 | ||||
-rw-r--r-- | chapter04/addinguser.xml | 4 | ||||
-rw-r--r-- | chapter04/chapter04.xml | 2 | ||||
-rw-r--r-- | chapter04/creatingminlayout.xml | 32 | ||||
-rw-r--r-- | chapter04/introduction.xml | 2 | ||||
-rw-r--r-- | chapter04/settingenviron.xml | 8 |
6 files changed, 43 insertions, 17 deletions
diff --git a/chapter04/abouttestsuites.xml b/chapter04/abouttestsuites.xml index 1b2e0d68f..780216181 100644 --- a/chapter04/abouttestsuites.xml +++ b/chapter04/abouttestsuites.xml @@ -25,15 +25,9 @@ are strongly recommended.</para> <note> - <para>Experience has shown that there is little to be gained from running - the test suites in <xref linkend="chapter-temporary-tools"/>. There can be - no escaping the fact that the host system always exerts some influence on - the tests in that chapter, often causing inexplicable failures. Because - the tools built in <xref linkend="chapter-temporary-tools"/> are temporary - and eventually discarded, we do not recommend running the test suites in - <xref linkend="chapter-temporary-tools"/> for the average reader. The - instructions for running those test suites are provided for the benefit of - testers and developers, but they are strictly optional.</para> + <para>Running the test suites in <xref linkend="chapter-temporary-tools"/> + is impossible, since the programs are compiled with a cross-compiler, + so are not supposed to be able to run on the build host.</para> </note> <para>A common issue with running the test suites for Binutils and GCC diff --git a/chapter04/addinguser.xml b/chapter04/addinguser.xml index a26aa55a2..24cdb3aab 100644 --- a/chapter04/addinguser.xml +++ b/chapter04/addinguser.xml @@ -77,10 +77,10 @@ useradd -s /bin/bash -g lfs -m -k /dev/null lfs</userinput></screen> <screen role="nodump"><userinput>passwd lfs</userinput></screen> <para>Grant <systemitem class="username">lfs</systemitem> full access to - <filename class="directory">$LFS/tools</filename> by making + all directories under <filename class="directory">$LFS</filename> by making <systemitem class="username">lfs</systemitem> the directory owner:</para> -<screen><userinput>chown -v lfs $LFS/tools</userinput></screen> +<screen><userinput>chown -v lfs $LFS/{usr,lib,var,etc,bin,sbin,lib64,tools}</userinput></screen> <para>If a separate working directory was created as suggested, give user <systemitem class="username">lfs</systemitem> ownership of this diff --git a/chapter04/chapter04.xml b/chapter04/chapter04.xml index 3e44ce94f..5ad2d22db 100644 --- a/chapter04/chapter04.xml +++ b/chapter04/chapter04.xml @@ -13,7 +13,7 @@ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="introduction.xml"/> <!--<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="aboutlfs.xml"/>--> - <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="creatingtoolsdir.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="creatingminlayout.xml"/> <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="addinguser.xml"/> <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="settingenviron.xml"/> <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="aboutsbus.xml"/> diff --git a/chapter04/creatingminlayout.xml b/chapter04/creatingminlayout.xml new file mode 100644 index 000000000..44cca8d22 --- /dev/null +++ b/chapter04/creatingminlayout.xml @@ -0,0 +1,32 @@ +<?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-tools-creatingminlayout"> + <?dbhtml filename="creatingminlayout.html"?> + + <title>Creating the Minimal directory layout in LFS filesystem</title> + + <para>The first task performed in the LFS partition is to create a minimal + directory hierarchy so that programs compiled in <xref + linkend="chapter-temporary-tools"/> may be installed in their final + location. This is needed so that those temporary programs be overwritten + when rebuilding them in <xref linkend="chapter-building-system"/>.</para> + + <para>Create the required directory layout by running the following as + <systemitem class="username">root</systemitem>:</para> + +<screen><userinput>mkdir -pv $LFS/{usr,lib,var,etc,bin,sbin,lib64}</userinput></screen> + + <para>Programs in <xref linkend="chapter-temporary-tools"/> will be compiled + with a cross-compiler (more details in section <xref + linkend="ch-tools-toolchaintechnotes"/>). In order to separate this + cross-compiler from the other programs, it will be installed in a special + directory. Create this directory with:</para> + +<screen><userinput>mkdir -pv $LFS/tools</userinput></screen> + +</sect1> diff --git a/chapter04/introduction.xml b/chapter04/introduction.xml index f1ac91989..c54c67f8c 100644 --- a/chapter04/introduction.xml +++ b/chapter04/introduction.xml @@ -11,7 +11,7 @@ <title>Introduction</title> <para>In this chapter, we will perform a few additional tasks to prepare - for building the temporary system. We will create a directory in + for building the temporary system. We will create a set of directories in <filename class="directory">$LFS</filename> for the installation of the temporary tools, add an unprivileged user to reduce risk, and create an appropriate build environment for that user. We will also diff --git a/chapter04/settingenviron.xml b/chapter04/settingenviron.xml index 512d30d10..86d10bf05 100644 --- a/chapter04/settingenviron.xml +++ b/chapter04/settingenviron.xml @@ -43,7 +43,7 @@ umask 022 LFS=/mnt/lfs LC_ALL=POSIX LFS_TGT=$(uname -m)-lfs-linux-gnu -PATH=/tools/bin:/bin:/usr/bin +PATH=$LFS/tools/bin:/bin:/usr/bin export LFS LC_ALL LFS_TGT PATH</literal> EOF</userinput></screen> @@ -61,7 +61,7 @@ EOF</userinput></screen> be used as soon as they are installed. By switching off the hash function, the shell will always search the <envar>PATH</envar> when a program is to be run. As such, the shell will find the newly compiled tools in - <filename class="directory">$LFS/tools</filename> as soon as they are + <filename class="directory">~/tools</filename> as soon as they are available without remembering a previous version of the same program in a different location.</para> </listitem> @@ -108,9 +108,9 @@ EOF</userinput></screen> </varlistentry> <varlistentry> - <term><parameter>PATH=/tools/bin:/bin:/usr/bin</parameter></term> + <term><parameter>PATH=$LFS/tools/bin:/bin:/usr/bin</parameter></term> <listitem> - <para>By putting <filename class="directory">/tools/bin</filename> ahead of the + <para>By putting <filename class="directory">$LFS/tools/bin</filename> ahead of the standard <envar>PATH</envar>, all the programs installed in <xref linkend="chapter-temporary-tools"/> are picked up by the shell immediately after their installation. This, combined with turning off hashing, limits the risk |