DragonFlyBSD Kernel Audit
DF-0769 / build.sh
← back to finding ↓ download raw
#!/bin/sh
# DF-0769 build script. Builds both the deterministic harness and the image forger.
# The image forger links against the kernel's own iscsi_crc32 (icrc32.c, userspace-buildable).
# Run as root inside the guest (cc available; no external deps).
set -e
cd "$(dirname "$0")"
SRCDIR="${ICRC32_SRC:-/root/df0769}"
# icrc32.c is shipped alongside this script (verbatim copy of sys/libkern/icrc32.c).
if [ ! -f icrc32.c ]; then
    echo "ERROR: icrc32.c missing (copy from sys/libkern/icrc32.c)" >&2
    exit 1
fi
cc -O2 -o harness   harness.c
cc -O2 -o craft_img craft_img.c icrc32.c
echo "BUILD OK: harness, craft_img"