Compare commits
3 Commits
f46339c949
...
cea8926604
| Author | SHA1 | Date | |
|---|---|---|---|
| cea8926604 | |||
| e98ae2f9d1 | |||
| 531b3edcd2 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -2,6 +2,8 @@ prebuilt
|
|||||||
system/clearpilot/dev/on_start_brian.sh
|
system/clearpilot/dev/on_start_brian.sh
|
||||||
system/clearpilot/dev/id_rsa
|
system/clearpilot/dev/id_rsa
|
||||||
system/clearpilot/dev/id_rsa.pub
|
system/clearpilot/dev/id_rsa.pub
|
||||||
|
system/clearpilot/dev/id_ed25519
|
||||||
|
system/clearpilot/dev/id_ed25519.pub
|
||||||
venv/
|
venv/
|
||||||
.venv/
|
.venv/
|
||||||
.ci_cache
|
.ci_cache
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ chown -R comma:comma /data/openpilot
|
|||||||
|
|
||||||
### Git
|
### Git
|
||||||
|
|
||||||
- Remote: `git@git.internal.hanson.xyz:brianhansonxyz/comma.git`
|
- Remote: `git@git.hanson.xyz:brianhansonxyz/clearpilot.git`
|
||||||
- Branch: `clearpilot`
|
- Branch: `clearpilot`
|
||||||
- Large model files are tracked in git (intentional — this is a backup)
|
- Large model files are tracked in git (intentional — this is a backup)
|
||||||
|
|
||||||
|
|||||||
@@ -14,5 +14,5 @@ nmcli radio wifi on 2>/dev/null
|
|||||||
|
|
||||||
# Provision (packages, git pull, build) if no quick_boot flag
|
# Provision (packages, git pull, build) if no quick_boot flag
|
||||||
if [ ! -f /data/quick_boot ]; then
|
if [ ! -f /data/quick_boot ]; then
|
||||||
bash /data/openpilot/system/clearpilot/provision.sh
|
sudo bash /data/openpilot/system/clearpilot/provision.sh
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -32,11 +32,9 @@ sudo mount -o remount,rw /
|
|||||||
echo "Installing packages..."
|
echo "Installing packages..."
|
||||||
sudo apt-get update -qq
|
sudo apt-get update -qq
|
||||||
sudo apt-get install -y openvpn curl ccrypt
|
sudo apt-get install -y openvpn curl ccrypt
|
||||||
echo "Installing Node.js 18..."
|
#echo "Installing Node.js 20..."
|
||||||
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
|
#curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
|
||||||
sudo apt-get install -y nodejs
|
sudo apt-get install -y nodejs
|
||||||
node -v
|
|
||||||
sudo apt-get install -y npm
|
|
||||||
mount -o rw,remount /
|
mount -o rw,remount /
|
||||||
echo "Installing Claude Code..."
|
echo "Installing Claude Code..."
|
||||||
curl -fsSL https://claude.ai/install.sh | bash
|
curl -fsSL https://claude.ai/install.sh | bash
|
||||||
@@ -49,19 +47,29 @@ serial=$(sed 's/.*androidboot.serialno=\([^ ]*\).*/\1/' /proc/cmdline)
|
|||||||
ssh_dir="/data/ssh/.ssh"
|
ssh_dir="/data/ssh/.ssh"
|
||||||
if [[ $serial == 3889765b ]] && [[ ! -f "$ssh_dir/id_ed25519" || ! -f "$ssh_dir/id_ed25519.pub" ]]; then
|
if [[ $serial == 3889765b ]] && [[ ! -f "$ssh_dir/id_ed25519" || ! -f "$ssh_dir/id_ed25519.pub" ]]; then
|
||||||
echo "Decrypting SSH identity keys (serial=$serial)..."
|
echo "Decrypting SSH identity keys (serial=$serial)..."
|
||||||
bash /data/openpilot/system/clearpilot/tools/decrypt /data/openpilot/system/clearpilot/dev/id_ed25519.cpt /data/openpilot/system/clearpilot/dev/id_ed25519
|
tmpdir=$(mktemp -d)
|
||||||
bash /data/openpilot/system/clearpilot/tools/decrypt /data/openpilot/system/clearpilot/dev/id_ed25519.pub.cpt /data/openpilot/system/clearpilot/dev/id_ed25519.pub
|
bash /data/openpilot/system/clearpilot/tools/decrypt /data/openpilot/system/clearpilot/dev/id_ed25519.cpt "$tmpdir/id_ed25519"
|
||||||
|
bash /data/openpilot/system/clearpilot/tools/decrypt /data/openpilot/system/clearpilot/dev/id_ed25519.pub.cpt "$tmpdir/id_ed25519.pub"
|
||||||
mkdir -p "$ssh_dir"
|
mkdir -p "$ssh_dir"
|
||||||
cp /data/openpilot/system/clearpilot/dev/id_ed25519 /data/openpilot/system/clearpilot/dev/id_ed25519.pub "$ssh_dir/"
|
cp "$tmpdir/id_ed25519" "$tmpdir/id_ed25519.pub" "$ssh_dir/"
|
||||||
|
rm -rf "$tmpdir"
|
||||||
chmod 700 "$ssh_dir"
|
chmod 700 "$ssh_dir"
|
||||||
chmod 600 "$ssh_dir/id_ed25519"
|
chmod 600 "$ssh_dir/id_ed25519"
|
||||||
chmod 644 "$ssh_dir/id_ed25519.pub"
|
chmod 644 "$ssh_dir/id_ed25519.pub"
|
||||||
echo "SSH identity keys installed to $ssh_dir"
|
echo "SSH identity keys installed to $ssh_dir"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 4. Pull latest from remote (remote always wins)
|
# 4. Ensure git remote uses SSH (not HTTPS)
|
||||||
echo "Checking for updates..."
|
|
||||||
cd /data/openpilot
|
cd /data/openpilot
|
||||||
|
EXPECTED_REMOTE="git@git.hanson.xyz:brianhansonxyz/clearpilot.git"
|
||||||
|
CURRENT_REMOTE=$(git remote get-url origin 2>/dev/null)
|
||||||
|
if [ "$CURRENT_REMOTE" != "$EXPECTED_REMOTE" ]; then
|
||||||
|
echo "Fixing git remote: $CURRENT_REMOTE -> $EXPECTED_REMOTE"
|
||||||
|
git remote set-url origin "$EXPECTED_REMOTE"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 5. Pull latest from remote (remote always wins)
|
||||||
|
echo "Checking for updates..."
|
||||||
git fetch origin clearpilot
|
git fetch origin clearpilot
|
||||||
LOCAL=$(git rev-parse HEAD)
|
LOCAL=$(git rev-parse HEAD)
|
||||||
REMOTE=$(git rev-parse origin/clearpilot)
|
REMOTE=$(git rev-parse origin/clearpilot)
|
||||||
@@ -76,15 +84,8 @@ fi
|
|||||||
|
|
||||||
# 5. Build
|
# 5. Build
|
||||||
echo ""
|
echo ""
|
||||||
echo "Starting build..."
|
sudo chown -R comma:comma /data/openpilot
|
||||||
sudo su - comma -c "bash /data/openpilot/build_only.sh"
|
touch /data/quick_boot
|
||||||
if [ $? -eq 0 ]; then
|
|
||||||
echo "Build succeeded"
|
|
||||||
touch /data/quick_boot
|
|
||||||
else
|
|
||||||
echo "Build failed"
|
|
||||||
sleep 10
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Provision complete"
|
echo "Provision complete"
|
||||||
sleep 2
|
sleep 2
|
||||||
|
|||||||
Reference in New Issue
Block a user