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