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:
198
src/dpack/README.md
Normal file
198
src/dpack/README.md
Normal file
@@ -0,0 +1,198 @@
|
||||
# dpack — DarkForge Package Manager
|
||||
|
||||
A source-based package manager for DarkForge Linux, positioned between CRUX's `pkgutils` and Gentoo's `emerge` in complexity. Written in Rust.
|
||||
|
||||
## Features
|
||||
|
||||
- **TOML package definitions** — clean, readable package recipes
|
||||
- **Dependency resolution** — topological sort with circular dependency detection
|
||||
- **Build sandboxing** — bubblewrap (bwrap) isolation with PID/network namespaces
|
||||
- **Installed package database** — file-based TOML tracking in `/var/lib/dpack/db/`
|
||||
- **Full build orchestration** — download → checksum → extract → sandbox build → stage → commit → register
|
||||
- **CRUX Pkgfile converter** — convert CRUX ports to dpack format
|
||||
- **Gentoo ebuild converter** — best-effort conversion of Gentoo ebuilds (handles ~80% of cases)
|
||||
- **Shared library conflict detection** — ELF binary scanning via readelf/objdump
|
||||
- **Reverse dependency tracking** — warns before removing packages that others depend on
|
||||
|
||||
## Requirements
|
||||
|
||||
- Rust 1.75+ (build)
|
||||
- Linux (runtime — uses Linux namespaces for sandboxing)
|
||||
- bubblewrap (`bwrap`) for sandboxed builds (optional, falls back to direct execution)
|
||||
- `curl` or `wget` for source downloads
|
||||
- `tar` for source extraction
|
||||
- `readelf` or `objdump` for shared library scanning
|
||||
|
||||
## Building
|
||||
|
||||
```bash
|
||||
cd src/dpack
|
||||
cargo build --release
|
||||
```
|
||||
|
||||
The binary is at `target/release/dpack`. Install it:
|
||||
|
||||
```bash
|
||||
sudo install -m755 target/release/dpack /usr/local/bin/
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```bash
|
||||
# Install a package (resolves deps, builds in sandbox, installs, updates db)
|
||||
dpack install zlib
|
||||
|
||||
# Install multiple packages
|
||||
dpack install openssl curl git
|
||||
|
||||
# Remove a package (warns about reverse deps, removes files)
|
||||
dpack remove zlib
|
||||
|
||||
# Upgrade packages (compares installed vs repo versions)
|
||||
dpack upgrade # upgrade all outdated packages
|
||||
dpack upgrade openssl git # upgrade specific packages
|
||||
|
||||
# Search for packages
|
||||
dpack search compression
|
||||
|
||||
# Show package info
|
||||
dpack info zlib
|
||||
|
||||
# List installed packages
|
||||
dpack list
|
||||
|
||||
# Check for file conflicts and shared library issues
|
||||
dpack check
|
||||
|
||||
# Convert foreign package formats
|
||||
dpack convert /path/to/Pkgfile # CRUX → dpack TOML (stdout)
|
||||
dpack convert /path/to/curl-8.19.0.ebuild -o curl.toml # Gentoo → dpack TOML (file)
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
dpack reads its configuration from `/etc/dpack.conf` (TOML format). If the file doesn't exist, sensible defaults are used.
|
||||
|
||||
Example `/etc/dpack.conf`:
|
||||
|
||||
```toml
|
||||
[flags]
|
||||
cflags = "-march=znver5 -O2 -pipe -fomit-frame-pointer"
|
||||
cxxflags = "-march=znver5 -O2 -pipe -fomit-frame-pointer"
|
||||
ldflags = "-Wl,-O1,--as-needed"
|
||||
makeflags = "-j32"
|
||||
|
||||
[paths]
|
||||
db_dir = "/var/lib/dpack/db"
|
||||
repo_dir = "/var/lib/dpack/repos"
|
||||
source_dir = "/var/cache/dpack/sources"
|
||||
build_dir = "/var/tmp/dpack/build"
|
||||
|
||||
[sandbox]
|
||||
enabled = true
|
||||
allow_network = false
|
||||
bwrap_path = "/usr/bin/bwrap"
|
||||
|
||||
[[repos]]
|
||||
name = "core"
|
||||
path = "/var/lib/dpack/repos/core"
|
||||
priority = 0
|
||||
|
||||
[[repos]]
|
||||
name = "extra"
|
||||
path = "/var/lib/dpack/repos/extra"
|
||||
priority = 10
|
||||
|
||||
[[repos]]
|
||||
name = "desktop"
|
||||
path = "/var/lib/dpack/repos/desktop"
|
||||
priority = 20
|
||||
|
||||
[[repos]]
|
||||
name = "gaming"
|
||||
path = "/var/lib/dpack/repos/gaming"
|
||||
priority = 30
|
||||
```
|
||||
|
||||
## Package Definition Format
|
||||
|
||||
Package definitions are TOML files stored at `<repo>/<name>/<name>.toml`:
|
||||
|
||||
```toml
|
||||
[package]
|
||||
name = "zlib"
|
||||
version = "1.3.1"
|
||||
description = "Compression library implementing the deflate algorithm"
|
||||
url = "https://zlib.net/"
|
||||
license = "zlib"
|
||||
|
||||
[source]
|
||||
url = "https://zlib.net/zlib-${version}.tar.xz"
|
||||
sha256 = "38ef96b8dfe510d42707d9c781877914792541133e1870841463bfa73f883e32"
|
||||
|
||||
[dependencies]
|
||||
run = []
|
||||
build = ["gcc", "make"]
|
||||
|
||||
[dependencies.optional]
|
||||
static = { description = "Build static library", default = true }
|
||||
minizip = { description = "Build minizip utility", deps = [] }
|
||||
|
||||
[build]
|
||||
system = "autotools"
|
||||
configure = "./configure --prefix=/usr"
|
||||
make = "make"
|
||||
install = "make DESTDIR=${PKG} install"
|
||||
|
||||
[build.flags]
|
||||
cflags = "" # empty = use global defaults
|
||||
ldflags = ""
|
||||
```
|
||||
|
||||
### Variables available in build commands
|
||||
|
||||
- `${PKG}` — staging directory (DESTDIR)
|
||||
- `${version}` — package version (expanded in source URL)
|
||||
|
||||
### Build systems
|
||||
|
||||
The `system` field is a hint: `autotools`, `cmake`, `meson`, `cargo`, or `custom`.
|
||||
|
||||
## Running Tests
|
||||
|
||||
```bash
|
||||
cargo test
|
||||
```
|
||||
|
||||
Tests cover: TOML parsing, dependency resolution (simple, diamond, circular), database operations (register, unregister, persistence, file ownership, conflicts), and converter parsing.
|
||||
|
||||
## Architecture
|
||||
|
||||
```
|
||||
src/
|
||||
├── main.rs # CLI (clap) — install, remove, upgrade, search, info, list, convert, check
|
||||
├── lib.rs # Library re-exports
|
||||
├── config/
|
||||
│ ├── mod.rs # Module root
|
||||
│ ├── package.rs # PackageDefinition TOML structs + parsing + validation
|
||||
│ └── global.rs # DpackConfig (flags, paths, sandbox, repos)
|
||||
├── resolver/
|
||||
│ ├── mod.rs # DependencyGraph, topological sort, reverse deps
|
||||
│ └── solib.rs # Shared library conflict detection (ELF scanning)
|
||||
├── sandbox/
|
||||
│ └── mod.rs # BuildSandbox (bubblewrap + direct backends)
|
||||
├── converter/
|
||||
│ ├── mod.rs # Format auto-detection
|
||||
│ ├── crux.rs # CRUX Pkgfile parser
|
||||
│ └── gentoo.rs # Gentoo ebuild parser
|
||||
├── db/
|
||||
│ └── mod.rs # PackageDb (file-based TOML, installed tracking)
|
||||
└── build/
|
||||
└── mod.rs # BuildOrchestrator (download → build → install pipeline)
|
||||
```
|
||||
|
||||
## Repository
|
||||
|
||||
```
|
||||
git@git.dannyhaslund.dk:danny8632/dpack.git
|
||||
```
|
||||
Reference in New Issue
Block a user