Part of the Fathom-OS Project Log.
This is Part 6 of Chapter 8, the core system build. Part 5 finished the build tooling and Perl. This part builds the run of supporting packages that lead up to Python, XML::Parser and Intltool for internationalization, Autoconf and Automake for the build system, OpenSSL for cryptography, then the libraries Python needs, Libelf, Libffi, and Sqlite, closing with the final permanent Python. Nine packages, ending on Python.
References:
Resuming the Build
Every Chapter 8 session starts the same way, since the snapshot is taken outside the chroot with the virtual filesystems unmounted. Become root on the host, confirm $LFS, check the mount state, remount, and re-enter the chroot. This session it all went clean.
sudo -i
echo $LFS
findmnt | grep /lfs
$LFS came back /lfs and findmnt showed only the /lfs root partition. The remount block and chroot entry then ran first try:
mount -v --bind /dev $LFS/dev
mount -vt devpts devpts -o gid=5,mode=0620 $LFS/dev/pts
mount -vt proc proc $LFS/proc
mount -vt sysfs sysfs $LFS/sys
mount -vt tmpfs tmpfs $LFS/run
if [ -h $LFS/dev/shm ]; then
install -v -d -m 1777 $LFS$(realpath /dev/shm)
else
mount -vt tmpfs -o nosuid,nodev tmpfs $LFS/dev/shm
fi
chroot "$LFS" /usr/bin/env -i \
HOME=/root TERM="$TERM" \
PS1='(lfs chroot) \u:\w\$ ' \
PATH=/usr/bin:/usr/sbin \
MAKEFLAGS="-j$(nproc)" \
TESTSUITEFLAGS="-j$(nproc)" \
/bin/bash --login
The standing reminder still holds: use sudo -i, not su -, since the Ubuntu host keeps the root account locked.
The Internationalization Tools
Two packages for extracting and handling translatable strings, both needed by later parts of the build.
8.45 XML::Parser
A Perl module that interfaces with the Expat library built in Part 5. Perl modules build differently from the autotools packages, using perl Makefile.PL in place of configure.
perl Makefile.PL
make
make test
make install
Result: all tests successful, Files=15, Tests=140. The “Couldn’t load LWP based external entity handler” messages during the test are expected. LWP is an optional network module the book does not install, so the tests fall back to the file based handler and pass.
8.46 Intltool
An internationalization tool for pulling translatable strings out of source files. Note the version here is 0.51.0, which is much older than the packages around it, but it is the version the 13.0 book specifies. A sed first fixes a warning caused by perl 5.22 and later.
sed -i 's:\\\${:\\\$\\{:' intltool-update.in
./configure --prefix=/usr
make
make check
make install
install -v -Dm644 doc/I18N-HOWTO /usr/share/doc/intltool-0.51.0/I18N-HOWTO
Result: 1 test, passing. Configure confirmed it found perl 5.42.0 and the XML::Parser module just built.
The Build System
Autoconf and Automake generate the configure scripts and Makefiles that most source packages rely on.
8.47 Autoconf
Produces the shell scripts that automatically configure source code. Plain build.
./configure --prefix=/usr
make
make check
make install
Result: 549 tests behaved as expected, 60 skipped. The skips are the tests that need Automake, which is not installed yet. The book notes those can be covered later by re-testing Autoconf after Automake is in. The “experimental version of Autoconf” notice printed during configure is standard boilerplate, not a warning about the build.
8.48 Automake
Generates Makefiles for use with Autoconf. The test suite forces parallel jobs because individual tests have internal delays.
./configure --prefix=/usr --docdir=/usr/share/doc/automake-1.18.1
make
make -j$(nproc) check
make install
Result: TOTAL 2960, PASS 2761, SKIP 160, XFAIL 39, no failures. The XFAIL entries are expected failures by design and the skips are environment dependent, mostly the Fortran tests since LFS installs no Fortran compiler.
8.49 OpenSSL
Management tools and libraries for cryptography, used by OpenSSH, mail clients, and web browsers for HTTPS. This package uses its own ./config script rather than the usual configure.
./config --prefix=/usr \
--openssldir=/etc/ssl \
--libdir=lib \
shared \
zlib-dynamic
make
HARNESS_JOBS=$(nproc) make test
The HARNESS_JOBS=$(nproc) sets how many test files OpenSSL’s test harness runs in parallel, which cuts the run time on a multi core machine. Result: all tests successful, Files=350, Tests=4541, Result: PASS. The afalg test that can fail on hosts missing certain kernel crypto options passed here, and the only skipped tests were external and fips tests that were not configured.
The install strips the static libraries first, then installs with an ssl man page suffix so its pages do not collide with other packages:
sed -i '/INSTALL_LIBS/s/libcrypto.a libssl.a//' Makefile
make MANSUFFIX=ssl install
mv -v /usr/share/doc/openssl /usr/share/doc/openssl-3.6.1
cp -vfr doc/* /usr/share/doc/openssl-3.6.1
The Python Prerequisites
Three libraries Python links against, built in order before Python itself.
8.50 Libelf (from Elfutils)
Only the libelf portion of the larger elfutils package is built here. There is no test run: the page notes the test suite fails to build with glibc 2.43 and newer, so the book compiles and installs the libelf pieces only.
./configure --prefix=/usr --disable-debuginfod --enable-libdebuginfod=dummy
make -C lib
make -C libelf
make -C libelf install
install -vm644 config/libelf.pc /usr/lib/pkgconfig
rm /usr/lib/libelf.a
The -C flags scope the build to only the lib and libelf directories, leaving the rest of elfutils untouched.
8.51 Libffi
The Foreign Function Interface library, a bridge that lets code in one language call code written in another. Python, Perl, and others use it.
./configure --prefix=/usr --disable-static --with-gcc-arch=native
make
make check
make install
Result: 2460 expected passes, no failures. The --with-gcc-arch=native flag optimizes for this exact CPU. That is correct here because the build stays on this hardware. Copying a native build to a different, less capable machine would cause illegal operation errors, so that flag is a deliberate choice, not a default.
8.52 Sqlite
A self contained, serverless SQL database engine that Python needs. This package uses two source archives, the main source plus a separate documentation archive that unpacks from inside the source directory. It has no test suite.
tar -xf ../sqlite-doc-3510200.tar.xz
./configure --prefix=/usr \
--disable-static \
--enable-fts{4,5} \
CPPFLAGS="-D SQLITE_ENABLE_COLUMN_METADATA=1 \
-D SQLITE_ENABLE_UNLOCK_NOTIFY=1 \
-D SQLITE_ENABLE_DBSTAT_VTAB=1 \
-D SQLITE_SECURE_DELETE=1"
make LDFLAGS.rpath=""
make install
install -v -m755 -d /usr/share/doc/sqlite-3.51.2
cp -v -R sqlite-doc-3510200/* /usr/share/doc/sqlite-3.51.2
The LDFLAGS.rpath="" stops the build from hard coding library search paths into the shared library, which is not needed for a standard install location.
8.53 Python
The Python 3 development environment, and the closing package for this part. Built with the shared library, linked against the system Expat, and with optimizations that build the interpreter twice for a faster final version.
./configure --prefix=/usr \
--enable-shared \
--with-system-expat \
--enable-optimizations \
--without-static-libpython
make
The compile checks 114 modules. One shows as missing, _tkinter, because Tk is not installed in LFS. That only affects the idle3 GUI editor and is expected.
The Test Suite and the Network Failures
This is the part worth reading closely, because the test result looks alarming and is not. The book sets a 2 minute per test timeout since some tests can hang:
make test TESTOPTS="--timeout 120"
The run ends in a red result: Tests result: FAILURE then FAILURE, and make exits with an error. Two tests failed, and failed again on rerun: test_urllib2 and test_urllibnet.
Both are network tests. urllib is Python’s URL and HTTP library, and the “net” group opens real internet connections. The LFS chroot has no network or DNS configured yet, that comes after the system is booted, so any test that reaches for the internet cannot connect and fails. This is an environment limitation, not a defect in the Python build. The numbers confirm it: 47,304 tests ran and exactly 2 failed, both network tests. Everything else passed or skipped for known reasons. A genuinely broken Python would fail across core functionality, not on two network tests alone. Once the system is booted with networking up, these two pass.
Install, then write the pip config that quiets the root user and version check warnings, which are harmless in the chroot:
make install
cat > /etc/pip.conf << EOF
[global]
root-user-action = ignore
disable-pip-version-check = true
EOF
The pip warning about running as root is expected. LFS has no system package manager for pip to conflict with, so it is safe.
Snapshot
With Python done, the prerequisites for the rest of the chapter are all in place. Exit the chroot, unmount the virtual filesystems one at a time with children before parents, verify clean with findmnt, then snapshot.
exit
umount $LFS/dev/shm
umount $LFS/dev/pts
umount $LFS/{sys,proc,run,dev}
findmnt | grep /lfs
Only the /lfs root partition remained. Snapshot taken.
What Is Next
Part 7 continues the run of Python build system packages, Flit-Core, Wheel, Setuptools, Ninja, and Meson, then moves into Kmod and the start of the core system utilities. That run is large, so it will span more than one post as the earlier parts did.
More updates to follow as each build phase completes.
Previous: Chapter 8 Part 5: Build Tools and Perl | Next: Chapter 8 Part 7 (coming soon)
All session notes and build logs are committed to the private repository at github.com/QuietWireDev/fathom-os.



