Files
darkforge/toolchain/scripts/175-util-linux.sh
2026-03-20 15:09:30 +01:00

45 lines
1.3 KiB
Bash
Executable File

#!/bin/bash
# ============================================================================
# DarkForge Linux — Phase 3, Chapter 8: util-linux (Full Build)
# ============================================================================
# Purpose: Build util-linux with full feature set.
# This is the FULL build after temporary build in chapter 7.
# Provides: mount, fdisk, lsblk, findfs, chfn, chsh, login, etc.
# Inputs: /sources/util-linux-2.40.4.tar.xz
# Outputs: util-linux utilities and libraries in /usr/
# Assumes: Running inside chroot
# Ref: LFS 13.0 §8.81
# ============================================================================
set -euo pipefail
source /sources/toolchain-scripts/100-chroot-env.sh
PACKAGE="util-linux"
VERSION="2.40.4"
echo "=== Building ${PACKAGE}-${VERSION} (Full) ==="
cd /sources
tar -xf "${PACKAGE}-${VERSION}.tar.xz"
cd "${PACKAGE}-${VERSION}"
# Create the adjtime file location (used by hwclock)
mkdir -pv /var/lib/hwclock
# Full build with all features (unlike temp build in chapter 7)
# --disable-lsfd: fixes conflict with glibc 2.43 bsearch macro
./configure \
--libdir=/usr/lib \
--runstatedir=/run \
--disable-lsfd
make
# Optional: run tests
# make check || true
make install
cd /sources
rm -rf "${PACKAGE}-${VERSION}"
echo "=== ${PACKAGE}-${VERSION} complete ==="