Check staged package integrity with deployment timestamps and local DB

This commit is contained in:
Pavel Isaev 2026-11-06 10:02:56 +03:00
parent 13a6644e6c
commit 30c097794b
2 changed files with 11 additions and 1 deletions

View file

@ -62,6 +62,7 @@ Observed integration failures and permanent corrections:
| Package inventory initializes repository trust/download user or cannot resolve relocated DB | Query through `arch-chroot` with `--config /dev/null --dbpath /usr/lib/archipelago/package-db -Q`; read only the local DB | Integration continuation pending |
| Copy loses setuid/setgid or capabilities | Apply ownership before mode/xattrs; verify copied identity | Privileged-mode regression passed; real composition rerun pending |
| Installed GNOME fails package integrity for two Core-owned configuration files | Keep Core bytes unchanged; provide separate GNOME configs, select them for composition and Host Extension initramfs; run self-check before image capture | Cycle 20261105T233849Z rejected; corrected full cycle pending |
| Pre-capture self-check loads runtime pacman trust/sandbox and sees checkout-local mtimes | Temporarily use local-DB-only pacman config in staging, normalize `/usr` timestamps to deployment epoch, restore runtime config before capture | Real staging self-check: 41 files, 0 altered; installed acceptance pending |
Capture checks the copied object against the recorded source identity before
commit. Compose validates input identities and checks each copied output. Keep

View file

@ -99,7 +99,16 @@ mv /job/composed /job/core
mv /job/core/usr/etc /job/core/etc
cp /job/core/usr/lib/archipelago/defaults/os-release-gnome /job/core/etc/os-release
@@GNOME_FINALIZE@@
arch-chroot /job/core /bin/bash -euxc 'archipelago self-check; k=$(basename /usr/lib/modules/*); depmod "$k"; mkinitcpio -c /usr/lib/archipelago/mkinitcpio-gnome.conf -k "$k" -g "/usr/lib/modules/$k/initramfs.img"; ldconfig; systemd-hwdb update --usr'
# Force-copy checkout timestamps are host-local; deployments use OSTree's epoch.
# Match that representation before checking the package's reproducible mtree.
find /job/core/usr -exec touch -h -d @0 '{}' +
# A staging root has factory accounts and no machine keyring. Query only the local
# package DB, retaining the exact same integrity/permissions check as on the host.
cp -a /job/core/etc/pacman.conf /job/finalize-pacman.conf
printf '[options]\nDBPath = /usr/lib/archipelago/package-db/\n' > /job/core/etc/pacman.conf
arch-chroot /job/core archipelago self-check
mv /job/finalize-pacman.conf /job/core/etc/pacman.conf
arch-chroot /job/core /bin/bash -euxc 'k=$(basename /usr/lib/modules/*); depmod "$k"; mkinitcpio -c /usr/lib/archipelago/mkinitcpio-gnome.conf -k "$k" -g "/usr/lib/modules/$k/initramfs.img"; ldconfig; systemd-hwdb update --usr'
# Inventory is a read-only local DB query: do not initialize repository trust or
# the download sandbox in a finalized root containing factory accounts.
arch-chroot /job/core pacman --config /dev/null --dbpath /usr/lib/archipelago/package-db -Q > /job/evidence/core-packages.txt