Index: .cirrus.yml =================================================================== --- /dev/null +++ .cirrus.yml @@ -0,0 +1,18 @@ +freebsd_instance: + image: freebsd-12-0-release-amd64 + cpu: 8 + memory: 24G + +env: + CIRRUS_CLONE_DEPTH: 1 + +task: + timeout_in: 90m + install_script: + - pkg install -y qemu-devel + - fetch https://people.freebsd.org/~emaste/OVMF.fd + script: + - make -j$(sysctl -n hw.ncpu) WITHOUT_TOOLCHAIN=yes buildworld buildkernel + test_script: + - sh tools/ci/qemu-test.sh + Index: tools/ci/qemu-test.sh =================================================================== --- /dev/null +++ tools/ci/qemu-test.sh @@ -0,0 +1,56 @@ +#!/bin/sh +set -e + +# Root directory for minimal FreeBSD installation. +ROOTDIR=$(pwd)/fat-root + +# Create minimal directory structure. +rm -rf $ROOTDIR/efi/boot/BOOTx64.EFI +for dir in dev bin efi/boot etc lib libexec sbin usr/libexec; do + mkdir -p $ROOTDIR/$dir +done + +# Install kernel, loader and minimal userland. +make -DNO_ROOT DESTDIR=$ROOTDIR \ + MODULES_OVERRIDE= \ + WITHOUT_DEBUG_FILES=yes \ + WITHOUT_KERNEL_SYMBOLS=yes \ + installkernel +for dir in stand \ + lib/libc lib/libedit lib/ncurses \ + libexec/rtld-elf \ + bin/sh sbin/init sbin/shutdown; do + make -DNO_ROOT DESTDIR=$ROOTDIR INSTALL="install -U" \ + WITHOUT_MAN= \ + WITHOUT_PROFILE= \ + WITHOUT_TESTS= \ + WITHOUT_TOOLCHAIN= \ + -C $dir install +done + +# Copy loader to standard EFI location. +mv $ROOTDIR/boot/loader.efi $ROOTDIR/efi/boot/BOOTx64.EFI + +# Configuration files. +cat > $ROOTDIR/boot/loader.conf < $ROOTDIR/etc/rc <&1 | tee boot.log +grep -q 'Hello world.' boot.log +echo OK