me

/

vinix-ports Public
382 commits 0 issues 0 pull requests 1 contributor Discussions Projects Snippets LOC history Platform CI

Install the vpac-backed pkg command in desktop roots

diviocity committed 5 days ago · ae5d59975b62c2b37c7f4f2f490e34de16681bff View patch
Unverified signature 6 files changed +153 -3
PROFILES.md +3 -1

@@ -14,7 +14,7 @@ The launchers and policy files for optional desktop apps come from Vinix sources

1414

1515The upstream profile adds one input row per architecture. Alpine v3.21 selects btop 1.4.0-r0, whose musl, libgcc and libstdc++ requirements already have Vinix providers. The worker's source input checksums and 240-row closures are in `release-inputs/upstream-7f173671`, receipt SHA-256 `f26c013d651aec9ee957e7b6139ff75e96014a2fd0b58f2eb04d573eec7fd758`. The AArch64 desktop now uses a single compositor executable and starts a first-frame watchdog from init. Asahi Mesa remains an opt-in image layer. [AArch64 desktop builder](https://github.com/vlang/vinix/blob/7f173671b6d1f1a8ceda2c693eadbb0eb58c4aa4/scripts/build-desktop-aarch64.sh) · [AArch64 init](https://github.com/vlang/vinix/blob/7f173671b6d1f1a8ceda2c693eadbb0eb58c4aa4/build-support/init-aarch64/initcore/core.v)

1616

17-The upstream source plan orders 157 packages in 14 stages on each architecture. The desktop metapackage requires btop and the new AArch64 init with its watchdog. The amd64 init script has the same bytes as in the published release, which lets the new profile use its existing archive. The plans are in `release-inputs/upstream-7f173671/order-01`, receipt SHA-256 `45e137834f354d6effab4d784d6198f2a2d05b207124ddd18d781d46ccc355fc`.

17+The upstream source plan orders 158 packages in 14 stages on each architecture. The desktop metapackage requires btop, the vpac-backed `vinix-pkg` command and the new AArch64 init with its watchdog. The amd64 init script has the same bytes as in the published release, which lets the new profile use its existing archive. The plans are in `release-inputs/upstream-7f173671/order-03`, receipt SHA-256 `67d5c82443c21997418823e18061fb9a30baeca3dba9aa4525d61dc1597bfca0`.

1818

1919Both btop 1.4.0-1 archives were built against the signed Vinix musl and GNU C++ runtime and checked for their target ELF layout. Each published Vinix kernel booted an eight-package signed root, ran btop's version and help commands, and found the installed theme and manual. See `release-inputs/upstream-7f173671/btop-build-01` and `btop-guests-05`, receipt SHA-256 `888b9bec6a542a464a7f22c5689e894188b1fb1bd22ef8704b91b4bf00aa77a9` and `7c67d8d52bd24eee7c800076b3f3a4407e6c4dc7215fdaa91583873ba906cdcc`. The upstream AArch64 init and watchdog were also built from source and passed static linkage and 16 KiB load-segment checks. See `init-arm16-01`, receipt SHA-256 `20ae3a3806e753b35483f30cb9444f2b9c5aaf11d1e0f00f01b9a0660b4a784d`.

2020

@@ -135,3 +135,5 @@ To survey the whole release initramfs, pass `--system-providers providers.tsv` t

135135`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`.

136136

137137With `--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`.

138+

139+`vinix-pkg` owns `/usr/bin/pkg` in the vpac-installed desktop root. Its `search --exact` command returns the matching package name or empty output when the signed index has no exact match. It translates `x11` into the `vinix-release-x11` metapackage. The first-run selector and System Information still need to use the new package interfaces in the Vinix source tree.

tests/userland/pkg.sh new file +45 -0

@@ -0,0 +1,45 @@

1+#!/bin/sh

2+set -eu

3+export PATH=/bin:/usr/bin:/sbin:/usr/sbin LC_ALL=C HOME=/root

4+

5+phase=identity

6+finish() {

7+ status=$?

8+ if [ "$status" -ne 0 ]; then echo "PKG FIXTURE FAIL at $phase with status $status"; fi

9+ /sbin/poweroff -f

10+}

