Commit Graph

43 Commits

Author SHA1 Message Date
d66d544066 wip 2026-03-20 11:49:27 +01:00
3cbe1e1f74 update package versions 2026-03-20 11:41:05 +01:00
6b2c4981ce wip 2026-03-20 11:29:44 +01:00
ad3819c9c9 wip 2026-03-20 11:21:20 +01:00
0d041913be wip 2026-03-20 11:18:42 +01:00
d0c590c185 wip 2026-03-20 10:47:58 +01:00
f791799105 ts 2026-03-20 10:26:38 +01:00
998339d2b5 Wip 2026-03-20 10:03:00 +01:00
d6ea38db14 Moved to new phase 2026-03-20 09:45:20 +01:00
31e2574e18 changelog update 2026-03-20 09:34:30 +01:00
6e046a505d wip 2026-03-20 09:24:01 +01:00
5ba3b8d723 wip 2026-03-20 09:04:41 +01:00
f41cc5aef1 Wip 2026-03-20 08:57:03 +01:00
b85f3d1fdd wip 2026-03-20 08:40:38 +01:00
ea00688fe9 wip 2026-03-20 08:35:32 +01:00
8a7603ffcc More test fixes 2026-03-20 08:28:23 +01:00
de45176e6c wip, more installs 2026-03-20 08:21:02 +01:00
a8a1c4901d more test fixes 2026-03-20 08:16:04 +01:00
d29663c710 More test fixes 2026-03-20 07:35:16 +01:00
88e8411ec3 Added more tests 2026-03-20 07:32:37 +01:00
826c1c890a Trying to get testing working 2026-03-20 07:20:31 +01:00
379451020f Fixed source list 2026-03-20 07:10:58 +01:00
fcfe79d50f Changed ncurses download url 2026-03-19 16:54:21 +01:00
b946237dc2 updated bin utils download url 2026-03-19 16:51:56 +01:00
c571c13c3d Fix test_parse_dep_atoms: strip version suffix after regex match
The regex required names to end with a letter ([a-zA-Z]) to avoid
capturing version numbers, but this rejected valid packages like
"nghttp2" that end with a digit.

Fix: use a greedy regex that captures the full "category/name-version"
string, then strip the version suffix with a dedicated function that
finds the last "-" followed by a digit. This correctly handles:
- "dev-libs/openssl-1.0.2" → "openssl"
- "net-libs/nghttp2" → "nghttp2" (no version, ends in digit)
- "sys-libs/zlib" → "zlib"
- "dev-qt/qt6-base-6.8.0" → "qt6-base" (hyphen in name)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 16:43:51 +01:00
4d8e27cd50 Fix OVMF 4m variant detection and Gentoo dep atom parsing
1. host.ovmf: Arch edk2-ovmf 202508+ uses OVMF_CODE.4m.fd (4MB variant)
   instead of OVMF_CODE.fd. Added .4m.fd paths to the search list and
   updated the find fallback to match OVMF_CODE*.fd glob.

2. test_parse_dep_atoms: The single-regex approach with lazy quantifiers
   failed on atoms like "sys-libs/zlib" at end-of-string. Rewrote
   parse_dep_atoms to split on whitespace first, strip [:slot] and [USE]
   suffixes, then match category/name with a simple anchored regex.
   This is more robust and easier to reason about.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 16:40:52 +01:00
658289dc51 Fix 4 test failures from Proxmox VM report
1. converter panic (5 unit tests): "FIXME_CHECKSUM".repeat(4) is only
   56 chars but was sliced to [..64], causing index-out-of-bounds panic.
   Both crux.rs and gentoo.rs converters now use "a".repeat(64) as the
   placeholder checksum instead.

2. dpack list/check exit code 1: these commands call PackageDb::open()
   which tries to create /var/lib/dpack/db — fails without root.
   Test runner now creates a temp dpack.conf pointing at a writable
   temp directory with repos symlinked from the project. Also added
   search and info smoke tests.

3. host.ovmf: not a code bug — edk2-ovmf just needs to be installed
   on the test VM (sudo pacman -S edk2-ovmf --noconfirm).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 16:37:34 +01:00
8f9fa9f00e Fix OVMF detection for Arch Linux (split CODE/VARS files)
Arch's edk2-ovmf package installs split files (OVMF_CODE.fd +
OVMF_VARS.fd) instead of a single OVMF.fd. Updated the search
to check OVMF_CODE.fd paths first, with a find fallback.

QEMU boot command now handles both formats:
- Split: -drive if=pflash,format=raw,readonly=on,file=OVMF_CODE.fd
         -drive if=pflash,format=raw,file=OVMF_VARS.fd
