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,52 @@ +#!/bin/sh +set -e + +# Root directory for minimal FreeBSD installation. +ROOTDIR=$(pwd)/fat-root + +# Create minimal directory structure. +rm -rf $ROOTDIR/rescue $ROOTDIR/efi/boot/BOOTx64.EFI +for dir in dev efi/boot etc rescue; do + mkdir -p $ROOTDIR/$dir +done + +# Install kernel, loader and rescue. +make -DNO_ROOT DESTDIR=$ROOTDIR \ + MODULES_OVERRIDE= \ + WITHOUT_DEBUG_FILES=yes \ + WITHOUT_KERNEL_SYMBOLS=yes \ + installkernel +for dir in stand rescue; do + make -DNO_ROOT DESTDIR=$ROOTDIR INSTALL="install -U" \ + CRUNCH_GENERATE_LINKS=no \ + WITHOUT_MAN= \ + WITHOUT_TOOLCHAIN= \ + -C $dir install +done + +# Copy loader to standard EFI location, and rescue to required binaries. +mv $ROOTDIR/boot/loader.efi $ROOTDIR/efi/boot/BOOTx64.EFI +for bin in init sh shutdown; do + cp $ROOTDIR/rescue/rescue $ROOTDIR/rescue/$bin +done +rm -f $ROOTDIR/rescue/rescue + +# Configuration files. +cat > $ROOTDIR/boot/loader.conf < $ROOTDIR/etc/rc <&1 | tee boot.log +grep -q 'Hello world.' boot.log +echo OK