Building & installation documentation for Ubuntu Touch on the OnePlus 3/3T
* Your warranty is now void.
*
* We are not responsible for bricked devices, dead SD cards,
* thermonuclear war, or you getting fired because the alarm app failed. Please
* do some research if you have any concerns about features included in this modification
* before flashing it! YOU are choosing to make these modifications, and if
* you point the finger at us for messing up your device, we are not responsible.
To install Ubuntu Touch on your OP3/3T, you don't need to compile halium source, go directly to Treblelizing your OP3(T) & Firmware & TWRP
- Install prerequisites for building
- Initializing local repo
- Syncing local repository
- Applying patches
- Building HAL parts
- Treblelizing your OP3(T) & Firmware & TWRP
- Installing UBports using Erfan's GSI
- Installing Droidian
- Note
- Source
- Thanks
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install git gnupg flex bison gperf build-essential \
zip bzr curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \
libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 \
libgl1-mesa-dev g++-multilib mingw-w64-i686-dev tofrodos \
python-markdown libxml2-utils xsltproc zlib1g-dev:i386 schedtool \
repo liblz4-tool bc lzop imagemagick libncurses5 rsync
For ubuntu Focal, repo is not in the ubuntu repository, download it manually from https://packages.ubuntu.com/groovy/all/repo/download
mkdir ~/Halium/ && cd ~/Halium/
repo init -u https://github.com/Halium/android -b halium-9.0 --depth=1
git clone https://github.com/OP3-Halium/local_manifests .repo/local_manifests/
git clone https://gitlab.com/JBBgameich/halium-install/ halium/scripts/ --depth 1
cd ~/Halium/
repo sync --no-clone-bundle --no-tags -c -j`nproc`
hybris-patches/apply-patches.sh --mb
NOTE: This will fail if you've already applied them; to revert the patches and all other local changes run repo sync -l
Type the following to initilize the current environment for building:
. build/envsetup.sh
breakfast oneplus3
export LANG=C LC_ALL=POSIX
To produce the required halium-boot.img kernel image for Ubuntu Touch, execute:
mka halium-boot
NOTE: If you've decided to install manually (without Erfan GSI) you also need to mka systemimage!
https://drive.google.com/drive/folders/1vnJEKkhO3xqH-fWWG55-yxwx5K1EeKq7?usp=sharing
For further information please read the subject on XDA
- To sumup, GSI port requires a dedicated vendor partition.
Download the "[New][A/B] LineageOS 16.0 Treble system-as-root"
- Recovery : twrp-op3treble-3.3.1-1.img
- LineageOS 16 image : lineage-Ubuntu touch custom
- Firmware 9.0.6 : oxygenos-9.0.6 be careful the firmwares are device specific
Reboot into fastboot and install the TWRP recovery => Check the official link for installation TWRP link
Treblelize your OP3(t)
- Follow the information there : https://forum.xda-developers.com/oneplus-3/oneplus-3--3t-cross-device-development/treble-lineageos-15-1-treble-oneplus-3-t3830455
Reboot into the TWRP Recovery
- Update the firmware
- Install lineage 16.0
Reboot into Lineage, confirm everything works fine.
- Download the latest GSI zip from here
- Ensure your
/vendorpartition is populated (after mounting) with content from an Android 9 ROM (LineageOS or equivalent) - In TWRP, go to
Wipe->Advanced Wipe-> Select everything except Vendor and USB-OTG, thenSwipe to Wipe. Then reboot back to recovery. - Flash the GSI zip file
- Flash halium-boot.img to your boot partition (See instructions in the note below)
- Flash the OP3_GSI_Fix_V1.X
- Reboot
- Enjoy!
- Download latest .zip from here (look for api28-arm64 zip)
- Ensure your '/vendor' partition is populated (after mounting) with content from an Android 9 ROM (LineageOS or equivalent)
- In TWRP, go to
Wipe->Advanced Wipe-> Select everything except Vendor and USB-OTG, thenSwipe to Wipe. Then reboot back to recovery. - Flash the droidian zip file
- Flash halium-boot.img to your boot partition (See instructions in the note below)
- Flash op3-gsi-fix-droidian.zip
- Reboot
- Once you have booted for the first time, open a terminal on the phone and run the
move-homecommand, which will move your home folder to the /userdata partition so you can use all of the storage on your device. Your device will reboot when it's done. - Enjoy!
If you built your own halium-boot.img, it will be located at out/target/product/oneplus3/halium-boot.img.
There are 3 ways of flashing the boot image to your device (choose one):
- Using adb (Boot into TWRP, connect usb cable and then run from your pc):
adb push path/to/halium-boot.img /tmp/
adb shell "dd if=/tmp/halium-boot.img of=/dev/block/bootdevice/by-name/boot"
- Using fastboot (Boot into fastboot/bootloader mode, connect usb cable and then run from your pc):
fastboot flash boot path/to/halium-boot.img
- Using TWRP's own install method (Boot into TWRP, connect usb cable and then run from your pc):
a) Connect your device to your pc and push halium-boot.img to the device:adb push path/to/halium-boot.img /sdcard/.
b) In TWRP main menu, pressInstall->Install Image->halium-boot.img
c) SelectBootas the partiton where to install, thenSwipe to confirm Flash
- Documentation based on https://github.com/ubports-oneplus5
- Another 3.18 kernel working with ErfanGSI : https://github.com/MotoZ-2016/android_kernel_motorola_msm8996/tree/halium-9.0
- https://github.com/OP3Treble Project
https://github.com/OP3-Halium/
-
Webbrowser not reconized as a mobile
- edit the file
sudo nano /usr/lib/arm-linux-gnueabihf/qt5/qml/Morph/Web/UserAgent02.qml - chang line 68 to
return (screenDiagonal === 0) ? "unknown" : (screenDiagonal > 0 && screenDiagonal < 190) ? "small" : "small"
- edit the file
-
Data doesn't work
cd /usr/share/ofono/scripts/ && ./activate-context -
Wifi doesn't restart
sudo nano /etc/udev/rules.d/90-oneplus3.rules- add
ACTION=="change|remove|create", DEVPATH=="/devices/soc/600000.qcom,pcie/pci0000:00/0000:00:00.0/0000:01:00.0/ieee80211/phy?", RUN+="/usr/bin/python3 /home/phablet/wlan_restart.py" - then
nano /home/phablet/wlan_restart.py -
import subprocess import os.path subprocess.Popen("echo sta > /sys/module/wlan/parameters/fwpath", shell=True) print("Wifi card set up for wlan activation")