7.1 KiB
Managed Overlay producer checkpoint
build-overlay.sh now sequences resolve/download in a network-enabled private
bootstrap, then install/capture/pack in a separate private-network nspawn. Offline
also isolates the first phase. Installation/capture share one /run lifetime;
locks, receipts, logs and final artifact remain in the protected job directory.
An OSTree commit/ref and result receipt are produced only after successful packing.
system/src/service/overlay_build.rs supplies the supervised invocation and
embedded adapters. PrepareSet/PrepareUpdate now call it through authenticated source
extraction and a private bootstrap. The target base must supply reviewed policy at
/usr/lib/archipelago/hook-policy/overlay-build.json; its producer and build-tool
binding remain unfinished, so ordinary current bases fail this prerequisite. Explicit
manifest actions are rejected until their locked executor exists, not ignored.
System/builder compile-only and driver bash syntax passed on yabloko; the driver
has not been executed. Network isolation and final output require pipeline evidence.
adapters/capture-overlay.py connects an installation result to the packer. It
verifies the resolution hash and installed package set/versions, indexes local DB
records once, and selects each package's files without rescanning or copying the
entire root. Vendor defaults map from installation /etc to artifact /usr/etc.
The packer accepts a private path_sources map for these shared-root inputs;
otherwise its separate-package-root mode remains available. Original ALPM bytes
are retained. Unowned installation outputs do not become package payload merely
because they exist; generated outputs need explicit finalization provenance.
Absent paths, canonical alias collisions and new lifecycle paths still require
their explicit adapters. This does not silently make arbitrary packages supported.
The normal-pipeline fixture covers capture→pack and exclusion of an unowned file.
adapters/install-overlay.py is the private offline installation phase (embedded
as builder::overlay::INSTALLER). It consumes the resolved lock, download receipt,
an authenticated profile's action policy and retained archives, creating a fresh
/run target inside the layer sandbox. It checks receipt/closure, archive checksums,
detached signature identity and libalpm signature validation before installation.
It inventories .INSTALL/ALPM hooks before committing; every observed action must
have an exact hash and layer-build classification. Unknown actions and hook
overrides fail. Native ALPM transaction dependencies/triggers apply; logged errors
or failure warnings fail the result even if commit returns success.
Policy v0 is {version:0,actions:[{kind:scriptlet|hook,sha256,phase:layer-build}]}.
This is an internal executor input, not blanket approval of existing package
scripts. The caller must bind policy provenance. Other lifecycle phases need
explicit adapters rather than relabeling their actions as layer-build.
The fresh target may lack build tools needed by scripts: locked build dependencies
and target preparation are still required in orchestration. No runtime success or
general package conformance is claimed. Installation result records root/database,
resolution hash, policy hash and observed action identities.
Python syntax and builder compile-only passed on yabloko; installation has not run.
adapters/download-overlay.py implements the exact-closure download phase inside
the layer sandbox. It reconstructs the resolver's empty local DB from pinned sync
DBs and checks repository bytes/order, package versions/architectures/filenames,
archive checksums and detached signature identities before the transaction.
Only libalpm download-only commit is used; no package installation runs.
All retained archives are checksum-checked and loaded with mandatory signature
verification, including offline/warm-cache use. Offline requires every archive
already present and never commits a download transaction. A receipt binds the
resolution content hash, snapshot and verified archive hashes.
Invocation: download-overlay.py LOCK FRESH_RUN_WORKSPACE CACHE NEW_RECEIPT [--offline].
The resolver script must be installed alongside it; caller owns the sandbox,
cache and network isolation. Runtime libalpm/network acceptance is still pending.
src/overlay.rs exposes canonical YAML normalization via contracts::layer and
embeds the private resolver/packer scripts for isolated worker invocation.
adapters/resolve-overlay.py resolves runtime constraints with libalpm using a
fresh empty local DB and copied pinned sync DBs inside the selected base sandbox.
It never refreshes repositories or commits an installation transaction. Output
retains repository DB hashes/order, archive checksums/signatures, exact dependency
names and requirement/provider bindings. Provider lookups use a name index.
The script requires the layer-sandbox marker and matching snapshot identity;
these are execution guards, not substitutes for caller-side signature validation.
Compile-only builder and resolver Python syntax passed on yabloko. libalpm runtime
execution has not yet been exercised in the normal pipeline.
adapters/indexed-overlay.py is the private offline packaging phase for the
generic overlay builder. It accepts a structurally validated normalized Layer v1
manifest and protected prepared inputs. It does not implement package resolution,
signature admission, installation or hook execution.
Invocation: indexed-overlay.py COMPOSER_ADAPTER_DIR MANIFEST_JSON REQUEST_JSON NEW_OUTPUT.
The request has version 0, snapshot_id, source_root and packages. Each package has
name/version/architecture, archive/archive_sha256, exact resolved dependency names,
an adapted immutable root and an original ALPM record directory. The caller must
authenticate the archives and bind the resolution to the selected snapshot first.
The packer hashes retained archives/records/payload objects, constructs contribution identities and namespaced package trees, copies authored content with declared metadata, emits indexes/lock and runs the existing artifact checker. It preserves original ALPM bytes. Persistent/boot payload without a lifecycle adapter is rejected. Payload writes reject symlink ancestors; no live host mutation is performed.
Remaining integration: worker invocation of normalization/resolution, worker invocation and runtime validation of download/install, profile action policy binding, build-tool closure, non-build lifecycle actions, capture invocation, runtime/lifecycle adapters, source retention, OSTree commit creation and update worker orchestration. This file is not evidence that rebuild-on-update works or that hardware overlays are supported.
tests/indexed_overlay.py is registered in the normal release source checks;
fixtures cover snapshot rebinding and symlink escape rejection. Only Python syntax
has been checked on yabloko; runtime fixtures have not run.
The packer now accepts optional requirement_bindings from the resolver and
retains them in the lock. The checker verifies complete declaration/provider
accounting; a fixture covers a version-constrained virtual requirement and a
mismatched constraint. It does not replace runtime signature/provider checks.