diff options
| author | Danilo M. <danix@danix.xyz> | 2026-06-24 15:21:51 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-06-24 15:21:51 +0200 |
| commit | 198499d28f69abd20584a2eb88d9e1dd29e9dbec (patch) | |
| tree | aaba332d7285be62ee396896c5e8eb3ca79b961e /CLAUDE.md | |
| parent | be4f69754e104fb753a9c9f9299a3e72821a6946 (diff) | |
| download | sbo-batch-tester-198499d28f69abd20584a2eb88d9e1dd29e9dbec.tar.gz sbo-batch-tester-198499d28f69abd20584a2eb88d9e1dd29e9dbec.zip | |
Externalize config; mirror mountpoint+auto-mount, MIRROR_TREE, --terse
Config now lives outside the script in $SBO_BATCH_CONFIG (default
~/.config/sbo-batch-tester/config), sourced at load. Script ships empty
defaults plus config.example as the template; require_config (in validate_env
and init_base) hard-fails a real run when the config is missing or has not set
SLACKWARE_BASE / LOCAL_MIRROR_15 / SBO_TREE_ROOTS.
LOCAL_MIRROR_15 is now the NFS mountpoint, not the tree root. The Slackware
tree is derived as MIRROR_TREE=$LOCAL_MIRROR_15/slackware64-$VERSION (holds
ChangeLog.txt, slackware64/, patches/); all mirror content reads use it. The
mountpoint is checked with mountpoint -q and auto-mounted (mount
$LOCAL_MIRROR_15) when the noauto fstab entry is not mounted, left mounted
after the run.
installpkg/upgradepkg run with --terse for cleaner output. Docs updated.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'CLAUDE.md')
| -rw-r--r-- | CLAUDE.md | 49 |
1 files changed, 36 insertions, 13 deletions
@@ -30,8 +30,11 @@ docs in `README.md`. local SBo tree is the single source of truth (contains unpublished personal/pentesting packages). Settled, not open for revisiting. - **overlay lowerdir must be LOCAL.** `SLACKWARE_BASE` is a local fs path. - `LOCAL_MIRROR_15` is NFS and is a package SOURCE only. overlayfs over NFS - lowerdir is fragile. The script guards against pointing base under the mirror. + `LOCAL_MIRROR_15` is the NFS mountpoint, a package SOURCE only (content read + via the derived `MIRROR_TREE`). overlayfs over NFS lowerdir is fragile. The + script guards against pointing base under the mirror. The mirror fstab entry + is `noauto`; the script checks `mountpoint -q` and auto-mounts (`mount + $LOCAL_MIRROR_15`) if absent, left mounted after the run. - **Do not wrap/drive slackrepo.** Separate pipeline, keep independent. - **Shares host kernel.** No kernel-module testing claims. - Runs as root only (overlay + chroot). @@ -42,18 +45,30 @@ docs in `README.md`. Top-to-bottom layout: -1. **CONFIG block** - `SLACKWARE_BASE`, `LOCAL_MIRROR_15`, `SBO_TREE_ROOTS[]`, - `CHROOT_LOCATION`, `LOG_ROOT`, `VERSION`. Currently placeholder paths (we are - not in the VM, no real values yet). User fills these in. +1. **CONFIG block** - empty defaults plus a `source` of the external config + file. Real values live OUTSIDE the script in `$SBO_BATCH_CONFIG` (default + `~/.config/sbo-batch-tester/config`, i.e. `/root/.config/...` since it runs + as root); `config.example` in the repo is the template. The block sets empty + defaults (`SLACKWARE_BASE LOCAL_MIRROR_15 SBO_TREE_ROOTS`) plus + `CHROOT_LOCATION=/tmp LOG_ROOT VERSION=15.0`, sources the config if present + (NOT an error if missing, so the script stays sourceable by `test-logic.sh`), + then derives `MIRROR_TREE`. `require_config` (called by `validate_env` and + `init_base`) is what hard-fails a real run when the config is absent or has + not set the required paths. `LOCAL_MIRROR_15` is the NFS mountpoint; the tree + is one level down, `MIRROR_TREE="$LOCAL_MIRROR_15/slackware64-$VERSION"` + (holds ChangeLog.txt, slackware64/, patches/). All mirror content reads use + `MIRROR_TREE`; the mountpoint check, auto-mount, and the under-mirror guard + use `LOCAL_MIRROR_15`. 2. **Globals / flags** - `USE_COLOR DRY_RUN WITH_X JOBS`, status maps (`ST_STATUS ST_REASON ST_TIME ST_README`), `ACTIVE_MOUNTS[]`. 3. **usage / init_color / parse_args / validate_env** - fail-fast startup checks with copy-pasteable hints. 4. **init_base** - `--init-base` mode only. First-time populate: `installpkg --root` the full `slackware64/*/*.t?z` set into `SLACKWARE_BASE`, seed the - `last-base-update` marker, exit. Runs its own checks (root, NFS reachable, - not under mirror) since the base does not exist yet; refuses to clobber a - populated base. Wired in `main` before `validate_env`, exits 0. + `last-base-update` marker, exit. Runs its own checks (root, mirror mounted + /auto-mount, ChangeLog.txt present, not under mirror) since the base does not + exist yet; refuses to clobber a populated base. Wired in `main` before + `validate_env`, exits 0. installpkg/upgradepkg run with `--terse`. **update_base** - patches local base from mirror's `patches/packages/` when ChangeLog head differs (reused from reference script). 5. **SBo tree lookup** - `find_slackbuild_dir`, `category_of`, `pkg_key`, @@ -93,13 +108,21 @@ not a status. VM needed): topo order, `%README%` recording, unmet-dep, cycle detection, and BLOCKED-BY-DEP propagation (`depends_on_failed`, including the transitive one-hop cascade). The check builds a fake SBo tree and sources the script with - config overridden AFTER sourcing (sourcing re-runs the CONFIG block, so test - vars must be set after the `source`). Gotchas baked in: do not name the dead + config overridden AFTER sourcing (sourcing re-runs the CONFIG block, which + resets the vars to empty defaults and may source the external config, so test + vars must be set after the `source`). The test runs as a normal user, so + `~/.config/sbo-batch-tester/config` usually does not exist and is not sourced; + even if it did, the post-source overrides win. Gotchas baked in: do not name the dead list `failed` (collides with `depends_on_failed`'s `local -n failed`), and `ok`/`bad` must `return 0` (`((x++))` returns nonzero when x was 0). -- **NOT runnable-tested** (needs the VM): overlay mounts, chroot build flow, - base patching, `--init-base` populate, installpkg. Logic mirrors the - reference script / the prior manual populate hint. +- **Verified on the build system**: `--init-base` populate ran clean against + the real mirror (mountpoint check, auto-mount of the noauto NFS entry, + `MIRROR_TREE` derivation, external config sourcing, full installpkg --terse + set). The external-config split (`require_config`, missing/incomplete errors) + was checked in isolation too. +- **NOT runnable-tested** (needs a real build run): overlay mounts, chroot + build flow, base patching (update_base), per-package installpkg. Logic mirrors + the reference script. ## Known shortcuts (ponytail: comments in source) |
