53 lines
1.5 KiB
Bash
Executable File
53 lines
1.5 KiB
Bash
Executable File
#!/bin/bash
|
|
# ============================================================================
|
|
# DarkForge Linux — Phase 0, Chapter 7: Util-linux (Chroot)
|
|
# ============================================================================
|
|
# Purpose: Build util-linux (essential system utilities: mount, fdisk,
|
|
# lsblk, etc.). Minimal build for bootstrapping — the full build
|
|
# happens in Phase 3.
|
|
# Inputs: /sources/util-linux-2.40.4.tar.xz
|
|
# Outputs: util-linux programs and libraries in /usr/
|
|
# Assumes: Running inside chroot
|
|
# Ref: LFS 13.0 §7.12
|
|
# ============================================================================
|
|
|
|
set -euo pipefail
|
|
|
|
PACKAGE="util-linux"
|
|
VERSION="2.40.4"
|
|
|
|
echo "=== Building ${PACKAGE}-${VERSION} (Chroot) ==="
|
|
|
|
cd /sources
|
|
tar -xf "${PACKAGE}-${VERSION}.tar.xz"
|
|
cd "${PACKAGE}-${VERSION}"
|
|
|
|
# Create the adjtime file location
|
|
mkdir -pv /var/lib/hwclock
|
|
|
|
# --disable-lsfd: lsfd.c has a bsearch macro conflict with glibc 2.43
|
|
# (passes 6 args to a 5-arg macro). Not needed for temp tools.
|
|
./configure \
|
|
--libdir=/usr/lib \
|
|
--runstatedir=/run \
|
|
--disable-chfn-chsh \
|
|
--disable-login \
|
|
--disable-nologin \
|
|
--disable-su \
|
|
--disable-setpriv \
|
|
--disable-runuser \
|
|
--disable-pylibmount \
|
|
--disable-static \
|
|
--disable-liblastlog2 \
|
|
--disable-lsfd \
|
|
--without-python \
|
|
ADJTIME_PATH=/var/lib/hwclock/adjtime \
|
|
--docdir=/usr/share/doc/util-linux-${VERSION}
|
|
|
|
make
|
|
make install
|
|
|
|
cd /sources
|
|
rm -rf "${PACKAGE}-${VERSION}"
|
|
echo "=== ${PACKAGE}-${VERSION} complete ==="
|