From 73ce2171ae35895d87442ccbc8f43104ce63a4fc Mon Sep 17 00:00:00 2001 From: diviocity Date: Mon, 30 Nov 2026 03:13:40 +0100 Subject: [PATCH] Package Git and OpenSSH clients with target object and signature checks --- BOOTSTRAP.md | 2 ++ git/PKGBUILD.vile | 31 +++++++++++++++++++++++++ git/check.py | 27 ++++++++++++++++++++++ git/config.mak | 15 ++++++++++++ openssh-client/PKGBUILD.vile | 44 ++++++++++++++++++++++++++++++++++++ 5 files changed, 119 insertions(+) create mode 100644 git/PKGBUILD.vile create mode 100644 git/check.py create mode 100644 git/config.mak create mode 100644 openssh-client/PKGBUILD.vile diff --git a/BOOTSTRAP.md b/BOOTSTRAP.md index fbb5fad..5a4d3dd 100644 --- a/BOOTSTRAP.md +++ b/BOOTSTRAP.md @@ -50,6 +50,8 @@ The Ubuntu build worker runs one build or guest test at a time under its shared ## Verified x86_64 bootstrap +A fresh signed Git 2.47.3 installation pulled in 15 packages and passed the audit for 1,842 paths and 46 ELF files. In the isolated root, Git created a commit, read it back and passed `git fsck --full`. The installed OpenSSH 9.9p2 client and its five dependencies passed the audit for 4,319 paths and 34 ELFs. Its `ssh-keygen` generated an Ed25519 key, signed a file and verified it for the named principal. The worker retains those installed-package results in `foundation/signed-git-01` and `foundation/signed-ssh-01`, receipt SHA-256 `f43c1f53e159f97b6e5cfb8db542828f5ab055996e7885b2e4b89b044df9ed76` and `6e30b1d67ad5e9740ca28cf76317ef3f4dac4e75c82c78560785a2395ddb2e32` respectively. + The November 2026 worker run installed 24 packages by name into a fresh root from a test-signed repository. The ownership and ELF auditor at ports revision `4cc4c14` checked 8,169 files and links and 67 ELF files, including interpreter and shared library resolution. The package set includes BusyBox 1.38.0-4, musl, Linux headers, GNU Make, GMP, OpenSSL, the CA bundle, libpng, nghttp2 and c-ares. The worker retains the package hashes in `foundation/feed-01/packages.tsv` and the client in `foundation/sdk-01`. A separate client upgraded BusyBox 1.38.0-3 to 1.38.0-4 and installed `vinix-release`. vpac recorded BusyBox as owner of `/bin/uname` and the identity package as owner of `/usr/bin/uname`. The installed OS ID was `vinix`. [Signed upgrade commands](tests/FEED.md) diff --git a/git/PKGBUILD.vile b/git/PKGBUILD.vile new file mode 100644 index 0000000..05138c1 --- /dev/null +++ b/git/PKGBUILD.vile @@ -0,0 +1,31 @@ +defpkgbuild(git, + #:pkgname, "git", + #:pkgver, "2.47.3", + #:pkgrel, 1, + #:pkgdesc, "Distributed version control with HTTP and HTTPS transport", + #:arch, [#:x86-64, #:aarch64], + #:license, "GPL-2.0-only", + #:url, "https://git-scm.com/", + #:depends, ["musl", "curl", "expat", "openssl", "pcre2", "zlib"], + #:source, ["https://www.kernel.org/pub/software/scm/git/git-2.47.3.tar.xz", + "https://raw.githubusercontent.com/alpinelinux/aports/a7de3e63cc8015474a4feadd8bb7c0ecc097b1fa/main/git/fix-t4219-with-sticky-bit.patch", + "config.mak", "check.py"], + #:sha256sums, ["9c2eb1250781b3e5bfef098572d07fdf132d67e6c065e4307332ade9819a1501", + "2ae5b4901a7ef98ffb35eaba1d201d97b556fca1bf4688f88f79ca24d51a8cd6", + "458eb38655279e40713e134ba778346524279d6787681b1f8af2c16f0fce0c76", "8bc530df1d77f35bfdd0cbbcde4860c3f0964842cfbe6c50bdf878331d73332b"], + #:prepare, fn() { + run("patch", "-d", "git-2.47.3", "-p1", "-i", string-append(srcdir(), "/fix-t4219-with-sticky-bit.patch")) + run("cp", "config.mak", "git-2.47.3/config.mak") + }, + #:build, fn() { + root := get-environment-variable("VPAC_MAKEPKG_ROOT") + run("make", "-C", "git-2.47.3", string-append("CURL_CONFIG=", root, "/usr/bin/curl-config"), "all") + }, + #:check, fn() { + run("python3", "check.py") + }, + #:package, fn() { + root := get-environment-variable("VPAC_MAKEPKG_ROOT") + run("make", "-C", "git-2.47.3", string-append("CURL_CONFIG=", root, "/usr/bin/curl-config"), string-append("DESTDIR=", pkgdir()), "install") + run("install", "-Dm644", "git-2.47.3/COPYING", string-append(pkgdir(), "/usr/share/licenses/git/COPYING")) + }) diff --git a/git/check.py b/git/check.py new file mode 100644 index 0000000..83bd89f --- /dev/null +++ b/git/check.py @@ -0,0 +1,27 @@ +"""Exercise Git's target object, index, reference and PCRE code offline.""" +from pathlib import Path +import os +import subprocess + +source = Path.cwd() +binary = source / "git-2.47.3/git" +work = source / "git-check" +work.mkdir() +os.chdir(work) +os.environ.update(GIT_CONFIG_NOSYSTEM="1", HOME=str(work), GIT_TERMINAL_PROMPT="0", + GIT_AUTHOR_NAME="Vinix", GIT_AUTHOR_EMAIL="test@invalid", + GIT_COMMITTER_NAME="Vinix", GIT_COMMITTER_EMAIL="test@invalid") + +def git(*args, data=None): + return subprocess.check_output(["vinix-run", str(binary), *args], input=data, text=True).strip() + +git("init", "-q", "--template=") +(work / "file").write_text("Vinix\n") +git("add", "file") +tree = git("write-tree") +commit = git("commit-tree", tree, data="First commit\n") +git("update-ref", "HEAD", commit) +if git("show", "HEAD:file") != "Vinix" or git("grep", "-P", "(?=Vini)Vinix") != "file:Vinix": + raise SystemExit("target Git object or PCRE result did not match") +if not (source / "git-2.47.3/git-remote-http").is_file(): + raise SystemExit("target Git HTTP transport is missing") diff --git a/git/config.mak b/git/config.mak new file mode 100644 index 0000000..126fb41 --- /dev/null +++ b/git/config.mak @@ -0,0 +1,15 @@ +prefix = /usr +CC = vinix-cc +CFLAGS = -O2 +# libcurl's OpenSSL dependency must resolve in the same target SDK as libcurl. +LDFLAGS += -Wl,--sysroot=$(VPAC_MAKEPKG_ROOT) -L$(VPAC_MAKEPKG_ROOT)/usr/lib -Wl,-rpath-link,$(VPAC_MAKEPKG_ROOT)/usr/lib +INSTALL_SYMLINKS = YesPlease +USE_LIBPCRE2 = YesPlease +NO_GETTEXT = YesPlease +NO_PYTHON = YesPlease +NO_PERL = YesPlease +NO_TCLTK = YesPlease +NO_SVN_TESTS = YesPlease +ICONV_OMITS_BOM = YesPlease +NO_REGEX = YesPlease +NO_SYS_POLL_H = YesPlease diff --git a/openssh-client/PKGBUILD.vile b/openssh-client/PKGBUILD.vile new file mode 100644 index 0000000..364bc02 --- /dev/null +++ b/openssh-client/PKGBUILD.vile @@ -0,0 +1,44 @@ +defpkgbuild(openssh-client, + #:pkgname, "openssh-client", + #:pkgver, "9.9p2", + #:pkgrel, 1, + #:pkgdesc, "OpenSSH client, file transfer, key generation and authentication agent", + #:arch, [#:x86-64, #:aarch64], + #:license, "SSH-OpenSSH", + #:url, "https://www.openssh.com/portable.html", + #:depends, ["musl", "libedit", "openssl", "zlib"], + #:makedepends, ["linux-headers"], + #:backup, ["etc/ssh/ssh_config"], + #:source, ["https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-9.9p2.tar.gz", + "https://raw.githubusercontent.com/alpinelinux/aports/a7de3e63cc8015474a4feadd8bb7c0ecc097b1fa/main/openssh/include-config-dir.patch"], + #:sha256sums, ["91aadb603e08cc285eddf965e1199d02585fa94d994d6cae5b41e1721e215673", + "d64820f473f3421922c0b4d88b067b2816cd22323af3157af503688e1003f8c1"], + #:prepare, fn() { + run("patch", "-d", "openssh-9.9p2", "-p1", "-i", string-append(srcdir(), "/include-config-dir.patch")) + }, + #:build, fn() { + run("vinix-configure", "openssh-9.9p2/configure", "--sysconfdir=/etc/ssh", "--libexecdir=/usr/lib/ssh", + "--with-libedit", "--with-xauth=/usr/bin/xauth", "--with-pid-dir=/run", + "--disable-utmp", "--disable-wtmp", "--disable-lastlog") + run("make", "ssh", "scp", "sftp", "ssh-keygen", "ssh-agent", "ssh-add", "ssh-keyscan", "ssh-pkcs11-helper") + }, + #:check, fn() { + run("vinix-run", "./ssh", "-V") + run("vinix-run", "./ssh", "-Q", "cipher") + run("vinix-run", "./ssh-keygen", "-q", "-t", "ed25519", "-N", "", "-f", "test-key") + run("vinix-run", "./ssh-keygen", "-lf", "test-key.pub") + run("vinix-run", "./ssh-keygen", "-Y", "sign", "-f", "test-key", "-n", "vinix", "openssh-9.9p2/LICENCE") + run("test", "-s", "openssh-9.9p2/LICENCE.sig") + }, + #:package, fn() { + for-each(fn(tool) { + run("install", "-Dm755", tool, string-append(pkgdir(), "/usr/bin/", tool)) + }, list("ssh", "scp", "sftp", "ssh-keygen", "ssh-agent", "ssh-add", "ssh-keyscan", "ssh-pkcs11-helper")) + run("mkdir", "-p", string-append(pkgdir(), "/usr/lib/ssh"), string-append(pkgdir(), "/etc/ssh/ssh_config.d")) + run("ln", "-s", "../../bin/ssh-pkcs11-helper", string-append(pkgdir(), "/usr/lib/ssh/ssh-pkcs11-helper")) + run("install", "-Dm755", "openssh-9.9p2/contrib/ssh-copy-id", string-append(pkgdir(), "/usr/bin/ssh-copy-id")) + run("install", "-Dm755", "openssh-9.9p2/contrib/findssl.sh", string-append(pkgdir(), "/usr/bin/findssl.sh")) + run("install", "-Dm644", "openssh-9.9p2/ssh_config", string-append(pkgdir(), "/etc/ssh/ssh_config")) + run("install", "-Dm644", "openssh-9.9p2/moduli", string-append(pkgdir(), "/etc/ssh/moduli")) + run("install", "-Dm644", "openssh-9.9p2/LICENCE", string-append(pkgdir(), "/usr/share/licenses/openssh-client/LICENCE")) + }) -- 2.56.1