aboutsummaryrefslogtreecommitdiffstats
path: root/chapter08
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 /chapter08
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 'chapter08')
-rw-r--r--chapter08/bash.xml8
-rw-r--r--chapter08/revisedchroot.xml22
2 files changed, 1 insertions, 29 deletions
diff --git a/chapter08/bash.xml b/chapter08/bash.xml
index 36bbcf0d9..787882b59 100644
--- a/chapter08/bash.xml
+++ b/chapter08/bash.xml
@@ -94,13 +94,7 @@ EOF</userinput></screen>
<para>Run the newly compiled <command>bash</command> program (replacing the one that is
currently being executed):</para>
- <screen role="nodump"><userinput>exec /usr/bin/bash --login +h</userinput></screen>
-
- <note>
- <para>The parameters used make the <command>bash</command>
- process an interactive login shell and continues to disable hashing so
- that new programs are found as they become available.</para>
- </note>
+ <screen role="nodump"><userinput>exec /usr/bin/bash --login</userinput></screen>
</sect2>
diff --git a/chapter08/revisedchroot.xml b/chapter08/revisedchroot.xml
index bc519d491..52c74a381 100644
--- a/chapter08/revisedchroot.xml
+++ b/chapter08/revisedchroot.xml
@@ -14,28 +14,6 @@
<screen><userinput>rm -rf /tmp/*</userinput></screen>
- <para>Now log out and reenter the chroot environment with an updated
- chroot command. From now on, use this updated chroot command any time
- you need to reenter the chroot environment after exiting:</para>
-
-<screen role="nodump"><userinput>logout
-
-chroot "$LFS" /usr/bin/env -i \
- HOME=/root TERM="$TERM" \
- PS1='(lfs chroot) \u:\w\$ ' \
- PATH=/usr/bin:/usr/sbin \
- /usr/bin/bash --login</userinput></screen>
-
- <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
- when reentering the chroot. This process was explained in <xref
- linkend="ch-tools-bindmount"/> and <xref
- linkend="ch-tools-kernfsmount"/>.</para>
-
<para>There are also several files installed in the /usr/lib and /usr/libexec
directories with a file name extension of .la. These are "libtool archive"
files. As already said, they are only useful when linking with static