mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-23 21:03:53 +08:00
* less scripts
* better
* fixes
* naming
* revert
* cleanup
* lets test it
* fix that one
* and rm
* don't run this
* fix
* not here
* revert testing
* fix docs
* default here too
* t
---------
Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 62f053bc4d
52 lines
1.1 KiB
Bash
Executable File
52 lines
1.1 KiB
Bash
Executable File
#!/usr/bin/bash
|
|
|
|
set -e
|
|
|
|
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
|
|
SOURCE_DIR="$(git -C $DIR rev-parse --show-toplevel)"
|
|
BUILD_DIR=${1:-$(mktemp -d)}
|
|
|
|
if [ -f /TICI ]; then
|
|
FILES_SRC="release/files_tici"
|
|
else
|
|
FILES_SRC="release/files_pc"
|
|
fi
|
|
|
|
echo "Building openpilot into $BUILD_DIR"
|
|
|
|
rm -rf $BUILD_DIR
|
|
mkdir -p $BUILD_DIR
|
|
|
|
# Copy required files to BUILD_DIR
|
|
cd $SOURCE_DIR
|
|
cp -pR --parents $(cat release/files_common) $BUILD_DIR/
|
|
cp -pR --parents $(cat $FILES_SRC) $BUILD_DIR/
|
|
|
|
# Build + cleanup
|
|
cd $BUILD_DIR
|
|
export PYTHONPATH="$BUILD_DIR"
|
|
|
|
rm -f panda/board/obj/panda.bin.signed
|
|
rm -f panda/board/obj/panda_h7.bin.signed
|
|
|
|
if [ -n "$RELEASE" ]; then
|
|
export CERT=/data/pandaextra/certs/release
|
|
fi
|
|
|
|
scons -j$(nproc)
|
|
|
|
# Cleanup
|
|
find . -name '*.a' -delete
|
|
find . -name '*.o' -delete
|
|
find . -name '*.os' -delete
|
|
find . -name '*.pyc' -delete
|
|
find . -name 'moc_*' -delete
|
|
find . -name '__pycache__' -delete
|
|
rm -rf .sconsign.dblite Jenkinsfile release/
|
|
rm selfdrive/modeld/models/supercombo.onnx
|
|
|
|
# Mark as prebuilt release
|
|
touch prebuilt
|
|
|
|
echo "----- openpilot has been built to $BUILD_DIR -----"
|