me

/

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

Check HTTPS, Git, SSH signing and XBPS inside the release kernel

diviocity committed 5 days ago · f26bf8bdfbef57feec518b71ceecad6f71289275 View patch
Unverified signature 2 files changed +68 -0
BOOTSTRAP.md +2 -0

@@ -70,3 +70,5 @@ python3 tools/build-queue.py --reserve-mib 6144 "$arch" "$plan/order.tsv" "$port

70```

171

272Each port gets a fresh, signed SDK containing its transitive prerequisites. The queue records recipe and dependency hashes, compiler logs and ELF page results. A subsequent port consumes an archive after its final checksum is available. Exit status 2 reports outstanding input packages. Rerunning reuses verified outputs and reclaims interrupted scratch directories. The worker built musl-fts, resumed it, and rejected an incorrect input version and a damaged receipt in `foundation/queue-test-03`, receipt SHA-256 `1de747944bd569219494cd127fc1f42cf110f7b0ad2a4e513099249a2e0b3bb1`. Two concurrent resumptions passed in `foundation/queue-resume-04`, receipt SHA-256 `a58a80c0050294666d4ecd41ce5c2affc371c5fbeb58fc672e98a9b7c8c3b14b`.

73+

74+The published x86_64 Vinix kernel booted 32 signed network packages. It refreshed the trust store with a local CA, established loopback HTTPS, rejected the wrong hostname, committed and read a Git file, signed and verified that file with the installed SSH tools, then installed and queried a local XBPS package. The fixture and logs are `tests/userland/network.sh` and `foundation/network-guest-03`, receipt SHA-256 `4e9afac33947b999911a4ff35f218b49f3356b345e47e7b90e7ffce644d0c7b4`.

tests/userland/network.sh new file +66 -0

@@ -0,0 +1,66 @@

1+#!/bin/sh

2+# BusyBox starts this script as the signed network packages' guest smoke test.

3+set -eu

4+export PATH=/bin:/usr/bin:/sbin:/usr/sbin HOME=/tmp TERM=dumb LC_ALL=C

5+phase=identity

6+server=

7+finish() {

8+ status=$?

9+ if [ -n "$server" ]; then kill "$server" 2>/dev/null || true; fi

10+ if [ "$status" -ne 0 ]; then echo "VPAC NETWORK FAIL at $phase with status $status"; fi

11+ /sbin/poweroff -f

12+}

13+trap finish EXIT

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

15+mkdir -p /tmp/network

16+cd /tmp/network

17+

18+phase=trust

19+openssl req -x509 -newkey ec -pkeyopt ec_paramgen_curve:P-256 -nodes -days 1 \

20+ -subj /CN=vinix.test -addext subjectAltName=DNS:vinix.test -keyout key.pem -out cert.pem

21+mkdir -p /usr/local/share/ca-certificates

22+cp cert.pem /usr/local/share/ca-certificates/vinix-fixture.crt

23+update-ca-certificates

24+openssl verify -CAfile /etc/ssl/cert.pem cert.pem

25+openssl verify -no-CAfile -no-CAstore -CApath /etc/ssl/certs cert.pem

26+

27+phase=https

28+openssl s_server -accept 127.0.0.1:2443 -cert cert.pem -key key.pem -www >tls.log 2>&1 &

29+server=$!

30+curl --disable --noproxy '*' --retry 5 --retry-connrefused --max-time 8 --silent --show-error \

31+ --resolve vinix.test:2443:127.0.0.1 https://vinix.test:2443/ -o page

32+grep -qi '<html>' page

33+status=0

34+curl --disable --noproxy '*' --max-time 5 --silent --show-error --resolve wrong.test:2443:127.0.0.1 \

35+ https://wrong.test:2443/ -o wrong || status=$?

36+test "$status" -eq 60

37+kill "$server"

38+wait "$server" || true

39+server=

40+

41+phase=git

42+git init -q repo

43+printf '%s\n' 'Vinix source ports' >repo/note

44+git -C repo add note

45+git -C repo -c user.name=Vinix -c user.email=ports@example.invalid commit -qm fixture

46+test "$(git -C repo show HEAD:note)" = 'Vinix source ports'

47+git -C repo grep -q -P '(?=source)source'

48+

49+phase=ssh

50+ssh-keygen -q -t ed25519 -N '' -f ssh-key

51+ssh-keygen -Y sign -f ssh-key -n vinix repo/note

52+printf 'builder %s\n' "$(cat ssh-key.pub)" >signers

53+ssh-keygen -Y verify -f signers -I builder -n vinix -s repo/note.sig <repo/note

54+

55+phase=xbps

56+arch=$(xbps-uhelper arch)

57+test "$arch" = "$(uname -m)-musl"

58+mkdir payload client conf

59+cp repo/note payload/note

60+xbps-create -A "$arch" -n vinix-test-1.0_1 -s 'Vinix fixture' payload

61+xbps-rindex -a "vinix-test-1.0_1.$arch.xbps"

62+test "$(xbps-query -r "$PWD/client" -C "$PWD/conf" --repository="$PWD" -R -p pkgver vinix-test)" = vinix-test-1.0_1

63+xbps-install -y -r "$PWD/client" -C "$PWD/conf" --repository="$PWD" vinix-test

64+cmp payload/note client/note

65+test "$(xbps-query -r "$PWD/client" -C "$PWD/conf" -p pkgver vinix-test)" = vinix-test-1.0_1

66+echo 'VPAC FIXTURE GUEST PASS'