📜 ⬆️ ⬇️

Linux From Scratch, without going into details

Linux From Scratch, without going into details


LFS is a book about how to build a working GNU / Linux operating system from source codes. Of course, it is better to build a system for this book. But if you spend a few days of your time it is a pity, but still want to meet - I will try to tell.

Based on Linux From Scratch, Version 7.3, in English.

I wanted to build LFS to better understand the Linux device, I hope you are also interested. I admit, there was another desire - to build a reference, "vanilla" Linux. Alas, the reference Linux exists only in the imagination of naive IT people.


')
Nevertheless, according to the LFS book you can assemble a wonderful operating system, and according to BLFS (this is the next book), you can finish it up to full compliance with the Linux Standard Base. This, by the way, is reported in one of the first chapters.

The heads are mostly short and concise. The language is simple and clear. Reading this book is a pleasure.

The system is assembled by compiling from the source codes all the necessary programs - the kernel, the main C library, the compiler, the command line shell, etc. All packages with source codes are listed in the wget-list file. So download them all is very simple. Also contains the file md5sum - to check the integrity of the files after downloading.

First you need to use some other linux (you can live-cd). Using its compiler and other tools, it builds the environment necessary for the assembly (compiler, linker). The results are placed in /mnt/lfs/tools .

Then, service filesystems are mounted ( /mnt/lfs/proc -> /proc , /mnt/lfs/dev -> /dev , etc.) and using the chroot user session switches to using /mnt/lfs as the root file system your new linux. And the /tools folder is added to the $PATH environment variable. Thus, as the tools are built, they will replace their temporary counterparts from /tools .



With the help of a temporary system all the tools are reassembled, but this time they are placed in /bin , /sbin , /lib . After that, download scripts are installed from one of the downloaded packages.

Next, the system is minimally configured (network, console, devices). The file /etc/fstab (disk configuration) is created, the kernel is compiled and installed (FINALLY!), GRUB is configured, and the system is rebooted. Everything.

It is worth mentioning that some points are explained quite well in the book. For example: what are the / etc / profile, ~ / .bash_profile, ~ / .bashrc files and how they interact. Or it explains how to configure udev to ensure that two network cards always have the same names eth0, eth1. For each package there is a list of all the programs included in it with a brief description of each.

Source: https://habr.com/ru/post/183714/


All Articles