#!/bin/bash # ============================================================================ # DarkForge Linux — Phase 3, Chapter 8: coreutils # ============================================================================ # Purpose: Build coreutils with i18n support (full install, not temporary). # Provides cat, ls, cp, mv, rm, chmod, chown, etc. # Inputs: /sources/coreutils-9.10.tar.xz # /sources/coreutils-9.10-i18n-1.patch # Outputs: coreutils binaries and libraries in /usr/ # Assumes: Running inside chroot # Ref: LFS 13.0 §8.61 # ============================================================================ set -euo pipefail source /sources/toolchain-scripts/100-chroot-env.sh PACKAGE="coreutils" VERSION="9.10" echo "=== Building ${PACKAGE}-${VERSION} ===" cd /sources tar -xf "${PACKAGE}-${VERSION}.tar.xz" cd "${PACKAGE}-${VERSION}" # Apply i18n patch for internationalization support patch -Np1 -i ../coreutils-${VERSION}-i18n-1.patch # Disable the tests that are known to fail autoreconf -fiv FORCE_UNSAFE_CONFIGURE=1 ./configure \ --prefix=/usr \ --enable-no-install-program=kill,uptime make # Optional: run tests (may take time) # make check || true make install # Move programs to proper locations cd /usr/bin mv -v chroot ../sbin # mkdir -pv /usr/share/man/man8 # mv -v ../share/man/man1/chroot.1 ../share/man/man8/chroot.8 # sed -i 's/"1"/"8"/' ../share/man/man8/chroot.8 cd /sources rm -rf "${PACKAGE}-${VERSION}" echo "=== ${PACKAGE}-${VERSION} complete ==="