Fathom-OS Build Series: Chapter 2.2 - Host System Requirements

Part of the Fathom-OS Project Log.


Before you touch a single source package, LFS needs your host machine to be in a specific state. Chapter 2.2 covers hardware minimums, software version requirements, and the version-check.sh script that confirms everything is ready. This post walks through what the page requires, what I ran, what came back, and the one fix I had to make.

Reference: LFS 13.0-systemd - 2.2 Host System Requirements


The Build Host

A dedicated virtual machine is running on a Proxmox homelab cluster.

Property Value
VM Name fathomos-dev
CPU 10 vCPUs
RAM 32 GB
LFS Disk 245 GB dedicated partition
Host OS Ubuntu Server 24.04 LTS


Hardware Requirements

The LFS book recommends at minimum a four-core CPU and 8 GB of RAM. You can build on less, but expect significantly longer compile times. The build host is running well past those numbers, so this was a non-issue.


Software Requirements

The page lists the minimum version for every tool the build depends on. A few things the book specifically calls out that are worth paying attention to:

Bash requires that /bin/sh be a symbolic or hard link to bash, not just that bash is installed. This is the one that caught me, and I will cover it below.

Bison requires that /usr/bin/yacc point to bison or a small wrapper that calls bison.

Gawk requires that /usr/bin/awk point to gawk.

GCC must include the C++ compiler (g++), and the C and C++ standard libraries with headers must be present. Versions above 15.2.0 are not tested, but that is not a concern on a current Ubuntu install.

Linux Kernel must be 5.4 or newer. The reason is that glibc is compiled in Chapters 5 and 8 targeting that kernel version, and the kernel also needs to have UNIX 98 PTY support enabled (CONFIG_UNIX98_PTYS=y). Any modern distribution kernel will have this.

The book is clear that symlinks pointing to other tools like dash or mawk may work, but they are not tested or supported by the LFS team. Stick to what the book requires.


Running the Version Check

The LFS page provides a version-check.sh script. Copy it from the page, save it, and run it. I keep mine in the scripts directory under the fathom-os project:

cd ~/fathom-os/scripts
bash version-check.sh

My Results

All packages passed except one. The sh alias check failed because /bin/sh was pointing to dash instead of bash.

OK:    Coreutils 9.4    >= 8.1
OK:    Bash      5.2.21 >= 3.2
OK:    Binutils  2.42   >= 2.13.1
OK:    Bison     3.8.2  >= 2.7
OK:    Diffutils 3.10   >= 2.8.1
OK:    Findutils 4.9.0  >= 4.2.31
OK:    Gawk      5.2.1  >= 4.0.1
OK:    GCC       13.3.0 >= 5.4
OK:    GCC (C++) 13.3.0 >= 5.4
OK:    Grep      3.11   >= 2.5.1a
OK:    Gzip      1.12   >= 1.3.12
OK:    M4        1.4.19 >= 1.4.10
OK:    Make      4.3    >= 4.0
OK:    Patch     2.7.6  >= 2.5.4
OK:    Perl      5.38.2 >= 5.8.8
OK:    Python    3.12.3 >= 3.4
OK:    Sed       4.9    >= 4.1.5
OK:    Tar       1.35   >= 1.22
OK:    Texinfo   7.1    >= 5.0
OK:    Xz        5.4.5  >= 5.0.0
OK:    Linux Kernel 6.8.0 >= 5.4
OK:    Linux Kernel supports UNIX 98 PTY
Aliases:
OK:    awk  is GNU
OK:    yacc is Bison
ERROR: sh   is NOT Bash
Compiler check:
OK:    g++ works
OK: nproc reports 10 logical cores are available

The Error: sh is NOT Bash

This is a common one on Ubuntu and Debian systems. By default, /bin/sh points to dash, not bash. Dash is a lightweight POSIX shell that Ubuntu uses for performance reasons. LFS specifically needs /bin/sh to be bash during the build.

Confirmed with:

ls -la /bin/sh

Output:

lrwxrwxrwx 1 root root 4 Mar 31  2024 /bin/sh -> dash

The Fix

The typical way to change this on Debian-based systems is through dpkg-reconfigure:

sudo DEBIAN_FRONTEND=dialog dpkg-reconfigure dash

When prompted, answer No to the question about installing dash as /bin/sh. In my case the command ran silently without prompting, so the symlink did not change. If that happens to you, just do it manually:

sudo ln -sf bash /bin/sh

Verify it:

ls -la /bin/sh

You should see:

lrwxrwxrwx 1 root root 4 Jun  9 01:47 /bin/sh -> bash

Verification

Re-run the version check:

bash version-check.sh

The ERROR line should now show:

OK:    sh   is Bash

Once you have a clean run with no errors, the host system is ready to move on to Chapter 2 partitioning.


A Note for After the Build

This change affects the host system only, not the LFS target. Once the build is done, you can switch /bin/sh back to dash:

sudo dpkg-reconfigure dash

Answer Yes that time. For the duration of the LFS build, leave it pointing to bash.


More updates to follow as each build phase completes.

Next: Chapter 2.4 and 2.5: Partition and Filesystem Setup


All session notes and build logs are committed to the private repository at github.com/QuietWireDev/fathom-os.