From 609db0e08d1376fd3fff7bb151854c55181c4634 Mon Sep 17 00:00:00 2001 From: Pavel Isaev Date: Mon, 9 Nov 2026 04:41:36 +0300 Subject: [PATCH] Use explicit local package DB for extension validation and inventory --- DBUS-AUDIT.md | 8 ++++++++ adapters/extensions.sh | 11 +++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/DBUS-AUDIT.md b/DBUS-AUDIT.md index 56f6716..bd8fd99 100644 --- a/DBUS-AUDIT.md +++ b/DBUS-AUDIT.md @@ -124,6 +124,14 @@ Required before claiming hardware readiness: ## Execution order after this audit +Run `20261108T225854Z` passed JSON download and exact nano installation in the +private checkout. Validation then failed because `pacman -Dk` initialized the +runtime DownloadUser=alpm from pacman.conf, absent in this checkout. Post-install +local DB reason updates, consistency checks and inventory now use --config +/dev/null with explicit /usr/lib/archipelago/package-db, matching builder queries. +Repository download/signature checks remain in the package adapter. Confirmation +of validation/finalization and installed activation awaits the next normal run. + Run `20261108T202529Z` passed adapter builds and reached package download in Core Stage, past the previous lock failure. The package command exited successfully but its output failed JSON decoding. nspawn defaults to a read-only PTY for nonterminal diff --git a/adapters/extensions.sh b/adapters/extensions.sh index b6f4780..ff29af2 100644 --- a/adapters/extensions.sh +++ b/adapters/extensions.sh @@ -147,25 +147,28 @@ systemd-nspawn --settings=no --register=no --private-network --resolv-conf=off " else pacman -S --needed --noconfirm --cachedir /inputs -- "${requested[@]}" fi + # Local DB operations must not initialize repository transport or require + # the runtime DownloadUser in this account-free checkout. + local_db=(pacman --config /dev/null --dbpath /usr/lib/archipelago/package-db) for target in "${requested[@]}"; do name=${target%%=*} if ! grep -Fxq "$name" /explicit-requested; then - pacman -D --asdeps -- "$name" + "${local_db[@]}" -D --asdeps -- "$name" fi done # Add is not an override or base upgrade. Reject any removed/replaced base package. if [[ ${ARCHIPELAGO_SERVICE_PACKAGE:-0} != 1 ]]; then while read -r name version; do - [[ $(pacman -Q -- "$name") == "$name $version" ]] || { + [[ $("${local_db[@]}" -Q -- "$name") == "$name $version" ]] || { echo "Base package replacement requires a separate override: $name" >&2; exit 1; } done < /base-packages fi - pacman -Dk + "${local_db[@]}" -Dk if command -v dkms >/dev/null; then /bin/bash /dkms-finalize.sh fi - pacman -Q > /usr/lib/archipelago/packages.txt + "${local_db[@]}" -Q > /usr/lib/archipelago/packages.txt /bin/bash -euo pipefail /finalize-managed.sh ' 2>&1 | tee "$generation/logs/transaction.log" if grep -Ei 'error:|warning:.*(failed|failure)' "$generation/logs/transaction.log"; then