2001-01-24 00:31:17 +00:00
|
|
|
<sect1 id="ch02-aboutlfs">
|
|
|
|
<title>About $LFS</title>
|
2001-09-26 00:48:31 +01:00
|
|
|
<?dbhtml filename="aboutlfs.html" dir="chapter02"?>
|
2001-01-24 00:31:17 +00:00
|
|
|
|
2001-07-22 20:45:10 +01:00
|
|
|
<para>Please read the following carefully: throughout this book
|
2002-09-28 22:08:29 +01:00
|
|
|
the variable LFS will be used frequently. $LFS must at all times be
|
2001-08-29 17:56:32 +01:00
|
|
|
replaced with the directory where the partition that contains the LFS system
|
2001-01-24 00:31:17 +00:00
|
|
|
is mounted. How to create and where to mount the partition will be
|
2002-09-20 22:11:28 +01:00
|
|
|
explained in full detail in Chapter 4. For example, let's assume that
|
2001-08-29 17:56:32 +01:00
|
|
|
the LFS partition is mounted on /mnt/lfs.</para>
|
2001-03-23 02:38:02 +00:00
|
|
|
|
2002-09-22 04:01:40 +01:00
|
|
|
<para>When you are told to run a command like
|
2002-09-18 19:31:39 +01:00
|
|
|
<userinput>./configure --prefix=$LFS/static</userinput> you actually have to
|
|
|
|
execute <userinput>./configure --prefix=/mnt/lfs/static</userinput>.</para>
|
2001-01-24 00:31:17 +00:00
|
|
|
|
2001-07-22 20:45:10 +01:00
|
|
|
<para>It's important that this is done no matter where it is read; be it in
|
|
|
|
commands entered in a shell, or in a file edited or created.</para>
|
2001-01-24 00:31:17 +00:00
|
|
|
|
2001-07-22 20:45:10 +01:00
|
|
|
<para>A possible solution is to set the environment variable LFS.
|
2001-08-29 17:56:32 +01:00
|
|
|
This way $LFS can be entered literally instead of replacing it with
|
2002-03-29 12:38:41 +00:00
|
|
|
/mnt/lfs. This is accomplished by running: </para>
|
|
|
|
|
|
|
|
<para><screen><userinput>export LFS=/mnt/lfs</userinput></screen></para>
|
2001-01-24 00:31:17 +00:00
|
|
|
|
2002-09-22 04:13:20 +01:00
|
|
|
<para>Now, if you are told to run a command such as
|
|
|
|
<userinput>./configure --prefix=$LFS/static</userinput>, then you may type
|
|
|
|
it literally. Your shell will replace $LFS with /mnt/lfs when it processes
|
|
|
|
the command line (meaning when you hit enter after having typed the
|
|
|
|
command).</para>
|
2001-01-24 00:31:17 +00:00
|
|
|
|
2002-09-28 22:08:29 +01:00
|
|
|
<para>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" >
|
2002-09-28 22:08:29 +01:00
|
|
|
$LFS/etc/passwd</userinput> without the LFS variable set will
|
2001-03-23 02:38:02 +00:00
|
|
|
re-create your host system's /etc/passwd file. Simply put: it will
|
2001-07-22 20:45:10 +01:00
|
|
|
destroy your current password database file.</para>
|
2001-01-24 00:31:17 +00:00
|
|
|
|
2001-07-22 20:45:10 +01:00
|
|
|
<para>One way to make sure that $LFS is set at all times is adding it to
|
2002-02-20 01:10:29 +00:00
|
|
|
the /root/.bash_profile and /root/.bashrc files so that every time
|
2002-09-22 04:13:20 +01:00
|
|
|
you login as user root, or you <userinput>su</userinput> to user root,
|
2002-09-28 22:08:29 +01:00
|
|
|
the LFS variable is set.</para>
|
2001-01-24 00:31:17 +00:00
|
|
|
|
|
|
|
</sect1>
|
|
|
|
|