#!/bin/sh
# DF-5105 probe: is the amdgpu_test.c move-test path reachable on this guest?
# Run as root inside the DragonFly guest.
set -x
uname -a
# 1. Is there any AMD display adapter for amdgpu to attach to?
pciconf -l | grep -iE "amd|ati|0x1002" || echo "NO_AMD_DISPLAY_ADAPTER"
# 2. Does the amdgpu module exist / load?
ls -l /boot/kernel/amdgpu.ko
kldload amdgpu; echo "kldload_rc=$?"
kldstat | grep amdgpu
# 3. Did a device attach (amdgpu_device_init -> amdgpu_test_moves caller)?
dmesg | grep -iE "amdgpu" | tail -5
# 4. The test gate itself: amdgpu_testing param (default 0, load-time only).
sysctl -a 2>/dev/null | grep -i amdgpu_testing || echo "amdgpu_testing_param_not_runtime_visible(0444_module_param)"
echo "PROBE_DONE"
