#!/bin/sh # Invoked by the packaged BusyBox init inside a disposable Vinix guest. set -eu export PATH=/bin:/usr/bin:/sbin:/usr/sbin export HOME=/tmp TERM=xterm-256color LC_ALL=C finish() { result=$? if [ "$result" -ne 0 ]; then echo "VPAC USERLAND GUEST FAIL at $phase (status $result)" fi /sbin/poweroff -f } phase=identity trap finish EXIT mkdir -p /tmp cd /tmp test "$(/bin/uname -o)" = Vinix grep -q '^ID=vinix$' /etc/os-release phase=shell /bin/zsh -fc 'zmodload zsh/zle && zmodload zsh/complete && zmodload zsh/terminfo && zmodload zsh/pcre && zmodload zsh/cap && setopt RE_MATCH_PCRE && [[ alphabet =~ "^(?=alpha)alpha" ]]' phase=editor printf '%s\n' 'before' >note vim -Nu NONE -i NONE -n -es note -c 'call setline(1, "Vinix edit")' -c 'wq' test "$(cat note)" = 'Vinix edit' phase=make printf 'all:\n\t@printf "built in Vinix\\n" > result\n' >Makefile make -f Makefile test "$(cat result)" = 'built in Vinix' phase=compression bzip2 -kc note >note.bz2 xz -c note >note.xz test "$(bzip2 -dc note.bz2)" = 'Vinix edit' test "$(xz -dc note.xz)" = 'Vinix edit' phase=libraries pkg-config --exists zlib libpng libpcre2-8 printf '\n' >release.xml xmlwf release.xml phase=certificates printf abc >abc openssl dgst -sha256 abc | grep -q ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad openssl verify -no_check_time -CAfile /etc/ssl/cert.pem /usr/share/ca-certificates/mozilla/ISRG_Root_X1.crt echo 'VPAC USERLAND GUEST PASS'