aboutsummaryrefslogtreecommitdiffstats
path: root/chapter02/aboutlfs.xml
blob: b89b29e1db25152615218abe3ee64a45e6303cdb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<sect1 id="ch02-aboutlfs">
<title>About $LFS</title>

<para>
Please read the following carefully: throughout this book 
the variable name $LFS will frequently be used. $LFS must at all times be
replaced by the directory where the partition that contains the LFS system 
is mounted. How to create and where to mount the partition will be
explaind in full detail later on in chapter 4. In my case, the LFS 
partition is mounted  on /mnt/lfs. If I read this book myself and I see 
$LFS somewhere, I will pretend that I read /mnt/lfs. If I read that 
I have to run this command: cp inittab $LFS/etc, I actually will run this: 
cp inittab /mnt/lfs/etc.
</para>

<para>
It's important that this is done no matter where it is read; be it in
commands entered on the prompt, or in a file edited or created.
</para>

<para>
Another possible solution is to set the environment variable LFS.
This way the $LFS can be entered literally instead of replacing it by 
something like
/mnt/lfs. This is accomplished by running: export LFS=/mnt/lfs.
</para>

<para>
If I read cp inittab $LFS/etc, I literally can type cp inittab $LFS/etc
and the shell will replace this command by cp inittab /mnt/lfs/etc
automatically.
</para>

<para>
Do not forget to set the $LFS variable at all times. If 
the variable is not set and is used it in a command, $LFS will be ignored 
and whatever
is left will be executed. The command cp inittab $LFS/etc without the $LFS
variable set will result in copying the inittab file to the /etc
directory, which will overwrite the host-system's inittab. A file like inittab 
isn't that big a problem as it can easily be restored, but if 
this mistake is made during the installation of the C Library, things might
be damaged
</para>

<para>
One way to make sure that $LFS is set at all times is adding it to
the /root/.bash_profile and/or /root/.bashrc file(s) so that every time a
'su' to root is done to install LFS, the $LFS variable is set.
</para>

</sect1>