I Built Linux From Scratch in a Weekend (And All I Got Was a Shell Prompt)
I spent a weekend building a Linux system from absolute zero — compiling every package by hand, one at a time. Here's what a game programmer learned about operating systems by doing the most tedious thing possible.
I stared at a blinking cursor on a black screen. No desktop. No package manager. No welcome message. Just a shell prompt on a system I’d built entirely by hand, one package at a time, over an entire weekend.
It was the most satisfying nothing I’ve ever seen.
Why a Game Dev Built Linux
I use Linux. I make games. I’ve spent years writing C# in Unity, debugging multiplayer netcode, and optimizing memory allocations. But I had no real idea what happens between pressing the power button and getting a terminal.
I knew the words — kernel, bootloader, init system — but they were abstractions. Black boxes I never opened. One day, pure curiosity got the better of me. I found the Linux From Scratch book and thought: how hard can it be?
The answer is: not hard, exactly. Just relentless.
What Linux From Scratch Actually Is
For those who haven’t heard of it, Linux From Scratch (LFS) is a book — freely available online — that walks you through building a complete Linux system from source code. No installer. No precompiled binaries. You download the raw source for every single package and compile them yourself.
It’s not a distro. It’s more like a recipe book for making your own. The philosophy is simple: the best way to understand something is to build it yourself, piece by piece.
The book is genuinely excellent. It’s well-written, well-maintained, and treats you like an adult. It tells you what to do, explains why, and moves on. No hand-holding, but no gatekeeping either.
Death by a Thousand Packages
The process starts innocently enough. You set up a partition, create a directory structure, and download a list of source tarballs. Then you start compiling.
And compiling. And compiling.
The first big challenge is the cross-compilation toolchain. You need a compiler to compile things — but you’re building a system that doesn’t have a compiler yet. So you use your host system’s compiler to build a temporary compiler, then use that temporary compiler to build the real compiler. GCC building GCC. It’s compilers all the way down.
After the toolchain, you enter the main build phase. This is where the scale of a “simple” operating system hits you. You’re not just building the kernel and a shell. You’re building:
- Glibc — the C library that basically everything depends on
- Coreutils —
ls,cp,mv, and the other commands you take for granted - Bash — your shell
- Grep, sed, awk, find — text processing tools
- Systemd or SysVinit — to actually boot the thing
- And dozens more — m4, bison, flex, gettext, ncurses, readline, zlib…
Each one has the same rhythm: extract, configure, make, make install. Over and over. Some take seconds. Some take minutes. A few take long enough that you go make coffee.
It’s manual, repetitive, and strangely meditative.
What I Didn’t Understand (And That’s Fine)
I’ll be honest: I didn’t fully understand every package I compiled. I know what GCC does. I know what Bash does. But bison? M4? Autoconf? I had a vague sense — parser generators, macro processors, build system tools — but I couldn’t explain them deeply.
And that’s okay. The LFS book doesn’t pretend you need to master every component. It acknowledges that some of these packages exist to support the build process of other packages. They’re the scaffolding, not the building.
What matters is the big picture. You start to see the dependency chain. You realize that the tools you use every day are built on layers and layers of other tools, each one maintained by people you’ll never meet. A Linux system isn’t one thing. It’s hundreds of things that happen to work together.
As a game programmer, this felt familiar. A game engine is the same kind of layered beast — rendering on top of graphics APIs on top of drivers on top of hardware abstractions. LFS just showed me the same pattern at the OS level.
The Moment It Booted
After a weekend of copying commands, watching compiler output scroll by, and occasionally re-reading paragraphs to make sure I didn’t skip a step, I configured GRUB, set up the kernel, and rebooted.
It worked.
A login prompt appeared. I typed root, hit enter, and there it was. A shell. My shell, on my system, built from nothing.
It couldn’t do much. No networking. No graphical interface. No package manager to install anything with. Just a bare system that could run basic commands and… exist.
But I’d built it. Every binary on that system had passed through my terminal. Every library had been compiled on my machine. There was no magic, no mystery — just source code, a compiler, and patience.
It was nothing. And it was everything.
What I Actually Learned
A weekend isn’t enough to become a Linux expert. But it was enough to demystify things I’d been cargo-culting for years.
What distros actually do for you. Ubuntu, Fedora, Arch — they’re not just “Linux with a different theme.” They handle an insane amount of work: dependency resolution, pre-compiled packages, hardware detection, sane defaults, security patches. After building LFS, I’ll never take apt install for granted again.
How compilers bootstrap. The chicken-and-egg problem of needing a compiler to build a compiler is one of those things that sounds like a riddle until you actually do it. Cross-compilation and multi-pass builds suddenly make sense.
How little it takes to “run Linux.” The kernel, a C library, a shell, and a handful of utilities. That’s it. You can boot a system with surprisingly little.
How much it takes to make Linux usable. That minimal system is basically useless for real work. The distance between “it boots” and “I can browse the web” is enormous. Every convenience you enjoy was built by someone.
Should You Do It?
If you’re a programmer and you’ve ever been curious about what’s under the hood of your OS — yes. Do it. Set aside a weekend, open the LFS book, and start compiling.
You don’t need to be a systems programmer. You don’t need prior Linux experience beyond basic terminal usage. You just need patience and the willingness to type ./configure && make && make install about a hundred times.
The LFS book is one of the best pieces of technical documentation I’ve read. It’s free, it’s thorough, and it respects your time. I can’t recommend it enough.
You probably won’t use your LFS system for anything after you build it. That’s not the point. The point is that the next time you see a blinking cursor, you’ll know exactly what it took to get there.