⬢ DragonFlyBSD Kernel Audit
DF-5015 / watcher.sh
← back to finding ↓ download raw
#!/bin/sh
# DF5015 mismatch watcher: freeze the failed-realloc window the instant
# the in-kernel probe shows a 25-row history serving a 60-row screen.
rm -f /tmp/DF5015_STOP /tmp/DF5015_FROZEN
i=0
while [ $i -lt 40000 ]; do
  s=$(sysctl -n hw.df5015 2>/dev/null)
  case "$s" in
    *"rows=25 size=2000"*"xsize=80 ysize=60"*)
      touch /tmp/DF5015_STOP
      echo "$s" > /tmp/DF5015_FROZEN
      echo "FROZEN after $i polls: $s"
      exit 0
      ;;
  esac
  i=$((i+1))
  sleep 0.1
done
echo "watcher: gave up"