Kuidas ehitada LFS süsteemi

Allikas: Kuutõrvaja

The LFS system will be built by using an already installed Linux distribution (such as Debian, Mandriva, Red Hat, or SUSE). This existing Linux system (the host) will be used as a starting point to provide necessary programs, including a compiler, linker, and shell, to build the new system. Select the “development” option during the distribution installation to be able to access these tools.

LFS süsteem ehitatakse kokku kasutades eelnevalt paigaldatud Linuxi distributsiooni (näiteks Debian, Mandriva, Red Hat või SUSE). Seda Linuxi süsteemi (ehk baasi) kasutame stardipunktina mis pakub meile vajalikke programme, kaasaarvatud kompilaator, linker ja käsurea kest (shell), et panna kokku uus süsteem. Baas distributsiooni paigalduse käigus tasub valida võimaluse korral "development" tugi, et kindlustada vajalike töövahendite olemasolu.

As an alternative to installing a separate distribution onto your machine, you may wish to use the Linux From Scratch LiveCD or a LiveCD from a commercial distribution. The LFS LiveCD works well as a host system, providing all the tools you need to successfully follow the instructions in this book. The LiveCD version is behind the current book, but is still useful as a host for building the current book. The “-nosrc” or “-min” editions of the LiveCD are the most appropriate for building a current LFS system. For more information about the LFS LiveCD or to download a copy, visit http://www.linuxfromscratch.org/livecd/.'

Eraldi distributsiooni arvutisse installimise alternatiivina võib kasutada ka Linux From Scatch LoveCD'd või mõnda komertsiaalse distributsiooni LiveCD'd. LFS LiveCD töötab hästi baas süsteemina, pakkudes kõiki vajalikke töövahendeid mis läheb selle raamatu instruktsioonide täitmise juures.

Rohkem informatsiooni saamiseks LFS LiveCD kohta või soovides tõmmata endale koopia külasta http://www.linuxfromscratch.org/livecd/

Note The LFS LiveCD might not work on newer hardware configurations, failing to boot or failing to detect some devices such as some SATA hard drives.

LFS'i LiveCD ei pruugi töötada kõige uuema riistvaraga. Probleemid võivad tekkida peamiselt startimise ning mõningate SATA kõvaketaste leidmisega.

Chapter 2 of this book describes how to create a new Linux native partition and file system. This is the place where the new LFS system will be compiled and installed. Chapter 3 explains which packages and patches need to be downloaded to build an LFS system and how to store them on the new file system. Chapter 4 discusses the setup of an appropriate working environment. Please read Chapter 4 carefully as it explains several important issues you need be aware of before beginning to work your way through Chapter 5 and beyond.

Peatükk 2 kirjeldab kuidas luua uus Linuxi partitsioon ja failisüsteem. Seal toimub uue LFS süsteemi kompileerimine ning installimine. Kolmas peatükk seletab mis paketid ja paigad tuleb tõmmata ja kuidas neid failisüsteemi paigutada. Neljas peatükk tegeleb töötava keskkonna seadistamise nüanssidega. Seda peatükki tasub lugeda eriti hoolikalt kuna seletab mitmeid olulisi asju mida vaja teada viienda peatüki läbitöötlema asudes.

Chapter 5 explains the installation of a number of packages that will form the basic development suite (or toolchain) which is used to build the actual system in Chapter 6. Some of these packages are needed to resolve circular dependencies—for example, to compile a compiler, you need a compiler.

Chapter 5 also shows you how to build a first pass of the toolchain, including Binutils and GCC (first pass basically means these two core packages will be reinstalled). 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 toolchain will be built. This time, the toolchain will be dynamically linked against the newly built Glibc. The remaining Chapter 5 packages are built using this second pass toolchain. When this is done, the LFS installation process will no longer depend on the host distribution, with the exception of the running kernel.

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 provided in Section 5.2, “Toolchain Technical Notes”.

In Chapter 6, the full LFS system is built. The chroot (change 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 chroot's because creating a bootable system requires additional work which is not necessary just yet. The major advantage is that “chrooting” allows you to continue using the host system while LFS is being built. While waiting for package compilations to complete, you can continue using your computer as normal.

To finish the installation, the LFS-Bootscripts are set up in Chapter 7, and the kernel and boot loader are set up in Chapter 8. Chapter 9 contains information on continuing the LFS experience beyond this book. After the steps in this book have been implemented, the computer will be ready to reboot into the new LFS system.

Installatsiooni lõpetamiseks vajalikud LFS-stardiskriptid on peatükis 7. Kernel ja boot loaderi ülesseadise juhendid asuvad peatükis 8. Peatükk 9 sisaldab infot kuidas jätkata LFS kasutamist edaspidi. Nende nimetatud sammude täitmise järel on arvuti valmis restartima töötava LFS süsteemi.

This is the process in a nutshell. Detailed information on each step is discussed in the following chapters and package descriptions. Items that may seem complicated will be clarified, and everything will fall into place as you embark on the LFS adventure.

See on kiirelt lahti seletatult kogu protsess. Detaile info iga sammu kohta on täpsemalt lahti seletatud järgnevates peatükkides ning pakettide kirjeldustes. Keerukad asjad saavad selguse ja kõik loksub paika kui astud LFS seiklusesse.