Generate FreeBSD system closures in /frx/store

This commit is contained in:
2026-04-01 18:42:33 +02:00
parent 13963e7f62
commit e4288dc330
6 changed files with 314 additions and 2 deletions

View File

@@ -1906,7 +1906,7 @@ Important findings:
- `host_name=fruix-freebsd`
- `kernel_package=freebsd-kernel`
- `bootloader_package=freebsd-bootloader`
- `base_packages=freebsd-runtime,freebsd-userland,freebsd-libc,freebsd-rc-scripts,freebsd-bash`
- `base_packages=freebsd-runtime,freebsd-userland,freebsd-libc,freebsd-rc-scripts,freebsd-sh,freebsd-bash`
- `users=root,operator`
- `groups=wheel,operator`
- `generated_files=boot/loader.conf,etc/rc.conf,etc/fstab,etc/hosts,etc/passwd,etc/group,etc/shells,etc/motd,activate,shepherd/init.scm`
@@ -1916,3 +1916,51 @@ Current assessment:
- Phase 7.1 is now satisfied on the current FreeBSD prototype track
- the next step is to materialize this operating-system description into a reproducible system closure under `/frx/store`
## 2026-04-01 — Phase 7.2 completed: minimal system closure generated under `/frx/store`
Completed work:
- added the Phase 7.2 closure materialization harnesses:
- `tests/system/materialize-phase7-system-closure.scm`
- `tests/system/run-phase7-system-closure.sh`
- refined the minimal operating-system example so the generated system profile also contains `/bin/sh`
- wrote the Phase 7.2 report:
- `docs/reports/phase7-system-closure-freebsd.md`
- ran the system-closure harness successfully and captured metadata under:
- `/tmp/phase7-system-closure-metadata.txt`
Important findings:
- the declarative FreeBSD Fruix operating-system object now materializes into a real system closure under `/frx/store`
- that closure contains:
- boot assets
- a merged system profile
- generated `/etc` files
- a generated activation script
- a generated Shepherd configuration
- a generated `rc.d` launcher for Shepherd
- the closure now embeds the concrete first init integration choice for the FreeBSD track:
- `freebsd-init+rc.d-shepherd`
- rerunning the same materialization produced the same closure path, which is the current prototype proof of reproducible closure generation for this phase
- observed metadata confirmed:
- `closure_path=/frx/store/...-fruix-system-fruix-freebsd`
- `closure_rebuild_path=/frx/store/...-fruix-system-fruix-freebsd`
- `kernel_store=/frx/store/...-freebsd-kernel-15.0-STABLE`
- `bootloader_store=/frx/store/...-freebsd-bootloader-15.0-STABLE`
- `guile_store=/frx/store/...-fruix-guile-runtime-3.0`
- `guile_extra_store=/frx/store/...-fruix-guile-extra-3.0`
- `shepherd_store=/frx/store/...-fruix-shepherd-runtime-1.0.9`
- `profile_bin_sh=/frx/store/...-fruix-system-fruix-freebsd/profile/bin/sh`
- `profile_sbin_init=/frx/store/...-fruix-system-fruix-freebsd/profile/sbin/init`
- `profile_rc=/frx/store/...-fruix-system-fruix-freebsd/profile/etc/rc`
Current assessment:
- Phase 7.2 is now satisfied on the current FreeBSD prototype track
- the next step is to materialize and statically validate an installable root filesystem tree from this system closure
Current assessment:
- Phase 7.1 is now satisfied on the current FreeBSD prototype track
- the next step is to materialize this operating-system description into a reproducible system closure under `/frx/store`

View File

@@ -56,7 +56,7 @@ Observed metadata included:
- `host_name=fruix-freebsd`
- `kernel_package=freebsd-kernel`
- `bootloader_package=freebsd-bootloader`
- `base_packages=freebsd-runtime,freebsd-userland,freebsd-libc,freebsd-rc-scripts,freebsd-bash`
- `base_packages=freebsd-runtime,freebsd-userland,freebsd-libc,freebsd-rc-scripts,freebsd-sh,freebsd-bash`
- `users=root,operator`
- `groups=wheel,operator`
- `file_system_count=3`

View File

@@ -0,0 +1,74 @@
# Phase 7.2: Minimal FreeBSD system closure generated from the Fruix system model
Date: 2026-04-01
## Summary
This step materializes the Phase 7.1 Fruix operating-system description into a reproducible system closure under `/frx/store`.
Added files:
- `tests/system/materialize-phase7-system-closure.scm`
- `tests/system/run-phase7-system-closure.sh`
## Validation command
Run command:
```sh
METADATA_OUT=/tmp/phase7-system-closure-metadata.txt \
./tests/system/run-phase7-system-closure.sh
```
## What the harness does
The harness:
1. ensures the local Guile/Fibers/Shepherd runtime needed for the generated system is available
2. loads the declarative Phase 7 operating-system object
3. materializes the referenced FreeBSD base packages into `/frx/store`
4. materializes local Guile and Shepherd prefixes into `/frx/store`
5. generates a Fruix system closure store item containing:
- boot assets
- a merged system profile
- generated `/etc` files
- an activation script
- a Shepherd configuration
- a generated FreeBSD `rc.d` launcher for Shepherd
6. reruns the same materialization a second time and verifies that the same closure path is produced
## Observed results
Observed metadata included:
- `closure_path=/frx/store/...-fruix-system-fruix-freebsd`
- `closure_rebuild_path=/frx/store/...-fruix-system-fruix-freebsd`
- `kernel_store=/frx/store/...-freebsd-kernel-15.0-STABLE`
- `bootloader_store=/frx/store/...-freebsd-bootloader-15.0-STABLE`
- `guile_store=/frx/store/...-fruix-guile-runtime-3.0`
- `guile_extra_store=/frx/store/...-fruix-guile-extra-3.0`
- `shepherd_store=/frx/store/...-fruix-shepherd-runtime-1.0.9`
- `profile_bin_sh=/frx/store/...-fruix-system-fruix-freebsd/profile/bin/sh`
- `profile_sbin_init=/frx/store/...-fruix-system-fruix-freebsd/profile/sbin/init`
- `profile_rc=/frx/store/...-fruix-system-fruix-freebsd/profile/etc/rc`
- `init_integration=freebsd-init+rc.d-shepherd`
## Important findings
- the FreeBSD system definition now materializes into a single reproducible system closure store item rather than remaining only a logical specification
- the closure uses a Guix-like split between:
- referenced store items for package/runtime content
- generated configuration and activation payload in the system closure itself
- the first integrated init strategy is now concretely encoded in the closure contents:
- FreeBSD init and rc infrastructure from the base system profile
- a generated `fruix_shepherd` rc script
- a generated Shepherd configuration that writes a deterministic ready marker
- rerunning the same materialization produced the same closure path, which is the current prototype proof of reproducible closure generation for this phase
## Conclusion
Phase 7.2 is satisfied on the current FreeBSD prototype track:
- a declarative Fruix system description now generates a real system closure under `/frx/store`
- that closure contains boot files, `/etc` payloads, activation payload, and Shepherd launch integration
- the next step is to materialize a root filesystem tree from this closure and statically validate it for later image construction work