Skip to content

Commit 4cbc692

Browse files
committed
launch_openpilot: move WiFi regdomain hook to top-level (covers c3 + c4)
Move the 'sudo iw reg set US' block from sunnypilot/system/hardware/c3/launch_chffrplus.sh agnos_init into launch_openpilot.sh, before the model dispatch. This way the hook runs once for BOTH comma 3 ('comma tici') and comma 4 ('comma mici'), since they share this entry point. Dispatch logic (the 'if MODEL == comma tici' block) is intentionally left untouched to minimise merge conflicts with upstream. Subshell + '|| true' around the hook is mandatory: set -euo pipefail and 'trap ... ERR' are active at this point in the script, so any unhandled failure would trip the trap and exec the fallback launcher, which would break the c3 path. The subshell isolates failures.
1 parent 1e8c970 commit 4cbc692

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

launch_openpilot.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,17 @@ C3_LAUNCH_SH="./sunnypilot/system/hardware/c3/launch_chffrplus.sh"
99
MODEL="$(tr -d '\0' < "/sys/firmware/devicetree/base/model")"
1010
export MODEL
1111

12+
# WiFi regdomain US — runs for both comma 3 (tici) and comma 4 (mici)
13+
# subshell + `|| true` is mandatory: set -e + ERR trap above would otherwise
14+
# fall back to ./launch_chffrplus.sh on any failure, breaking the c3 path
15+
(
16+
if ! command -v iw >/dev/null 2>&1; then
17+
# iw is not in stock AGNOS — auto-install it
18+
sudo apt-get update -qq && sudo apt-get install -y --no-install-recommends iw
19+
fi
20+
command -v iw >/dev/null 2>&1 && sudo iw reg set US
21+
) || true
22+
1223
if [ "$MODEL" = "comma tici" ]; then
1324
# Force a failure if the launcher doesn't exist
1425
[ -x "$C3_LAUNCH_SH" ] || false

0 commit comments

Comments
 (0)