11+trap finish EXIT

12+

13+test "$(uname -o)" = Vinix

14+test ! -e /sbin/apk

15+test ! -e /lib/apk/db/installed

16+vpac o /usr/bin/pkg | grep -q vinix-pkg

17+pkg list > /tmp/pkg-list

18+grep -Fxq vinix-pkg /tmp/pkg-list

19+pkg info musl > /tmp/pkg-info

20+grep -Eq '^name[[:space:]]+musl$' /tmp/pkg-info

21+

22+phase=repository

23+pkg update

24+pkg search netbase > /tmp/pkg-search

25+grep -Fq netbase /tmp/pkg-search

26+test "$(pkg search --exact netbase)" = netbase

27+test -z "$(pkg search --exact net)"

28+if pkg search --eval '(exit 0)' > /tmp/pkg-invalid 2>&1; then exit 1; fi

29+grep -Fq 'pkg: invalid query --eval' /tmp/pkg-invalid

30+

31+phase=install

32+test ! -e /etc/services

33+pkg install netbase

34+pkg list > /tmp/pkg-list

35+grep -Fxq netbase /tmp/pkg-list

36+vpac q -F validation local/netbase > /tmp/pkg-validation

37+grep -Eq '^validation[[:space:]]+signature$' /tmp/pkg-validation

38+vpac o /etc/services | grep -q netbase

39+

40+phase=remove

41+pkg remove netbase

42+test ! -e /etc/services

43+pkg list > /tmp/pkg-list

44+if grep -Fxq netbase /tmp/pkg-list; then exit 1; fi

45+echo 'VPAC FIXTURE GUEST PASS'

tools/desktop-root.py +1 -0

@@ -25,6 +25,7 @@ def build(args):

2525 name, = [field.splitlines()[1] for field in desc if field.startswith("%NAME%\n")]

2626 records[name] = record.with_name("files")

2727 owners = {"busybox": "bin/sh", "vinix-desktop-init": "sbin/init", "vpac": "usr/bin/vpac",

28+ "vinix-pkg": "usr/bin/pkg",

2829 "vinix-keyring": "usr/share/vpac/keyrings/vinix.gpg", "gcc": "usr/bin/gcc",

2930 "binutils": "usr/bin/ld", "make": "usr/bin/make", "zsh": "bin/zsh", "btop": "usr/bin/btop"}

3031 for name, path in owners.items():

vinix-pkg/PKGBUILD.vile new file +17 -0

@@ -0,0 +1,17 @@

1+defpkgbuild(vinix-pkg,

2+ #:pkgname, "vinix-pkg",

3+ #:pkgver, "1.0.0",

4+ #:pkgrel, 1,

5+ #:pkgdesc, "Vinix pkg command for the vpac package repository",

6+ #:arch, [#:any],

7+ #:url, "https://github.com/vlang/vinix",

8+ #:license, "0BSD",

9+ #:depends, ["busybox", "vpac>=1.0.0-2"],

10+ #:source, ["pkg"],

11+ #:sha256sums, ["35a291f69a5965bbbbcd4692eea6db4db746324760a46f8fcc8b78f5798858cf"],

12+ #:check, fn() {

13+ run("sh", "-n", "pkg")

14+ },

15+ #:package, fn() {

16+ run("install", "-Dm755", "pkg", string-append(pkgdir(), "/usr/bin/pkg"))

17+ })

vinix-pkg/pkg new file +85 -0

@@ -0,0 +1,85 @@

1+#!/bin/sh

2+# SPDX-License-Identifier: 0BSD

3+set -eu

4+

5+usage() {

6+ printf '%s\n' 'Usage: pkg install|remove|info PACKAGE ...' \

7+ ' pkg search QUERY ... | pkg search --exact PACKAGE' \

8+ ' pkg list|update|upgrade'

9+}

10+

11+require_root() {

12+ if [ "$(id -u)" != 0 ]; then

13+ printf '%s\n' 'pkg: package changes require root' >&2

14+ exit 1

15+ fi

16+}

17+

