[GSI][ROM][mata][12][Feb 10] Android GSI Support for Essential Phone

Search This thread

sansp00

Member
Dec 22, 2010
17
5
Nexus 7 (2013)
OnePlus 3
That's actually what I started looking into ... I haven't built a rom since Gingerbread, so bear with me :) Do you have a specific git and/or tutorial ? Currently, I am checking out the AOSP (GSI and normal), phhusson stuff. I was also gonna checkout the mata source code just in case. Thank god for WSL cause I don't have a Linux box lying around anymore that have the required specs.
 

sansp00

Member
Dec 22, 2010
17
5
Nexus 7 (2013)
OnePlus 3
After a lot of fiddling with WSL2, I managed to get a build of the current AOSP master branch and ended up with the same issues. I will experiment a bit using the info provided here from the Essential team. I have also looked at this but I have a lot of catching up on that front.
 

nguyenquangduc2000

Senior Member
Jun 21, 2015
240
180
Long Xuyen
Nokia X2
Moto E 2015
That's actually what I started looking into ... I haven't built a rom since Gingerbread, so bear with me :) Do you have a specific git and/or tutorial ? Currently, I am checking out the AOSP (GSI and normal), phhusson stuff. I was also gonna checkout the mata source code just in case. Thank god for WSL cause I don't have a Linux box lying around anymore that have the required specs.
Dear bro,
As some ones reported that using the android-12-enabled kernel together with AOSP can be a successful solution.
Therefore, I have built a new image with android-12 kernel and system AOSP 11.

The link to the new build I have updated on #3 post. Could you please help me try it?
 

sansp00

Member
Dec 22, 2010
17
5
Nexus 7 (2013)
OnePlus 3
Dear bro,
As some ones reported that using the android-12-enabled kernel together with AOSP can be a successful solution.
Therefore, I have built a new image with android-12 kernel and system AOSP 11.

The link to the new build I have updated on #3 post. Could you please help me try it?
This boots properly, but like in all Android 12 based GSI's, wifi is broken ... Android 12 kernel is probably missing the wifi modules/driver. We seems to be making progress :) I spent some time looking the source code to get a full AOSP build going in Android 12, but it is quite tedious and I don't have a ton of free time on my hands currently.
 

nguyenquangduc2000

Senior Member
Jun 21, 2015
240
180
Long Xuyen
Nokia X2
Moto E 2015
This boots properly, but like in all Android 12 based GSI's, wifi is broken ... Android 12 kernel is probably missing the wifi modules/driver. We seems to be making progress :) I spent some time looking the source code to get a full AOSP build going in Android 12, but it is quite tedious and I don't have a ton of free time on my hands currently.
For the confirmation, the wifi works normally on AOSP 11 but is broken in Android 12 GSI? Is it your situation?
 
For the confirmation, the wifi works normally on AOSP 11 but is broken in Android 12 GSI? Is it your situation?
With the A12 ROMs that I tried, this seems to be the case. Using OEM boot.img results in SELinux enforcing, but WiFi that will not turn on. When that boot.img is patched w/ Magisk, SELinux becomes permissive, but WiFi is then working OK.

Also, every A12 GSI I tried requires the .088 vendor.img in order to boot. This is all in addition to the fact that A12 AOSP and GSI ROMs based on it are a work in progress and far from ready to be "daily drivers"
 
  • Like
Reactions: nguyenquangduc2000

nguyenquangduc2000

Senior Member
Jun 21, 2015
240
180
Long Xuyen
Nokia X2
Moto E 2015
With the A12 ROMs that I tried, this seems to be the case. Using OEM boot.img results in SELinux enforcing, but WiFi that will not turn on. When that boot.img is patched w/ Magisk, SELinux becomes permissive, but WiFi is then working OK.

