Linux From Scratch (LFS) – Make Your Own Operating system Ankit Chaubey, 24, June 202227, June 2022 Linux From Scratch (LFS) is a type of a Linux installation and the name of a book written by Gerard Beekmans. The book gives readers instructions on how to build a Linux system from source.TABLE OF CONTENTS1 Benefits of having a system that is truly your own.1.1 About The Author1.1.1 Ankit Chaubey1.2 RelatedBenefits of having a system that is truly your own.Gerard BeekmansLinuxfromscratchAudienceThere are many reasons why you would want to read this book. One of the questions many people raise is, “why gothrough all the hassle of manually building a Linux system from scratch when you can just download and install anexisting one?”viiiLinux From Scratch – Version 10.1One important reason for this project’s existence is to help you learn how a Linux system works from the inside out.Building an LFS system helps demonstrate what makes Linux tick, and how things work together and depend on eachother. One of the best things that this learning experience can provide is the ability to customize a Linux system tosuit your own unique needs.Another key benefit of LFS is that it allows you to have more control over the system without relying on someone else’sLinux implementation. With LFS, you are in the driver’s seat and dictate every aspect of the system.LFS allows you to create very compact Linux systems. When installing regular distributions, you are often forced toinstall a great many programs which are probably never used or understood. These programs waste resources. Youmay argue that with today’s hard drive and CPUs, such resources are no longer a consideration. Sometimes, however,you are still constrained by size considerations if nothing else. Think about bootable CDs, USB sticks, and embeddedsystems. Those are areas where LFS can be beneficial.Another advantage of a custom built Linux system is security. By compiling the entire system from source code, you areempowered to audit everything and apply all the security patches desired. It is no longer necessary to wait for somebodyelse to compile binary packages that fix a security hole. Unless you examine the patch and implement it yourself, youhave no guarantee that the new binary package was built correctly and adequately fixes the problem.The goal of Linux From Scratch is to build a complete and usable foundation-level system. If you do not wish to buildyour own Linux system from scratch, you may nevertheless benefit from the information in this book.There are too many other good reasons to build your own LFS system to list them all here. In the end, education is byfar the most powerful of reasons. As you continue in your LFS experience, you will discover the power that informationand knowledge truly bring.LFS Target ArchitecturesThe primary target architectures of LFS are the AMD/Intel x86 (32-bit) and x86_64 (64-bit) CPUs. On the other hand,the instructions in this book are also known to work, with some modifications, with the Power PC and ARM CPUs.To build a system that utilizes one of these CPUs, the main prerequisite, in addition to those on the next page, is anexisting Linux system such as an earlier LFS installation, Ubuntu, Red Hat/Fedora, SuSE, or other distribution thattargets the architecture that you have. Also note that a 32-bit distribution can be installed and used as a host systemon a 64-bit AMD/Intel computer.For building LFS, the gain of building on a 64-bit system compared to a 32-bit system is minimal. For example, in atest build of LFS-9.1 on a Core i7-4790 CPU based system, using 4 cores, the following statistics were measured:Architecture Build Time32-bit239.9 minutes64-bit233.2 minutesBuild Size3.6 GB4.4 GBAs you can see, on the same hardware, the 64-bit build is only 3% faster and is 22% larger than the 32-bit build. If youplan to use LFS as a LAMP server, or a firewall, a 32-bit CPU may be largely sufficient. On the other hand, severalpackages in BLFS now need more than 4GB of RAM to be built and/or to run, so that if you plan to use LFS as adesktop, the LFS authors recommend building on a 64-bit system.The default 64-bit build that results from LFS is considered a “pure” 64-bit system. That is, it supports 64-bit executablesonly. Building a “multi-lib” system requires compiling many applications twice, once for a 32-bit system and oncefor a 64-bit system. This is not directly supported in LFS because it would interfere with the educational objective ofproviding the instructions needed for a straightforward base Linux system. Some LFS/BLFS editors maintain a forkof LFS for multilib, which is accessible at http://www.linuxfromscratch.org/~thomas/multilib/index.html. But it is anadvanced topic.ixLinux From Scratch – Version 10.1PrerequisitesBuilding an LFS system is not a simple task. It requires a certain level of existing knowledge of Unix systemadministration in order to resolve problems and correctly execute the commands listed. In particular, as an absoluteminimum, you should already have the ability to use the command line (shell) to copy or move files and directories, listdirectory and file contents, and change the current directory. It is also expected that you have a reasonable knowledgeof using and installing Linux software.Because the LFS book assumes at least this basic level of skill, the various LFS support forums are unlikely to be ableto provide you with much assistance in these areas. You will find that your questions regarding such basic knowledgewill likely go unanswered or you will simply be referred to the LFS essential pre-reading list.Before building an LFS system, we recommend reading the following:• Software-Building-HOWTO http://www.tldp.org/HOWTO/Software-Building-HOWTO.htmlThis is a comprehensive guide to building and installing “generic” Unix software packages under Linux. Althoughit was written some time ago, it still provides a good summary of the basic techniques needed to build and installsoftware.• Beginner’s Guide to Installing from Source http://moi.vonos.net/linux/beginners-installing-from-source/This guide provides a good summary of basic skills and techniques needed to build software from source code.LFS and StandardsThe structure of LFS follows Linux standards as closely as possible. The primary standards are:• POSIX.1-2008.• Filesystem Hierarchy Standard (FHS) Version 3.0• Linux Standard Base (LSB) Version 5.0 (2015)The LSB has four separate standards: Core, Desktop, Runtime Languages, and Imaging. In addition to genericrequirements there are also architecture specific requirements. There are also two areas for trial use: Gtk3 andGraphics. LFS attempts to conform to the architectures discussed in the previous section.NoteMany people do not agree with the requirements of the LSB. The main purpose of defining it is to ensurethat proprietary software will be able to be installed and run properly on a compliant system. Since LFSis source based, the user has complete control over what packages are desired and many choose not toinstall some packages that are specified by the LSB.Creating a complete LFS system capable of passing the LSB certifications tests is possible, but not without manyadditional packages that are beyond the scope of LFS. These additional packages have installation instructions in BLFS.Packages supplied by LFS needed to satisfy the LSB RequirementsLSB Core:Bash, Bc, Binutils, Coreutils, Diffutils, File, Findutils, Gawk,Grep, Gzip, M4, Man-DB, Ncurses, Procps, Psmisc, Sed,Shadow, Tar, Util-linux, ZlibLSB Desktop:NoneLFS-BOOK-10.1DownloadAbout The Author Ankit Chaubey See author's postsRelated Linux Reveals LinuxLinux From Scratch
Hacking The Best Penetration Testing Tools for Linux 16, March 202316, March 2023Penetration Testing is the process of identifying, exploiting and mitigating vulnerabilities in wireless networks. It is an important part of network security and often requires specialized tools to be used. Linux is a great platform for wireless penetration testing as it has a wide variety of tools available for this… Read More
Hacking Binder Trace: a tool for intercepting and parsing Android Binder messages 5, June 20235, June 2023TABLE OF CONTENTS1 Binder Trace2 ⚙️ Installation3 Arguments4 ▶️ Starting binder trace5 ⌨️ Controls6 🔎 Filtering6.1 About The Author6.1.1 PrakashBinder Trace Binder Trace is a tool for intercepting and parsing Android Binder messages. Think of it as “Wireshark for Binder”. ⚙️ Installation You’ll need a rooted Android device or emulator. Arguments Argument Description -h Prints… Read More
Cyber Security The 9 Best Free and Open Source OSINT Tools 8, April 2023OSINT Tools stands for “Open Source Intelligence,” which refers to the practice of collecting and analyzing information from publicly available sources. These sources may include social media, online forums, news articles, government records, and other publicly accessible data. The goal of OSINT is to gather relevant and accurate information that… Read More