18+check_query() {

19+ for query do

20+ case "$query" in

21+ ''|-*) printf 'pkg: invalid query %s\n' "$query" >&2; exit 1 ;;

22+ esac

23+ done

24+}

25+

26+check_package() {

27+ case "$1" in

28+ ''|-*|*[!a-zA-Z0-9._+-]*)

29+ printf 'pkg: invalid package name %s\n' "$1" >&2

30+ exit 1

31+ ;;

32+ esac

33+}

34+

35+case "${1:-}" in

36+ help|-h|--help) usage; exit 0 ;;

37+ '') usage >&2; exit 1 ;;

38+esac

39+command=$1

40+shift

41+

42+case "$command" in

43+ install|add|remove|delete|del|info)

44+ if [ "$#" -eq 0 ]; then usage >&2; exit 1; fi

45+ for package do

46+ shift

47+ check_package "$package"

48+ if [ "$package" = x11 ]; then package=vinix-release-x11; fi

49+ set -- "$@" "$package"

50+ done

51+ case "$command" in

52+ install|add) require_root; exec /usr/bin/vpac i --needed --noconfirm "$@" ;;

53+ remove|delete|del) require_root; exec /usr/bin/vpac r --recursive --noconfirm "$@" ;;

54+ info) exec /usr/bin/vpac q --noconfirm "$@" ;;

55+ esac

56+ ;;

57+ search)

58+ if [ "$#" -eq 0 ]; then usage >&2; exit 1; fi

59+ if [ "$1" = --exact ]; then

60+ shift

61+ if [ "$#" -ne 1 ]; then usage >&2; exit 1; fi

62+ check_package "$1"

63+ name=$1

64+ if [ "$name" = x11 ]; then name=vinix-release-x11; fi

65+ matches=$(/usr/bin/vpac s --remote --quiet --noconfirm "$name")

66+ if printf '%s\n' "$matches" | grep -Fxq "$name"; then printf '%s\n' "$1"; fi

67+ exit 0

68+ fi

69+ check_query "$@"

70+ exec /usr/bin/vpac s --remote --noconfirm "$@"

71+ ;;

72+ list|update|upgrade)

73+ if [ "$#" -ne 0 ]; then usage >&2; exit 1; fi

74+ case "$command" in

75+ list) exec /usr/bin/vpac s --local --quiet ;;

76+ update) require_root; exec /usr/bin/vpac s --remote --sync --quiet --noconfirm >/dev/null ;;

77+ upgrade) require_root; exec /usr/bin/vpac u --sync --noconfirm ;;

78+ esac

79+ ;;

80+ *)

81+ printf 'pkg: unknown command %s\n' "$command" >&2

82+ usage >&2

83+ exit 1

84+ ;;

85+esac

vinix-release-desktop/PKGBUILD.vile +2 -2

@@ -5,14 +5,14 @@ arch := if string?(selected) { selected } else if memq(string->symbol("aarch64")

55musl := if string=?("aarch64", arch) { "musl>=1.2.6-4" } else { "musl>=1.2.6-2" }

66common := list(musl, "busybox>=1.38.0-5", "musl-utils", "ssl-client", "netbase",

77 "vinix-release", "vinix-filesystem>=0.1.0-2", "vinix-accounts", "vinix-keyring",

8- "ca-certificates", "curl", "git", "openssh-client", "vpac", "xbps",

8+ "ca-certificates", "curl", "git", "openssh-client", "vpac", "vinix-pkg", "xbps",

99 "zsh", "vim", "btop", "build-base",

1010 if string=?(arch, "aarch64") { "vinix-desktop-init>=20261130-1" } else { "vinix-desktop-init" })

1111

1212defpkgbuild(vinix-release-desktop,

1313 #:pkgname, "vinix-release-desktop",

1414 #:pkgver, "20261130",

15- #:pkgrel, 1,

15+ #:pkgrel, 2,

1616 #:pkgdesc, "Base, network and toolchain packages for the Vinix desktop release",

1717 #:arch, [#:x86-64, #:aarch64],

1818 #:url, "https://github.com/vlang/vinix",