2001-01-24 00:31:17 +00:00
|
|
|
<sect1 id="ch02-aboutlfs">
|
|
|
|
<title>About $LFS</title>
|
|
|
|
|
|
|
|
<para>
|
2001-03-16 18:06:46 +00:00
|
|
|
Please read the following carefully: throughout this book
|
2001-03-23 02:38:02 +00:00
|
|
|
the variable $LFS will be used frequently. $LFS must at all times be
|
2001-01-24 00:31:17 +00:00
|
|
|
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
|
2001-03-23 02:56:31 +00:00
|
|
|
explained in full detail in chapter 4. In my case, the LFS
|
2001-03-23 02:38:02 +00:00
|
|
|
partition is mounted on /mnt/lfs.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
For example when you are told to run a command like
|
2001-03-23 02:56:31 +00:00
|
|
|
<userinput>./configure --prefix=$LFS</userinput> you actually have to
|
|
|
|
run <userinput>./configure --prefix=/mnt/lfs</userinput>
|
2001-01-24 00:31:17 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
2001-03-16 18:06:46 +00:00
|
|
|
It's important that this is done no matter where it is read; be it in
|
2001-03-23 02:38:02 +00:00
|
|
|
commands entered in a shell, or in a file edited or created.
|
2001-01-24 00:31:17 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
2001-03-16 18:06:46 +00:00
|
|
|
Another possible solution is to set the environment variable LFS.
|
2001-03-23 02:38:02 +00:00
|
|
|
This way $LFS can be entered literally instead of replacing it by
|
|
|
|
/mnt/lfs. This is accomplished by running <userinput>export
|
|
|
|
LFS=/mnt/lfs</userinput>.
|
2001-01-24 00:31:17 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
2001-04-13 00:25:34 +01:00
|
|
|
Now, if you are told to run a command like <userinput>./configure
|
2001-03-23 02:38:02 +00:00
|
|
|
--prefix=$LFS</userinput> you can type that literally. Your shell will
|
|
|
|
replace $LFS with /mnt/lfs when it processes the command line (meaning
|
2001-03-23 02:56:31 +00:00
|
|
|
when you hit enter after having typed the command).
|
2001-01-24 00:31:17 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
2001-03-23 02:38:02 +00:00
|
|
|
If you plan to use $LFS, do not forget to set the $LFS variable at all
|
2001-04-13 00:25:34 +01:00
|
|
|
times. If the variable is not set and is used in a command, $LFS will
|
2001-03-23 02:38:02 +00:00
|
|
|
be ignored and whatever is left will be executed. A command like
|
|
|
|
<userinput>echo "root:x:0:0:root:/root:/bin/bash" >
|
|
|
|
$LFS/etc/passwd</userinput> without the $LFS variable set will
|
|
|
|
re-create your host system's /etc/passwd file. Simply put: it will
|
|
|
|
destroy your current password database file.
|
2001-01-24 00:31:17 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
2001-03-15 17:01:05 +00:00
|
|
|
One way to make sure that $LFS is set at all times is adding it to
|
2001-03-23 02:38:02 +00:00
|
|
|
the /root/.bash_profile and/or /root/.bashrc file(s) so that every time
|
|
|
|
you login as user root, or you 'su' to user root, the $LFS variable is
|
|
|
|
set.
|
2001-01-24 00:31:17 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
</sect1>
|
|
|
|
|