Setting up the environment While logged in as user lfs, issue the following commands to set up a good work environment: cat > ~/.bash_profile << "EOF" set +h umask 022 LFS=/mnt/lfs LC_ALL=POSIX PATH=/stage1/bin:$PATH export LFS LC_ALL PATH EOF source ~/.bash_profile set +h turns off Bash's hash function. Hash normally is a useful feature where Bash uses a hash table to remember the full pathnames of executable files to avoid multiple `PATH' searches. However, we'd like the new tools to become available as soon as they are installed. By switching off the hash function, our "interactive" commands (make, patch, sed, cp and so forth) will always use the newest available during the build process. This profile sets the umask to 022, so newly created files and directories will have the correct permissions. To be more specific, only the file owner will have write permission to new files and directories. Other users of the system will be have read permission, and executable permission to directories. It is advisable to keep this setting throughout your LFS installation. The LFS variable should of course be set to the mount point you chose. The LC_ALL variable controls the localization of certain programs, making their messages follow the conventions of a specified country. If your host system uses a version of glibc older than 2.2.4, having LC_ALL set to something other than "C" or "POSIX" during this chapter may cause trouble if you exit the chroot environment and wish to return later. By setting LC_ALL to "POSIX" ("C" is an alias for "POSIX") we ensure that everything will work as expected in the chroot environment. LDFLAGS is a variable we set in order to prevent debugging symbols from being compiled into our static packages. By omitting these symbols during the linking stage of compilation, we save hard drive space and decrease our build time. We are now prepared to begin building the temporary tools which will support us in later chapters.