Also, every A12 GSI I tried requires the .088 vendor.img in order to boot. This is all in addition to the fact that A12 AOSP and GSI ROMs based on it are a work in progress and far from ready to be "daily drivers"
According to your report, maybe the wifi module violates some SELinux rules in Android 12. It is a good idea to get the logging of SELinux so that I can analyze and fix it.

The AOSP rom is built upon .088 vendor so that using the lower version of vendor may result in errors, bro!
 
Last edited:

nguyenquangduc2000

Senior Member
Jun 21, 2015
240
180
Long Xuyen
Nokia X2
Moto E 2015
With the A12 ROMs that I tried, this seems to be the case. Using OEM boot.img results in SELinux enforcing, but WiFi that will not turn on. When that boot.img is patched w/ Magisk, SELinux becomes permissive, but WiFi is then working OK.

Also, every A12 GSI I tried requires the .088 vendor.img in order to boot. This is all in addition to the fact that A12 AOSP and GSI ROMs based on it are a work in progress and far from ready to be "daily drivers"
This boots properly, but like in all Android 12 based GSI's, wifi is broken ... Android 12 kernel is probably missing the wifi modules/driver. We seems to be making progress :) I spent some time looking the source code to get a full AOSP build going in Android 12, but it is quite tedious and I don't have a ton of free time on my hands currently.
I have updated wifi driver to the latest version with CAF. Here is the new built, please give it a try bros!
AOSP_Jan_27.zip
 

nguyenquangduc2000

Senior Member
Jun 21, 2015
240
180
Long Xuyen
Nokia X2
Moto E 2015
Here is a dump of dmesg with the latest version ... No apparent changes from the previous one. Hope it helps
Thank you for your dmesg log. It is very useful.
According to your log:
Code:
[    5.369755] init: processing action (boot) from (/vendor/etc/init/hw/init.mata.rc:133)
[    5.370427] init: Command 'start rfs_access' action=boot (/vendor/etc/init/hw/init.mata.rc:138) took 0ms and failed: service rfs_access not found
[    5.394091] subsys-pil-tz soc:qcom,kgsl-hyp: a540_zap: Brought out of reset
[    5.395434] devfreq soc:qcom,kgsl-busmon: Couldn't update frequency transition information.
[    5.445446] wlan: disagrees about version of symbol module_layout
[    5.446817] init: Command 'insmod /vendor/lib/modules/qca_cld3_wlan.ko' action=boot (/vendor/etc/init/hw/init.mata.rc:140) took 76ms and failed: finit_module for "/vendor/lib/modules/qca_cld3_wlan.ko" failed: Exec format error

I see that there are two major errors at rfs_access service and wlan module (qca_cld3_wlan.ko).
Maybe the kernel has some issues with the version of wlan.

Therefore, I have integrated wlan driver directly into kernel. Then the boot process does not need to load it.
This is the new built: AOSP_Jan_28.zip
Hope it works!!!
 
According to your report, maybe the wifi module violates some SELinux rules in Android 12. It is a good idea to get the logging of SELinux so that I can analyze and fix it.

The AOSP rom is built upon .088 vendor so that using the lower version of vendor may result in errors, bro!
Well, it's turning out not to be so straightforward after all. I'm still testing.
 
