Files
clearpilot/build_only.sh
T
brianhansonxyz 54c566c68f kill stale text-error window by comm too, not just path
selfdrive/ui/text is a shell wrapper that execs ./_text. After exec,
the running process's argv has no path component, so
pkill -f 'selfdrive/ui/text' silently misses it. Add pkill -x _text
alongside the existing path-pattern kills in build_only.sh,
launch_openpilot.sh, and launch_chffrplus.sh.
2026-05-03 22:28:33 -05:00

44 lines
1.5 KiB
Bash
Executable File

#!/usr/bin/bash
# CLEARPILOT: build-only mode — compile without starting manager.
# On failure: shows error on screen (non-blocking) and exits nonzero with stderr output.
# On success: exits 0, does not start manager.
#
# Usage: su - comma -c "bash /data/openpilot/build_only.sh"
BASEDIR="/data/openpilot"
# Fix ownership — we edit as root, openpilot builds/runs as comma
sudo chown -R comma:comma "$BASEDIR"
# Kill stale error displays and any running manager/launch/managed processes.
# `text` is a shell wrapper that execs `./_text` — after exec the process is named
# `_text` (no path), so we kill by exact comm in addition to the path pattern.
pkill -9 -f "selfdrive/ui/text" 2>/dev/null
pkill -9 -x _text 2>/dev/null
pkill -9 -f 'launch_openpilot.sh' 2>/dev/null
pkill -9 -f 'launch_chffrplus.sh' 2>/dev/null
pkill -9 -f 'python.*manager.py' 2>/dev/null
pkill -9 -f 'selfdrive\.' 2>/dev/null
pkill -9 -f 'system\.' 2>/dev/null
pkill -9 -f './ui' 2>/dev/null
sleep 1
source "$BASEDIR/launch_env.sh"
ln -sfn "$BASEDIR" /data/pythonpath
export PYTHONPATH="$BASEDIR"
# Hardware init (GPU perms)
sudo chgrp gpu /dev/adsprpc-smd /dev/ion /dev/kgsl-3d0 2>/dev/null
sudo chmod 660 /dev/adsprpc-smd /dev/ion /dev/kgsl-3d0 2>/dev/null
# Preflight: create dirs git can't track
source "$BASEDIR/build_preflight.sh"
cd "$BASEDIR/selfdrive/manager"
rm -f "$BASEDIR/prebuilt"
# Tee output to /tmp/build.log for inspection after the script exits
BUILD_ONLY=1 ./build.py 2>&1 | tee /tmp/build.log
exit "${PIPESTATUS[0]}"