aboutsummaryrefslogtreecommitdiffstats
path: root/chapter07/chroot.xml
diff options
context:
space:
mode:
authorXi Ruoyao <xry111@mengyan1223.wang>2022-02-05 11:36:39 +0800
committerXi Ruoyao <xry111@mengyan1223.wang>2022-02-05 20:48:27 +0800
commit490dc15317e18e4f87d2a2555adc6ce2c2a774ba (patch)
treecdd4f927f4ca62b6cbd3ddc26260015232ba0aaf /chapter07/chroot.xml
parent69c4524b6df4f5ac7b87e868afe55569b61752a8 (diff)
remove "+h" in bash commands in chroot (#4998)
In the new cross-compilation approach, the $PATH in chroot does not contain '/tools/bin'. So "+h" is useless in chroot as the newly installed tools always replace the temporary counterpart at the same location. "+h" in chapter4/settingenviron.xml is kept deliberately. Currently $LFS/tools/bin only contains programs prefixed with "x86_64-lfs-linux-gnu-", and it's highly unlikely that any distro will ever ship a program named with such prefix. So it may seems that we can remove this "+h" as well. However, the situation may change in future and we can take this oppertunity to teach the advantage and disvantage of bash hash feature.
Diffstat (limited to 'chapter07/chroot.xml')
-rw-r--r--chapter07/chroot.xml7
1 files changed, 2 insertions, 5 deletions
diff --git a/chapter07/chroot.xml b/chapter07/chroot.xml
index d018cb218..6404c0625 100644
--- a/chapter07/chroot.xml
+++ b/chapter07/chroot.xml
@@ -23,7 +23,7 @@
TERM="$TERM" \
PS1='(lfs chroot) \u:\w\$ ' \
PATH=/usr/bin:/usr/sbin \
- /bin/bash --login +h</userinput></screen>
+ /bin/bash --login</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
@@ -44,10 +44,7 @@
<para>Notice that <filename class="directory">/tools/bin</filename> is not
in the <envar>PATH</envar>. This means that the cross toolchain will no longer be
- used in the chroot environment. This occurs when the shell does not
- <quote>remember</quote> the locations of executed binaries&mdash;for this
- reason, hashing is switched off by passing the <parameter>+h</parameter> option
- to <command>bash</command>.</para>
+ used in the chroot environment.</para>
<para>Note that the <command>bash</command> prompt will say
<computeroutput>I have no name!</computeroutput> This is normal because the