1 | <sect1 id="ch02-aboutlfs">
|
---|
2 | <title>About $LFS</title>
|
---|
3 |
|
---|
4 | <para>
|
---|
5 | Please read the following carefully: throughout this book
|
---|
6 | the variable $LFS will be used frequently. $LFS must at all times be
|
---|
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
|
---|
9 | explained in full detail in chapter 4. In my case, the LFS
|
---|
10 | partition is mounted on /mnt/lfs.
|
---|
11 | </para>
|
---|
12 |
|
---|
13 | <para>
|
---|
14 | For example when you are told to run a command like
|
---|
15 | <userinput>./configure --prefix=$LFS</userinput> you actually have to
|
---|
16 | run <userinput>./configure --prefix=/mnt/lfs</userinput>
|
---|
17 | </para>
|
---|
18 |
|
---|
19 | <para>
|
---|
20 | It's important that this is done no matter where it is read; be it in
|
---|
21 | commands entered in a shell, or in a file edited or created.
|
---|
22 | </para>
|
---|
23 |
|
---|
24 | <para>
|
---|
25 | Another possible solution is to set the environment variable LFS.
|
---|
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>.
|
---|
29 | </para>
|
---|
30 |
|
---|
31 | <para>
|
---|
32 | Now, if you read to run a command like <userinput>./configure
|
---|
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
|
---|
35 | when you hit enter after having typed the command).
|
---|
36 | </para>
|
---|
37 |
|
---|
38 | <para>
|
---|
39 | If you plan to use $LFS, do not forget to set the $LFS variable at all
|
---|
40 | times. If the variable is not set and is used it in a command, $LFS will
|
---|
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.
|
---|
46 | </para>
|
---|
47 |
|
---|
48 | <para>
|
---|
49 | One way to make sure that $LFS is set at all times is adding it to
|
---|
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.
|
---|
53 | </para>
|
---|
54 |
|
---|
55 | </sect1>
|
---|
56 |
|
---|