[GSI][arm64] Ubuntu Touch (ubports) [DRG/B2N/PL2]

Search This thread
https%3A%2F%2Fmiro.medium.com%2Fmax%2F1400%2F0%2AxXfO04nJkRitzXe6


Code:
/*
* Your warranty is now void.
*
* I am 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 ROM
* before flashing it! YOU are choosing to make these modifications, and if
* you point the finger at me for messing up your device, I will laugh at you.
*/

What is Ubuntu Touch?
Ubuntu Touch is the touch-friendly mobile version of Ubuntu.
This operating system is developed and maintained by UBports: An international community of passionate volunteers.
This means Ubuntu Touch is 100% community driven and independent.

What is Halium?
Halium is the collaborative project to unify the Hardware Abstraction Layer for projects which run GNU/Linux on mobile devices with pre-installed Android.

How it is a GSI?
First of all, I should mention ubports GSI definition is different from android, but both are generic.
ubports root file system was always generic and works for most cases, but devs were porting halium system image to add device-specific (HALs and configs) support to ubports Android container.
But after project treble which introduced in android 8, all device-specific parts of android system image moved to vendor partition and we can use "Generic system images" over one vendor partition.
In halium version 9, we use this adventure and have a totally generic system image + root file system.

Requirements:
The only Requirement of booting this GSI is having Halium patched kernel.
Keep in mind having android 9 firmware installed on the device as GSI base is mandatory (GSI can be used on android 8.0 and 8.1 vendors but experimental and not supported yet)

How to install?
1. Boot TWRP and FORMAT data
2. Flash vendor image and halium-boot.img (Halium-boot.img confirmed working on DRG and PL2, B2N needs testing)
3. Flash GSI installer zip
4. Reboot

Note: if the device is stuck on the splash screen on boot, simply force reboot using the power/volume button combo meant for your device

Download:
GSI - built by @mrcyjanek (download ONLY target.zip)
Vendor images
Halium-boot

Whats suppose to work?
Bluetooth
Camera
Cellular Radio
Mobile Data
GPS
Graphics
Sensors
Sound
In-call Audio
Touch
Wifi
Vibration
Anbox
Media Playback

Known bugs?
Random (but rare) BSOD + reboots
no way to unlock using Fingerprint
Touching Fingerprint sensor can reduce media volume
oh and of course VoLTE
Camera (on B2N)

Supports:
Halium telegram group
UBports telegram group
UBports Porting telegram group
ErfanGSIs telegram group

Report Bugs:
Explain your bug in proper support telegram groups (from above)
Please don't ask about spoon-feeding or helping on building kernel or device specific builds.
Please don't ask about picking/reverting commits or any basic git commands.
bug reports without logs will be ignored
logs we need are: android logcat, kernel log, syslog

kernel log:
Code:
 dmesg
syslog:
Code:
 cat /var/log/syslog
logcat:
Code:
sudo -s
LD_LIBRARY_PATH=/system/lib64 lxc-attach -e -n android -- /system/bin/logcat

Taken with all due respect from Erfan's Thread

Appendix:

Anbox installation guide (by SevralTi on Github)
Code:
sudo mount -o rw,remount /
sudo apt update && sudo apt install -y anbox-ubuntu-touch android-tools-adb
mkdir ~/anbox-data
wget http://cdimage.ubports.com/anbox-images/android-armhf-64binder.img -O ~/anbox-data/android.img
touch ~/anbox-data/.enable
sudo chmod -R o+wrx /home/phablet/anbox-data/data
sudo start -q anbox-container

reboot, wait 2 minutes the reboot again

To symlink anbox files to system:

ln -s ~/anbox-data/data/media/0/Documents ~/Documents/android
ln -s ~/anbox-data/data/media/0/Pictures ~/Pictures/android
ln -s ~/anbox-data/data/media/0/Music ~/Music/android
ln -s ~/anbox-data/data/media/0/Movies ~/Videos/android

To make the QS panel occupy the whole screen, install UT Tweak Tool from the Open Store and increase device display scaling

Libertine containers can't be created from the settings app for now. To create a container, pass the command "TMPDIR=/tmp" in the terminal and follow documentation here
 

Attachments

  • 500017900989_481145.jpg
    500017900989_481145.jpg
    59.9 KB · Views: 1,339
  • 500033000008_149358.jpg
    500033000008_149358.jpg
    66 KB · Views: 1,353
  • 500033100613_149365.jpg
    500033100613_149365.jpg
    50.9 KB · Views: 1,317
  • 500033400016_150074.jpg
    500033400016_150074.jpg
    27.7 KB · Views: 1,221
  • 500034600715_150068.jpg
    500034600715_150068.jpg
    26.1 KB · Views: 1,248
