#!/bin/bash # ============================================================================ # DarkForge Linux — Phase 0, Chapter 6: Bash # ============================================================================ # Purpose: Cross-compile Bash for the temporary tools. This gives us a # working shell inside the chroot environment. # Inputs: ${LFS}/sources/bash-5.3.tar.gz # Outputs: bash binary in ${LFS}/usr/bin/ # Assumes: Cross-toolchain + ncurses complete # Ref: LFS 13.0 §6.4 # ============================================================================ set -euo pipefail source "${LFS}/sources/darkforge-env.sh" PACKAGE="bash" VERSION="5.3" SRCDIR="${LFS}/sources" echo "=== Building ${PACKAGE}-${VERSION} (Temporary Tool) ===" cd "${SRCDIR}" tar -xf "${PACKAGE}-${VERSION}.tar.gz" cd "${PACKAGE}-${VERSION}" ./configure \ --prefix=/usr \ --build="$(sh support/config.guess)" \ --host="${LFS_TGT}" \ --without-bash-malloc \ bash_cv_strtold_broken=no make make DESTDIR="${LFS}" install # Create /bin/sh symlink pointing to bash ln -sfv bash "${LFS}/usr/bin/sh" cd "${SRCDIR}" rm -rf "${PACKAGE}-${VERSION}" echo "=== ${PACKAGE}-${VERSION} complete ==="