#!/bin/sh
# DF-2829 PoC build: compile the KLD harness inside the guest against /usr/src.
# Copies sources to /root/df2829 on the guest; run via vm.sh run_root.
set -e
mkdir -p /root/df2829
cat > /root/df2829/Makefile <<'EOF'
KMOD=   df2829
SRCS=   df2829_harness.c
KMODDIR=/root/df2829
.include <bsd.kmod.mk>
EOF
cp /root/df2829_src/df2829_harness.c /root/df2829/
cd /root/df2829
make clean 2>/dev/null || true
make depend 2>&1
make 2>&1
ls -l df2829.ko
