From 0f5d6ec05df94bda5d2d6ccc22182f1e876ae9c7 Mon Sep 17 00:00:00 2001 From: diviocity Date: Mon, 30 Nov 2026 19:38:55 +0100 Subject: [PATCH] Exercise signed desktop installs with the native build layer --- tests/desktop-guest.py | 8 ++++++++ tests/x11/README.md | 2 +- tools/desktop-root.py | 14 +++++++++++--- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/tests/desktop-guest.py b/tests/desktop-guest.py index 22d1027..418b7cc 100644 --- a/tests/desktop-guest.py +++ b/tests/desktop-guest.py @@ -40,10 +40,18 @@ def native_overlay(archive, arch, root): copies.add(name) if copies != set(PROGRAMS): raise ValueError(f"missing release programs: {set(PROGRAMS) - copies}") + record_native_programs(root) + + +def record_native_programs(root): watchdog = "usr/libexec/vinix-desktop-watchdog" checksummed = ["sbin/init", *PROGRAMS] if (root / watchdog).is_file(): checksummed.append(watchdog) + for name in checksummed: + program = root / name + if program.is_symlink() or not program.is_file() or not os.access(program, os.X_OK): + raise ValueError(f"expected an installed native executable at /{name}") manifest = root / "desktop-programs.sha256" with manifest.open("x") as output: for name in checksummed: diff --git a/tests/x11/README.md b/tests/x11/README.md index 04384f8..d75c496 100644 --- a/tests/x11/README.md +++ b/tests/x11/README.md @@ -65,7 +65,7 @@ The Mesa 24.2.8 recipe compiles Gallium once and uses one Meson installation to For those checks, install `vinix-release-x11` and `busybox-init` from the signed feed into a clean root and audit it. Build `egl.v` and `glx.v` against that SDK and place the executables at `/vinix-egl-check` and `/vinix-glx-check` in a disposable guest root. Boot `graphics.sh` using `tests/disk-root.py`. The fixture reads back the expected pixel from current Mesa's surfaceless EGL and again from an authenticated indirect GLX connection to `Xvfb-glx` using the legacy DRI directory. -For the on-demand release test, combine the signed desktop and X11 package lists with `tests/combined-feed.py --publish-only`. Pass the combined feed to `tools/desktop-root.py` to install the desktop metapackage and embed the signed feed. Add the native desktop programs and framebuffer probe as in `tests/desktop-guest.py`. Set `VINIX_DESKTOP_NEXT_FIXTURE` in the desktop fixture to the guest path of `graphics.sh` and set `VINIX_X11_INSTALL_FROM_PKG=1` in that script. With `tests/disk-root.py --desktop-init --space-for "$x11_sdk/root"`, the guest must reach graphical registration, resolve `x11` by exact name, install the signed X11 metapackage, verify the server and Mesa owners, and pass both rendered pixel checks. +For the on-demand release test, combine the signed desktop and X11 package lists with `tests/combined-feed.py --publish-only`. Pass the combined feed and `--native-layer "$native_layer"` to `tools/desktop-root.py` to install the desktop metapackage, stage the source-built desktop programs and embed the signed feed. Run `record_native_programs` from `tests/desktop-guest.py` on the staged root and add the framebuffer probe. Set `VINIX_DESKTOP_NEXT_FIXTURE` in the desktop fixture to the guest path of `graphics.sh` and set `VINIX_X11_INSTALL_FROM_PKG=1` in that script. With `tests/disk-root.py --desktop-init --space-for "$x11_sdk/root"`, the guest must reach graphical registration, resolve `x11` by exact name, install the signed X11 metapackage, verify the server and Mesa owners, and pass both rendered pixel checks. Use the same signed feed for the downloadable X11 sidecar. Cold-install `vinix-release-desktop` into one client. Into a second client, cold-install both `vinix-release-desktop` and `vinix-release-x11` with the target font hooks enabled. diff --git a/tools/desktop-root.py b/tools/desktop-root.py index d0e022f..c19c7b4 100644 --- a/tools/desktop-root.py +++ b/tools/desktop-root.py @@ -40,8 +40,11 @@ def build(args): if (root / path).exists() or (root / path).is_symlink(): raise ValueError(f"unexpected Alpine package-management path /{path}") if not args.install_only: - run("stage", [sys.executable, Path(__file__).with_name("stage-image.py"), args.arch, client, - args.repo, work / "image", args.auditor, args.fingerprint]) + command = [sys.executable, Path(__file__).with_name("stage-image.py"), args.arch, client, + args.repo, work / "image", args.auditor, args.fingerprint] + if args.native_layer: + command += ["--native-layer", args.native_layer] + run("stage", command) with (work / "receipts.sha256").open("x") as receipts: for path in sorted(work.glob("*.log")): with path.open("rb") as stream: @@ -56,4 +59,9 @@ if __name__ == "__main__": parser.add_argument("fingerprint", help="the distributor's fingerprint supplied independently of the feed") parser.add_argument("--install-only", action="store_true", help="prepare the audited client for a separate image assembly") - build(parser.parse_args()) + parser.add_argument("--native-layer", type=lambda p: Path(p).resolve(), + help="install the source-built native desktop layer into the staged image") + args = parser.parse_args() + if args.install_only and args.native_layer: + parser.error("--native-layer requires image staging") + build(args) -- 2.56.1