| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 | <sect1 id="ch05-settingenviron"><title>Setting up the environment</title><?dbhtml filename="settingenviron.html" dir="chapter05"?><para>While logged in as user <emphasis>lfs</emphasis>, issue thefollowing commands to set up a good work environment:</para><para><screen><userinput>cat > ~/.bash_profile << "EOF"set +humask 022LFS=/mnt/lfsLC_ALL=POSIXPATH=/stage1/bin:$PATHexport LFS LC_ALL LDFLAGS PATHEOFsource ~/.bash_profile</userinput></screen></para><para><userinput>set +h</userinput> turns off Bash's hash function. Hashnormally is a useful feature where Bash uses a hash table to remember thefull pathnames of executable files to avoid multiple `PATH' searches.However, we'd like the new tools to become available as soon as they areinstalled.  By switching off the hash function, our "interactive" commands(make, patch, sed, cp and so forth) will always use the newest availableduring the build process.</para><para>This profile sets the umask to 022, so newly created files anddirectories will have the correct permissions. To be more specific, onlythe file owner will have write permission to new files and directories.Other users of the system will be have read permission, and executablepermission to directories. It is advisable to keep this setting throughoutyour LFS installation.</para><para>The LFS variable should of course be set to the mount point youchose.</para><para>The LC_ALL variable controls the localization of certain programs,making their messages follow the conventions of a specified country. If yourhost system uses a version of <emphasis>glibc</emphasis> older than 2.2.4,having LC_ALL set to something other than "C" or "POSIX" during this chaptermay 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 thateverything will work as expected in the chroot environment.</para><para>LDFLAGS is a variable we set in order to prevent debugging symbols frombeing compiled into our static packages. By omitting these symbols duringthe linking stage of compilation, we save hard drive space and decrease ourbuild time.</para><para>We are now prepared to begin building the temporary tools which willsupport us in later chapters.</para></sect1>
 |