NEOS background updater (#1892)

old-commit-hash: cb5a2996e75658ac61f057fb729c229a554c551e
This commit is contained in:
Adeeb Shihadeh
2020-08-12 11:39:21 -07:00
committed by GitHub
parent c52e3fe331
commit c2b1d97b20
9 changed files with 392 additions and 178 deletions
+9 -22
View File
@@ -1,23 +1,13 @@
#!/usr/bin/bash
export OMP_NUM_THREADS=1
export MKL_NUM_THREADS=1
export NUMEXPR_NUM_THREADS=1
export OPENBLAS_NUM_THREADS=1
export VECLIB_MAXIMUM_THREADS=1
if [ -z "$BASEDIR" ]; then
BASEDIR="/data/openpilot"
fi
if [ -z "$PASSIVE" ]; then
export PASSIVE="1"
fi
source "$BASEDIR/launch_env.sh"
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
STAGING_ROOT="/data/safe_staging"
function launch {
# Wifi scan
wpa_cli IFNAME=wlan0 SCAN
@@ -54,6 +44,7 @@ function launch {
git submodule foreach --recursive git reset --hard
echo "Restarting launch script ${LAUNCHER_LOCATION}"
unset REQUIRED_NEOS_VERSION
exec "${LAUNCHER_LOCATION}"
else
echo "openpilot backup found, not updating"
@@ -81,24 +72,20 @@ function launch {
[ -d "/proc/irq/736" ] && echo 3 > /proc/irq/736/smp_affinity_list # USB for OP3T
# Remove old NEOS update file
# TODO: move this code to the updater
if [ -d /data/neoupdate ]; then
rm -rf /data/neoupdate
fi
# Check for NEOS update
if [ $(< /VERSION) != "14" ]; then
if [ $(< /VERSION) != "$REQUIRED_NEOS_VERSION" ]; then
if [ -f "$DIR/scripts/continue.sh" ]; then
cp "$DIR/scripts/continue.sh" "/data/data/com.termux/files/continue.sh"
fi
if [ ! -f "$BASEDIR/prebuilt" ]; then
echo "Clearing build products and resetting scons state prior to NEOS update"
cd $BASEDIR && scons --clean
rm -rf /tmp/scons_cache
rm -r $BASEDIR/.sconsign.dblite
# Clean old build products, but preserve the scons cache
cd $DIR
scons --clean
git clean -xdf
git submodule foreach --recursive git clean -xdf
fi
"$DIR/installer/updater/updater" "file://$DIR/installer/updater/update.json"
else
if [[ $(uname -v) == "#1 SMP PREEMPT Wed Jun 10 12:40:53 PDT 2020" ]]; then