|
| 1 | +#!/bin/sh |
| 2 | +BASE="/home/deck/homebrew/plugins/eGPUBridge" |
| 3 | +OUT="/tmp/egpubridge-copy-report.txt" |
| 4 | + |
| 5 | +{ |
| 6 | + echo "===== COPY START: eGPUBridge report =====" |
| 7 | + echo "Time: $(date)" |
| 8 | + echo |
| 9 | + |
| 10 | + echo "===== 1) CONFIG =====" |
| 11 | + echo "--- output_order.conf ---" |
| 12 | + cat "$BASE/output_order.conf" 2>/dev/null || echo "missing" |
| 13 | + echo |
| 14 | + echo "--- prefer_vk_device.conf ---" |
| 15 | + cat "$BASE/prefer_vk_device.conf" 2>/dev/null || echo "missing" |
| 16 | + echo |
| 17 | + echo "--- gamescope_mode.conf ---" |
| 18 | + cat "$BASE/gamescope_mode.conf" 2>/dev/null || echo "missing" |
| 19 | + echo |
| 20 | + |
| 21 | + echo "===== 2) GAMESCOPE =====" |
| 22 | + pgrep -a gamescope || true |
| 23 | + echo |
| 24 | + |
| 25 | + echo "===== 3) DISPLAY / GPU STATUS =====" |
| 26 | + python3 - <<'PY' |
| 27 | +import sys, json |
| 28 | +sys.path.insert(0, "/home/deck/homebrew/plugins/eGPUBridge") |
| 29 | +try: |
| 30 | + import main |
| 31 | + st = main.build_status(heavy=False) |
| 32 | + print(json.dumps({ |
| 33 | + "ok": st.get("ok"), |
| 34 | + "version": st.get("version"), |
| 35 | + "connected": st.get("connected"), |
| 36 | + "display_target": st.get("display_target"), |
| 37 | + "gpu_label": st.get("gpu_label"), |
| 38 | + "display_label": st.get("display_label"), |
| 39 | + "current_mode": st.get("current_mode"), |
| 40 | + "internal_display": st.get("internal_display"), |
| 41 | + "external_display": st.get("external_display"), |
| 42 | + "tv_network": st.get("tv_network"), |
| 43 | + "tv_power": st.get("tv_power"), |
| 44 | + }, indent=2, ensure_ascii=False, default=str)) |
| 45 | +except Exception as e: |
| 46 | + print("ERROR:", repr(e)) |
| 47 | +PY |
| 48 | + echo |
| 49 | + |
| 50 | + echo "===== 4) TV CONTROL HEALTH =====" |
| 51 | + python3 - <<'PY' |
| 52 | +import sys, json, asyncio |
| 53 | +sys.path.insert(0, "/home/deck/homebrew/plugins/eGPUBridge") |
| 54 | +try: |
| 55 | + import main |
| 56 | + async def run(): |
| 57 | + res = await main.Plugin.tv_control_health() |
| 58 | + print(json.dumps({ |
| 59 | + "ok": res.get("ok"), |
| 60 | + "label": res.get("label"), |
| 61 | + "network": res.get("network"), |
| 62 | + "adb": res.get("adb"), |
| 63 | + "wol": res.get("wol"), |
| 64 | + "buttons": res.get("buttons"), |
| 65 | + "missing": res.get("missing"), |
| 66 | + }, indent=2, ensure_ascii=False, default=str)) |
| 67 | + asyncio.run(run()) |
| 68 | +except Exception as e: |
| 69 | + print("ERROR:", repr(e)) |
| 70 | +PY |
| 71 | + echo |
| 72 | + |
| 73 | + echo "===== 5) ADB DEVICES =====" |
| 74 | + if [ -x "$BASE/bin/adb" ]; then |
| 75 | + "$BASE/bin/adb" devices -l || true |
| 76 | + else |
| 77 | + echo "local adb missing" |
| 78 | + fi |
| 79 | + echo |
| 80 | + |
| 81 | + echo "===== 6) UI / TV CONTROL MARKERS =====" |
| 82 | + grep -nE 'TV ON|HDMI|TV OFF|tv_on|tv_input|tv_off|TV Control BETA|Check TV Control status|FRONTEND_CLICK_TV_CONTROL|doCall' "$BASE/src/index.tsx" 2>/dev/null | tail -n 80 || true |
| 83 | + echo |
| 84 | + |
| 85 | + echo "===== 7) BACKEND METHOD SIGNATURES =====" |
| 86 | + python3 - <<'PY' |
| 87 | +import sys, inspect, json |
| 88 | +sys.path.insert(0, "/home/deck/homebrew/plugins/eGPUBridge") |
| 89 | +try: |
| 90 | + import main |
| 91 | + names = [ |
| 92 | + "tv_on", "tv_input", "tv_off", |
| 93 | + "tv_input_mode", "tv_control_health", |
| 94 | + "smart_toggle_display", "apply_egpu_mode", "restore_internal_mode", |
| 95 | + ] |
| 96 | + out = {} |
| 97 | + for name in names: |
| 98 | + obj = getattr(main.Plugin, name, None) |
| 99 | + if obj is None: |
| 100 | + out[name] = {"exists": False} |
| 101 | + continue |
| 102 | + try: |
| 103 | + sig = str(inspect.signature(obj)) |
| 104 | + except Exception as e: |
| 105 | + sig = "signature_error: " + str(e) |
| 106 | + out[name] = { |
| 107 | + "exists": True, |
| 108 | + "signature": sig, |
| 109 | + "is_coroutine": inspect.iscoroutinefunction(obj), |
| 110 | + "type": str(type(obj)), |
| 111 | + } |
| 112 | + print(json.dumps(out, indent=2, ensure_ascii=False)) |
| 113 | +except Exception as e: |
| 114 | + print("ERROR:", repr(e)) |
| 115 | +PY |
| 116 | + echo |
| 117 | + |
| 118 | + echo "===== 8) RECENT USEFUL PLUGIN LOGS =====" |
| 119 | + grep -Ei 'UI_CALL|FRONTEND|tv_on|tv_input|tv_off|tv_control|KEYCODE|HDMI_SWITCH|python_wol|adb|restore_internal|apply_egpu|RUN CLEAN|STATUS_SUMMARY' "$BASE/plugin.log" 2>/dev/null | tail -n 100 || true |
| 120 | + echo |
| 121 | + |
| 122 | + echo "===== 9) LATEST KNOWN GOOD BACKUPS =====" |
| 123 | + ls -1dt "$BASE"/stable_backup/KNOWN_GOOD_* 2>/dev/null | head -n 12 || true |
| 124 | + echo |
| 125 | + ls -1t "$BASE"/stable_backup/rollback_known_good_* 2>/dev/null | head -n 12 || true |
| 126 | + echo |
| 127 | + |
| 128 | + echo "===== COPY END: eGPUBridge report =====" |
| 129 | +} > "$OUT" |
| 130 | + |
| 131 | +cat "$OUT" |
| 132 | +echo |
| 133 | +echo "Report file saved to: $OUT" |
0 commit comments