2.2. Setting The ${CLFS} Variable

Throughout this book, the environment variable CLFS will be used several times. You should ensure that this variable is always defined throughout the CLFS build process. It should be set to the name of the directory where you will be building your CLFS system - we will use /mnt/clfs as an example, but the directory choice is up to you. If you are building CLFS on a separate partition, this directory will be the mount point for the partition. Choose a directory location and set the variable with the following command:

export CLFS=[/mnt/clfs]

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

Do not forget to check that ${CLFS} is set whenever you leave and reenter the current working environment (such as when doing a su to root or another user). Check that the CLFS variable is set up properly with:

echo ${CLFS}

Make sure the output shows the path to your CLFS system's build location, which is /mnt/clfs if the provided example was followed. If the output is incorrect, use the command given earlier on this page to set ${CLFS} to the correct directory name.