Have you tried the latest build? AOSP_Jan_28.zip
Yes, and I did get WiFi working, but the problem with it is different than I suggested, and still to be figured out.
It turns out that what allowed me to freely play with A11/A12 ROMs without running into many of the problems reported by others was a boot.img that at one time i scrapped (with 'dd', as suggested on Magisk troubleshooting FAQ) from one of the A11 ROMs. The problem? I do not remember from which (most likely from OctaviOS, but I need to verify that... the timestamp in the boot.img is different from their ROM build date). Anyways, clues.
BTW, as opposed to starting with pure Google AOSP, why not use PHHussons' as base, and then submit any PH-1 specific patches back to the community?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    I was able to get calls working including audio with the two tweaks in `Phh Treble Settings` > `Qualcomm features`

    Running `SP2A.220405.004
    PixelExperience_Plus_treble_arm64_bvS-12.1-20220412-1606-UNOFFICIAL`
  • 7
    Android 12 works now that the official AOSP sources are out, I used this specific build
    1635700271660.png
    6

    GSI baseline image for Essential Phone

    Android 12 updated in #3

    As you know, from Android 9, there is a project called Project Treble with the aim to bring newer Android versions faster to the user. Together with the time movement, Google also introduces HIDL. It is a concept separating Android hardware and software.

    Now, you also know, the Essential Phone PH-1 is on the list of supported devices in Project Treble. Unfortunately, this device requires specific storage mapping in the kernel so that it might not be able to use LineageOS as the baseline image.

    In order to overcome this inconvenience, you must build a stock AOSP image and disable verity. It is somehow complicated for newbies. Therefore, I am here to make it easier for you.

    [Window only] Driver for Essential: https://drive.google.com/file/d/1ofTm8cprzuc0i4SWxMrdlrATB3JpSRR9/view?usp=sharing

    Following step-by-step guidance here will make GSI work for you.

    Step 1:
    Download prebuild Stock AOSP build here.
    Link: https://drive.google.com/file/d/1hX_cUJqCp41flJjKASDLbhxzr6X7irw_/view?usp=sharing

    Step 2:
    Extract the download file into a folder. It contains three different files: boot.img, system.img and vendor.img.

    Step 3:
    Boot your device into bootloader (fastboot mode) by holding Power and Volume Down at the same time.

    Step 4:
    Unlock bootloader (If you have done, skip this step)
    Bash:
    fastboot flashing unlock
    fastboot flashing unlock_critical

    Step 5:
    Flash the above images
    Bash:
    fastboot flash boot_a boot.img
    fastboot set_active a
    fastboot flash vendor_a vendor.img
    fastboot flash system_a system.img
    fastboot format userdata
    fastboot reboot

    Step 6:
    After reboot, connect your phone into computer and run the followings.
    Bash:
    adb root
    adb disable-verity
    adb reboot bootloader

    Step 7:
    Download any GSI image you want. You can refer in this page.
    I have tested with Google GSI Android 11 and DotOS.
    If you want to try Google GSI, please use this link:
    https://developer.android.com/topic/generic-system-image/releases

    Step 8:
    Extract the downloaded file in step 7 into a folder. Make sure that you have the system image, whose size is more than 1GB.

    Step 9:
    Go to the above folder and run the following commands.
    Bash:
    fastboot flash system_a system.img
    fastboot format userdata
    fastboot reboot

    Step 10:
    Now your device will boot new os. Congratulation!

    Know issues:
    Almost every thing works fine.
    SELinux: Permissive

    Kernel: https://github.com/EssentialPhone/linux
    Device:
    https://github.com/EssentialPhone/device_essential_mata

    If you love my work, buy me a coffee at:
    Paypal: paypal.me/nguyenquangduc2000

    Thank you so much!
    3
    Android 12 GSI

    Last updated: Feb. 10th 2022


    The process of flashing Android 12 GSI is almost the same as the one of Android 11. But you need to replace some above steps with these following ones.

    Step 1:
    Download prebuild Stock AOSP here. [AOSP_Feb_10.zip]

    ...


    Step 7:
    Download your favorite Android 12 GSI rom. You can also refer here.

    ...

    Step 10:
    If your device boots up, you are lucky. Congratulation!

    Know issues:
    Almost stable
    SELinux: Permissive

    If you love my work, you can give me a hug at:
    Paypal: paypal.me/nguyenquangduc2000

    Thank you so much!
    2
    Many thanks for supporters:
    1. Botany Lane Pottery
    2. Mariusz Stanczak
    2
    I was able to get calls working including audio with the two tweaks in `Phh Treble Settings` > `Qualcomm features`

    Running `SP2A.220405.004
    PixelExperience_Plus_treble_arm64_bvS-12.1-20220412-1606-UNOFFICIAL`