mirror of
https://git.linuxfromscratch.org/lfs.git
synced 2025-06-19 03:39:20 +01:00
Rewrite "How to Build an LFS System" for cross chapter 5
git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/cross-chap5@11888 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
This commit is contained in:
parent
4f3e4e369a
commit
3a56c9a7fb
@ -52,31 +52,36 @@
|
|||||||
or to unpack the tar package, you need tar.</para>
|
or to unpack the tar package, you need tar.</para>
|
||||||
|
|
||||||
<para><xref linkend="chapter-temporary-tools"/> also shows you how to
|
<para><xref linkend="chapter-temporary-tools"/> also shows you how to
|
||||||
build a first pass of the toolchain, including Binutils and GCC (first pass
|
build a C cross-compiling toolchain as a first step, including binutils
|
||||||
basically means these two core packages will be reinstalled).
|
and GCC. Cross-compiling is not absolutely needed since the machine we'll
|
||||||
|
run LFS on is the same as the one we build on, but it has the advantage
|
||||||
|
of clearly separating the already installed system and the future LFS one.
|
||||||
The next step is to build Glibc, the C library. Glibc will be compiled by
|
The next step is to build Glibc, the C library. Glibc will be compiled by
|
||||||
the toolchain programs built in the first pass. Then, a second pass of the
|
the toolchain programs built previously. Then, the missing bits for a
|
||||||
toolchain will be built. This time, the toolchain will be dynamically linked
|
C++ cross-compiling toolchain will be built. It is then possible to build
|
||||||
against the newly built Glibc. The remaining <xref
|
packages that are needed to resolve circular dependencies in such a way
|
||||||
linkend="chapter-temporary-tools"/> packages are built using this second
|
that the produced executables and libraries are completely independent
|
||||||
pass toolchain. When this is done, the LFS installation process will no
|
from the installed distribution.</para>
|
||||||
longer depend on the host distribution, with the exception of the running
|
|
||||||
kernel. </para>
|
<para>The remainder of <xref linkend="chapter-temporary-tools"/> adds
|
||||||
|
the packages necessary to get a complete build environment. This is done
|
||||||
|
after running the <command>chroot</command> (change root) program to enter
|
||||||
|
a virtual environment and start a new shell whose root directory will be
|
||||||
|
set to the LFS partition. This is very similar to rebooting and instructing
|
||||||
|
the kernel to mount the LFS partition as the root partition. The system
|
||||||
|
does not actually reboot, but instead uses <command>chroot</command>
|
||||||
|
because creating a bootable system requires additional work which is not
|
||||||
|
ecessary just yet. The major advantage is that <quote>chrooting</quote>
|
||||||
|
allows to isolate the build process from the installed distribution, while
|
||||||
|
using the installed kernel.</para>
|
||||||
|
|
||||||
<para>This effort to isolate the new system from the host distribution may
|
<para>This effort to isolate the new system from the host distribution may
|
||||||
seem excessive. A full technical explanation as to why this is done is
|
seem excessive. A full technical explanation as to why this is done is
|
||||||
provided in <xref linkend="ch-tools-toolchaintechnotes"/>.</para>
|
provided in <xref linkend="ch-tools-toolchaintechnotes"/>.</para>
|
||||||
|
|
||||||
<para><xref linkend="chapter-building-system"/> begins with installing the
|
<para>In <xref linkend="chapter-building-system"/>, The
|
||||||
remaining packages needed to build and test the final toolchain. Then, the
|
full LFS system is built. Another advantage provided by the chroot
|
||||||
full LFS system is built. But first, the <command>chroot</command> (change
|
environment is that it allows you to continue using the host system
|
||||||
root) program is used to enter a virtual environment and start a new shell
|
|
||||||
whose root directory will be set to the LFS partition. This is very similar
|
|
||||||
to rebooting and instructing the kernel to mount the LFS partition as the
|
|
||||||
root partition. The system does not actually reboot, but instead uses
|
|
||||||
<command>chroot</command> because creating a bootable system requires
|
|
||||||
additional work which is not necessary just yet. The major advantage is
|
|
||||||
that <quote>chrooting</quote> allows you to continue using the host system
|
|
||||||
while LFS is being built. While waiting for package compilations to
|
while LFS is being built. While waiting for package compilations to
|
||||||
complete, you can continue using your computer as normal.</para>
|
complete, you can continue using your computer as normal.</para>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user