aboutsummaryrefslogtreecommitdiffstats
path: root/chapter04/settingenviron.xml
diff options
context:
space:
mode:
authorBruce Dubbs <bdubbs@linuxfromscratch.org>2020-06-16 11:56:28 +0000
committerBruce Dubbs <bdubbs@linuxfromscratch.org>2020-06-16 11:56:28 +0000
commit675606bde2ba53946537b42a5aa576692a311621 (patch)
treeaf20c20ce3841c16b24d0b9903af6878a4a0f5a6 /chapter04/settingenviron.xml
parent560065f976e371779928dbf8b9428217f3f57331 (diff)
parent1cd59612d00603c9ce773ad821a15d20bc4fa0b7 (diff)
Split Chapter 5 into three separate chapters.
Implement a new method of cross-building the LFS tool chain and other tools to simplify the method of isolating the new system from the original host. This will be the start of LFS-10.0. Move old trunk/BOOK to branches/old-trunk. git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@11946 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
Diffstat (limited to 'chapter04/settingenviron.xml')
-rw-r--r--chapter04/settingenviron.xml46
1 files changed, 35 insertions, 11 deletions
diff --git a/chapter04/settingenviron.xml b/chapter04/settingenviron.xml
index 512d30d10..9c8bae7a9 100644
--- a/chapter04/settingenviron.xml
+++ b/chapter04/settingenviron.xml
@@ -43,12 +43,14 @@ umask 022
LFS=/mnt/lfs
LC_ALL=POSIX
LFS_TGT=$(uname -m)-lfs-linux-gnu
-PATH=/tools/bin:/bin:/usr/bin
+PATH=/usr/bin
+if [ ! -L /bin ]; then PATH=/bin:$PATH; fi
+PATH=$LFS/tools/bin:$PATH
export LFS LC_ALL LFS_TGT PATH</literal>
EOF</userinput></screen>
<variablelist>
- <title>The meaning of the command line options in <filename>.bashrc</filename></title>
+ <title>The meaning of the settings in <filename>.bashrc</filename></title>
<varlistentry>
<term><parameter>set +h</parameter></term>
@@ -61,7 +63,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,14 +110,36 @@ EOF</userinput></screen>
</varlistentry>
<varlistentry>
- <term><parameter>PATH=/tools/bin:/bin:/usr/bin</parameter></term>
+ <term><parameter>PATH=/usr/bin</parameter></term>
<listitem>
- <para>By putting <filename class="directory">/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
- that old programs are used from the host when the same programs are available in
- the Chapter 5 environment.</para>
+ <para>Many modern linux distributions have merged <filename
+ class="directory">/bin</filename> and <filename
+ class="directory">/usr/bin</filename>. When this is the case, the standard
+ <envar>PATH</envar> variable needs just to be set to <filename
+ class="directory">/usr/bin/</filename> for the <xref
+ linkend="chapter-temporary-tools"/> environment. When this is not the
+ case, the following line adds <filename class="directory">/bin</filename>
+ to the path.</para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><parameter>if [ ! -L /bin ]; then PATH=/bin:$PATH; fi</parameter></term>
+ <listitem>
+ <para>If <filename class="directory">/bin</filename> is not a symbolic
+ link, then it has to be added to the <envar>PATH</envar> variable.</para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><parameter>PATH=$LFS/tools/bin:$PATH</parameter></term>
+ <listitem>
+ <para>By putting <filename class="directory">$LFS/tools/bin</filename> ahead of the
+ standard <envar>PATH</envar>, the cross-compiler installed at the beginning
+ of <xref linkend="chapter-cross-tools"/> is picked up by the shell
+ immediately after its installation. This, combined with turning off hashing,
+ limits the risk that the compiler from the host be used instead of the
+ cross-compiler.</para>
</listitem>
</varlistentry>
@@ -123,7 +147,7 @@ EOF</userinput></screen>
<term><parameter>export LFS LC_ALL LFS_TGT PATH</parameter></term>
<listitem>
<para>While the above commands have set some variables, in order
- to make them visible within any sub-shells, we export them</para>
+ to make them visible within any sub-shells, we export them.</para>
</listitem>
</varlistentry>