Last edited:
  • Love
Reactions: SharperAtol1791
I would like to offer a special thanks to a bunch of people who've been with me through this ridiculous journey of mine:
@Sahil_Sonar - for all the help and advice he's given
@krushndayshmookh - for being a generally sweet guy and looking out for me
@CarbonGTR and @Nikhilkumar038 - for being solid friends and motivators throughout my struggle
@Catharsis007 - for being best boi
@ArcherTanu - for being extremely helpful
The UBPorts community
EVERYONE who's worked on the LOS sdm660 Kernel
and a special unnamed best friend who helped me power through the last couple of months.

Cheers,
Sid
 
Last edited:
Dec 14, 2018
21
5
19
Bengaluru
Ok! Installing it soon

It works on the PL2, encountered nothing broken so far :good:. I received an SMS, downloaded some stuff, etc (but haven't tried calling yet). Once in while it does hang with a black screen while booting, but simply holding Vol. up + Power to force-restart does the trick, like mentioned in the OP. Set up whatsapp successfully on Anbox, but graphics on any anbox app are jerky and laggy at times, in a manner similar to that of the anbox installation on my Linux Mint, so this doesn't seem to be an issue pertaining to this GSI/Halium port. Still, would be nice to have an improvement
 
Last edited:

SamandaR1112

Member
Apr 15, 2018
29
1
Andijon
Oh looks like really interesting. I'm downloading now. I'll test this for a few days. Question: It isn't Android totally. It's Ubuntu yes? Does it meant that other OS's can be ported as well like HarmonyOs? If that's true how it is can be ported.
 
Oh looks like really interesting. I'm downloading now. I'll test this for a few days. Question: It isn't Android totally. It's Ubuntu yes? Does it meant that other OS's can be ported as well like HarmonyOs? If that's true how it is can be ported.

It isn't Android, it isn't exactly Ubuntu Desktop either. Canonical was working on Ubuntu Touch/Ubuntu Phone until 2017, and after they dropped the project, the UBports community was born and carried it forward. I'm not sure about HarmonyOS
 

n00bDroid

Member
Jun 12, 2011
47
5
Which flashing method is prefered? Anybody who can tell a little on how it is in use? (Does it feel snappy or any lags)
 

n00bDroid

Member
Jun 12, 2011
47
5
Just about to flash to my B2N. The file B2N####-vendor.img needs to be set to a partition. "Select partition to flash image". I'm guessing boot or system, but honestly I have no idea. help?

---------- Post added at 11:43 AM ---------- Previous post was at 11:32 AM ----------

So.. I'm not exactly known for my patience.. Using method 1 I flashed the vendor image to system image, and boot image to boot partition. then changed to zip and flashed gsi. Twrp prompted me to install official twrp app, I was curious to see if it would work so I chose to do so. Then reboot turned me into a bootloop...
 
Dec 14, 2018
21
5
19
Bengaluru
Just about to flash to my B2N. The file B2N####-vendor.img needs to be set to a partition. "Select partition to flash image". I'm guessing boot or system, but honestly I have no idea. help?

---------- Post added at 11:43 AM ---------- Previous post was at 11:32 AM ----------

So.. I'm not exactly known for my patience.. Using method 1 I flashed the vendor image to system image, and boot image to boot partition. then changed to zip and flashed gsi. Twrp prompted me to install official twrp app, I was curious to see if it would work so I chose to do so. Then reboot turned me into a bootloop...

Code:
fastboot flash vendor <B2N####-vendor.img>
fastboot flash boot halium-boot.img # NOT B2N-0-354H-00WW-boot.img

Let the keyword "vendor" in <B2N####-vendor.img> serve as a reminder that it is meant to be flashed to the vendor partition.
 

n00bDroid

Member
Jun 12, 2011
47
5
Code:
fastboot flash vendor <B2N####-vendor.img>
fastboot flash boot halium-boot.img # NOT B2N-0-354H-00WW-boot.img

Let the keyword "vendor" in <B2N####-vendor.img> serve as a reminder that it is meant to be flashed to the vendor partition.

Immidiately after my post I made the same realization that vendor.img = vendor partition. So I did that, and it still didn't work.. But then again, I actually flashed B2N-0-354H-00WW-boot.img because I hadn't seen the halium-boot :eek:

So I went again. Now according to recipe. Then reboot system..I've been stuck on the "AndroidOne" logo for 15 minutes....after a forced reboot I see the Ubuntu Touch logo!!! :D thank you!
 

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    https%3A%2F%2Fmiro.medium.com%2Fmax%2F1400%2F0%2AxXfO04nJkRitzXe6


    Code:
    /*
    * Your warranty is now void.
    *
    * I am 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 ROM
    * before flashing it! YOU are choosing to make these modifications, and if
    * you point the finger at me for messing up your device, I will laugh at you.
    */

    What is Ubuntu Touch?
    Ubuntu Touch is the touch-friendly mobile version of Ubuntu.
    This operating system is developed and maintained by UBports: An international community of passionate volunteers.
    This means Ubuntu Touch is 100% community driven and independent.

    What is Halium?
    Halium is the collaborative project to unify the Hardware Abstraction Layer for projects which run GNU/Linux on mobile devices with pre-installed Android.

    How it is a GSI?
    First of all, I should mention ubports GSI definition is different from android, but both are generic.
    ubports root file system was always generic and works for most cases, but devs were porting halium system image to add device-specific (HALs and configs) support to ubports Android container.
    But after project treble which introduced in android 8, all device-specific parts of android system image moved to vendor partition and we can use "Generic system images" over one vendor partition.
    In halium version 9, we use this adventure and have a totally generic system image + root file system.

    Requirements:
    The only Requirement of booting this GSI is having Halium patched kernel.
    Keep in mind having android 9 firmware installed on the device as GSI base is mandatory (GSI can be used on android 8.0 and 8.1 vendors but experimental and not supported yet)

    How to install?
    1. Boot TWRP and FORMAT data
    2. Flash vendor image and halium-boot.img (Halium-boot.img confirmed working on DRG and PL2, B2N needs testing)
    3. Flash GSI installer zip
    4. Reboot

    Note: if the device is stuck on the splash screen on boot, simply force reboot using the power/volume button combo meant for your device

    Download:
    GSI - built by @mrcyjanek (download ONLY target.zip)
    Vendor images
    Halium-boot

    Whats suppose to work?
    Bluetooth
    Camera
    Cellular Radio
    Mobile Data
    GPS
    Graphics
    Sensors
    Sound
    In-call Audio
    Touch
    Wifi
    Vibration
    Anbox
    Media Playback

    Known bugs?
    Random (but rare) BSOD + reboots
    no way to unlock using Fingerprint
    Touching Fingerprint sensor can reduce media volume
    oh and of course VoLTE
    Camera (on B2N)

    Supports:
    Halium telegram group
    UBports telegram group
    UBports Porting telegram group
    ErfanGSIs telegram group

    Report Bugs:
    Explain your bug in proper support telegram groups (from above)
    Please don't ask about spoon-feeding or helping on building kernel or device specific builds.
    Please don't ask about picking/reverting commits or any basic git commands.
    bug reports without logs will be ignored
    logs we need are: android logcat, kernel log, syslog

    kernel log:
    Code:
     dmesg
    syslog:
    Code:
     cat /var/log/syslog
    logcat:
    Code:
    sudo -s
    LD_LIBRARY_PATH=/system/lib64 lxc-attach -e -n android -- /system/bin/logcat

    Taken with all due respect from Erfan's Thread

    Appendix:

    Anbox installation guide (by SevralTi on Github)
    Code:
    sudo mount -o rw,remount /
    sudo apt update && sudo apt install -y anbox-ubuntu-touch android-tools-adb
    mkdir ~/anbox-data
    wget http://cdimage.ubports.com/anbox-images/android-armhf-64binder.img -O ~/anbox-data/android.img
    touch ~/anbox-data/.enable
    sudo chmod -R o+wrx /home/phablet/anbox-data/data
    sudo start -q anbox-container
    
    reboot, wait 2 minutes the reboot again
    
    To symlink anbox files to system:
    
    ln -s ~/anbox-data/data/media/0/Documents ~/Documents/android
    ln -s ~/anbox-data/data/media/0/Pictures ~/Pictures/android
    ln -s ~/anbox-data/data/media/0/Music ~/Music/android
    ln -s ~/anbox-data/data/media/0/Movies ~/Videos/android

    To make the QS panel occupy the whole screen, install UT Tweak Tool from the Open Store and increase device display scaling

    Libertine containers can't be created from the settings app for now. To create a container, pass the command "TMPDIR=/tmp" in the terminal and follow documentation here