DragonFlyBSD Kernel Audit
DF-2938 / setup.sh
← back to finding ↓ download raw
#!/bin/sh
# setup.sh -- idempotent guest-side build for the DF-2938 PoC.
# Sources are expected in /tmp/poc_host (pushed from the host).
set -e
D=/tmp/df2938
mkdir -p $D/hs
chmod 777 $D $D/hs
cp /tmp/poc_host/* $D/
cd $D
cat > Makefile <<'MK'
KMOD=	devuaf
SRCS=	devuaf.c
.include <bsd.kmod.mk>
MK
rm -f devuaf.o devuaf.ko
make >/tmp/df2938/build.log 2>&1
cc -O -o trig trig.c
cc -O -o swap ctl.c
cc -O -o status ctl.c
kldload $D/devuaf.ko
echo SETUP-OK