[6370fa6] | 1 | <sect1 id="ch02-aboutlfs">
|
---|
| 2 | <title>About $LFS</title>
|
---|
[04f5529] | 3 | <?dbhtml filename="aboutlfs.html" dir="chapter02"?>
|
---|
[6370fa6] | 4 |
|
---|
[b822811] | 5 | <para>Please read the following carefully: throughout this book
|
---|
[2c094d6] | 6 | the variable LFS will be used frequently. $LFS must at all times be
|
---|
[fada431] | 7 | replaced with the directory where the partition that contains the LFS system
|
---|
[6370fa6] | 8 | is mounted. How to create and where to mount the partition will be
|
---|
[26e62aa] | 9 | explained in full detail in Chapter 4. For example, let's assume that
|
---|
[fada431] | 10 | the LFS partition is mounted on /mnt/lfs.</para>
|
---|
[97f1db3] | 11 |
|
---|
[1e6acd6] | 12 | <para>When you are told to run a command like
|
---|
[60ed866] | 13 | <userinput>./configure --prefix=$LFS/static</userinput> you actually have to
|
---|
| 14 | execute <userinput>./configure --prefix=/mnt/lfs/static</userinput>.</para>
|
---|
[6370fa6] | 15 |
|
---|
[b822811] | 16 | <para>It's important that this is done no matter where it is read; be it in
|
---|
| 17 | commands entered in a shell, or in a file edited or created.</para>
|
---|
[6370fa6] | 18 |
|
---|
[b822811] | 19 | <para>A possible solution is to set the environment variable LFS.
|
---|
[fada431] | 20 | This way $LFS can be entered literally instead of replacing it with
|
---|
[6ad9627] | 21 | /mnt/lfs. This is accomplished by running: </para>
|
---|
| 22 |
|
---|
| 23 | <para><screen><userinput>export LFS=/mnt/lfs</userinput></screen></para>
|
---|
[6370fa6] | 24 |
|
---|
[2294abc] | 25 | <para>Now, if you are told to run a command such as
|
---|
| 26 | <userinput>./configure --prefix=$LFS/static</userinput>, then you may type
|
---|
| 27 | it literally. Your shell will replace $LFS with /mnt/lfs when it processes
|
---|
| 28 | the command line (meaning when you hit enter after having typed the
|
---|
| 29 | command).</para>
|
---|
[6370fa6] | 30 |
|
---|
[2c094d6] | 31 | <para>If you plan to use $LFS, do not forget to set the LFS variable at all
|
---|
[280bcc8] | 32 | times. If the variable is not set and is used in a command, $LFS will
|
---|
[97f1db3] | 33 | be ignored and whatever is left will be executed. A command like
|
---|
| 34 | <userinput>echo "root:x:0:0:root:/root:/bin/bash" >
|
---|
[2c094d6] | 35 | $LFS/etc/passwd</userinput> without the LFS variable set will
|
---|
[97f1db3] | 36 | re-create your host system's /etc/passwd file. Simply put: it will
|
---|
[b822811] | 37 | destroy your current password database file.</para>
|
---|
[6370fa6] | 38 |
|
---|
[b822811] | 39 | <para>One way to make sure that $LFS is set at all times is adding it to
|
---|
[ce04b11] | 40 | the /root/.bash_profile and /root/.bashrc files so that every time
|
---|
[2294abc] | 41 | you login as user root, or you <userinput>su</userinput> to user root,
|
---|
[2c094d6] | 42 | the LFS variable is set.</para>
|
---|
[6370fa6] | 43 |
|
---|
| 44 | </sect1>
|
---|
| 45 |
|
---|