- Single: -bios OVMF.fd

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 16:32:06 +01:00
547ab79fba Change repos submodule URL from SSH to HTTPS
The SSH URL (gitea@git.dannyhaslund.dk:...) requires SSH keys which
aren't available in test VMs or CI environments. HTTPS works for
public repos without authentication.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 16:29:16 +01:00
0c0f1ec715 Fix git clone in Proxmox VM: add GIT_SSL_NO_VERIFY for self-hosted Gitea
The Gitea server at git.dannyhaslund.dk has a TLS SNI issue that
causes 'tlsv1 unrecognized name' errors from inside VMs. Adding
GIT_SSL_NO_VERIFY=true for the clone since it's a trusted self-hosted
server on the local network.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 16:12:22 +01:00
83760025b6 Fix darkforge-test heredoc indentation in cloud-init
The cat heredoc inside cloud-init runcmd was indented, causing the
shebang line to become "    #!/bin/bash" (with leading spaces) which
makes the script fail to execute as a proper interpreter.

Fixed by removing indentation from the heredoc body. Also improved
the error message to explain that the clone likely failed during
provisioning and show the manual clone command.

Added tmux kill-session before starting new session to avoid
"duplicate session" errors on re-run.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 16:10:03 +01:00
fe6ee25d1c Fix Proxmox VM login — force user creation via runcmd
The Arch Linux cloud image ignores Proxmox's --ciuser/--cipassword
and the cloud-init chpasswd module depending on version. The previous
approach had three conflicting methods fighting each other.

Fixed by:
- Removed --ciuser/--cipassword from qm set (they conflict with snippet)
- Removed chpasswd cloud-init module (unreliable on Arch)
- Set users: [] to disable cloud-init's default user module
- ALL user setup now done via runcmd (runs as root, always works):
  - Sets root password to 'darkforge' as fallback
  - Creates darkforge user via useradd + chpasswd
  - Grants passwordless sudo via /etc/sudoers.d/
  - Enables PermitRootLogin yes as safety net
- Package install via explicit pacman commands instead of packages: module
  (Arch cloud-init packages module can be unreliable)
- Added pacman-key --init/--populate before package install

Login credentials:
  user: darkforge  password: darkforge
  user: root       password: darkforge  (fallback)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 15:48:24 +01:00
6d1b87c7ab More ram 2026-03-19 15:41:11 +01:00
28946b52d0 Fix SSH password auth in Proxmox VM cloud-init
Arch Linux cloud images disable SSH password authentication by default.
Added cloud-init directives to:
- Enable ssh_pwauth
- Set the darkforge user password via chpasswd (plaintext, non-expiring)
- Write /etc/ssh/sshd_config.d/99-darkforge.conf enabling PasswordAuthentication
- Restart sshd after config is written

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 15:22:51 +01:00
fc02915b52 test 2026-03-19 15:04:26 +01:00
c35ba5dc0f Use tmux for test runner — detachable SSH sessions
Tests now run inside a tmux session so you can disconnect and
reconnect without interrupting multi-hour test runs.

Changes:
- create-vm.sh: cloud-init no longer auto-runs tests, just provisions
  packages and clones the repo. Installs a `darkforge-test` command
  in /usr/local/bin that wraps run-in-vm.sh in tmux.
- run-in-vm.sh: detects when called as `darkforge-test` and re-execs
  inside a tmux session named "darkforge". --tmux flag for internal use.
- README updated with tmux workflow (detach/reattach instructions).

Workflow:
  ssh darkforge@<ip>
  darkforge-test --quick    # starts in tmux
  Ctrl+B D                  # detach, go do other things
  tmux attach -t darkforge  # come back later

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 13:59:52 +01:00
c464e0eec9 Add Proxmox test environment (VM creation + automated test suite)
Tests everything possible without the target hardware:

create-vm.sh (runs on Proxmox host):
- Creates Arch Linux VM (VMID 900, 8 cores, 16GB RAM, 100GB disk)
- UEFI boot with OVMF (for nested QEMU testing)
- Cloud-init auto-installs packages, clones repo, runs tests
- Nested virtualization enabled for QEMU-in-QEMU boot tests

run-in-vm.sh (runs inside the VM, 9 test suites):
1. Host environment validation
2. dpack build + unit tests + CLI smoke tests
3. Package definition validation (154 packages, dep resolution)
4. Script syntax checking (toolchain, init, installer, ISO)
5. Kernel config validation (critical options)
6. Package signing test (download zlib, compute SHA256)
7. Toolchain bootstrap (LFS Ch.5 cross-compiler build)
8. ISO generation
9. Nested QEMU boot test (UEFI boot, kernel + userspace check)

