DragonFlyBSD Kernel Audit
DF-0825 / build.sh
← back to finding ↓ download raw
#!/bin/sh
# DF-0825 harness build script — builds the KLD module in-guest.
set -e
cd "$(dirname "$0")"

# Stage the module source into the kernel source tree (out-of-tree module dir).
ssh dfbsd /bin/sh <<'EOF'
set -e
rm -rf /usr/src/sys/test/df0825_harness
mkdir -p /usr/src/sys/test/df0825_harness
EOF

scp -q df0825_harness.c Makefile dfbsd:/usr/src/sys/test/df0825_harness/

# Build the module using the kernel build infrastructure.
ssh dfbsd /bin/sh <<'EOF'
set -e
cd /usr/src/sys/test/df0825_harness
make SYSDIR=/usr/src/sys 2>&1
echo "BUILD_EXIT=$?"
ls -l df0825_harness.ko 2>/dev/null
EOF