4.1. About $HLFS

Throughout this book, the environment variable HLFS will be used. It is paramount that this variable is always defined. It should be set to the mount point chosen for the HLFS partition. Check that the HLFS variable is set up properly with:

echo $HLFS

Make sure the output shows the path to the HLFS partition's mount point, which is /mnt/hlfs if the provided example was followed. If the output is incorrect, the variable can be set with:

export HLFS=/mnt/hlfs

Having this variable set is beneficial in that commands such as mkdir $HLFS/tools can be typed literally. The shell will automatically replace “$HLFS” with “/mnt/hlfs” (or whatever the variable was set to) when it processes the command line.

Do not forget to check that $HLFS is set whenever you leave and reenter the current working environment (as when doing a su to root or another user).