From f9395a626df08e4415c502ecd90b5e23be75f9d2 Mon Sep 17 00:00:00 2001 From: diviocity Date: Mon, 30 Nov 2026 13:46:48 +0100 Subject: [PATCH] Support signed vpac downloads on Vinix without Landlock --- BOOTSTRAP.md | 2 ++ vpac/PKGBUILD.vile | 9 ++++++--- vpac/vinix-landlock.patch | 15 +++++++++++++++ 3 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 vpac/vinix-landlock.patch diff --git a/BOOTSTRAP.md b/BOOTSTRAP.md index e30384b..125490e 100644 --- a/BOOTSTRAP.md +++ b/BOOTSTRAP.md @@ -80,6 +80,8 @@ The published x86_64 Vinix kernel booted that 22-package root. Both `gpgv` and t The x86_64 vpac recipe uses V at `597b0f6`, targets musl explicitly, and embeds the Vile resources. Its configuration check temporarily removes both input Scheme files and queries an installed signed musl record. The recipe uses the locked `nobody` account from `vinix-accounts` and keeps package and database signature checks enabled. The build peaked at 2,281,107,456 bytes with zero cgroup OOM events. The resulting `vpac-1.0.0-1-x86_64.pkg.tar.zst` has SHA-256 `f6aa20508a8bc62b5da8b5134657f8d12b1ff5c1609a87e2d7eae02759ea7786`. The worker recorded the pinned source trees in `foundation/vpac-vcs-pins-01`, receipt SHA-256 `2124cc24c72459f7274eb4a74c0d1fa4ec30896a35183e31e6786e9060666014`. +Release 2 handles the Vinix kernel's `ENOSYS` response to the Landlock ABI query. Downloads retain the locked account, no-new-privs and seccomp, and the transaction still verifies the signed package. The x86_64 guest refused a same-length modification of the signed netbase archive, installed the authentic archive, and verified its local owner and signature. A separate boot queried the signed repository record by exact name. See `foundation/vpac-transaction-08/disk/guest/serial.log` and `foundation/vpac-remote-query-01/disk/receipts.sha256`, receipt SHA-256 `0d0569ad76f9828fadac877bf1f67ae505eceab3231546b30a13423826f48891`. The combined test still times out during repository lookup after installation. The upgrade fixture reaches package verification and extraction and still needs to pass its post-upgrade checks. + For later builds, `tools/build-queue.py` uses the source order and a verified bootstrap feed. Place the input archives and a `NAME.sha256` receipt for each in `$work/artifacts`. Configure the host compiler and signing tools as for a single native build, then select the ports to build. The worker uses this command form. ```sh diff --git a/vpac/PKGBUILD.vile b/vpac/PKGBUILD.vile index 5564b21..f7f30b6 100644 --- a/vpac/PKGBUILD.vile +++ b/vpac/PKGBUILD.vile @@ -5,7 +5,7 @@ v-arch := if string=?("aarch64", arch) { "arm64" } else { "x64" } defpkgbuild(vpac, #:pkgname, "vpac", #:pkgver, "1.0.0", - #:pkgrel, 1, + #:pkgrel, 2, #:pkgdesc, "Vinix package manager and native Vile package builder", #:arch, [#:x86-64, #:aarch64], #:url, "https://gitly.divio.city/me/vpac", @@ -18,12 +18,15 @@ defpkgbuild(vpac, "nspkg::git+https://gitly.divio.city/me/nspkg.git#commit=c01b0795d1db56c7bce2539b2c46b110637fdc1a", "stutter::git+https://gitly.divio.city/me/stutter.git#commit=29b47cb4b818f95a5308d3c086bd7933b7c176bd", "vile::git+https://git.vorelabs.dev/diviocity/vile.git#commit=76646891b77a3d5c6af4a1e42b122cd61dc1654b", - "config.vile.in", "check-config.py"], + "config.vile.in", "check-config.py", "vinix-landlock.patch"], #:sha256sums, ["SKIP", "SKIP", "SKIP", "SKIP", "da473de43c4b1232145dee708df4762a1b26f930bb5693053b19a763df462bf4", - "eb72a7f3ce972cfe0b653984324332cf119d778e723d7e659b3a49494cc883ea"], + "eb72a7f3ce972cfe0b653984324332cf119d778e723d7e659b3a49494cc883ea", + "7c0e1262f5d7b65a1c95b4efb5ea00e2fab9f0ef4f27b304f359858e564aa212"], #:prepare, fn() { run("mkdir", "modules") run("mv", "nspkg", "stutter", "vile", "modules/") + run("patch", "--batch", "--fuzz=0", "-d", "modules/nspkg", "-p1", "-i", + string-append(srcdir(), "/vinix-landlock.patch")) run("cp", "config.vile.in", "config.vile") run("sed", "-i", string-append("s/@ARCH@/", arch, "/g"), "config.vile") }, diff --git a/vpac/vinix-landlock.patch b/vpac/vinix-landlock.patch new file mode 100644 index 0000000..c267ce7 --- /dev/null +++ b/vpac/vinix-landlock.patch @@ -0,0 +1,15 @@ +--- a/engine/sandbox_restrictions.v ++++ b/engine/sandbox_restrictions.v +@@ -118,6 +118,12 @@ + abi := C.v_alpm_landlock_abi() + if abi < 0 { ++ // Vinix has no Landlock syscall. The caller still sets no-new-privs ++ // and seccomp and drops privileges before it starts the transfer. ++ if C.errno == C.ENOSYS && os.uname().sysname == 'Vinix' { ++ handle.log(.debug, 'Landlock is unavailable on this Vinix kernel\n') ++ return 0 ++ } + problem := os.last_error().msg() + handle.log(.error, localized_message('restricting filesystem access failed because Landlock is not supported by the kernel!\n')) + return AlpmError{ kind: .retrieve_prepare, detail: 'Landlock is not supported: ${problem}' } + } -- 2.56.1