diff options
author | Pierre Labastie <pieere@linuxfromscratch.org> | 2020-05-06 13:02:47 +0000 |
---|---|---|
committer | Pierre Labastie <pieere@linuxfromscratch.org> | 2020-05-06 13:02:47 +0000 |
commit | b454589fa6e9dcb0c386d9f84f6d181884230c62 (patch) | |
tree | d00182c6766b17f7ebd4494cfd4eef2a116806eb /chapter04 | |
parent | 69a8b2b7e4f6bee9e1067c17b1fb49182a049515 (diff) |
Avoid having /bin in lfs' PATH if the build distro has merged
/bin and /usr/bin
git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/cross-chap5@11837 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
Diffstat (limited to 'chapter04')
-rw-r--r-- | chapter04/settingenviron.xml | 38 |
1 files changed, 31 insertions, 7 deletions
diff --git a/chapter04/settingenviron.xml b/chapter04/settingenviron.xml index 86d10bf05..a94586e0c 100644 --- a/chapter04/settingenviron.xml +++ b/chapter04/settingenviron.xml @@ -43,7 +43,9 @@ umask 022 LFS=/mnt/lfs LC_ALL=POSIX LFS_TGT=$(uname -m)-lfs-linux-gnu -PATH=$LFS/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> @@ -108,14 +110,36 @@ EOF</userinput></screen> </varlistentry> <varlistentry> - <term><parameter>PATH=$LFS/tools/bin:/bin:/usr/bin</parameter></term> + <term><parameter>PATH=/usr/bin</parameter></term> + <listitem> + <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>, 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> + standard <envar>PATH</envar>, the cross-compiler installed at the beginning + of <xref linkend="chapter-temporary-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> |