gpkg: gapk Phase 7 — apk backend on-target integration#44
Open
ispyisail wants to merge 6 commits into
Open
Conversation
added 6 commits
July 10, 2026 07:30
…testing gpkg's own apk backend (GPKG_BACKEND=apk, merged in #39) needs a real apk binary present in the image -- nothing previously selected one. Picked the mbedtls variant since libmbedtls is already selected on this profile (avoids pulling in a second TLS stack for openssl). Re-derived via a real make defconfig + scripts/diffconfig.sh round trip; confirmed no other symbols changed as a side effect.
conf.c already parses apk_root/apk_repository/apk_keys_dir (added in earlier gapk phases) but nothing ever emitted them into a real image's /etc/opkg.conf. Adds them to opkg.gpkg.tmp using the same version/board/profile substitution tokens as the existing gargoyle src/gz lines, nested under an "apk" path segment so both feed formats can be served from the same release tree. Inert for the default legacy backend. Also has gpkg-uci-defaults create /etc/gargoyle/apk-keys on first boot, ready for a release or test signing pubkey to be dropped in later. Verified via a real scoped package rebuild + host gpkg run: the rendered template parses cleanly (dest-info reads destinations correctly; list attempts a real apk_query_json call using the configured repository, failing only on no real feed/binary present in this dev environment, not a parsing error). One bug caught and fixed before this: the added comment used literal %G/%T/%F characters, which the package's own build-time sed then mangled since it substitutes those tokens file-wide, not just in the src/gz lines -- reworded in prose instead.
…pk Phase 7.3) A CGI process spawned through haserl can't be relied on to inherit an environment variable the way an interactive shell does, so the env-only GPKG_BACKEND switch (Phase 3) isn't usable for a real on-target Plugins UI flow. Adds a `backend apk` conf-file directive, parsed the same way as the existing apk_root/apk_repository/ apk_keys_dir lines. GPKG_BACKEND still wins if set (unchanged CLI/test behavior); the conf file is now the on-target mechanism. Verified all four precedence combinations manually (env unset+conf unset -> legacy; conf-only apk -> apk codepath attempted; conf apk + env opkg -> env wins, legacy; env apk + conf unset -> apk codepath), plus a full re-run of every existing gapk golden suite (48 tests: 17 legacy + 5 apk-read + 10 apk-install + 10 apk-remove/update + 6 apk-local-file), all passing -- this touches shared init code in main() that every gpkg invocation runs through.
Found via the real booted-VM smoke test: every apk operation, even a read-only query, fails with "Unable to read database: No such file or directory" against a fresh root that's never run a real apk command -- installing the apk-mbedtls/apk-openssl package alone doesn't create /lib/apk/db's actual database file, only the empty directory. Needs an explicit `apk add --initdb` once. Confirmed idempotent (harmless no-op on an already-initialized db), so it runs unconditionally on every boot rather than gating on first-run state.
…7.4) Found via the real booted-VM smoke test: apk itself appends its own --print-arch value (e.g. "x86") when fetching "<apk_repository>/<arch>/APKINDEX.tar.gz" -- the earlier template version also appended the ipk-side %A token (e.g. "i386_pentium4"), double-nesting the arch segment and 404ing every real fetch attempt.
package/system/apk declares lua/host only as HOST_BUILD_DEPENDS, which
covers apk's own host build -- but the target package's meson configure
also hard-requires lua5.1 on the host ("Program 'lua5.1' not found").
In this tree nothing ever builds apk/host (gpkg is the default package
manager, apk-mbedtls is selected only as a target package), so lua/host
never enters the build graph and every from-scratch build fails
deterministically at package/system/apk/compile.
Add PKG_BUILD_DEPENDS:=lua/host via a new generic patch so the target
build pulls the host tool in itself.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #43 — base branch is
openwrt-2512(the 25.12 bump), notmaster. Merge #43 first; this rebases cleanly onto master afterward.Continues the gpkg→apk backend work (gapk) into Phase 7: on-target integration and boot-time initialization, now exercised against the real 25.12 apk-tools rather than a lab prototype.
apk-mbedtlsinto the vnet-wifi profile for on-target testing.apk_*directives to the gpkg conf template and a conf-file backend switch alongside the existingGPKG_BACKENDenv var, so the backend can be chosen per-install rather than only at build time.apk_repositorytemplate.lua5.1host dependency —package/system/apkonly declaredlua/hostas a host-build dependency; the target package's own meson configure also needs it, and nothing pullslua/hostinto the graph when apk is only selected as a target package (Gargoyle's situation, since gpkg remains the default). Newpatches-generic/032addsPKG_BUILD_DEPENDS:=lua/host. Without this, any build selectingapk-mbedtlsfails deterministically and non-obviously atpackage/system/apk/compile.Verified via a real booted-VM smoke test earlier in this branch's history: full install/remove/reinstall cycle through the actual CGI shapes (
install_gargoyle_package.sh/remove_gargoyle_package.sh/plugins.sh), no--allow-untrustedneeded anywhere.