How To create a linux system from scratch
2018-07-07
Introduction
I wanted to build a linux OS from scratch to know every package required to run the system. I followed the lfs.org book titled "Linux From Scratch Version 8.2". I completed this in my spare time over ther duration of about 60 hours. It took three attempts to get the system fully functional. Majority of errors stem from small typos buried in the thousand + lines of commands required to build the system.
The book's instructions worked very well. The level of detail is mind numbing and I was only able to get all packages to work by checking the test output to the build log Linuxfromscratch.
The installation of the packages was well done and could be completed on the first try if one proceeds with care and always checks the make test to the build log. However, Chapter 7 and 8 are difficult to complete without more indepth knowledge. Most of the issue was just setting up all the text files correctly. For example, the US keyboard requires "LANG=en_US.ISO-8859-1" but this was not explained. Also, had issues with fstab and inittab configuration files. For example, config file /etc/sysconfig may work as written (refer to page 235), or not as in my case. My ethernet device failed to read. It took several hours to figure out it was because my hardware required the alx driver to be set in the linux kernel. However, the driver option in the linux kernel menu was "Qualcom Atheros AR816x/AR817x support". It would have been nice if the book could have warned about errors due to missing linux drivers. I found adding multiple linux kernels to grub to be a handy way to debug and try different settings. Hint, to find your ethernet card use "dmesg | grep -i ethernet".
Other useful commands for debugging used are modinfo, modprobe, lsmod, ip link, ls /sys/class/net.Design credit knxops.com in cooperation with Ltimas and co.
Copyright © 2019 by Gregory Altimas aka Greg Altimas