The LFS temporary toolchain is going to take a while to cover completely, so I’m breaking it up into several parts for readability.
The first part of actually building LFS is building a temporary toolchain to prevent contamination from the host environment (in my case, the LFS live CD).
I will build Binutils and GCC twice during the beginning of this process: first to tune them for the hardware I’m using; and second to allow them to refer only to themselves, and not to the liveCD versions. This was the trickiest part of the build for me to understand, but it made sense the more I thought about it. Next, I will build a minimal set of tools that will let me build (and test) my final LFS system.
At several points in this process, I must adjust the temporary toolchain to be more self-referential, until finally I chroot into the final build environment and discard the temporary toolchain.
Before I actually begin building the temporary toolchain, I am going to explain my process for actually building the toolchain, and most of the rest of LFS, so it can be assumed in later entries for brevity’s sake:
- Since my sources are in
/sources(/mnt/lfs/sourcesduring the temporary toolchain build), I will be there to begin with each program build. - I will then use
tar -zxfon .tar.gz sources andtar -jxfon .tar.bz2 sources to decompress them into their own directory (usually<package-name>-<version>). - I will the
cdinto the newly extracted directories and follow the instructions as given in the book. - I will, where possible, use a
time { ./configure && make && make install }template so I can give an accurate account of the length of each build (this is slightly deviant from the book, other than the first time I build Binutils for the temporary toolchain). - I will then
cdback into/sources(again,/mnt/lfs/sourcesduring the temporary toolchain build) andrm -rfthe extracted source files and any dedicated build directories. This keeps down the amount of hard disk space needed, especially for a very constrained system like Pressie, and it will ensure a completely clean build for software that I have to build multiple times.
And with these preliminaries, I am ready to build the temporary toolchain.
Pingback: LFS 6.8 (Part 7): Temporary Toolchain First Pass and Adjustments « Becoming A Glider
Thanks for this LFS series.
It’s very instructive
You’re very welcome! I am enjoying building LFS, and writing out my experiences is forcing me to have a deeper understanding of both the technical and intuitive aspects of Linux than I would have otherwise.
Pingback: LFS 6.8 (Part 8): Temporary Toolchain Second Pass « Becoming A Glider
Pingback: LFS 6.8 (Part 9): The First Part of the Rest of the Temporary Toolchain « Becoming A Glider
Pingback: LFS 6.8 (Part 10): The Second Part of the Rest of the Temporary Toolchain « Becoming A Glider
Pingback: LFS 6.8 (Part 11): Tweaking and Backing Up the Temporary Toolchain « Becoming A Glider