MTD 248-645A Manual de usuario Pagina 47

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 347
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 46
Linux From Scratch - Version 7.0
27
Chapter 4. Final Preparations
4.1. About $LFS
Throughout this book, the environment variable LFS will be used. It is paramount that this variable is always defined.
It should be set to the mount point chosen for the LFS partition. Check that the LFS variable is set up properly with:
echo $LFS
Make sure the output shows the path to the LFS partition's mount point, which is /mnt/lfs if the provided example
was followed. If the output is incorrect, the variable can be set with:
export LFS=/mnt/lfs
Having this variable set is beneficial in that commands such as mkdir $LFS/tools can be typed literally. The shell will
automatically replace “$LFS” with “/mnt/lfs” (or whatever the variable was set to) when it processes the command
line.
Do not forget to check that $LFS is set whenever you leave and reenter the current working environment (as when
doing a su to root or another user).
4.2. Creating the $LFS/tools Directory
All programs compiled in Chapter 5 will be installed under $LFS/tools to keep them separate from the programs
compiled in Chapter 6. The programs compiled here are temporary tools and will not be a part of the final LFS system.
By keeping these programs in a separate directory, they can easily be discarded later after their use. This also prevents
these programs from ending up in the host production directories (easy to do by accident in Chapter 5).
Create the required directory by running the following as root:
mkdir -v $LFS/tools
The next step is to create a /tools symlink on the host system. This will point to the newly-created directory on
the LFS partition. Run this command as root as well:
ln -sv $LFS/tools /
Note
The above command is correct. The ln command has a few syntactic variations, so be sure to check info
coreutils ln and ln(1) before reporting what you may think is an error.
The created symlink enables the toolchain to be compiled so that it always refers to /tools, meaning that the
compiler, assembler, and linker will work both in Chapter 5 (when we are still using some tools from the host) and
in the next (when we are “chrooted” to the LFS partition).
Vista de pagina 46
1 2 ... 42 43 44 45 46 47 48 49 50 51 52 ... 346 347

Comentarios a estos manuales

Sin comentarios