FDD-book/examples/part-07/ch34-advanced-debugging/lab02-kgdb/dump-setup.sh
Edson Brandi 6e6dac94fe Add book companion files under examples/
Organize companion code and materials by book part:

  part-01/      Foundations
  part-02/      Kernel & driver fundamentals
  part-03/      Character & block devices
  part-04/      Networking & storage
  part-05/      Buses & advanced topics
  part-06/      Debugging & performance
  part-07/      Real-world drivers
  appendices/   Supplementary material
  README.md     Overview and build instructions
2026-04-25 16:51:00 +00:00

35 lines
752 B
Bash

#!/bin/sh
#
# dump-setup.sh - verify that a dump device is configured.
#
# This script does not change the system. It reports the current dump
# configuration and, if no dump device is set, prints the commands the
# reader should run to configure one.
echo "current dump configuration:"
dumpon -l
if ! dumpon -l | grep -q '^/dev/'; then
cat <<'EOF'
No dump device is currently configured. To set one, identify your
swap partition and run:
# dumpon /dev/DEVICE
and persist across reboots by adding to /etc/rc.conf:
dumpdev="/dev/DEVICE"
savecore_enable="YES"
Replace DEVICE with your actual swap partition name. You can find it
with:
# swapinfo
EOF
exit 1
fi
echo "dump device is configured. ready to capture panics."
exit 0