diff --git a/SConstruct b/SConstruct index d9b801454a..f5be10f06d 100644 --- a/SConstruct +++ b/SConstruct @@ -13,6 +13,10 @@ AddOption('--test', action='store_true', help='build test files') +AddOption('--setup', + action='store_true', + help='build setup and installer files') + AddOption('--kaitai', action='store_true', help='Regenerate kaitai struct parsers') diff --git a/release/build_release3.sh b/release/build_release3.sh index 1a3879103a..e18c3b8ed6 100755 --- a/release/build_release3.sh +++ b/release/build_release3.sh @@ -1,48 +1,29 @@ #!/usr/bin/bash -e -BUILD_DIR=/data/openpilot -SOURCE_DIR=/data/openpilot_source - -ln -snf $BUILD_DIR /data/pythonpath - export GIT_COMMITTER_NAME="Vehicle Researcher" export GIT_COMMITTER_EMAIL="user@comma.ai" export GIT_AUTHOR_NAME="Vehicle Researcher" export GIT_AUTHOR_EMAIL="user@comma.ai" export GIT_SSH_COMMAND="ssh -i /data/gitkey" +BUILD_DIR=/data/releasepilot +SOURCE_DIR="$(git rev-parse --show-toplevel)" + +BRANCH=release3-staging + echo "[-] Setting up repo T=$SECONDS" -#rm -rf $BUILD_DIR +rm -rf $BUILD_DIR mkdir -p $BUILD_DIR cd $BUILD_DIR git init -git remote add origin git@github.com:commaai/openpilot.git || true - -echo "[-] fetching public T=$SECONDS" -git prune || true -git remote prune origin || true - -echo "[-] git fetch origin T=$SECONDS" -git fetch origin - -git checkout -f -B release3-staging -git reset --hard origin/devel -git clean -xdf - -# remove everything except .git -echo "[-] erasing old files T=$SECONDS" -find . -maxdepth 1 -not -path './.git' -not -name '.' -not -name '..' -exec rm -rf '{}' \; - -# reset tree and get version -cd $SOURCE_DIR -git clean -xdf -git checkout -- selfdrive/common/version.h +git remote add origin git@github.com:commaai/openpilot.git +git checkout -f -B $BRANCH # do the files copy echo "[-] copying files T=$SECONDS" cd $SOURCE_DIR cp -pR --parents $(cat release/files_common) $BUILD_DIR/ -cp -pR --parents installer/continue_openpilot.sh $BUILD_DIR/ +cp -pR --parents $(cat release/files_tici) $BUILD_DIR/ # in the directory cd $BUILD_DIR @@ -54,12 +35,12 @@ echo "#define COMMA_VERSION \"$VERSION-$(git --git-dir=$SOURCE_DIR/.git rev-pars echo "[-] committing version $VERSION T=$SECONDS" git add -f . -git status git commit -a -m "openpilot v$VERSION release" +# TODO: sign with release cert # Build panda firmware pushd panda/ -scons +scons -U . mv board/obj/panda.bin.signed /tmp/panda.bin.signed popd @@ -78,7 +59,7 @@ find . -name '*.os' -delete find . -name '*.pyc' -delete find . -name '__pycache__' -delete rm -rf panda/board panda/certs panda/crypto -rm -rf .sconsign.dblite Jenkinsfile release/ apk/ +rm -rf .sconsign.dblite Jenkinsfile release/ # Move back signed panda fw mkdir -p panda/board/obj @@ -95,14 +76,14 @@ git add -f . git commit --amend -m "openpilot v$VERSION" if [ ! -z "$PUSH" ]; then + echo "[-] pushing T=$SECONDS" git remote set-url origin git@github.com:commaai/openpilot.git - - git push -f origin release3-staging + git push -f origin $BRANCH # Create dashcam - #git rm selfdrive/car/*/carcontroller.py - #git commit -m "create dashcam release from release" - #git push -f origin release3-staging:dashcam3-staging + git rm selfdrive/car/*/carcontroller.py + git commit -m "create dashcam release from release" + git push -f origin $BRANCH:dashcam3-staging fi echo "[-] done T=$SECONDS" diff --git a/release/files_common b/release/files_common index d6efc61ef3..000c6b02ea 100644 --- a/release/files_common +++ b/release/files_common @@ -277,11 +277,7 @@ selfdrive/hardware/eon/__init__.py selfdrive/hardware/eon/hardware.h selfdrive/hardware/eon/hardware.py selfdrive/hardware/tici/__init__.py -selfdrive/hardware/tici/hardware.h selfdrive/hardware/tici/hardware.py -selfdrive/hardware/tici/pins.py -selfdrive/hardware/tici/agnos.py -selfdrive/hardware/tici/agnos.json selfdrive/hardware/pc/__init__.py selfdrive/hardware/pc/hardware.py @@ -379,8 +375,6 @@ selfdrive/camerad/cameras/camera_frame_stream.cc selfdrive/camerad/cameras/camera_frame_stream.h selfdrive/camerad/cameras/camera_qcom.cc selfdrive/camerad/cameras/camera_qcom.h -selfdrive/camerad/cameras/camera_qcom2.cc -selfdrive/camerad/cameras/camera_qcom2.h selfdrive/camerad/cameras/debayer.cl selfdrive/camerad/cameras/sensor_i2c.h selfdrive/camerad/cameras/sensor2_i2c.h diff --git a/release/files_tici b/release/files_tici new file mode 100644 index 0000000000..bc82cde047 --- /dev/null +++ b/release/files_tici @@ -0,0 +1,14 @@ +installer/continue_openpilot.sh + +selfdrive/camerad/cameras/camera_qcom2.cc +selfdrive/camerad/cameras/camera_qcom2.h +selfdrive/camerad/cameras/real_debayer.cl + +selfdrive/hardware/tici/__init__.py +selfdrive/hardware/tici/hardware.h +selfdrive/hardware/tici/hardware.py +selfdrive/hardware/tici/pins.py +selfdrive/hardware/tici/agnos.py +selfdrive/hardware/tici/agnos.json + +selfdrive/timezoned.py diff --git a/selfdrive/ui/SConscript b/selfdrive/ui/SConscript index 358172d765..48e51de575 100644 --- a/selfdrive/ui/SConscript +++ b/selfdrive/ui/SConscript @@ -49,13 +49,13 @@ qt_src = ["main.cc", "ui.cc", "paint.cc", "qt/sidebar.cc", "qt/onroad.cc", qt_env.Program("_ui", qt_src, LIBS=qt_libs) # setup, factory resetter, and installer -if arch != 'aarch64' and "BUILD_SETUP" in os.environ: +if arch != 'aarch64' and GetOption('setup'): qt_env.Program("qt/setup/reset", ["qt/setup/reset.cc"], LIBS=qt_libs) qt_env.Program("qt/setup/setup", ["qt/setup/setup.cc"], LIBS=qt_libs + ['curl', 'common', 'json11']) qt_env.Program("qt/setup/wifi", ["qt/setup/wifi.cc"], LIBS=qt_libs + ['common', 'json11']) installers = [ - ("openpilot", "master"), + ("openpilot", "release3-staging"), ("openpilot_test", "release3-staging"), ("openpilot_internal", "master"), ("dashcam", "dashcam3-staging"), diff --git a/selfdrive/updated.py b/selfdrive/updated.py index ad2d880105..d50d6d6fe0 100755 --- a/selfdrive/updated.py +++ b/selfdrive/updated.py @@ -39,7 +39,6 @@ from common.params import Params from selfdrive.hardware import EON, TICI, HARDWARE from selfdrive.swaglog import cloudlog from selfdrive.controls.lib.alertmanager import set_offroad_alert -from selfdrive.hardware.tici.agnos import flash_agnos_update LOCK_FILE = os.getenv("UPDATER_LOCK_FILE", "/tmp/safe_staging_overlay.lock") STAGING_ROOT = os.getenv("UPDATER_STAGING_ROOT", "/data/safe_staging") @@ -220,6 +219,8 @@ def finalize_update() -> None: def handle_agnos_update(wait_helper): + from selfdrive.hardware.tici.agnos import flash_agnos_update + cur_version = HARDWARE.get_os_version() updated_version = run(["bash", "-c", r"unset AGNOS_VERSION && source launch_env.sh && \ echo -n $AGNOS_VERSION"], OVERLAY_MERGED).strip()