From 30c097794b236799b9849a45183390539d807c32 Mon Sep 17 00:00:00 2001 From: Pavel Isaev Date: Fri, 6 Nov 2026 10:02:56 +0300 Subject: [PATCH] Check staged package integrity with deployment timestamps and local DB --- LAYERED-GNOME.md | 1 + adapters/gnome-layer.sh | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/LAYERED-GNOME.md b/LAYERED-GNOME.md index 25e0e67..7baddc0 100644 --- a/LAYERED-GNOME.md +++ b/LAYERED-GNOME.md @@ -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 diff --git a/adapters/gnome-layer.sh b/adapters/gnome-layer.sh index d53658f..3458241 100644 --- a/adapters/gnome-layer.sh +++ b/adapters/gnome-layer.sh @@ -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