#!/bin/sh set -eu export PATH=/bin:/usr/bin:/sbin:/usr/sbin HOME=/tmp export DISPLAY=:71 XAUTHORITY=/tmp/vinix-glx.Xauthority LIBGL_ALWAYS_SOFTWARE=1 server= phase=identity finish() { status=$? if [ "$status" -ne 0 ]; then echo "Vinix graphics fixture failed at $phase" if [ -f /tmp/xvfb-glx.log ]; then cat /tmp/xvfb-glx.log; fi fi if [ -n "$server" ]; then kill "$server" 2>/dev/null || true; fi if [ "$(id -u)" = 0 ]; then /sbin/poweroff -f; fi } trap finish EXIT test "$(uname -o)" = Vinix if [ "${VINIX_X11_INSTALL_FROM_PKG:-0}" = 1 ]; then phase=package-install test ! -e /usr/bin/Xvfb-glx test "$(vpac o --quiet /usr/bin/pkg)" = vinix-pkg test "$(pkg search --exact x11)" = x11 pkg install x11 vpac q -F validation local/vinix-release-x11 >/tmp/x11-validation grep -Eq '^validation[[:space:]]+signature$' /tmp/x11-validation test "$(vpac o --quiet /usr/bin/Xvfb-glx)" = xorg-server test "$(vpac o --quiet /usr/lib/libgallium-24.2.8.so)" = mesa echo 'Vinix installed the signed X11 packages' fi if [ -n "${VINIX_X11_SIDECAR_SHA256:-}" ]; then phase=sidecar-extract test ! -e /usr/bin/Xvfb-glx test "$(vpac o --quiet /usr/bin/pkg)" = vinix-pkg pkg_checksum=$(sha256sum /usr/bin/pkg) printf '%s /vinix-x11-sidecar.tar.gz\n' "$VINIX_X11_SIDECAR_SHA256" | sha256sum -c - /bin/busybox tar -k -xzf /vinix-x11-sidecar.tar.gz -C / printf '%s\n' "$pkg_checksum" | sha256sum -c - test "$(vpac o --quiet /usr/bin/pkg)" = vinix-pkg test -x /usr/bin/vinix-wine-host test /usr/lib/xorg/modules/dri/swrast_dri.so -ef /usr/lib/xorg/modules/dri/libgallium_dri.so echo 'Vinix extracted the checked X11 release sidecar' fi phase=egl LIBGL_DRIVERS_PATH=/usr/lib/mesa24/dri /vinix-egl-check phase=glx-server export LIBGL_DRIVERS_PATH=/usr/lib/xorg/modules/dri mkdir -p /tmp xauth -q -f "$XAUTHORITY" add "$DISPLAY" MIT-MAGIC-COOKIE-1 0123456789abcdef0123456789abcdef Xvfb-glx "$DISPLAY" -auth "$XAUTHORITY" -nolisten tcp -noreset -screen 0 128x128x24 \ +extension GLX +iglx >/tmp/xvfb-glx.log 2>&1 & server=$! attempt=0 until xset q >/tmp/xset-glx.log 2>&1; do kill -0 "$server" attempt=$((attempt + 1)) [ "$attempt" -lt 30 ] sleep 1 done phase=glx-client LIBGL_ALWAYS_INDIRECT=1 /vinix-glx-check echo 'VPAC FIXTURE GUEST PASS'