Linux From Scratch (LFS) is a hands-on project focused on building a complete Linux system directly from source code.
Instead of installing a prebuilt distribution, this project follows the Linux From Scratch book to construct the system step by step — from the initial toolchain to a functional Linux environment.
The main objective is to understand how Linux distributions are assembled, how their core components interact, and how a minimal Linux system operates internally.
- Build a Linux system entirely from source.
- Understand cross-compilation and toolchain construction.
- Explore the GNU toolchain and core system utilities.
- Understand the Linux filesystem hierarchy.
- Study system libraries, linking, and dynamic loading.
- Configure the kernel and system boot process.
- Understand system initialization with systemd.
- Document build procedures, test results, and troubleshooting.
| Component | Configuration |
|---|---|
| Host OS | Fedora 43 Workstation |
| Virtualization | KVM / QEMU |
| Architecture | x86_64 |
| Target Triplet | x86_64-lfs-linux-gnu |
| Build Method | Cross-compilation and native compilation |
| Build System | LFS with systemd |
| Build Directory | /mnt/lfs |
| Build User | lfs |
The project follows the structure of the official LFS book.
| Stage | Description |
|---|---|
| Preparation | Host environment and build prerequisites |
| Temporary Toolchain | Cross-compiler and temporary system tools |
| Chroot Environment | Entering the isolated LFS build environment |
| Base System | Building essential system packages |
| System Configuration | Configuring users, filesystems, and system services |
| Kernel | Linux kernel configuration and compilation |
| Bootloader | Preparing the bootable system |
| Component | Technologies |
|---|---|
| GNU Toolchain | GCC, Binutils, GNU Make |
| C Library | glibc |
| Shell | Bash |
| Core Utilities | Coreutils, Findutils, Grep, Sed, Gawk |
| System Libraries | Readline, Libcap |
| Build Tools | Make, Bison, M4, Flex |
| System Initialization | systemd |
| Kernel | Linux |
- Cross-compilation and toolchain construction
- Compilation from source code
- Shared libraries and dynamic linking
- Filesystem hierarchy and system configuration
- Package testing and troubleshooting
- Linux kernel and system initialization
This repository documents the actual build process, including:
- Build commands and configuration details.
- Package versions and dependencies.
- Test-suite results and failures.
- Compilation and linking issues.
- Root-cause analysis and applied fixes.
- Important configuration files and system changes.
The goal is not only to record successful builds, but also to understand why failures happen and how they are resolved.
In Progress
The base system construction is underway.
Current work includes building and validating essential system components, running package test suites, and resolving build-related issues.
Progress is documented incrementally as the project develops.
Source Code
|
v
Build Toolchain
|
v
Compile Packages
|
v
Test & Validate
|
v
Configure System
|
v
Bootable Linux
Every component is built and examined to understand its role in the operating system.
Build · Inspect · Test · Understand
Building Linux to understand Linux.
Daemon-linux | Linux From Scratch Project