Initial commit: DarkForge Linux — Phases 0-12

Complete from-scratch Linux distribution targeting AMD Ryzen 9 9950X3D +
NVIDIA RTX 5090 on ASUS ROG CROSSHAIR X870E HERO.

Deliverables:
- dpack: custom package manager in Rust (3,800 lines)
  - TOML package parser, dependency resolver, build sandbox
  - CRUX Pkgfile and Gentoo ebuild converters
  - Shared library conflict detection
- 124 package definitions across 4 repos (core/extra/desktop/gaming)
- 34 toolchain bootstrap scripts (LFS 13.0 adapted for Zen 5)
- Linux 6.19.8 kernel config (hardware-specific, fully commented)
- SysVinit init system with rc.d service scripts
- Live ISO builder (UEFI-only, squashfs+xorriso)
- Interactive installer (GPT partitioning, EFISTUB boot)
- Integration test checklist (docs/TESTING.md)

No systemd. No bootloader. No display manager.
Kernel boots via EFISTUB → auto-login → dwl Wayland compositor.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-19 11:30:40 +01:00
commit 029642ae5b
206 changed files with 14696 additions and 0 deletions

127
toolchain/scripts/build-all.sh Executable file
View File

@@ -0,0 +1,127 @@
#!/bin/bash
# ============================================================================
# DarkForge Linux — Phase 0: Master Build Runner
# ============================================================================
# Purpose: Run all toolchain build scripts in sequence with logging.
# This is a convenience wrapper that executes each script,
# logs output, and stops on any failure.
# Inputs: LFS environment variable, all source tarballs downloaded
# Outputs: Complete cross-toolchain and temporary tools
# Assumes: Running as 'lfs' user (scripts 001-022), root for 023+
# ============================================================================
set -euo pipefail
LFS="${LFS:-/mnt/darkforge}"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
LOG_DIR="${SCRIPT_DIR}/../logs"
mkdir -p "${LOG_DIR}"
# Color output helpers
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m'
run_script() {
local script="$1"
local name
name=$(basename "${script}" .sh)
local logfile="${LOG_DIR}/${name}.log"
echo -e "${YELLOW}>>> [$(date '+%H:%M:%S')] Starting: ${name}${NC}"
if bash "${script}" 2>&1 | tee "${logfile}"; then
echo -e "${GREEN}>>> [$(date '+%H:%M:%S')] PASSED: ${name}${NC}"
echo ""
else
echo -e "${RED}>>> [$(date '+%H:%M:%S')] FAILED: ${name}${NC}"
echo "Log file: ${logfile}"
echo "Fix the issue and re-run this script to continue."
exit 1
fi
}
echo "============================================================"
echo " DarkForge Linux — Phase 0 Toolchain Bootstrap"
echo " Target: AMD Ryzen 9 9950X3D (Zen 5)"
echo " LFS: ${LFS}"
echo " Logs: ${LOG_DIR}/"
echo "============================================================"
echo ""
# --- Phase selection ---
PHASE="${1:-all}"
case "${PHASE}" in
cross|all)
echo "=== CHAPTER 5: Cross-Toolchain ==="
run_script "${SCRIPT_DIR}/001-binutils-pass1.sh"
run_script "${SCRIPT_DIR}/002-gcc-pass1.sh"
run_script "${SCRIPT_DIR}/003-linux-headers.sh"
run_script "${SCRIPT_DIR}/004-glibc.sh"
run_script "${SCRIPT_DIR}/005-libstdcxx.sh"
echo ""
;;&
temp|all)
echo "=== CHAPTER 6: Temporary Tools ==="
run_script "${SCRIPT_DIR}/006-m4.sh"
run_script "${SCRIPT_DIR}/007-ncurses.sh"
run_script "${SCRIPT_DIR}/008-bash.sh"
run_script "${SCRIPT_DIR}/009-coreutils.sh"
run_script "${SCRIPT_DIR}/010-diffutils.sh"
run_script "${SCRIPT_DIR}/011-file.sh"
run_script "${SCRIPT_DIR}/012-findutils.sh"
run_script "${SCRIPT_DIR}/013-gawk.sh"
run_script "${SCRIPT_DIR}/014-grep.sh"
run_script "${SCRIPT_DIR}/015-gzip.sh"
run_script "${SCRIPT_DIR}/016-make.sh"
run_script "${SCRIPT_DIR}/017-patch.sh"
run_script "${SCRIPT_DIR}/018-sed.sh"
run_script "${SCRIPT_DIR}/019-tar.sh"
run_script "${SCRIPT_DIR}/020-xz.sh"
run_script "${SCRIPT_DIR}/021-binutils-pass2.sh"
run_script "${SCRIPT_DIR}/022-gcc-pass2.sh"
echo ""
echo "=== Cross-compilation phases complete ==="
echo ">>> Next: Run 023-chroot-setup.sh as ROOT"
echo ">>> Then enter chroot and run 024-031 scripts"
;;&
chroot|all)
if [ "${PHASE}" = "all" ]; then
echo ""
echo "=== STOP: Chapters 5+6 are done. ==="
echo "Run the following as ROOT to continue:"
echo ""
echo " sudo bash ${SCRIPT_DIR}/023-chroot-setup.sh"
echo ""
echo "Then enter the chroot and run:"
echo " bash /sources/toolchain-scripts/024-chroot-essentials.sh"
echo " bash /sources/toolchain-scripts/025-gettext.sh"
echo " bash /sources/toolchain-scripts/026-bison.sh"
echo " bash /sources/toolchain-scripts/027-perl.sh"
echo " bash /sources/toolchain-scripts/028-python.sh"
echo " bash /sources/toolchain-scripts/029-texinfo.sh"
echo " bash /sources/toolchain-scripts/030-util-linux.sh"
echo " bash /sources/toolchain-scripts/031-cleanup.sh"
fi
;;
*)
echo "Usage: $0 [cross|temp|chroot|all]"
echo ""
echo " cross - Run Chapter 5 (cross-toolchain) only"
echo " temp - Run Chapter 6 (temporary tools) only"
echo " chroot - Show Chapter 7 (chroot) instructions"
echo " all - Run everything (default)"
exit 0
;;
esac
echo ""
echo "============================================================"
echo " Build complete. Check logs in: ${LOG_DIR}/"
echo "============================================================"