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 name $LFS will frequently be used. $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 | explaind in full detail later on in chapter 4. In my case, the LFS
|
---|
10 | partition is mounted on /mnt/lfs. If I read this book myself and I see
|
---|
11 | $LFS somewhere, I will pretend that I read /mnt/lfs. If I read that
|
---|
12 | I have to run this command: cp inittab $LFS/etc, I actually will run this:
|
---|
13 | cp inittab /mnt/lfs/etc.
|
---|
14 | </para>
|
---|
15 |
|
---|
16 | <para>
|
---|
17 | It's important that this is done no matter where it is read; be it in
|
---|
18 | commands entered on the prompt, or in a file edited or created.
|
---|
19 | </para>
|
---|
20 |
|
---|
21 | <para>
|
---|
22 | Another possible solution is to set the environment variable LFS.
|
---|
23 | This way the $LFS can be entered literally instead of replacing it by
|
---|
24 | something like
|
---|
25 | /mnt/lfs. This is accomplished by running: export LFS=/mnt/lfs.
|
---|
26 | </para>
|
---|
27 |
|
---|
28 | <para>
|
---|
29 | If I read cp inittab $LFS/etc, I literally can type cp inittab $LFS/etc
|
---|
30 | and the shell will replace this command by cp inittab /mnt/lfs/etc
|
---|
31 | automatically.
|
---|
32 | </para>
|
---|
33 |
|
---|
34 | <para>
|
---|
35 | Do not forget to set the $LFS variable at all times. If
|
---|
36 | the variable is not set and is used it in a command, $LFS will be ignored
|
---|
37 | and whatever
|
---|
38 | is left will be executed. The command cp inittab $LFS/etc without the $LFS
|
---|
39 | variable set will result in copying the inittab file to the /etc
|
---|
40 | directory, which will overwrite the host-system's inittab. A file like inittab
|
---|
41 | isn't that big a problem as it can easily be restored, but if
|
---|
42 | this mistake is made during the installation of the C Library, things might
|
---|
43 | be damaged
|
---|
44 | </para>
|
---|
45 |
|
---|
46 | <para>
|
---|
47 | One way to make sure that $LFS is set at all times is adding it to
|
---|
48 | the /root/.bash_profile and/or /root/.bashrc file(s) so that every time a
|
---|
49 | 'su' to root is done to install LFS, the $LFS variable is set.
|
---|
50 | </para>
|
---|
51 |
|
---|
52 | </sect1>
|
---|
53 |
|
---|