Skip to content

Instantly share code, notes, and snippets.

@geohot
Last active April 30, 2024 21:39
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save geohot/569e9e4b20fd41203d8da71c6022be15 to your computer and use it in GitHub Desktop.
Save geohot/569e9e4b20fd41203d8da71c6022be15 to your computer and use it in GitHub Desktop.
instructions to install openpilot on a pixel 3 running android 9
# instructions to install openpilot on a pixel 3
# enter fastboot with power + volume down
# make sure bootloader is unlocked
# make sure modern version of android platform tools is installed
mkdir pixel
wget https://dl.google.com/dl/android/aosp/blueline-pq3a.190801.002-factory-f3d66c49.zip
unzip blueline-pq3a.190801.002-factory-f3d66c49.zip
cd blueline-pq3a.190801.002/
./flash-all.sh
# wait for boot, click through setup, enable adb as usual for android
cd ../
wget https://github.com/termux/termux-app/releases/download/v0.118.0/termux-app_v0.118.0+github-debug_arm64-v8a.apk
wget https://github.com/topjohnwu/Magisk/releases/download/v24.2/Magisk-v24.2.apk
adb install termux-app_v0.118.0+github-debug_arm64-v8a.apk
adb install Magisk-v24.2.apk
unzip -p blueline-pq3a.190801.002/image-blueline-pq3a.190801.002.zip boot.img > boot.img
adb push boot.img /sdcard/Download/
# use magisk app to patch boot.img
adb pull /sdcard/Download/magisk_patched-24200_V7Jgg.img
adb reboot bootloader
fastboot flash boot magisk_patched-24200_V7Jgg.img
fastboot reboot
# your phone is now rooted, this builds and installs the userspace
# TODO: factor build_usr out of this repo
git clone git@github.com:commaai/eon-neos-builder.git
cd eon-neos-builder/devices/eon/build_usr/
./install.py
./finish.sh
cp -pRv ../home out/data/data/com.termux/files/
cd out/data/data/com.termux/files/
tar zcvf userspace.tar.gz home usr
adb push userspace.tar.gz /sdcard/Download/
adb shell
# now we are on the phone
su
cd /data/data/com.termux/
mkdir files && cd files
tar xvf /sdcard/Download/userspace.tar.gz
mount -o remount,rw /dev/root /
ln -s /data/data/com.termux/files/usr /usr
exit
# enter the new userspace (reuse later)
su -c 'HOME=/data/data/com.termux/files/home PATH="/data/data/com.termux/files/usr/bin:/bin" LD_LIBRARY_PATH="/data/data/com.termux/files/usr/lib" bash'
mkdir -p tmp && mount -t tmpfs -o size=2048M tmpfs /tmp
cd ~
tmux
# additional setup
apt-get update
apt-get install gawk findutils
chmod 644 /data/data/com.termux/files/home/.ssh/config
chown root:root /data/data/com.termux/files/home/.ssh/config
# build and install extra packages
# comment out line 9 from install.sh with the mount
# this takes about 45 minutes
# TODO: the binutils this builds is broken
./install.sh
# enable ssh (optional)
sshd
mkdir -p /data/params/d && cat > /data/params/d/GithubSshKeys
# put your authorized key here, then on host
adb forward tcp:8022 tcp:8022
ssh -p 8022 localhost
# install openpilot
touch /EON
cd /data
git clone https://github.com/commaai/openpilot.git --recurse-submodules -b pixel3
cd openpilot
scons -j4
# two things currently don't build, the model and panda (binutils issue)
# HACK: for qt to talk to android 9 surfaceflinger and for locked rotation landscape
cp /data/openpilot/third_party/qt-plugins/aarch64/libqeglfs-surfaceflinger-integration.so /usr/libexec/qt/egldeviceintegrations/
# launch!
./launch_openpilot.sh
@kaleydeskop
Copy link

./install.py ubuntu
ı got this error..

./install.py
http://termux.comma.ai/dists/stable/main/binary-aarch64/Packages
Downloading ffmpeg-dev - /tmp/tmp2rziatql - http://termux.comma.ai/dists/stable/main/binary-aarch64/ffmpeg-dev_4.1.3-3_aarch64.deb
Traceback (most recent call last):
File "/home/ali/p/eon-neos-builder/devices/eon/build_usr/./install.py", line 197, in
s = install_package(pkg_deps, pkg_filenames, pkg)
File "/home/ali/p/eon-neos-builder/devices/eon/build_usr/./install.py", line 97, in install_package
subprocess.check_call(['ar', 'x', deb_path], cwd=tmp_dir)
File "/usr/lib/python3.10/subprocess.py", line 364, in check_call
retcode = call(*popenargs, **kwargs)
File "/usr/lib/python3.10/subprocess.py", line 345, in call
with Popen(*popenargs, **kwargs) as p:
File "/usr/lib/python3.10/subprocess.py", line 971, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/lib/python3.10/subprocess.py", line 1863, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'ar'

@reekotubbs
Copy link

Any luck on resolving the error?

@kaleydeskop
Copy link

Any luck on resolving the error?

nope...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment