#!/bin/sh
# DF-5053 fix-mechanism run (ON THE GUEST, after the baseline panic +
# reset): load the KLD in fixmode (kenv suppresses the miibus probe, so
# the attach panic cannot retrigger), then replay the FIXED qsphy_attach
# no-media branch (fix.diff adds an IFM_NONE fallback via ifmedia_add,
# mirroring DF-5003's leaf fix) and the verbatim miibus_mediainit hub
# walk.  Expected: survives, ifm_cur non-NULL (the *_service() entry
# deref stays safe).
set -e
kenv hw.qsmedia.fixmode=1
kldload /root/df5053/qsmedia.ko
sysctl hw.qsmedia_fixcheck=1
echo "== fixcheck exited 0 (survived) =="
dmesg | tail -6
