Why would I want to put LFS on my Pi?

While the average user might be better off running a comfortable distribution such as Raspberry Pi OS, there are a few scenarios where LFS might benefit you:

  • You're already running LFS on your desktop and want to try it on your Pi.
  • You're working on a cool hardware project and want to build a bare essentials system, where you have complete control over every piece of software.
  • You need to try out some code on a "neutral" platform, free of distribution specific patches and quirks.
  • You're a curious individual (with a lot of spare time) who would like to learn how a working GNU/Linux distribution is put together.

Where do I send my comments or ask for help?

Please contact me at [email protected]

Any comments or ideas on how to improve the site or build instructions are greatly appreciated. Also note that building LFS on the Pi is not officially supported by the Linux From Scratch project, so don't demand any help from them.

What are the Pi specific parts during the LFS build?

In "4.4. Setting Up the Environment" the LFS_TGT variable needs to be set to:

LFS_TGT=$(uname -m)-lfs-linux-gnueabihf

GCC can be patched for RPi 1, RPi 2, RPi 3 or RPi 4 to take advantage of the floating point hardware by default.

GLIBC names the dynamic linker ld-linux-armhf so we make a compatibility symlink for software that expect ld-linux.so.3:

ln -sv ld-2.38.so /lib/ld-linux.so.3

The Raspberry Pi Foundation's kernel is downloaded and optionally compiled instead of the vanilla Linux kernel.

We use the bootloader from the Foundation's firmware repo instead of GRUB.