From 490dc15317e18e4f87d2a2555adc6ce2c2a774ba Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sat, 5 Feb 2022 11:36:39 +0800 Subject: 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. --- chapter08/bash.xml | 8 +------- chapter08/revisedchroot.xml | 22 ---------------------- 2 files changed, 1 insertion(+), 29 deletions(-) (limited to 'chapter08') 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 Run the newly compiled bash program (replacing the one that is currently being executed): - exec /usr/bin/bash --login +h - - - The parameters used make the bash - process an interactive login shell and continues to disable hashing so - that new programs are found as they become available. - + exec /usr/bin/bash --login 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 @@ rm -rf /tmp/* - 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: - -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 - - Here the +h option is not used anymore, since - all the previous programs have been replaced: hashing is therefore - possible. - - 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 and . - 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 -- cgit v1.2.3-54-g00ecf