Modes: --quick (30min, suites 1-5), --no-build (1hr), full (2-6hr)
Generates report.json + report.txt for automated debugging.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 13:32:01 +01:00
c6a3f33746 Use has_repo_update field in check-updates display
The CheckUpdates handler now reads has_repo_update to label each
update with its source: [repo], [upstream], or [repo+upstream].
This was the last remaining warning — build should now be fully clean.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 13:10:53 +01:00
3d5390b515 Fix all warnings properly — no blanket #![allow(dead_code)]
Removed both blanket #![allow(dead_code)] from main.rs and lib.rs.
Each warning is now handled individually with a targeted #[allow]
and a comment explaining WHY the item exists and WHEN it will be used.

Fixes:
- resolver/mod.rs: Added missing SourceInfo fields (git, branch, tag,
  commit, update_check) to test helper make_pkg() — fixes cargo test
- main.rs: Wire DEFAULT_CONFIG_PATH constant into CLI default_value
  instead of hardcoding the string (eliminates unused constant warning)

Targeted #[allow(dead_code)] with justification on:
- config/global.rs: load_default() (future system service mode),
  find_package() (future replacement for inline Info search)
- resolver/solib.rs: SharedLib, LibConflict, ConflictResolution structs
  (planned upgrade conflict UI), get_soname(), check_upgrade_conflicts(),
  format_conflict_report(), collect_provided_sonames(), soname_base()
  (entire conflict detection chain — will be wired into dpack upgrade)
- resolver/mod.rs: definition_path field (populated but read in future)
- sandbox/mod.rs: add_ro_bind() (planned dep mounting), staging_dir(),
  build_dir() (accessor methods for post-build inspection)
- db/mod.rs: is_installed() (used by tests, future install guard),
  who_owns() (planned dpack owns <file> command)
- build/mod.rs: db(), db_mut() (accessors for advanced orchestration)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 12:30:40 +01:00
1766909379 Update repos submodule: all 154 package deps now fully resolve
Added 16 missing packages (boost, opencascade, xerces-c, swig,
tcl, tk, nodejs, cbindgen, unibilium, libtermkey, libvterm,
msgpack-c, xcb, xcb-proto, libxau, libxdmcp).

Every package in all 4 repos can now be installed via dpack
with zero unresolvable dependencies.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 12:18:07 +01:00
3a5c200a28 Add dpack sign command, test runner, ISO builders, fix build errors
dpack fixes:
- Fixed missing SourceInfo fields in CRUX/Gentoo converters (git, branch,
  tag, commit, update_check fields added to struct initializers)
- Added 'sign' command: downloads source tarballs and computes real SHA256
  checksums, updating .toml definitions in-place. Replaces placeholder
  checksums. Usage: dpack sign zlib  or  dpack sign all

Testing:
- tests/run-tests.sh: comprehensive integration test runner for Arch Linux
  host. 7 test suites covering host env, dpack build/tests, package defs,
  toolchain scripts, kernel config, init system, and QEMU boot.
  Generates JSON + text reports for automated debugging.
  Usage: bash tests/run-tests.sh [--quick]

ISO builders:
- src/iso/build-iso-arch.sh: builds live ISO from Arch Linux host
  Creates rootfs from pre-built base system or busybox fallback,
  includes installer + dpack + package repos, UEFI-only boot
- src/iso/build-iso-darkforge.sh: builds live ISO from running DarkForge
  Snapshots the live system via rsync, creates redistributable ISO

Package repository (submodule updated):
- 14 new self-hosting packages: qemu, edk2-ovmf, squashfs-tools,
  xorriso, mtools, efibootmgr, efivar, rsync, lz4, nasm,
  neovim, htop, tmux, libevent
- Total: 138 packages across 4 repos

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 12:11:59 +01:00
5fb597e2d6 Add git sources, check-updates, repos submodule, improve docs
dpack features:
- Git source support: packages can specify [source].git for cloning
  instead of tarball download. Supports branch, tag, and commit pinning.
  SHA256 can be set to "SKIP" for git sources.
- check-updates command: queries upstream APIs (GitHub releases/tags)
  to find available updates. Packages set [source].update_check URL.
- CheckUpdates CLI subcommand wired into main.rs

Package changes:
- FreeCAD updated to weekly-2026.03.19 development builds
- dwl: added update_check URL and git source documentation
- src/repos extracted to standalone git repo (danny8632/repos.git)
  and added as git submodule

Documentation:
- All 7 README.md files updated with detailed requirements sections
  including which Linux distros are supported, exact package names
  for Arch/Ubuntu/Fedora, and clear notes about which components
  require Linux vs can be built on macOS
- dpack README: added git source and check-updates documentation

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 11:58:23 +01:00
029642ae5b 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>
2026-03-19 11:30:40 +01:00