ch-7.15 missing set +h?

John Gay johngay at
Mon Mar 20 19:52:32 PST 2006

This was asked back in Feb, and I posed the question again, but buried deep in 
another mail, so I'll pose it here.

In ch-8.4, chroot-ing to the build environment, we execute:

chroot "$LFS" /tools/bin/env -i \
    HOME=/root TERM="$TERM" PS1='\u:\w\$ ' \
    PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin \
    /tools/bin/bash --login +h

And then explain:

Notice that /tools/bin comes last in the PATH. This means that a temporary 
tool will no longer be used once its final version is installed. This occurs 
when the shell does not “remember” the locations of executed binaries—for 
this reason, hashing is switched off by passing the +h option to bash. 

But, in ch-7.15, if we're booting, we set the environment:

cat > ${LFS}/root/.bash_profile << "EOF"
PS1='\u:\w\$ '
export LC_ALL PATH PS1

But still explain:

By putting /tools/bin at the end of the standard PATH, all the programs 
installed in Constructing a Temporary System are only picked up by the shell 
if they have not yet been built on the target system. This configuration 
forces use of the final system binaries as they are built over the 
temp-system, minimising the chance of final system programs being built 
against the temp-system. 

But you'll notice that we haven't disabled bash's hashing with set +h? Am I 
missing something, or is this a typo for the booting path of the build? I've 
checked a few other build types, and they all seem the same. It is my 
understanding that we'll need to set +h in .bash_profile to ensure that the 
newer binaries are used when they're installed, rather than using the old 
binaries that bash remembers in it's hash table.

Or someone come hit me with a BIG CLUE-BAT (-;


	John Gay

More information about the cross-lfs mailing list