Initialize public feed verification under long image staging paths
@@ -139,6 +139,8 @@ The worker used a disposable test signer in `foundation/keyring-04`. It rejected
139139
140140### Assemble an image with an offline repository
141141
142+A public-only consumer can live below a long staging path. `feed trust` checks the fingerprint in a short private GnuPG directory and copies the public keybox and trust database to the consumer. Fresh clients for both architectures installed four packages from the signed layout feed. A wrong fingerprint and a by-name attempt to install the absent `vinix-release-desktop` both failed. The worker keeps the successful install receipts in `foundation/public-trust-install-03/consumer-with-a-deep-image-generation-directory`, manifest SHA-256 `28b5580486b8c36bd67df12b3e51924f96685aae447326aaacca88e6a32fede5`, and the partial-feed rejection in `foundation/partial-desktop-reject-03`, manifest SHA-256 `ad53b5e5fdcd0461ee72b5a9b9c0fb3c4a8b7e878c100f722c3e3c54ddf7dbc8`.
143+
142144Start with a fresh `feed install` client that includes `vinix-keyring`. Run this on the build worker with GNU cp, GnuPG and the installed-root auditor. The resulting `$output/root` is the input to the architecture's image builder.
143145
144146```sh
@@ -23,8 +23,12 @@ fn gpg(keyring string, args []string) !string {
2323fn trust_key(state string, key string, fingerprint string) ! {
2424 trust := os.join_path(state, 'verify')
2525 os.mkdir(trust, mode: 0o700)!
26- gpg(trust, ['--import', key])!
27- records := gpg(trust, ['--with-colons', '--fingerprint', '--list-keys'])!.split_into_lines()
26+ // GnuPG uses Unix sockets even for public imports. Deep SDK paths can
27+ // exceed the socket name limit. Transfer only its public databases.
28+ home := output(['mktemp', '-d', '/tmp/vinix-feed.XXXXXXXX'])!.trim_space()
29+ defer { os.rmdir_all(home) or {} }
30+ gpg(home, ['--no-autostart', '--import', key])!
31+ records := gpg(home, ['--no-autostart', '--with-colons', '--fingerprint', '--list-keys'])!.split_into_lines()
2832 fingerprints := records.filter(it.starts_with('fpr:'))
2933 if records.filter(it.starts_with('pub:')).len != 1 || fingerprints.len == 0
3034 || fingerprints[0].split(':')[9] != fingerprint {
@@ -32,7 +36,12 @@ fn trust_key(state string, key string, fingerprint string) ! {
3236 }
3337 ownertrust := os.join_path(trust, 'fixture-ownertrust')
3438 os.write_file(ownertrust, fingerprint + ':6:\n')!
35- gpg(trust, ['--import-ownertrust', ownertrust])!
39+ gpg(home, ['--no-autostart', '--import-ownertrust', ownertrust])!
40+ gpg(home, ['--no-autostart', '--check-trustdb'])!
41+ keybox := if os.is_file(os.join_path(home, 'pubring.kbx')) { 'pubring.kbx' } else { 'pubring.gpg' }
42+ for filename in [keybox, 'trustdb.gpg'] {
43+ os.cp(os.join_path(home, filename), os.join_path(trust, filename))!
44+ }
3645}
3746
3847// Keep private signing material out of every repository and consumer root.