curl pc installer (#33072)
* setup
* curl
* usable right now
* op sim
* cleanup
* show cmd
old-commit-hash: 173a633a75
pull/33302/head
parent
fbdb5f3495
commit
8b1766caa0
3 changed files with 68 additions and 29 deletions
@ -1,32 +1,54 @@ |
|||||||
#!/usr/bin/env bash |
#!/usr/bin/env bash |
||||||
|
|
||||||
set -e |
RED='\033[0;31m' |
||||||
|
GREEN='\033[0;32m' |
||||||
|
NC='\033[0m' |
||||||
|
|
||||||
if [ ! -f launch_openpilot.sh ]; then |
if [ -z "$OPENPILOT_ROOT" ]; then |
||||||
if [ ! -d openpilot ]; then |
# default to current directory for installation |
||||||
git clone --single-branch --recurse-submodules https://github.com/commaai/openpilot.git |
OPENPILOT_ROOT="$(pwd)/openpilot" |
||||||
fi |
fi |
||||||
cd openpilot |
|
||||||
|
function check_dir() { |
||||||
|
echo "Checking for installation directory..." |
||||||
|
if [ -d "$OPENPILOT_ROOT" ]; then |
||||||
|
echo -e " ↳ [${RED}✗${NC}] can't install openpilot in $OPENPILOT_ROOT !" |
||||||
|
return 1 |
||||||
fi |
fi |
||||||
|
|
||||||
if [[ "$OSTYPE" == "darwin"* ]]; then |
echo -e " ↳ [${GREEN}✔${NC}] Successfully chosen $OPENPILOT_ROOT as installation directory\n" |
||||||
tools/mac_setup.sh |
} |
||||||
|
|
||||||
|
function check_git() { |
||||||
|
echo "Checking for git..." |
||||||
|
if ! command -v "git" > /dev/null 2>&1; then |
||||||
|
echo -e " ↳ [${RED}✗${NC}] git not found on your system, can't continue!" |
||||||
|
return 1 |
||||||
else |
else |
||||||
tools/ubuntu_setup.sh |
echo -e " ↳ [${GREEN}✔${NC}] git found.\n" |
||||||
|
fi |
||||||
|
} |
||||||
|
|
||||||
|
function git_clone() { |
||||||
|
echo "Cloning openpilot..." |
||||||
|
if $(git clone --depth=1 https://github.com/commaai/openpilot.git "$OPENPILOT_ROOT"); then |
||||||
|
if [[ -f $OPENPILOT_ROOT/launch_openpilot.sh ]]; then |
||||||
|
echo -e " ↳ [${GREEN}✔${NC}] Successfully cloned openpilot.\n" |
||||||
|
return 0 |
||||||
|
fi |
||||||
fi |
fi |
||||||
|
|
||||||
git lfs pull |
echo -e " ↳ [${RED}✗${NC}] failed to clone openpilot!" |
||||||
|
return 1 |
||||||
|
} |
||||||
|
|
||||||
source .venv/bin/activate |
function install_with_op() { |
||||||
|
cd $OPENPILOT_ROOT |
||||||
|
$OPENPILOT_ROOT/tools/op.sh --install |
||||||
|
$OPENPILOT_ROOT/tools/op.sh install |
||||||
|
|
||||||
echo "Building openpilot" |
# make op usable right now |
||||||
scons -u -j$(nproc) |
alias op="source $OPENPILOT_ROOT/tools/op.sh \"\$@\"" |
||||||
|
} |
||||||
|
|
||||||
echo |
check_dir && check_git && git_clone && install_with_op |
||||||
echo "---- OPENPILOT BUILDING DONE ----" |
|
||||||
echo "To push changes to your fork, run the following commands:" |
|
||||||
echo "git remote remove origin" |
|
||||||
echo "git remote add origin git@github.com:<YOUR_USERNAME>/openpilot.git" |
|
||||||
echo "git fetch" |
|
||||||
echo "git commit -m \"first commit\"" |
|
||||||
echo "git push" |
|
||||||
|
Loading…
Reference in new issue