Integrate CAN-aware CMS risk pipeline and relocatable Orin runtime

This commit is contained in:
zmv
2026-09-23 18:54:11 +08:00
parent 26c5bfb88d
commit 9aadf9cbda
119 changed files with 13940 additions and 152 deletions
+25 -2
View File
@@ -1,4 +1,27 @@
#!/usr/bin/env bash
# Use the previously deployed 0920 drivers; do not force module compatibility.
set -euo pipefail
root="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)"
exec "$root/orin/scripts/initialize_camera.sh" "$@"
root="$(cd "$(dirname "$0")/.." && pwd)"
driver_dir="${DRIVER_DIR:-$root/../vision-anti-pinch-0920/orin/bin/drivers}"
device="${1:-/dev/video5}"
kernel="$(uname -r)"
for driver in max9295 max9296 sgx-yuv-gmsl2; do
module="${driver//-/_}"
[[ -d "/sys/module/$module" ]] && continue
file="$driver_dir/$driver.ko"
[[ -f "$file" ]] || { echo "Missing driver: $file" >&2; exit 1; }
vermagic="$(modinfo -F vermagic "$file")"
if [[ -n "$vermagic" && "${vermagic%% *}" != "$kernel" ]]; then
echo "Kernel mismatch: $file ($vermagic), running $kernel" >&2; exit 1
fi
if [[ -z "$vermagic" ]]; then
echo "No vermagic metadata: $file; using normal insmod kernel validation."
fi
options=()
[[ "$driver" == sgx-yuv-gmsl2 ]] && options=(gmsl_mode=2,2,2,2)
sudo -n insmod "$file" "${options[@]}"
done
for _ in {1..20}; do [[ -c "$device" ]] && break; sleep .25; done
[[ -c "$device" ]] || { echo "Camera not created: $device" >&2; exit 1; }
v4l2-ctl -d "$device" -c sensor_mode=1,trig_pin=0xffff0007
echo "Camera ready: $device"