Chapter 4. Final Preparations

About $LFS

Throughout this book the environment variable LFS will be used several times. It is paramount that this variable is always defined. It should be set to the mount point you chose for your LFS partition. Check that your LFS variable is set up properly with:

echo $LFS

Make sure the output shows the path to your LFS partition's mount point, which is /mnt/lfs if you followed our example. If the output is wrong, you can always set the variable with:

export LFS=/mnt/lfs

Having this variable set means that if you are told to run a command like mkdir $LFS/tools, you can type it literally. Your shell will replace "$LFS" with "/mnt/lfs" (or whatever you set the variable to) when it processes the command line.

Don't forget to check that “$LFS” is set whenever you leave and reenter the environment (as when doing an “su” to root or another user).