Linux from Scratch (LFS) – My Experience

I am writing this post to share my experience in building a Linux system using “Linux from Scratch” project.  I have only tried to build the base system using “LFS – Linux from Scratch” and postponed the further work for some other time.

Linux from Scratch project teaches you how a Linux system is built, installs in any distribution. This helps in understanding the skeleton of a Linux system. Some of the things that one can learn are how Linux system follows File Hierarchal Standard, which packages do you need to build a Linux system and so on.

My Approach

There are two slightly different methods in LFS: one based on ‘sysvinit’ and another based on ‘systemd’. These differ in how they handle services in Linux systems. For further details, visit Linux From Scratch: Systemd or Sysvinit?
I have used the ‘sysvinit’ format. One can follow the documentation given at  LFS Read Online to try LFS. I have used Ubuntu 16.04 64bit Live CD with a Virtual Disk of 40 GB storage in Virtual Box. It is recommended to have at least of 15GB space for the project. The virtual disk was divided into two partitions. One for ‘boot’ with a size of 150MB and rest size of the virtual disk provided to the ‘root’ partition. Following the documentation, I finished the project after a strenuous 48 hours facing a couple of issues during the process.

Problems Faced

One of the immediate problems, one can face is the absence of ‘makeinfo’ command. It can be rectified by installing ‘texinfo’ or ‘texinfo-doc-non-free’. If the problem persists, check the environment variable of $PATH and add the location of ‘makeinfo’ binary to the variable. While building the base system, while testing using test suites, a lot of errors are shown. Some can be ignored and those are mentioned in the documentation itself. At last, do check twice your partitions references while editing the configuration of the GRUB boot loader. And finally, choose a proper network interface as defined in the system while configuring networking in the system.

Resources

LFS – Linux from Scratch

Linux from Scratch by Anton – Youtube

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *