From 3c032c193a5c4d2da20f19c996d5d714cf667f43 Mon Sep 17 00:00:00 2001 From: diviocity Date: Mon, 30 Nov 2026 00:33:55 +0100 Subject: [PATCH] Boot a signed command-line userland and exercise its tools in Vinix --- PROFILES.md | 4 ++-- tests/FEED.md | 17 ++++++++++++++ tests/userland/check.sh | 49 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 68 insertions(+), 2 deletions(-) create mode 100644 tests/userland/check.sh diff --git a/PROFILES.md b/PROFILES.md index 20a0889..de1691c 100644 --- a/PROFILES.md +++ b/PROFILES.md @@ -41,8 +41,8 @@ Both desktop builders then remove `libOSMesa.so*`, `libGLU.so*` and `libxatracke | `libcrypto3`, `libssl3` | The `openssl` port builds both shared libraries from one source. | | `ca-certificates-bundle` | The native bundle provides `/etc/ssl/cert.pem`, the concatenated CA store and the individual Mozilla authorities. Check for consumers of the old `/etc/ssl1.1` aliases when auditing the final root. | | `busybox`, `busybox-binsh` | The BusyBox port owns `/bin/sh`. Expand the bootstrap applet configuration to cover the shell commands in both release images. Check the applet paths against the other packages during a signed install. | -| `ssl_client` | Build `/usr/bin/ssl_client` against OpenSSL and test its certificate checks. Exercise BusyBox wget with the helper and the release applet configuration. | -| `musl-utils`, `scanelf` | The proposed `musl-utils` output comprises `getconf`, `getent`, `iconv`, `ldconfig` and the architecture-specific musl `ldd` wrapper. Its `ldconfig` script uses `scanelf` from pax-utils. Check `ldd` in the arm64 desktop image since the target toolchain invokes it. | +| `ssl_client` | The `ssl-client` port builds `/usr/bin/ssl_client` against OpenSSL. Its x86_64 fixture verifies a trusted peer and rejects an unrelated CA and a wrong hostname. BusyBox wget still needs a guest test with the release applet configuration. | +| `musl-utils`, `scanelf` | The source-built `musl-utils` supplies `getconf`, `getent`, `iconv`, `ldconfig` and a target-specific musl `ldd` wrapper. Its `ldconfig` script uses the packaged `scanelf` from pax-utils. Both ports passed x86_64 recipe checks and installed together in the signed userland root. Verify the arm64 toolchain against its own loader. | | `alpine-release` | `vinix-release` supplies the OS identity and banners. The image builder supplies the image-specific `/etc/vinix-release` tag. | | `alpine-baselayout`, `alpine-baselayout-data` | Map the release's final paths, including account databases, shell profiles, network service tables and runtime directory links. Keep the Vinix account stage's handling of existing databases and verify edited configuration survives an upgrade. | | `apk-tools`, `alpine-keys` | Build target vpac and its OpenPGP dependencies. Update the Vinix `pkg` frontend, package persistence and release image checks that currently use APK paths. Install the release public key through a trusted image and verify on both architectures that vpac rejects a tampered package. | diff --git a/tests/FEED.md b/tests/FEED.md index cd4360e..2778f1e 100644 --- a/tests/FEED.md +++ b/tests/FEED.md @@ -63,3 +63,20 @@ To boot the packages, pass an existing Vinix amd64 BIOS ISO to the diskless test v -o "$work/boot" tests/busybox/boot.v "$work/boot" "$work/sdk/root" "$vinix_iso" "$work/guest" --musl ``` + +### Boot the packaged command-line userland + +Publish the following 27 target packages to a fresh feed. The November 29 run used BusyBox `1.38.0-4` and Zsh `5.9.2-2`. Select one archive per name. Run from the ports checkout on the worker with `bsdtar`, `xorriso`, `timeout` and QEMU on PATH. + +```sh +set -- musl linux-headers busybox vinix-release ca-certificates-bundle zlib bzip2 \ + brotli zstd xz expat libffi libcap libuuid ncurses pkgconf vim make openssl \ + pcre2 gmp libpng nghttp2 c-ares zsh scanelf musl-utils +"$work/feed" install "$work/client-keys" "$userland_feed" x86_64 "$work/userland" --fakeroot "$@" +v -o "$work/audit" tests/installed-root.v +"$work/audit" x86_64 "$work/userland" +v -o "$work/boot" tests/busybox/boot.v +"$work/boot" "$work/userland/root" "$vinix_iso" "$work/userland-guest" --userland +``` + +The x86_64 audit verified 27 signed package records, 9,583 owned files and links, and 110 target ELFs. Inside Vinix, the fixture loaded Zsh modules, edited a file with Vim, ran a Makefile, round-tripped compressed files, resolved pkg-config modules, parsed XML and verified the packaged ISRG root through OpenSSL. The serial log ends with `VPAC USERLAND GUEST PASS`. The worker keeps it under `musl-busybox-CqkBEA/foundation/userland-guest-01/serial.log` (SHA-256 `237592ae4c71ca99438e4fba943472c44c6890f60495a43204202c7ba2eb0837`). Boot harness revision `0a0ab0a` supports this run. diff --git a/tests/userland/check.sh b/tests/userland/check.sh new file mode 100644 index 0000000..d72c6da --- /dev/null +++ b/tests/userland/check.sh @@ -0,0 +1,49 @@ +#!/bin/sh +# Invoked by the packaged BusyBox init inside a disposable Vinix guest. +set -eu +export PATH=/bin:/usr/bin:/sbin:/usr/sbin +export HOME=/tmp TERM=xterm-256color LC_ALL=C + +finish() { + result=$? + if [ "$result" -ne 0 ]; then + echo "VPAC USERLAND GUEST FAIL at $phase (status $result)" + fi + /sbin/poweroff -f +} +phase=identity +trap finish EXIT +mkdir -p /tmp +cd /tmp +test "$(/bin/uname -o)" = Vinix +grep -q '^ID=vinix$' /etc/os-release + +phase=shell +/bin/zsh -fc 'zmodload zsh/zle && zmodload zsh/complete && zmodload zsh/terminfo && zmodload zsh/pcre && zmodload zsh/cap && setopt RE_MATCH_PCRE && [[ alphabet =~ "^(?=alpha)alpha" ]]' + +phase=editor +printf '%s\n' 'before' >note +vim -Nu NONE -i NONE -n -es note -c 'call setline(1, "Vinix edit")' -c 'wq' +test "$(cat note)" = 'Vinix edit' + +phase=make +printf 'all:\n\t@printf "built in Vinix\\n" > result\n' >Makefile +make -f Makefile +test "$(cat result)" = 'built in Vinix' + +phase=compression +bzip2 -kc note >note.bz2 +xz -c note >note.xz +test "$(bzip2 -dc note.bz2)" = 'Vinix edit' +test "$(xz -dc note.xz)" = 'Vinix edit' + +phase=libraries +pkg-config --exists zlib libpng libpcre2-8 +printf '\n' >release.xml +xmlwf release.xml + +phase=certificates +printf abc >abc +openssl dgst -sha256 abc | grep -q ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad +openssl verify -no_check_time -CAfile /etc/ssl/cert.pem /usr/share/ca-certificates/mozilla/ISRG_Root_X1.crt +echo 'VPAC USERLAND GUEST PASS' -- 2.56.1