From df47b46c485bdaae7fb1d0d6ac5688b6c59fb065 Mon Sep 17 00:00:00 2001 From: diviocity Date: Mon, 30 Nov 2026 04:20:52 +0100 Subject: [PATCH] Identify the release desktop and command-line consumers of apk --- PROFILES.md | 2 ++ tests/release-imports.py | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/PROFILES.md b/PROFILES.md index e54a97f..ae6938a 100644 --- a/PROFILES.md +++ b/PROFILES.md @@ -115,3 +115,5 @@ OpenSSL 3.5.9-4 on x86_64 enables those three methods. Its recipe creates and fr To survey the whole release initramfs, pass `--system-providers providers.tsv` to `tests/library-upgrades.py` in place of individual library arguments. It examines every regular shared-library ELF in `/lib` and `/usr/lib`, resolves its SONAME to an installed owner, and records absent providers and differing exports. The 129-package x86_64 root fully covered the exports for 51 of 69 regular library paths. Twelve had no installed provider and six had export differences, including the earlier OpenSSL build. Multiple paths in the release contain the same library. The nine-package arm64 bootstrap root covered its loader, had 68 missing providers and contained no replacement for the release's native OBS module without a SONAME. See `foundation/system-library-interfaces-01`, receipt SHA-256 `cdf961b747c2abcf7c90f0a5d011c783a16ad97e8aedb091f317c76628870381`. `tests/release-imports.py ARCHIVE SHA256 REPORT SYMBOL...` searches undefined dynamic symbols in the original binaries. Across 240 amd64 image files, 114 amd64 X11 files, 221 arm64 image files and 120 arm64 X11 files, no binary imported `_dlstart` or Zstd's deprecated experimental `ZSTD_copyCCtx` and `ZSTD_copyDCtx`, removed upstream in 1.6.0. The same scan found no direct imports of the five differing GMP helpers or the nine MPFR cache and default-state symbols. It found `ZSTD_decompress` in all four layers and `mpfr_init2` in both images. The scan measures link-time imports. MPFR's per-thread defaults need a runtime test independently. See `foundation/release-dynamic-imports-01`, receipt SHA-256 `2e5ff31cdbc7c255a15ba8b8da25749c1633e102245f89a95fe8dcdcdd9072a5`. + +With `--dependencies needed.tsv` the same command records each ELF's library dependencies. Across both images and their X11 bundles, only `/sbin/apk` links to `libapk.so.2.14.0`. The native desktop still uses apk through two other interfaces. The first-run selector invokes `/sbin/apk search --exact`, and System Information reads `/lib/apk/db/installed`. Both images also ship a 49,083-byte `/usr/bin/pkg` shell frontend that runs apk transactions. The cutover needs a vpac repository query for the selector, vpac records for System Information, and a working native backend for the published `pkg` commands. Test all three interfaces in the guest alongside first-boot registration. See `foundation/release-dependency-edges-01` and `foundation/release-pkg-callers-01`, receipt manifests `b003d96cba8b6d0a6ca4461865241b2815657b309f1fac8844cdd5f0806b67c2` and `6ec3399d9c79ceb33cd4099c9fad7d22d270f04595227fb1ba472bb80cbead49`. diff --git a/tests/release-imports.py b/tests/release-imports.py index 148ba87..e043c61 100644 --- a/tests/release-imports.py +++ b/tests/release-imports.py @@ -16,6 +16,7 @@ def scan(args): if hashlib.file_digest(stream, "sha256").hexdigest() != args.sha256: raise ValueError("release archive checksum mismatch") results = [] + dependencies = [] files = 0 with tempfile.TemporaryDirectory() as temp, tarfile.open(args.archive, "r|gz") as archive: elf = Path(temp) / "member" @@ -32,18 +33,26 @@ def scan(args): files += 1 report = subprocess.check_output(["readelf", "-Wd", "--dyn-syms", elf], text=True) needed = ",".join(re.findall(r"\(NEEDED\)[^\n]*?\[([^\]]+)\]", report)) + path = entry.name.removeprefix("./") + if args.dependencies: + dependencies.append((path, needed)) for line in report.splitlines(): cols = line.split() if len(cols) < 8 or cols[6] != "UND" or not cols[0].removesuffix(":").isdigit(): continue if cols[7].split("@", 1)[0] in symbols: - results.append((entry.name.removeprefix("./"), cols[7], cols[4], needed)) + results.append((path, cols[7], cols[4], needed)) if not files: raise ValueError("release archive contains no regular ELF files") with args.output.open("x") as out: table = csv.writer(out, delimiter="\t", lineterminator="\n") table.writerow(("release_path", "import", "binding", "needed")) table.writerows(sorted(results)) + if args.dependencies: + with args.dependencies.open("x") as out: + table = csv.writer(out, delimiter="\t", lineterminator="\n") + table.writerow(("release_path", "needed")) + table.writerows(sorted(dependencies)) for name in sorted(symbols): count = sum(symbol.split("@", 1)[0] == name for _, symbol, _, _ in results) print(f"{name}\t{count}") @@ -56,4 +65,5 @@ if __name__ == "__main__": parser.add_argument("sha256") parser.add_argument("output", type=Path) parser.add_argument("symbol", nargs="+") + parser.add_argument("--dependencies", type=Path, help="list DT_NEEDED entries for every regular ELF") scan(parser.parse_args()) -- 2.56.1