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:
73
toolchain/scripts/024-chroot-essentials.sh
Executable file
73
toolchain/scripts/024-chroot-essentials.sh
Executable file
@@ -0,0 +1,73 @@
|
||||
#!/bin/bash
|
||||
# ============================================================================
|
||||
# DarkForge Linux — Phase 0, Chapter 7: Create Essential Files and Symlinks
|
||||
# ============================================================================
|
||||
# Purpose: Create the essential system files (/etc/passwd, /etc/group,
|
||||
# log files) and symlinks that programs expect to exist.
|
||||
# This script runs INSIDE the chroot environment.
|
||||
# Inputs: None (creates files from scratch)
|
||||
# Outputs: /etc/passwd, /etc/group, log files, essential symlinks
|
||||
# Assumes: Running inside chroot (script 023 completed)
|
||||
# Ref: LFS 13.0 §7.6
|
||||
# ============================================================================
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
echo "=== DarkForge: Creating essential files and symlinks ==="
|
||||
|
||||
# --- Create essential symlinks ------------------------------------------------
|
||||
# Some programs hardcode paths to /bin/sh, /bin/cat, etc.
|
||||
# With the unified /usr layout, these are already correct via symlinks
|
||||
# created in 000-env-setup.sh, but verify:
|
||||
[ -L /bin ] || { echo "ERROR: /bin should be a symlink to usr/bin"; exit 1; }
|
||||
[ -L /lib ] || { echo "ERROR: /lib should be a symlink to usr/lib"; exit 1; }
|
||||
[ -L /sbin ] || { echo "ERROR: /sbin should be a symlink to usr/sbin"; exit 1; }
|
||||
|
||||
# --- Create /etc/passwd -------------------------------------------------------
|
||||
cat > /etc/passwd << "EOF"
|
||||
root:x:0:0:root:/root:/bin/bash
|
||||
bin:x:1:1:bin:/dev/null:/usr/bin/false
|
||||
daemon:x:6:6:Daemon User:/dev/null:/usr/bin/false
|
||||
messagebus:x:18:18:D-Bus Message Daemon User:/run/dbus:/usr/bin/false
|
||||
uuidd:x:80:80:UUID Generation Daemon User:/dev/null:/usr/bin/false
|
||||
nobody:x:65534:65534:Unprivileged User:/dev/null:/usr/bin/false
|
||||
EOF
|
||||
|
||||
# --- Create /etc/group --------------------------------------------------------
|
||||
cat > /etc/group << "EOF"
|
||||
root:x:0:
|
||||
bin:x:1:daemon
|
||||
sys:x:2:
|
||||
kmem:x:3:
|
||||
tape:x:4:
|
||||
tty:x:5:
|
||||
daemon:x:6:
|
||||
floppy:x:7:
|
||||
disk:x:8:
|
||||
lp:x:9:
|
||||
dialout:x:10:
|
||||
audio:x:11:
|
||||
video:x:12:
|
||||
utmp:x:13:
|
||||
cdrom:x:15:
|
||||
adm:x:16:
|
||||
messagebus:x:18:
|
||||
input:x:24:
|
||||
mail:x:34:
|
||||
kvm:x:61:
|
||||
uuidd:x:80:
|
||||
wheel:x:97:
|
||||
users:x:999:
|
||||
nogroup:x:65534:
|
||||
EOF
|
||||
|
||||
# --- Create log files ---------------------------------------------------------
|
||||
# These must exist for certain programs to function correctly
|
||||
install -o root -g utmp -m 664 /dev/null /var/log/lastlog
|
||||
install -o root -g root -m 600 /dev/null /var/log/btmp
|
||||
install -o root -g root -m 664 /dev/null /var/log/faillog
|
||||
install -o root -g utmp -m 664 /dev/null /var/log/wtmp
|
||||
|
||||
echo "=== Essential files and symlinks created ==="
|
||||
echo ""
|
||||
echo "Next: Run the chroot build scripts (025-xxx) to build additional tools."
|
||||
Reference in New Issue
Block a user