Linux from Scratch (v7.1)

Linux Fom Scratch (LFS) is a project that details the process of building a small Linux system. While fully functional, it is intended mostly as a learning exercise.

I've been meaning to run through the build process for a long time now and recently had the opportunity to do so following the 7.1 version of the LFS manual released in March 2012.

Note: This is completely out of date now. At some point I hope to update it with a current build log.

Here are some of my notes:

Creating env and getting source packages

Create minimal build system

  • Typical unzip command in the sources dir: tar -jxf binutils-2.22.tar.bz2
  • Problems getting time to work with binutils (rough estimate 1 SBU = 5 Min)
  • When compiling gcc, no mention of applying downloaded mpfr fixes-1 patch -- I applied it.
  • If you're confused about this 'cross-compiler' thing, Wikipedia has a breakdown here: Cross Compiler
  • A couple extra patches for glibc not mentioned in dos (fixes-1 and sort-1) -- applied all patches
  • Hmm. Not liking the extra patches. On gcc second pass I applied the startfiles_fix-1 patch but skipped the mpfr fixes-1 patch since it's not mentioned.
  • Second pass on gcc fails with crti.o missing. Looks like glibc didn't compile correctly -- going back
  • Looking at config warnings on glibc looks like I don't have autoconf installed -- re-running after install
  • Crap. Now I'm stuck in a loop compiling glibc. Probably need to go back to the beginning an re-compile again.

Create minimal build system (second try)

  • wiped /tools
  • time on binutils make is 5min 30sec
  • gcc applied only patches mentioned in text
  • glibc only applied gcc_fix-1 and cpuid-1 patches
  • glibc and toolchain check seem fine
  • binutils second pass ok
  • gcc second pass ok -- trying to hand-type commands led to errors
  • completed remain tools -- all compile fine
  • changed permissions and removed debug symbols; left docs

Build LFS system

  • TODO