1 | <sect1 id="ch05-settingenviron">
|
---|
2 | <title>Setting up the environment</title>
|
---|
3 | <?dbhtml filename="settingenviron.html" dir="chapter05"?>
|
---|
4 |
|
---|
5 | <para>While logged in as user <emphasis>lfs</emphasis>, issue the
|
---|
6 | following commands to set up a good work environment:</para>
|
---|
7 |
|
---|
8 | <para><screen><userinput>cat > ~/.bash_profile << "EOF"
|
---|
9 | umask 022
|
---|
10 | LFS=/mnt/lfs
|
---|
11 | LC_ALL=POSIX
|
---|
12 | CC="gcc -s"
|
---|
13 | export LFS LC_ALL CC
|
---|
14 | EOF
|
---|
15 | source ~/.bash_profile</userinput></screen></para>
|
---|
16 |
|
---|
17 | <para>This profile sets the umask to 022, so newly created files will and
|
---|
18 | directories will have the correct permissions. To be more specific, only
|
---|
19 | the file owner will have write permission to new files and directories.
|
---|
20 | Other users of the system will be have read permission, and executable
|
---|
21 | permission to directories. It is advisable to keep this setting throughout
|
---|
22 | your LFS installation.</para>
|
---|
23 |
|
---|
24 | <para>The LFS variable has been explained in previous chapters. LC_ALL is
|
---|
25 | a variable used for internationalization.</para>
|
---|
26 |
|
---|
27 | <para>The LC_ALL variable controls the localization of certain programs,
|
---|
28 | making their messages follow the conventions of a specified country. If your
|
---|
29 | host system uses a version of <emphasis>glibc</emphasis> older than 2.2.4,
|
---|
30 | having LC_ALL set to something other than "C" or "POSIX" during this chapter
|
---|
31 | may cause trouble if you exit the chroot environment and wish to return later.
|
---|
32 | By setting LC_ALL to "POSIX" ("C" is an alias for "POSIX") we ensure that
|
---|
33 | everything will work as expected in the chroot environment.</para>
|
---|
34 |
|
---|
35 | <para>CC is a variable we set in order to prevent debugging symbols from
|
---|
36 | being compiled into our static packages. By omitting these symbols during
|
---|
37 | the linking stage of compilation, we save hard drive space and decrease our
|
---|
38 | build time.</para>
|
---|
39 |
|
---|
40 | <para>We are now prepared to begin building the temporary tools which will
|
---|
41 | support us in later chapters.</para>
|
---|
42 |
|
---|
43 | </sect1>
|
---|
44 |
|
---|