⬢ DragonFlyBSD Kernel Audit
DF-5749 / fixbuild.sh
← back to finding ↓ download raw
#!/bin/sh
# DF-5749 fix validation build: apply fix.diff to the guest's
# /usr/src/sys/netbt copy (the read-only host sys/ tree is NEVER
# touched; vm.sh reset with-src restores this), rebuild the KLD with
# the patched production sources.  Run INSIDE the guest.
set -e

echo "== applying fix.diff to /usr/src =="
cd /usr/src
patch --dry-run -p1 < /root/l2uh/fix.diff
patch -p1 < /root/l2uh/fix.diff

echo "== verifying the patched tree =="
grep -c L2CAP_CLOSING /usr/src/sys/netbt/l2cap.h \
	/usr/src/sys/netbt/l2cap_lower.c
grep -c l2cap_lock /usr/src/sys/netbt/l2cap_misc.c

echo "== rebuilding KLD against patched sources =="
cd /root/l2uh
sh build.sh 2>&1 | tail -3
ls -l l2uh_harness.ko
echo "== fix build OK =="