My HowTos for the ASUS Zenfone 8

 Last Update: 20.09.2026/bs

(see also the News section)


Contents


  1. My HowTos for the ASUS Zenfone 8
    1. Contents
    2. Introduction
    3. News
    4. History
    5. Instructions to compile the OmniROM Custom ROM for the ASUS Zenfone 8
      1. How to compile the OmniROM Custom ROM for the ASUS Zenfone 8
      2. How to compile the OmniROM 12 Custom ROM for the ASUS Zenfone 8
      3. How to create an OmniROM Custom ROM image with MicroG
      4. How to compile the OmniROM 13 Custom ROM for the ASUS Zenfone 8
      5. How to compile the OmniROM 14 Custom ROM for the ASUS Zenfone 8
      6. Infos for building an Android 14 based Custom ROM image in Q1 2024 or later
      7. How to compile the OmniROM 15 Custom ROM for the ASUS Zenfone 8
      8. How to compile the OmniROM 16 Custom ROM for the ASUS Zenfone 8
    6. Instructions to compile other Custom ROMs for the ASUS Zenfone 8
      1. General hints for compiling other Custom ROMs
      2. How to compile other Custom ROMs for the ASUS Zenfone 8
      3. Compiling the /e/ Custom ROM for the ASUS Zenfone 8 using the docker image
      4. How to compile LineageOS 22.x Custom ROM for the ASUS Zenfone 8
      5. How to compile the /e/ Custom ROM based on Android 15 for the ASUS Zenfone 8
      6. How to compile the /e/ Custom ROM based on Android 16 for the ASUS Zenfone 8
      7. How to compile the official LineageOS 22.2 Custom ROM for the ASUS Zenfone 8
      8. How to compile the official LineageOS 23.0 Custom ROM for the ASUS Zenfone 8
      9. How to compile the official LineageOS 24.0 Custom ROM for the ASUS Zenfone 8
      10. How to compile the crDroid 11.x Custom ROM for the ASUS Zenfone 8
      11. How to compile the crDroid 12.x Custom ROM for the ASUS Zenfone 8
      12. How to compile the evolutionX 10.7 Custom ROM for the ASUS Zenfone 8
      13. How to compile the evolutionX 11.4 Custom ROM for the ASUS Zenfone 8
      14. How to compile the evolutionX 11.6 Custom ROM for the ASUS Zenfone 8
      15. How to compile the evolutionX 12.x Custom ROM for the ASUS Zenfone 8
      16. How to compile the evolutionX Custom ROM for the ASUS Zenfone 8 with kernelSU
      17. How to create an evolutionX Custom ROM image with MicroG
      18. How to compile the LMODroid 6.x Custom ROM for the ASUS Zenfone 8
      19. How to compile the iodeOS 4.x Custom ROM for the ASUS Zenfone 8
      20. How to compile the iodeOS 6.x Custom ROM for the ASUS Zenfone 8
      21. How to compile the iodeOS 7.x Custom ROM for the ASUS Zenfone 8
      22. How to compile the DerpFest 16.0 Custom ROM for the ASUS Zenfone 8
      23. How to compile the DerpFest 17.0 Custom ROM for the ASUS Zenfone 8
    7. Instructions to compile TWRP for the ASUS Zenfone 8 
      1. How to compile TWRP for the ASUS Zenfone 8
      2. How to compile the image for TWRP 3.7.0.12-1 w/ the bootctl binary
    8. Instructions to compile OrangeFox for the ASUS Zenfone 8
      1. How to compile the OrangeFox Recovery for the ASUS Zenfone 8
      2. How to create a OrangeFox Recovery using the OrangeFox Recovery Builder 2024
      3. How to create a OrangeFox Recovery for LineageOS 22.x or newer on the ASUS Zenfone 8 using the OrangeFox Recovery Builder 2024
    9. Instructions to compile a recovery for LineageOS 21.x or newer running on the ASUS Zenfone 8
      1. How to use TWRP if LineageOS 20.x is installed
      2. How to create a TWRP image for LineageOS based ROMs using a script
      3. How to create a TWRP recovery image for the ASUS Zenfone 8 running a LineageOS 22.x based OS
      4. TWRP images for ASUS Zenfone 8 with /e/
    10. Trouble Shooting Guides for compiling OS image or recoveries
      1. Some hints for repo sync troubleshooting
      2. Some hints for fixing errors building an Custom ROM Android image
      3. libcrypt.so.1 is required to build a LineageOS based Custom ROM
      4. Memory usage while building an Android 17 based custom ROM
    11. Misc
      1. Flashing a different Custom ROM with OrangeFox on the ASUS Zenfone 8
      2. How to re-install the Android OS from ASUS on the ASUS Zenfone 8
      3. ASUS Zenfone 8 Firmware Download
      4. How to boot the ASUS Zenfone 8 into the bootloader using the physical buttons
      5. How to use the Hardware Test App from ASUS on a Zenfone running a Custom ROM
      6. How to add the ASUS Hardware Testtool as prebuild app for a Custom ROM
      7. How to add the ASUS Hardware Testtool as prebuild app for the StatiXOS ROM
      8. Partition images in the file payload.bin for the LineageOS
    12. Links
      1. General Guides for creating Custom ROMs
      2. Recovery images for the ASUS Zenfone 8
      3. Links for the ASUS Zenfone 8
      4. Distributions for the ASUS Zenfone 8
   

Introduction


On this page I mirror my HowTos related to the ASUS Zenfone 8 which I published elsewhere (for example in the XDA Forums).


The page with the general HowTos for Android is available here: http://bnsmb.de/My_HowTos_for_Android.html.


Please note that all instructions for the PC in the HowTos apply to the Linux OS.

There is also a section with links for using the ASUS Zenfone 8 at the end of this page.

Some of the files mentioned in this HowTos can also be found in my repositories on GitHub: https://github.com/bnsmb

Download links for OS images of custom ROMs for the ASUS Zenfone 8, which are not officially supported for this smartphone, can be found here.

 


News


News

none


Old news

19.11.2025

After moving these HowTos for the ASUS Zenfone 8 to a separate web page, many links no longer worked. I hope that I have now fixed all broken links on this page.




----



Back to my home page


History

 
ChangeLog


20.09.2026

added the section libcrypt.so.1 is required to build a LineageOS based Custom ROM     
updated the section General hints for compiling other Custom ROMs (see also here)             


19.09.2026

updated the section Some hints for repo sync troubleshooting (see also here) 
added the section How to compile the DerpFest 17.0 Custom ROM for the ASUS Zenfone 8  
updated the section How to compile the DerpFest 16.0 Custom ROM for the ASUS Zenfone 8 (see also here)     


18.09.2026

updated the section How to compile the DerpFest 16.0 Custom ROM for the ASUS Zenfone 8 (see also here)     


14.09.2026

added the section How to compile the evolutionX 12.x Custom ROM for the ASUS Zenfone 8       
updated the section How to create an evolutionX Custom ROM image with MicroG (see also here)
added the section Flashing a different Custom ROM with OrangeFox on the ASUS Zenfone 8
updated the section General hints for compiling other Custom ROMs (see also here)             
added the section How to compile the official LineageOS 24.0 Custom ROM for the ASUS Zenfone 8    
added the section Memory usage while Building an Android 17 based custom ROM      


16.07.2026

updated the section How to compile the /e/ Custom ROM based on Android 16 for the ASUS Zenfone 8 (see also here)      
 

24.03.2026

added the section How to compile the /e/ Custom ROM based on Android 16 for the ASUS Zenfone 8       


20.02.2026

updated the requirements for recoveries for the ASUS Zenfone 8 if an OmniROM version based on Android QPR2 or newer is installed 


14.02.2026

updated the section How to compile the OrangeFox Recovery for the ASUS Zenfone 8 (see also here)          


31.01.2026

corrected the instructions in the section How to compile the iodeOS 6.x Custom ROM for the ASUS Zenfone 8 (see also here)
added the sectdion How to compile the iodeOS 7.x Custom ROM for the ASUS Zenfone 8  


29.01.2026

added the section General hints for compiling other Custom ROMs      
added the section How to compile the evolutionX 11.6 Custom ROM for the ASUS Zenfone 8         



29.12.2025

add links to the git repositories to the table with the list of other custom ROMs.

21.12.2025

updated the section How to compile the DerpFest 16.0 Custom ROM for the ASUS Zenfone 8 (see also here)     


20.12.2025


added the section How to compile the DerpFest 16.0 Custom ROM for the ASUS Zenfone 8      
updated the section Some hints for fixing errors building an Custom ROM Android image (see also here)   


02.12.2025

added the section How to compile the official LineageOS 23.0 Custom ROM for the ASUS Zenfone 8 (see also here)      


22.11.2025

added the section How to compile the evolutionX 11.4 Custom ROM for the ASUS Zenfone 8 (see also here)      
updated the section Some hints for fixing errors building an Custom ROM Android image (see also here)   
added the section How to create an evolutionX Custom ROM image with MicroG 


21.11.2025

added the section How to compile the official LineageOS 23.0 Custom ROM for the ASUS Zenfone 8     
updated the section Partition images in the file payload.bin for the LineageOS (see also here)    


19.11.2025

updated the section How to compile the evolutionX Custom ROM for the ASUS Zenfone 8 with kernelSU (see also here)    
fixed broken links


18.11.2025

added the section How to compile the crDroid 12.x Custom_ROM for the ASUS Zenfone 8          
added the section How to compile the evolutionX 11.4 Custom ROM for the ASUS Zenfone 8       



17.11.2025

added the section Partition images in the file payload.bin for the LineageOS  
updated the section How to compile the evolutionX 10.7 Custom ROM for the ASUS Zenfone 8 (see also here) 


16.11.2025

updated the section How to compile the iodeOS 4.x Custom ROM for the ASUS Zenfone 8 (see also here)
updated the section How to compile the iodeOS 6.x Custom ROM for the ASUS Zenfone 8 (see also here)


14.11.2025

initial release



---
  

Instructions to compile the OmniROM Custom ROM for the ASUS Zenfone 8



How to compile the OmniROM Custom ROM for the ASUS Zenfone 8


URL: https://xdaforums.com/t/how-to-compile-the-omnrom-for-the-asus-zenfone-8.4751666/


How to compile the OmniROM for the ASUS Zenfone 8



Update 11.05.2026

Unfortunately, OmniROM development was discontinued in 05/2026.



Here you will find links to the sections with instructions on how to compile the different versions of the OmniROM for the ASUS Zenfone 8:


HowTos to compile the OmniROM for the ASUS Zenfone 8:

OmniROM 12
How to compile the OmniROM 12 Custom ROM for the ASUS Zenfone 8 git repository
OmniROM 13 How to compile the OmniROM 13 Custom ROM for the ASUS Zenfone 8 https://github.com/omnirom/android.git
OmniROM 14
How to compile the OmniROM 14 Custom ROM for the ASUS Zenfone 8 https://github.com/omnirom/android.git
OmniROM 15
How to compile the OmniROM 15 Custom ROM for the ASUS Zenfone 8 https://github.com/omnirom/android.git
OmniROM 16
How to compile the OmniROM 16 Custom ROM for the ASUS Zenfone 8 https://github.com/omnirom/android.git

see How to compile other Custom ROMs for the ASUS Zenfone 8 for instructions to compile other Custom ROMs for the ASUS Zenfone 8.


History of this entry

11.05.2026

Added the info about the end of life for OmniROM

05.08.2025

moved the instructions to compile other Custom ROMs to a separate section

04.08.2025

added the links to instructions to create the recoveries for the ASUS Zenfone 8
added  the link to the instructions to compile evolutionX for the ASUS Zenfone 8

03.08.2025

added the link to the instructions to compile crDroid for the ASUS Zenfone 8


01.08.2025

added the link to the instructions to compile the official LineageOS 22.2 for the ASUS Zenfone 8


28.07.2025

added links to the HowTos to create other CustomROMs for the ASUS Zenfone 8

24.07.2025

initial release




How to compile the OmniROM 12 Custom ROM for the ASUS Zenfone 8


URL:  https://xdaforums.com/t/how-to-compile-the-omnirom-for-the-asus-zenfone-8.4461525/


How to compile the OmniROM 12 Custom ROM for the ASUS Zenfone 8




This HowTo is about compiling the OmniROM 12 for the ASUS Zenfone 8.

See How to compile the OmniROM for the ASUS Zenfone 8 for instructions to compile other versions of the OmniROM for the ASUS Zenfone 8.



Compiling the CustomROM OmniROM from within Linux is a very simple and straight forward process -- the developer for the OmniROM did a really amazing good job setting up the build environment for the OmniROM.

But some information are missing in the instructions (at least I did not found them ...)

Therefor I document here what I did to compile the OmniROM for the ASUS Zenfone 8 on my Linux notebook:

First install the necessary tool called "repo" to maintain the repositories for the OmniROM ; see here https://gerrit.googlesource.com/git-repo/

Next create a new directory on your PC; switch to that directory, and initialize the necessary repositories like described in the section "Getting Started" here: https://github.com/omnirom/android :


Note [29.07.2022]:

The repositories for the branch android-12.0 are somehow outdated with the security patch level from February 2022 . To get the code with the security patch level from June 2022 use the repositories for the branch android-12.1.

repo init -u https://github.com/omnirom/android.git -b android-12.1

Then to sync up:

repo sync


Be aware that the repositories need about 140 GB disk space so this will take a while.

Please note that I did not install any additional tool to compile the OmniROM - everything necessary was installed by syncing the repositories.


When the download is finished you must add the repositories for the vendor and device tree for your phone to the manifests in the local repositories. This should be done in the file .repo/local_manifests/local_manifest.xml . For the ASUS Zenfone 8 the file should look like this:

[xtrnaw7@t15g /data/develop/android/OmniROM]$ cat .repo/local_manifests/local_manifest.xml
<?xml version="1.0" encoding="UTF-8"?>

<manifest>
<remote name="DonkeyCoyote"
fetch="https://github.com/DonkeyCoyote" />

<project path="device/asus/zenfone8" name="android_device_asus_zenfone8" remote="omnirom" revision="android-12.0" />
<project path="vendor/asus" name="proprietary_vendor_asus" remote="DonkeyCoyote" revision="android-12.1" />
</manifest>


After updating the file local_manifest.xml do another

repo sync

to sync the added repositories. This time the download will be faster because only the two additional repos will be downloaded.

Now you can start the build with these commands:

. build/envsetup.sh

brunch omni_zenfone8-user

in the directory with the downloaded repositories (use the command "breakfast" instead of "brunch" to see other possible targets)

Note that the first time the compile process will take 4 hours or more. And keep in mind that the compile process will need additional 140 GB for the temporary output files.


If everything is fine there will be a ZIP file with your own CustomROM image in the directory ./out/target/product/zenfone8/ when the compile script is done, e.g:

[xtrnaw7@t15g /data/develop/android/OmniROM]$ ls -ltr out/target/product/zenfone8/omni-12-20220621-zenfone8-HOMEMADE.zip
 -rw-rw-r--. 25 xtrnaw7 xtrnaw7 1253703465 Jun 25 10:03 out/target/product/zenfone8/omni-12-20220621-zenfone8-HOMEMADE.zip
[xtrnaw7@t15g /data/develop/android/OmniROM]$


That image can now be installed on the Zenfone 8 using the LineageOS Recovery or TWRP.


Update 29.09.2022 /bs

There seems to be a bug or feature in the scripts to compile OmniROM:

Old versions of the ZIP file with the image in the output directory will always be overwritten or replaced with the current image, e.g.:


[ OmniRomDev - xtrnaw7@t15g /data/develop/android/test ] $ ls -l  /data/develop/android/OmniROM/out/target/product/zenfone8/omni-12-20220*zip
-rw-rw-r--. 20 xtrnaw7 xtrnaw7 1256445293 Sep 27 18:12 /data/develop/android/OmniROM/out/target/product/zenfone8/omni-12-20220728-zenfone8-MICROG.zip
-rw-rw-r--. 20 xtrnaw7 xtrnaw7 1256445293 Sep 27 18:12 /data/develop/android/OmniROM/out/target/product/zenfone8/omni-12-20220729-zenfone8-MICROG.zip
-rw-rw-r--. 20 xtrnaw7 xtrnaw7 1256445293 Sep 27 18:12 /data/develop/android/OmniROM/out/target/product/zenfone8/omni-12-20220804-zenfone8-MICROG.zip
-rw-rw-r--. 20 xtrnaw7 xtrnaw7 1256445293 Sep 27 18:12 /data/develop/android/OmniROM/out/target/product/zenfone8/omni-12-20220809-zenfone8-HOMEMADE.zip
-rw-rw-r--. 20 xtrnaw7 xtrnaw7 1256445293 Sep 27 18:12 /data/develop/android/OmniROM/out/target/product/zenfone8/omni-12-20220810-zenfone8-MICROG.zip
-rw-rw-r--. 20 xtrnaw7 xtrnaw7 1256445293 Sep 27 18:12 /data/develop/android/OmniROM/out/target/product/zenfone8/omni-12-20220820-zenfone8-MICROG.zip
-rw-rw-r--. 20 xtrnaw7 xtrnaw7 1256445293 Sep 27 18:12 /data/develop/android/OmniROM/out/target/product/zenfone8/omni-12-20220828-zenfone8-MICROG.zip
-rw-rw-r--. 20 xtrnaw7 xtrnaw7 1256445293 Sep 27 18:12 /data/develop/android/OmniROM/out/target/product/zenfone8/omni-12-20220904-zenfone8-MICROG.zip
-rw-rw-r--. 20 xtrnaw7 xtrnaw7 1256445293 Sep 27 18:12 /data/develop/android/OmniROM/out/target/product/zenfone8/omni-12-20220911-zenfone8-MICROG.zip
-rw-rw-r--. 20 xtrnaw7 xtrnaw7 1256445293 Sep 27 18:12 /data/develop/android/OmniROM/out/target/product/zenfone8/omni-12-20220918-zenfone8-MICROG.zip
-rw-rw-r--. 20 xtrnaw7 xtrnaw7 1256445293 Sep 27 18:12 /data/develop/android/OmniROM/out/target/product/zenfone8/omni-12-20220927-zenfone8-MICROG.zip
[ OmniRomDev - xtrnaw7@t15g /data/develop/android/test ] $

[ OmniRomDev - xtrnaw7@t15g /data/develop/android/test ] $ cksum /data/develop/android/OmniROM/out/target/product/zenfone8/omni-12-20220*zip
592627598 1256445293 /data/develop/android/OmniROM/out/target/product/zenfone8/omni-12-20220728-zenfone8-MICROG.zip
592627598 1256445293 /data/develop/android/OmniROM/out/target/product/zenfone8/omni-12-20220729-zenfone8-MICROG.zip
592627598 1256445293 /data/develop/android/OmniROM/out/target/product/zenfone8/omni-12-20220804-zenfone8-MICROG.zip
592627598 1256445293 /data/develop/android/OmniROM/out/target/product/zenfone8/omni-12-20220809-zenfone8-HOMEMADE.zip
592627598 1256445293 /data/develop/android/OmniROM/out/target/product/zenfone8/omni-12-20220810-zenfone8-MICROG.zip
592627598 1256445293 /data/develop/android/OmniROM/out/target/product/zenfone8/omni-12-20220820-zenfone8-MICROG.zip
592627598 1256445293 /data/develop/android/OmniROM/out/target/product/zenfone8/omni-12-20220828-zenfone8-MICROG.zip
592627598 1256445293 /data/develop/android/OmniROM/out/target/product/zenfone8/omni-12-20220904-zenfone8-MICROG.zip
592627598 1256445293 /data/develop/android/OmniROM/out/target/product/zenfone8/omni-12-20220911-zenfone8-MICROG.zip
592627598 1256445293 /data/develop/android/OmniROM/out/target/product/zenfone8/omni-12-20220918-zenfone8-MICROG.zip
592627598 1256445293 /data/develop/android/OmniROM/out/target/product/zenfone8/omni-12-20220927-zenfone8-MICROG.zip
[ OmniRomDev - xtrnaw7@t15g /data/develop/android/test ]




Update 08.02.2024

see Some hints for repo sync troubleshooting for how to fix common errors executing repo sync.

see Some hints for fixing errors building an Custom ROM Android image for how to fix some common errors while creating the image


Update 25.03.2025

see also How to change name of the ZIP file with the OS image while building a new image




How to create an OmniROM Custom ROM image with MicroG


URL:  https://xdaforums.com/t/how-to-compile-the-omnirom-for-the-asus-zenfone-8.4461525/


How to create an OmniROM Custom ROM image with MicroG
How to create an OmniROM image with MicroG

To create an OmniROM image with MicroG these additional steps are neccesarry:

Add the repo with the prebuild MicroG apks, android_prebuilts_prebuiltapks, to your local_manifests.xml file, e.g:

[xtrnaw7@t15g /data/develop/android/OmniROM]$ cat .repo/local_manifests/local_manifest.xml
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote name="DonkeyCoyote"
fetch="https://github.com/DonkeyCoyote" />
<project path="device/asus/zenfone8" name="android_device_asus_zenfone8" remote="omnirom" revision="android-12.0" />
<project path="vendor/asus" name="proprietary_vendor_asus" remote="DonkeyCoyote" revision="android-12.1" />
<project path="vendor/microg" name="android_prebuilts_prebuiltapks" remote="omnirom" revision="android-12.0" />
</manifest>
[xtrnaw7@t15g /data/develop/android/OmniROM]$



Do another repo sync to download the repository for MicroG:

repo sync


and create the CustomROM using these instructions:

export ROM_BUILDTYPE=MICROG

brunch omni_zenfone8-user



This creates an OmniROM Image with MicroG already installed, e.g:

[xtrnaw7@t15g /data/develop/android/OmniROM]$ ls -ltr out/target/product/zenfone8/omni-12-20220621-zenfone8-MICROG.zip
-rw-rw-r--. 25 xtrnaw7 xtrnaw7 1253703465 Jun 25 10:03 out/target/product/zenfone8/omni-12-20220621-zenfone8-MICROG.zip
[xtrnaw7@t15g /data/develop/android/OmniROM]$




How to compile the OmniROM 13 Custom ROM for the ASUS Zenfone 8


URL:  https://xdaforums.com/t/how-to-compile-the-omnirom-13-for-the-android-zenfone-8.4518733/


How to compile the OmniROM 13 Custom ROM for the ASUS Zenfone 8




This Howto is about compiling the OmniROM 13 for the ASUS Zenfone 8.

See How to compile the OmniROM for the ASUS Zenfone 8 for instructions to compile the other versions of the OmniROM for the ASUS Zenfone 8.



Update 08.11.2024 /bs

Two repositories necessary to compile OmniROM 13 are now renamed. Therefore, to sync the repositories please update the XML file:


[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/OmniROM_13.0/.repo/manifests ] $ diff omni-aosp.xml omni-aosp.xml.org
38c38
<     <project path="frameworks/base" name="android_frameworks_base_old" remote="omnirom" revision="android-13.0" />
---
>     <project path="frameworks/base" name="android_frameworks_base" remote="omnirom" revision="android-13.0" />
58c58
<     <project path="system/core" name="android_system_core_old" remote="omnirom" revision="android-13.0" />
---
>     <project path="system/core" name="android_system_core" remote="omnirom" revision="android-13.0" />
[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/OmniROM_13.0/.repo/manifests ] $



Compiling the CustomROM OmniROM 13 from within Linux is again a very simple and straight forward process -- the developer for the OmniROM did once again a really amazing good job setting up the build environment for the OmniROM 13.

Notes:

As of 22.01.2023 there is an additional repository required for compiling OmniROM 13 -- see below for details. I also added some more details at the end of this post.


Most (but not all) of the necessary steps to sync the repositories are described in the section "Getting Started" here: https://github.com/omnirom/android.


Prerequisites

Some of the repositories for OmniROM 13 are on https://gitlab.com and the access to these repositories for the repository sync is done via ssh. Therefor to sync these repositories a user account on gitlab.com with configured public ssh key is required. The user account on gitlab.com is free of charge and the public ssh key can be uploaded into the user profile on gitlab.com (see here: https://docs.gitlab.com/ee/user/ssh.html)

The repositories on http://github.com are currently accessed via https but that might change in the future. Therefor it's recommended to create a user on github.com and add the ssh public key to the profile of that user also.

Note:

To check how the access to the repositories is configured use this command:

xtrnaw7@t15g /data/develop/android/OmniROM_13.0/.repo]$ grep fetch $( find . -name "*xml"  )
./local_manifests/local_manifest.xml:     fetch="https://github.com/DonkeyCoyote" />
./manifests/omni-aosp.xml:           fetch="https://github.com/" />
./manifests/omni-aosp.xml:           fetch="ssh://git@gitlab.com/omnirom" />
./manifests/omni-aosp.xml:           fetch="https://github.com/omnirom"
./manifests/omni-caf.xml:           fetch="https://github.com/" />
./manifests/omni-caf.xml:           fetch="https://github.com/omnirom"
./manifests/omni-caf.xml:           fetch="https://git.codelinaro.org/clo/la"
./manifests/omni-private.xml:           fetch="ssh://git@github.com/omnirom"
./manifests/default.xml:           fetch="https://android.googlesource.com"
[xtrnaw7@t15g /data/develop/android/OmniROM_13.0/.repo]$


The tool repo is required to maintain the repositories for the OmniROM 13; you can download the tool "repo" from https://gerrit.googlesource.com/git-repo

It's not necessary to install additional tools for creating an OmniROM image -- all necessary tools to create the image are in the repositories for the OmniROM 13.



Creating the local copies of the repositories for the OmniROM 13

To create a local copy of the repositories for OmniROM 13 these steps are required:


First create a new directory for the repositories and change the working directory to the new directory, e.g.:

mkdir /data/develop/android/OmniROM_13.0

cd /data/develop/android/OmniROM_13.0


Init the local repositories using the command:

repo init -u https://github.com/omnirom/android.git -b android-13.0


Note that the command repo init only creates a hidden directory called .repo.


Next do the initial sync of the repositories using the command:

repo sync



Be aware that the repositories need about 160 GB disk space so this will take a while.


The initial repository sync will download all repositories necessary to create the OmniROM image except the hardware dependent repositories (these repos are different for the various phone models).

Therefor you must add the repositories for the vendor and device tree for your phone to the manifests in the local repositories after the download finished.

This should be done in the file .repo/local_manifests/local_manifest.xml (if the directory .repo/local_manifests does not exist create it).

For the ASUS Zenfone 8 the file should look like this:

[xtrnaw7@t15g /data/develop/android/OmniROM_13.0]$ cat .repo/local_manifests/local_manifest.xml
<?xml version="1.0" encoding="UTF-8"?>

<manifest>
<remote name="DonkeyCoyote"
fetch="https://github.com/DonkeyCoyote" />

<project path="device/asus/zenfone8" name="android_device_asus_zenfone8" remote="omnirom" revision="android-13.0" />
<project path="vendor/asus" name="proprietary_vendor_asus" remote="DonkeyCoyote" revision="android-13.0" />
<project path="vendor/microg" name="android_prebuilts_prebuiltapks" remote="omnirom" revision="android-13.0" />
<project path="vendor/images/asus" name="android_vendor_images_asus" remote="gitlab" revision="android-13.0" />
</manifest>
[xtrnaw7@t15g /data/develop/android/OmniROM_13.0]$



Note:

The repository android_prebuilts_prebuiltapks is only necessary for OmniROM images that should include the MicroG packages.

Update 22.01.2023

The repository android_vendor_images_asus is now also required; currently this repository only contains the ASUS Gallery.
I also added some more details at the end of this post.


After updating the file local_manifest.xml do another

repo sync


to sync the added repositories. This time the download will be faster because only the two (or three) additional repos will be downloaded.


Now you can start the build with these commands:

# optional:
#
# to create an OmniROM image with MicroG packages set the environment variable ROM_BUILDTYPE to MICROG before starting the build
#
# to create an OmniROM image with GAPPS packages set the environment variable ROM_BUILDTYPE to GAPPS before starting the build
#(that will only work if the repositories for the GAPPS are configured, of course)
#
export ROM_BUILDTYPE=MICROG

. build/envsetup.sh

brunch omni_zenfone8-user



in the directory with the downloaded repositories (use the command "breakast" instead of "brunch" to see other possible targets)

Note that the first time the compile process will take 4 hours or more. And keep in mind that the compile process will need additional 140 GB for the temporary output files.


If everything is fine there will be a ZIP file with your own CustomROM image in the directory ./out/target/product/zenfone8/ when the compile script is done, e.g. for images with the MicroG packages:

[xtrnaw7@t15g /data/develop/android/OmniROM_13.0]$ ls -l out/target/product/zenfone8/omni-13-2022*-zenfone8-*.zip
-rw-rw-r--. 3 xtrnaw7 xtrnaw7 1258920226 Nov 14 11:55 out/target/product/zenfone8/omni-13-202211141148-zenfone8-MICROG.zip
[xtrnaw7@t15g /data/develop/android/OmniROM_13.0]$



The image can now be installed on the ASUS Zenfone 8 using the LineageOS Recovery or TWRP.


Notes


Be aware that each new ROM image created with brunch will overwrite the existing ROM images (even if the name of the image is different), e.g.

[xtrnaw7@t15g /data/develop/android/OmniROM_13.0]$ ls -li out/target/product/zenfone8/omni-13-2022*-zenfone8-*.zip
77928215 -rw-rw-r--. 3 xtrnaw7 xtrnaw7 1258920226 Nov 14 11:55 out/target/product/zenfone8/omni-13-202211131612-zenfone8-MICROG.zip
77928215 -rw-rw-r--. 3 xtrnaw7 xtrnaw7 1258920226 Nov 14 11:55 out/target/product/zenfone8/omni-13-202211141148-zenfone8-MICROG.zip
[xtrnaw7@t15g /data/develop/android/OmniROM_13.0]$

[xtrnaw7@t15g /data/develop/android/OmniROM_13.0]$ cksum out/target/product/zenfone8/omni-13-2022*-zenfone8-*.zip
2429251380 1258920226 out/target/product/zenfone8/omni-13-202211131612-zenfone8-MICROG.zip
2429251380 1258920226 out/target/product/zenfone8/omni-13-202211141148-zenfone8-MICROG.zip
[xtrnaw7@t15g /data/develop/android/OmniROM_13.0]$


Therefor you should copy the zip file with the new image to a new directory before building new image



For OS images that should be used on the phone for daily use I strongly recommend to create your own certificates for the OS.

In the OmniROM development directory tree the necessary files, platform.pk8 and platform.x509.pem, are in the directory

./build/make/target/product/security

in your build tree for the CustomROM, e.g.

[xtrnaw7@t15g /data/develop/android/OmniROM]$ ls -l ./build/make/target/product/security/platform.* -rw-------. 1 xtrnaw7 xtrnaw7 1219 Jun 25 09:39 ./build/make/target/product/security/platform.pk8 -rw-rw-r--. 1 xtrnaw7 xtrnaw7 1460 Jun 25 09:39 ./build/make/target/product/security/platform.x509.pem [xtrnaw7@t15g /data/develop/android/OmniROM]$

Replace these files with your own certificate files and recreate the image using the command brunch (see above).


See here https://source.android.com/devices/tech/ota/sign_builds for how to create your own certificate.

How to manually create the SSL keys

To manually create the keys use these commands:

Android uses 2048-bit RSA keys with public exponent 3. You can generate certificate/private key pairs using the openssl tool from openssl.org:

# generate RSA key
#
[xtrnaw7@t15g /data/develop/android/test1]$
openssl genrsa -3 -out temp.pem 2048
[xtrnaw7@t15g /data/develop/android/test1]$ ls -ltr
total 4
-rw-------. 1 xtrnaw7 xtrnaw7 1704 Nov 14 13:24 temp.pem


# create a certificate with the public part of the key
#
[xtrnaw7@t15g /data/develop/android/test1]$
openssl req -new -x509 -key temp.pem -out releasekey.x509.pem -days 10000 -subj  '/C=DE/ST=Hessen/L=Frankfurt am Main/O=Android/OU=Android/CN=Android/emailAddress=bnsmb01@gmail.com'
[xtrnaw7@t15g /data/develop/android/test1]$


[xtrnaw7@t15g /data/develop/android/test1]$ ls -ltr
total 8
-rw-------. 1 xtrnaw7 xtrnaw7 1704 Nov 14 13:24 temp.pem
-rw-rw-r--. 1 xtrnaw7 xtrnaw7 1456 Nov 14 13:25 releasekey.x509.pem
[xtrnaw7@t15g /data/develop/android/test1]$



# create a PKCS#8-formatted version of the private key
#
[xtrnaw7@t15g /data/develop/android/test1]$
openssl pkcs8 -in temp.pem -topk8 -outform DER -out releasekey.pk8 -nocrypt
[xtrnaw7@t15g /data/develop/android/test1]$



[xtrnaw7@t15g /data/develop/android/test1]$ ls -ltr
total 12
-rw-------. 1 xtrnaw7 xtrnaw7 1704 Nov 14 13:24 temp.pem
-rw-rw-r--. 1 xtrnaw7 xtrnaw7 1456 Nov 14 13:25 releasekey.x509.pem
-rw-------. 1 xtrnaw7 xtrnaw7 1218 Nov 14 13:25 releasekey.pk8
[xtrnaw7@t15g /data/develop/android/test1]$


# securely delete the temp.pem file

#
[xtrnaw7@t15g /data/develop/android/test1]$ shred --remove temp.pem
[xtrnaw7@t15g /data/develop/android/test1]$


[xtrnaw7@t15g /data/develop/android/test1]$ ls -ltr
total 8
-rw-rw-r--. 1 xtrnaw7 xtrnaw7 1456 Nov 14 13:25 releasekey.x509.pem
-rw-------. 1 xtrnaw7 xtrnaw7 1218 Nov 14 13:25 releasekey.pk8
[xtrnaw7@t15g /data/develop/android/test1]$


From the documentation:

The openssl pkcs8 command given above creates a .pk8 file with no password, suitable for use with the build system. To create a .pk8 secured with a password (which you should do for all actual release keys), replace the -nocrypt argument with -passout stdin; then openssl will encrypt the private key with a password read from standard input. No prompt is printed, so if stdin is the terminal the program will appear to hang when it's really just waiting for you to enter a password. Other values can be used for the-passout argument to read the password from other locations; for details, see the openssl documentation.

The temp.pem intermediate file contains the private key without any kind of password protection, so dispose of it thoughtfully when generating release keys. In particular, the GNUshred utility may not be effective on network or journaled filesystems. You can use a working directory located in a RAM disk (such as a tmpfs partition) when generating keys to ensure the intermediates are not inadvertently exposed.


Updating the local repositories [Update 22.01.2023]

To update the local repositories change the working directory to the directory with the repositories for OmniROM 13 and execute

repo sync

After the synchronization is complete, create a new operating system image using the commands described above.

It is recommended to create a new image at least once a month after the new security patches for Android are added to the repositories for OmniROM.

To view the date of the security patch in the source files for the OmniROM do:

[ OmniRom 13 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_13.0 ] $ grep "^[[:space:]]*PLATFORM_SECURITY_PATCH[[:space:]]*:=" ./build/make/core/version_defaults.mk
    PLATFORM_SECURITY_PATCH := 2023-01-05
[ OmniRom 13 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_13.0 ] $


Moving the repositories to another directory [Update 22.01.2023]

In case you want to move the repositories to another directory or rename the directory with the repositories:

Be aware that the make scripts create some absolute links in the output directory; to list these absolute links use while in the directory with the repositories:

find . -type l -ls | grep "$PWD"
[ OmniRom 13 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_13.0 ] $ find . -type l -ls | grep "$PWD"
 79960553      4 lrwxrwxrwx   1 xtrnaw7  xtrnaw7        93 Dec 18 18:49 ./out/soong/.intermediates/prebuilts/build-tools/prebuilt_py3-launcher-autorun/linux_glibc_x86_64/py3-launcher-autorun -> /data/develop/android/OmniROM_13.0/prebuilts/build-tools/linux-x86/bin/py3-launcher-autorun64
 79960558      4 lrwxrwxrwx   1 xtrnaw7  xtrnaw7        73 Dec 18 18:46 ./out/soong/.intermediates/prebuilts/build-tools/m4/linux_glibc_x86_64/m4 -> /data/develop/android/OmniROM_13.0/prebuilts/build-tools/linux-x86/bin/m4
 78782027      0 lrwxrwxrwx   1 xtrnaw7  xtrnaw7        53 Jan 22 09:07 ./out/target/product/zenfone8/obj/DTBO_OBJ/source -> /data/develop/android/OmniROM_13.0/kernel/asus/sm8350
 78931423      0 lrwxrwxrwx   1 xtrnaw7  xtrnaw7        53 Jan 22 09:07 ./out/target/product/zenfone8/obj/DTB_OBJ/source -> /data/develop/android/OmniROM_13.0/kernel/asus/sm8350
 78792528      0 lrwxrwxrwx   1 xtrnaw7  xtrnaw7        53 Jan 15 11:56 ./out/target/product/zenfone8/obj/PACKAGING/kernel_modules_intermediates/lib/modules/5.4.147-Omni-qgki-perf-g3e8f0551c618/source -> /data/develop/android/OmniROM_13.0/kernel/asus/sm8350
 78792529      4 lrwxrwxrwx   1 xtrnaw7  xtrnaw7        77 Jan 15 11:56 ./out/target/product/zenfone8/obj/PACKAGING/kernel_modules_intermediates/lib/modules/5.4.147-Omni-qgki-perf-g3e8f0551c618/build -> /data/develop/android/OmniROM_13.0/out/target/product/zenfone8/obj/KERNEL_OBJ
 84806159      0 lrwxrwxrwx   1 xtrnaw7  xtrnaw7        53 Jan 22 09:13 ./out/target/product/zenfone8/obj/PACKAGING/kernel_modules_intermediates/lib/modules/5.4.147-Omni-qgki-perf-g875131b91949/source -> /data/develop/android/OmniROM_13.0/kernel/asus/sm8350
 84806160      4 lrwxrwxrwx   1 xtrnaw7  xtrnaw7        77 Jan 21 11:25 ./out/target/product/zenfone8/obj/PACKAGING/kernel_modules_intermediates/lib/modules/5.4.147-Omni-qgki-perf-g875131b91949/build -> /data/develop/android/OmniROM_13.0/out/target/product/zenfone8/obj/KERNEL_OBJ
 78788578      0 lrwxrwxrwx   1 xtrnaw7  xtrnaw7        53 Jan 22 09:10 ./out/target/product/zenfone8/obj/KERNEL_OBJ/source -> /data/develop/android/OmniROM_13.0/kernel/asus/sm8350
[ OmniRom 13 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_13.0 ] $



Before starting another build after moving the directories with the repositories you must correct these links.

Trouble Shooting


Update 08.02.2024

see Some hints for repo sync troubleshooting for how to fix common errors executing repo sync.

see Some hints for fixing errors building an Custom ROM Android image for how to fix some common errors while creating the image


Update 25.03.2025

see also How to change name of the ZIP file with the OS image while building a new image





How to compile the OmniROM 14 Custom ROM for the ASUS Zenfone 8


URL: https://xdaforums.com/t/how-to-compile-omnirom-14-for-the-asus-zenfone-8.4643071/


How to compile the OmniROM 14 Custom ROM for the ASUS Zenfone 8



Update 29.03.2024:


Please see also the Infos for building a Custom ROM image for changes in the build process since Q1 2024.




This HowTo is about compiling the OmniROM 14 for the ASUS Zenfone 8.

See How to compile the OmniROM for the ASUS Zenfone 8 for instructions to compile the other versions of the OmniROM for the ASUS Zenfone 8.




Compiling the Custom ROM OmniROM 14 from within Linux is again a very simple and straight forward process -- the developer for the OmniROM did once again a really amazing good job setting up the build environment for the OmniROM 14.

I'm repeating myself here - but it can't be said often enough.


Hardware requirements

Message from the repo tool:

"The minimum required amount of free memory is around 16GB, and even with that, some configurations may not work."

In my experience, the computer on which OmniROM is compiled should have at least 32 GB RAM and 4 CPU cores.
(The numbers in this document are for a PC with an Intel Core i7 with 16 cores and 128 GB RAM).

Note that the scripts used to create the OmniROM image start one workspace per CPU and each workspace requires about 4 GB of RAM. Plus about 2 GB RAM for the general tasks.

As of 09.01.2024, the repositories for OmniROM 14 occupy about 290 GB of disk space; the additional repositories for the hardware-specific repositories for the ASUS Zenfone 8 occupy about 30 GB of disk space.
The compile process will occupy additional 140 GB for the temporary output files.
In total, the repositories for OmniROM 14 require around 500 GB of storage space (the space used will increase with every "repo sync")



Prerequisites

Some of the repositories for OmniROM 14 are on https://gitlab.com and the access to these repositories for the repository sync is done via ssh. Therefore, to sync these repositories a user account on gitlab.com with configured public ssh key is required. The user account on gitlab.com is free of charge and the public ssh key can be uploaded into the user profile on gitlab.com (see here: https://docs.gitlab.com/ee/user/ssh.html)

The repositories on http://github.com are currently accessed via https but that might change in the future. Therefor it's recommended to create a user on github.com and add the ssh public key to the profile of that user also.

Note:

To check how the access to the repositories is configured use this command

[OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0/.repo ] $  grep fetch $( find . -name "*xml"  )
./local_manifests/local_manifest.xml:        fetch="https://github.com/DonkeyCoyote" />
./manifests/omni-aosp.xml:           fetch="https://github.com/" />
./manifests/omni-aosp.xml:           fetch="ssh://git@gitlab.com/omnirom" />
./manifests/omni-aosp.xml:           fetch="https://github.com/omnirom"
./manifests/omni-caf.xml:           fetch="https://github.com/" />
./manifests/omni-caf.xml:           fetch="https://github.com/omnirom"
./manifests/omni-caf.xml:           fetch="https://git.codelinaro.org/clo/la"
./manifests/omni-private.xml:           fetch="ssh://git@github.com/omnirom"
./manifests/default.xml:           fetch="https://android.googlesource.com"
[ OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0/.repo ] $



Use the commands

ssh git@github.com

ssh git@gitlab.com

to test the access via ssh and add the ssh hostkeys of the hosts github.com and gitab.com to the known_hosts file.

Or use

grep"^gitlab.com"~/.ssh/known_hosts  ||ssh-keyscan gitlab.com >>~/.ssh/known_hosts

grep"^github.com"
~/.ssh/known_hosts || ssh-keyscan github.com >>~/.ssh/known_hosts

to add the ssh hostkeys of the repository server used to the local known_hosts file of the user used to retrieve the repositories.

It's recommended to start the ssh-agent and load the private ssh keys before starting the sync of the repositories, e.g. if no global ssh-agent is running use:

$( eval ssh-agent )
ssh-add

Use

ssh-add -l

to list the ssh keys already loaded by the ssh-agent.





The tool repo is required to maintain the repositories for the OmniROM 14; you can download the tool "repo" from https://gerrit.googlesource.com/git-repo or download it with this command:

curl https://storage.googleapis.com/git-repo-downloads/repo > ./repo
chmod a+x ./repo  


It's not necessary to install additional tools for creating an OmniROM 14 image -- all necessary tools to create the image are in the repositories for the OmniROM 14.



The repositories used for the OmniROM 14 use the git command line extension git lfs. At least in Fedora this extension is not installed by default while installing git. In Fedora git lfs can be installed using this command:

sudo dnf install git-lfs 



Creating the local copies of the repositories for the OmniROM 14


Most (but not all) of the necessarry steps to sync the repositories necessary to create an OmniROM 14 installation image are described in the section "Getting Started" here: https://github.com/omnirom/android but some instructions are missing the details.


To create a local copy of the repositories for OmniROM 14 these steps are required:


First create a new directory for the repositories and change the working directory to the new directory, e.g.:

mkdir /data/develop/android/OmniROM_14.0
cd /data/develop/android/OmniROM_14.0


Then init the local repositories using the command:

repo init -u https://github.com/omnirom/android.git -b android-14.0 --git-lfs

Note that the command repo init only creates a hidden directory called .repo.


Next do the initial sync of the repositories using the command:

repo sync

The initial repository sync will download all repositories necessary to create the OmniROM 14 image except the hardware dependent repositories (these repos are different for the various phone models).

Therefor you must add the repositories for the vendor and device tree for your phone to the manifests in the local repositories after the download finished.

This should be done in the file .repo/local_manifests/local_manifest.xml (just create the directory .repo/local_manifests if it does not exist).

For the ASUS Zenfone 8 the file should look like this:

[ OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $ cat .repo/local_manifests/local_manifest.xml
<?xml version="1.0" encoding="UTF-8"?>

<manifest>
<remote name="DonkeyCoyote"
fetch="https://github.com/DonkeyCoyote" />

<project path="device/asus/zenfone8" name="android_device_asus_zenfone8" remote="omnirom" revision="android-14.0" />
<project path="vendor/asus" name="proprietary_vendor_asus" remote="DonkeyCoyote" revision="android-14.0" />
<project path="vendor/microg" name="android_prebuilts_prebuiltapks" remote="omnirom" revision="android-13.0" />
<project path="vendor/images/asus" name="android_vendor_images_asus" remote="gitlab" revision="android-13.0" />

</manifest>
[ OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $



Notes:

The repository android_prebuilts_prebuiltapks is only necessary for OmniROM 14 images that should include the MicroG packages.


After updating the file local_manifest.xml do another

repo sync

to sync the added repositories. This time the download will be faster because only the additional repos will be downloaded.


Now you can start the build with these commands:

# optional:
#
# to create an OmniROM image with MicroG packages set the environment variable ROM_BUILDTYPE to MICROG before starting the build
#
# to create an OmniROM image with GAPPS packages set the environment variable ROM_BUILDTYPE to GAPPS before starting the build
#(that will only work if the repositories for the GAPPS are configured, of course)
#
export ROM_BUILDTYPE=MICROG

. build/envsetup.sh

brunch omni_zenfone8-user


in the directory with the downloaded repositories (use the command "breakfast" without parameter instead of "brunch" to see other possible targets)

Be aware that the first time the compile process will take 4 hours or more.


If everything is fine there will be a ZIP file with your own Custom OmniROM 14 image in the directory ./out/target/product/zenfone8/ when the compile script is done, e.g. for images with the MicroG packages:

[ OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $ ls -l out/target/product/zenfone8/omni-14-202311*zip
-rw-rw-r--. 3 xtrnaw7 xtrnaw7 1363298353 Nov 20 10:22 out/target/product/zenfone8/omni-14-20231119-zenfone8-MICROG.zip
[ OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $



The image can now be installed on the ASUS Zenfone 8 using the LineageOS Recovery or TWRP.




Notes




Be aware that each new OmniROM 14 image created with brunch will overwrite the existing OmniROM 14 image (the name of the image is different but the used inodes are the same for all zip files):

[ OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $ ls -il out/target/product/zenfone8/omni-14-202311*zip
80813412 -rw-rw-r--. 3 xtrnaw7 xtrnaw7 1363298353 Nov 20 10:22 out/target/product/zenfone8/omni-14-20231119-zenfone8-MICROG.zip
80813412 -rw-rw-r--. 3 xtrnaw7 xtrnaw7 1363298353 Nov 20 10:22 out/target/product/zenfone8/omni-14-20231120-zenfone8-MICROG.zip
[ OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $

[OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $ cksum out/target/product/zenfone8/omni-14-202311*zip
1217746399 1363298353 out/target/product/zenfone8/omni-14-20231119-zenfone8-MICROG.zip
1217746399 1363298353 out/target/product/zenfone8/omni-14-20231120-zenfone8-MICROG.zip
[ OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $


Therefor you should copy the existing zip file with the image to a new directory before building a new image.



Certificates for the OS images

For OS images that should be used on the phone for daily use I strongly recommend to create your own certificates for the OS.

In the OmniROM development directory tree the necessary files, platform.pk8 and platform.x509.pem, are in the directory

./build/make/target/product/security

in your build tree for the Custom ROM, e.g.

[ OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $ ls -l ./build/make/target/product/security/platform.*
-rw-rw-r--. 1 xtrnaw7 xtrnaw7 1216 Nov 14 15:24 ./build/make/target/product/security/platform.pk8
-rw-rw-r--. 1 xtrnaw7 xtrnaw7 1675 Nov 14 15:24 ./build/make/target/product/security/platform.x509.pem
[ OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $


Replace these files with your own certificate files and recreate the image using the command brunch (see above).


See here https://source.android.com/devices/tech/ota/sign_builds for how to create your own certificate.

To manually create the keys use these commands:
To manually create the keys use these commands:


Android uses 2048-bit RSA keys with public exponent 3. You can generate certificate/private key pairs using the openssl tool from openssl.org:

# generate RSA key
#
[xtrnaw7@t15g /data/develop/android/test1]$
openssl genrsa -3 -out temp.pem 2048
[xtrnaw7@t15g /data/develop/android/test1]$ ls -ltr
total 4
-rw-------. 1 xtrnaw7 xtrnaw7 1704 Nov 14 13:24 temp.pem


# create a certificate with the public part of the key
#
[xtrnaw7@t15g /data/develop/android/test1]$
openssl req -new -x509 -key temp.pem -out releasekey.x509.pem -days 10000 -subj  '/C=DE/ST=Hessen/L=Frankfurt am Main/O=Android/OU=Android/CN=Android/emailAddress=bnsmb01@gmail.com'
[xtrnaw7@t15g /data/develop/android/test1]$


[xtrnaw7@t15g /data/develop/android/test1]$ ls -ltr
total 8
-rw-------. 1 xtrnaw7 xtrnaw7 1704 Nov 14 13:24 temp.pem
-rw-rw-r--. 1 xtrnaw7 xtrnaw7 1456 Nov 14 13:25 releasekey.x509.pem
[xtrnaw7@t15g /data/develop/android/test1]$



# create a PKCS#8-formatted version of the private key
#
[xtrnaw7@t15g /data/develop/android/test1]$
openssl pkcs8 -in temp.pem -topk8 -outform DER -out releasekey.pk8 -nocrypt
[xtrnaw7@t15g /data/develop/android/test1]$



[xtrnaw7@t15g /data/develop/android/test1]$ ls -ltr
total 12
-rw-------. 1 xtrnaw7 xtrnaw7 1704 Nov 14 13:24 temp.pem
-rw-rw-r--. 1 xtrnaw7 xtrnaw7 1456 Nov 14 13:25 releasekey.x509.pem
-rw-------. 1 xtrnaw7 xtrnaw7 1218 Nov 14 13:25 releasekey.pk8
[xtrnaw7@t15g /data/develop/android/test1]$


# securely delete the temp.pem file

#
[xtrnaw7@t15g /data/develop/android/test1]$ shred --remove temp.pem
[xtrnaw7@t15g /data/develop/android/test1]$


[xtrnaw7@t15g /data/develop/android/test1]$ ls -ltr
total 8
-rw-rw-r--. 1 xtrnaw7 xtrnaw7 1456 Nov 14 13:25 releasekey.x509.pem
-rw-------. 1 xtrnaw7 xtrnaw7 1218 Nov 14 13:25 releasekey.pk8
[xtrnaw7@t15g /data/develop/android/test1]$ 


From the documentation:

The openssl pkcs8 command given above creates a .pk8 file with no password, suitable for use with the build system. To create a .pk8 secured with a password (which you should do for all actual release keys), replace the -nocrypt argument with -passout stdin; then openssl will encrypt the private key with a password read from standard input. No prompt is printed, so if stdin is the terminal the program will appear to hang when it's really just waiting for you to enter a password. Other values can be used for the-passout argument to read the password from other locations; for details, see the openssl documentation.

The temp.pem intermediate file contains the private key without any kind of password protection, so dispose of it thoughtfully when generating release keys. In particular, the GNUshred utility may not be effective on network or journaled filesystems. You can use a working directory located in a RAM disk (such as a tmpfs partition) when generating keys to ensure the intermediates are not inadvertently exposed.



Update 01.07.2024

To view the certificate use this command:

openssl x509 -in ./build/make/target/product/security/platform.x509.pem -text



Updating the local repositories

To update the local repositories change the working directory to the directory with the repositories for OmniROM 14 and execute

repo sync

After the synchronization is complete, create a new operating system image using the commands described above.

It is recommended to create a new image at least once a month after the new security patches for Android are added to the repositories for OmniROM 14.

To view the date of the security patch in the source files for the OmniROM 14 execute this command in the directory with the source files for the OmniROM 14:

[ OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $ date
Tue Jan  9 07:24:05 PM CET 2024
[ OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $ grep "^[[:space:]]*PLATFORM_SECURITY_PATCH[[:space:]]*:=" ./build/make/core/version_defaults.mk
    PLATFORM_SECURITY_PATCH := 2024-01-05
[ OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $


See How to apply the Android Security patches to a local repository for how to apply an Android Security patch to the local repository.



Moving the repositories to another directory

In case you want to move the repositories for OmniROM 14 to another directory or rename the directory with the repositories:

Be aware that the make scripts create some absolute links in the output directory; to list these absolute links use this command while in the directory with the repositories for OmniROM 14 :

find . -type l -ls | grep "$PWD"


e.g. there are currently a lot of absolute links in the output directory:

[ OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $ find . -type l -ls | grep "$PWD" | wc -l
131245
[ OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $


Before starting another build after moving the directories with the repositories you must correct these links (or clean the directory ./out)



Log files

The verbose log of the compile script is always written to a compressed file in the output directory, e.g.:

ls -ltr /data/develop/android/OmniROM_14.0/out/verbose.log*
[ OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $ ls -ltr /data/develop/android/OmniROM_14.0/out/verbose.log*
-rw-rw-r--. 1 xtrnaw7 xtrnaw7     938 Nov 19 19:00 /data/develop/android/OmniROM_14.0/out/verbose.log.4.gz
-rw-rw-r--. 1 xtrnaw7 xtrnaw7 7321648 Nov 19 19:02 /data/develop/android/OmniROM_14.0/out/verbose.log.5.gz
-rw-rw-r--. 1 xtrnaw7 xtrnaw7   21660 Nov 19 19:05 /data/develop/android/OmniROM_14.0/out/verbose.log.3.gz
-rw-rw-r--. 1 xtrnaw7 xtrnaw7   20241 Nov 19 19:10 /data/develop/android/OmniROM_14.0/out/verbose.log.2.gz
-rw-rw-r--. 1 xtrnaw7 xtrnaw7 2917838 Nov 19 20:33 /data/develop/android/OmniROM_14.0/out/verbose.log.1.gz
-rw-rw-r--. 1 xtrnaw7 xtrnaw7   73725 Nov 20 10:22 /data/develop/android/OmniROM_14.0/out/verbose.log.gz
[ OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $




Other options of the make tools

To create the image with other options use

. build/envsetup.sh
lunch
make <options>


To list the known options for the make command use this command:

make help
[ OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $ make help
The basic Android build process is:

cd /data/develop/android/OmniROM_14.0
source build/envsetup.sh    # Add "lunch" (and other utilities and variables)
                            # to the shell environment.
lunch [<product>-<variant>] # Choose the device to target.
m [<goals>]                 # Execute the configured build.

Usage of "m" imitates usage of the program "make".
See /data/develop/android/OmniROM_14.0/build/make/Usage.txt for more info about build usage and concepts.

The parallelism of the build can be set with a -jN argument to "m".  If you
don't provide a -j argument, the build system automatically selects a parallel
task count that it thinks is optimal for your system.

Common goals are:

    clean                   (aka clobber) equivalent to rm -rf out/
    checkbuild              Build every module defined in the source tree
    droid                   Default target
    sync                    Build everything in the default target except the images,
                            for use with adb sync.
    nothing                 Do not build anything, just parse and validate the build structure

    java                    Build all the java code in the source tree
    native                  Build all the native code in the source tree

    host                    Build all the host code (not to be run on a device) in the source tree
    target                  Build all the target code (to be run on the device) in the source tree

    (java|native)-(host|target)
    (host|target)-(java|native)
                            Build the intersection of the two given arguments

    snod                    Quickly rebuild the system image from built packages
                            Stands for "System, NO Dependencies"
    vnod                    Quickly rebuild the vendor image from built packages
                            Stands for "Vendor, NO Dependencies"
    pnod                    Quickly rebuild the product image from built packages
                            Stands for "Product, NO Dependencies"
    senod                   Quickly rebuild the system_ext image from built packages
                            Stands for "SystemExt, NO Dependencies"
    onod                    Quickly rebuild the odm image from built packages
                            Stands for "Odm, NO Dependencies"
    vdnod                   Quickly rebuild the vendor_dlkm image from built packages
                            Stands for "VendorDlkm, NO Dependencies"
    odnod                   Quickly rebuild the odm_dlkm image from built packages
                            Stands for "OdmDlkm, NO Dependencies"
    sdnod                   Quickly rebuild the system_dlkm image from built packages
                            Stands for "SystemDlkm, NO Dependencies"


So, for example, you could run:

cd /data/develop/android/OmniROM_14.0
source build/envsetup.sh
lunch aosp_arm-userdebug
m -j java

to build all of the java code for the userdebug variant of the aosp_arm device.


#### build completed successfully (4 seconds) ####

[ OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $





Creating only the kernel or the boot image

To create only the kernel or the boot image use these commands:

. build/envsetup

# select the target hardware
#
breakfast omni_zenfone8-user

# Now instead of following the rest of the guide (which will compile both Android and the kernel
# for your device), simply compile the kernel:
#
mka kernel

# This command will also generate the device tree, initramfs and boot.img images
#
mka bootimage

 

Trouble Shooting

see Some hints for repo sync troubleshooting for how to fix some common errors while executing the command "repo sync".

see Some hints for fixing errors building an Custom ROM Android image for how to fix some common errors while creating the image



TWRP and OmniROM 14


Update 10.01.2024

For OmniROM 14 and other Android 14 based Custom ROMs on the ASUS Zenfone 8 the TWRP version 3.7.0.12-1 or newer is required (because TWRP version 3.7.0.12-0 or older can not mount the /data partitions created by Android 14). TWRP version 3.7.0.12-1 can now be downloaded from the TWRP webpage:

https://eu.dl.twrp.me/I006D/


Notes:

After dirty flashing an installed OmniROM 13 with OmniROM 14 the current official TWRP 3.7.0.12-0 can still access the /data partition - the "problem" only exists after a clean installation of OmniROM 14 (= with factory reset).




Update 10.01.2024

This workaround is not necessary anymore with TWRP version 3.7.0.12-1 or newer

Installing OmniROM 14 via script using the official TWRP image 3.7.0.12-0 for the ASUS Zenfone 8
The installation and customization of OmniROM 14 via script, as described in here How to install and configure the Android OS via Script, using the TWRP image for the ASUS Zenfone 8 3.7.0_12-0 will only partially work due to the missing support for Android 14 in that release of TWRP.

A workaround to install OmniROM 14 using the TWRP image without OmniROM 14 support is to use the scripts to install and customize OmniROM 13 first, and then use the scripts to update to OmniROM 14 , e.g.:

#install and customize OmniROM 13
#
./prepare_phone.sh in all

# update to OmniROM 14
#

# the name of the image must be a fully qualified path
#
export OMNIROM_14_OS_IMAGE_TO_INSTALL="/data/backup/ASUS_ZENFONE8/omnirom_local/omni-14/omni-14-20231119-zenfone8-MICROG.zip"

./prepare_phone.sh install_os:noreboot:${OMNIROM_14_OS_IMAGE_TO_INSTALL} install_twrp:noreboot:next install_magisk_v26_in_boot_partition:reboot:next

Note:  install_magisk_via_twrp.sh v3.1.3.1 or newer is required for this approach



Update 25.03.2025

see also How to change name of the ZIP file with the OS image while building a new image






History of this entry

01.07.2024

added the command to view the contents of a .pem file


31.03.2024

added a reference to a new post about changes in the build process in Q1 2024


08.02.2024

moved the trouble shooting instructions to separate posts


22.01.2024

Added info about the mandatory git command line extension "git lfs"


21.01.2024

Added note on handling 429 errors of the repo sync command


10.01.2024

The section about TWRP for OmniROM 14 was rewritten;, there is now an official TWRP version for the ASUS Zenfone 8 with support for Android 14. 


09.01.2024

the repositories for OmniROM 14 are now final and can be used to create an OmniROM 14 installation image for the ASUS Zenfone 8 

Updated the section about TWRP for OmniROM 14



 

Infos for building an Android 14 based Custom ROM image in Q1 2024 or later


URL: https://xdaforums.com/t/infos-for-building-an-android-14-based-customrom-image-in-q1-2024-or-later.4664652/


Infos for building an Android 14 based Custom ROM image in Q1 2024 or later



Notes:

The info below are for building the OmniROM 14 for the ASUS Zenfone 8. But I assume that this is also true for other AOSP based Custom ROMs.
brunch and breakfast are commands defined in the init script for OmniROM and may not be available in other Custom ROMs


Credits

Thanks to the OmniROM developer for this hint.




Attempting to create a new OmniROM image based on Android 14 using the well-known parameter for the command lunch in Q1 2024 or later may fail with this error:

[ OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $ lunch omni_zenfone8-user

Invalid lunch combo: omni_zenfone8-user
Valid combos must be of the form <product>-<release>-<variant>
[ OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $


This is because Google changed the naming conventions for Android releases created with Google's repositories in QPR2 (QPR = Quarterly Platform Releases; QPR2 for Android 14 is the Android Security Patch android-14.0.0_r29 from 05.3.2024) :

It's now necessary to specify a specific version to create a new image using the commands lunch and brunch (see envsetup.sh).

To get the necessary values for the lunch and brunch command check the entries in the file AndroidProducts.mk for your device:

[ OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $ cat ./device/asus/zenfone8/AndroidProducts.mk
PRODUCT_MAKEFILES := \
    $(LOCAL_DIR)/omni_zenfone8.mk

COMMON_LUNCH_CHOICES := \
    omni_zenfone8-ap1a-user \
    omni_zenfone8-ap1a-userdebug \
    omni_zenfone8-ap1a-eng


The example above is for a ASUS Zenfone 8; the file used for other phones is most probably in a different directory, of course)


So the commands lunch and brunch to build the OmniROM 14 image for an ASUS Zenfone 8 are now:

lunch omni_zenfone8-ap1a-user

brunch zenfone8 ap1a user


(use the parameter eng or userdebug instead of user for one of the other flavors of the ROM image).

The version string used, ap1a, is part of the build_id for the current security patch level: 




(see here: https://source.android.com/docs/setup/reference/build-numbers#source-code-tags-and-builds)


To check whether an AOSP source tree uses the new version definition, check whether the repository build/release exists, e.g:


[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/OmniROM_14.0 ] $ repo info build/release
Manifest branch: refs/tags/android-14.0.0_r29
Manifest merge branch: refs/heads/android-14.0
Manifest groups: default,platform-linux
----------------------------
Project: platform/build/release
Mount path: /devpool001/develop/OmniROM_14.0/build/release
Current revision: b63ef38d4ff1ced7ed8c16733b2b19c8d421aff8
Manifest revision: refs/tags/android-14.0.0_r29
Local Branches: 0
----------------------------
[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/OmniROM_14.0 ] $



In an AOSP source tree using the old version definitions the output looks like this:

[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/OmniROM_14.0_patch_2024-02-05 ] $ repo info build/release
Manifest branch: refs/tags/android-14.0.0_r27
Manifest merge branch: refs/heads/android-14.0
Manifest groups: default,platform-linux
----------------------------
error: project build/release not found
[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/OmniROM_14.0_patch_2024-02-05 ] $



I wrote a little script, print_security_patch, to print the current Security Patch level and build id for an AOSP based repository tree.
This script works for repositories that were last updated before Q1 2024 and after Q1 2024.

The script was only tested with the repositories for OmniROM 14 but I think it should work with every AOSP based repository tree.


Usage:

[ OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $ /data/develop/android/scripts_on_linux/print_security_patch  -h

print_security_patch - print the security patch and the the build id used in an repository tree for AOSP

This script works for repositories that were last updated before Q1 2024 and after Q1 2024.
The script must be executed at the top level in a repository tree for AOSP

[ OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $



Examples
executed in the top level of an Android repository tree using the old definitions

[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/OmniROM_14.0_patch_2024-02-05 ] $  /data/develop/android/scripts_on_linux/print_security_patch ; echo "RC=$?"
The repository uses the old definitions
The current security patch is "2024-02-05"

The current build_id is "UP1A"
RC=1
[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/OmniROM_14.0_patch_2024-02-05 ]



executed in the top level of an Android repository tree using the new definitions

[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/OmniROM_14.0 ] $  /data/develop/android/scripts_on_linux/print_security_patch ; echo "RC=$?"
The repository uses the new definitions
The current security patch is "2024-03-05"

The current build_id is "ap1a"
RC=0
[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/OmniROM_14.0 ] $



sourced in in the top level of an Android repository tree using the new definitions

[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/OmniROM_14.0 ] $ .  /data/develop/android/scripts_on_linux/print_security_patch
The repository uses the new definitions
The current security patch is "2024-03-05"

The current build_id is "ap1a"

[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/OmniROM_14.0 ] $ echo $RELEASE_PLATFORM_SECURITY_PATCH
2024-03-05

[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/OmniROM_14.0 ] $ echo $BUILD_ID
ap1a

[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/OmniROM_14.0 ] $ echo $REPO_FORMAT
new

[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/OmniROM_14.0 ] $




The script can be downloaded from here: print_security_patch

Update 09.04.2024/bs

There is now a new version of the script available - see How to print the security patch level used in repositories or ROM image zip files for details.


Notes

Note that as of 29.03.2024 the command breakfast does not work anymore in repository trees with the new version definitions.

See How to compile the OmniROM 14 Custom ROM for the the ASUS Zenfone 8 for general instructions how to create your own Custom ROM image with OmniROM 14.



 

How to compile the OmniROM 15 Custom ROM for the ASUS Zenfone 8


URL: https://xdaforums.com/t/how-to-compile-the-omnirom-15-for-the-asus-zenfone-8.4704406/


How to compile the OmniROM 15 Custom ROM for the ASUS Zenfone 8


Update 15.01.2025

Note that I have revised the instructions in this HowTo as the previous version of the HowTo was dependent on some not documented prerequisites and contained some typos.



This HowTo is about compiling the OmniROM 15 for the ASUS Zenfone 8.

See How to compile the OmniROM for the ASUS Zenfone 8 for instructions to compile the other versions of the OmniROM for the ASUS Zenfone 8.


Readers who have already built an earlier version of OmniROM can skip most of this post, with the exception of the instructions for synchronizing repositories, as these instructions are different for OmniROM 15 than in previous OmniROM versions.

The commands in this HowTo are intended for the Linux operating system, but it should not be too difficult to convert them into commands for the Windows operating system.




Compiling the Custom ROM OmniROM 15 from within Linux is again a very simple and straight forward process -- the developer for the OmniROM did once again a really amazing good job setting up the build environment for the OmniROM 15.

I'm repeating myself here - but it can't be said often enough.



Hardware requirements

Message from the repo tool:

"The minimum required amount of free memory is around 16GB, and even with that, some configurations may not work."

In my experience, the computer on which OmniROM is compiled should have at least 32 GB RAM and 4 CPU cores.
(The numbers in this document are for a PC with an Intel Core i7 with 16 cores and 128 GB RAM).

Note that the scripts used to create the OmniROM image start one workspace per CPU and each workspace requires about 4 GB of RAM. Plus about 2 GB RAM for the general tasks.

As of 15.01.2025, the repositories for OmniROM 15 occupy about 200 GB of disk space; the additional repositories for the hardware-specific repositories for the ASUS Zenfone 8 occupy about 20 GB of disk space.

The compile process will occupy additional 64 GB for the temporary output files.
In total, the repositories for OmniROM 15 require around 300 GB of storage space (the space occupied increases with every "repo sync")



Prerequisites

Some of the repositories for OmniROM 15 are on https://gitlab.com and the access to these repositories for the repository sync is done via ssh. Therefore, to sync these repositories a user account on gitlab.com with configured public ssh key is required. The user account on gitlab.com is free of charge and the public ssh key can be uploaded into the user profile on gitlab.com (see here: https://docs.gitlab.com/ee/user/ssh.html)

The repositories on http://github.com are currently accessed via https but that might change in the future. Therefor it's recommended to create a user on github.com and add the ssh public key to the profile of that user also.

Note:

To check how the access to the repositories is configured use this command

[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/OmniROM_15.0 ] $ date
Wed Jan 15 09:53:04 AM CET 2025
[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/OmniROM_15.0 ] $ grep fetch $( find .repo -maxdepth 2   -name "*xml"  )
.repo/local_manifests/local_manifest.xml:        fetch="https://github.com/DonkeyCoyote" />
.repo/manifests/omni-private.xml:           fetch="ssh://git@github.com/omnirom"
.repo/manifests/default.xml:           fetch="https://android.googlesource.com"
.repo/manifests/omni-aosp.xml:           fetch="https://github.com/" />
.repo/manifests/omni-aosp.xml:           fetch="ssh://git@gitlab.com/omnirom" />
.repo/manifests/omni-aosp.xml:           fetch="https://github.com/omnirom"
.repo/manifests/omni-caf.xml:           fetch="https://github.com/" />
.repo/manifests/omni-caf.xml:           fetch="https://github.com/omnirom"
.repo/manifests/omni-caf.xml:           fetch="https://git.codelinaro.org/clo/la"
[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/OmniROM_15.0 ] $



Use the commands

ssh git@github.com

ssh git@gitlab.com

to test the access via ssh and add the ssh hostkeys of the hosts github.com and gitab.com to the known_hosts file.


Or use

grep  "^gitlab.com"  ~/.ssh/known_hosts  || ssh-keyscan gitlab.com >>~/.ssh/known_hosts

grep  "^github.com"
  ~/.ssh/known_hosts || ssh-keyscan github.com >>~/.ssh/known_hosts

to add the ssh hostkeys of the repository server used to the local known_hosts file of the user used to retrieve the repositories.


It's recommended to start the ssh-agent and load the private ssh keys before starting the sync of the repositories, e.g. if no global ssh-agent is running use:

$( eval ssh-agent )
ssh-add

Use

ssh-add -l

to list the ssh keys already loaded by the ssh-agent.

Note

Example output for a working access:

[xtrnaw7@arcolinux OmniROM_15.0]$  ssh git@gitlab.com
PTY allocation request failed on channel 0
Welcome to GitLab, @bnsmb01!
Connection to gitlab.com closed.
[xtrnaw7@arcolinux OmniROM_15.0]$

[xtrnaw7@arcolinux OmniROM_15.0]$ ssh git@github.com
PTY allocation request failed on channel 0
Hi bnsmb! You've successfully authenticated, but GitHub does not provide shell access.
Connection to github.com closed.
[xtrnaw7@arcolinux OmniROM_15.0]$



If you have not used git on this machine, you must set some global git variables:

git config --global user.email <your_email_address>

git config --global user.name <your name>






The tool repo is required to maintain the repositories for the OmniROM 15; you can download the tool "repo" from https://gerrit.googlesource.com/git-repo or download it with this command:

curl https://storage.googleapis.com/git-repo-downloads/repo > ./repo && chmod a+x ./repo  


The script repo should be added to a directory available via the environment variable PATH.

It's not necessary to install additional tools for creating an OmniROM 15 image -- all necessary tools to create the image are in the repositories for the OmniROM 15, with one exception:


If you are compiling the OmniROM image on a machine running Linux, the source code for some of the tools to create the OmniROM 15 image requires the header files and libraries for OpenSSL.

Under Fedora, these files can be installed using these commands:

sudo dnf install openssl openssl-libs openssl-devel

and additionally for distributions in which the OpenSSL engine is not part of the OpenSSL package anymore (as in Fedora 41):

sudo dnf install openssl-devel-engine




The repositories used for the OmniROM 15 use the git command line extension git lfs. At least in Fedora this extension is not installed by default while installing git. In Fedora git lfs can be installed using this command:

sudo dnf install git-lfs 


Use the command

git lfs install

to initialize git lfs extension.


Creating the local copies of the repositories for the OmniROM 15


Please note that the instructions for building OmniROM 15 differ from the instructions for building OmniROM 14.

Most (but not all) of the necessary steps to sync the repositories necessary to create an OmniROM 15 installation image are described in the section "Getting Started" here: https://github.com/omnirom/android/tree/android-15 but some instructions are missing the details.


To create a local copy of the repositories for OmniROM 15 these steps are required:


First create a new directory for the repositories and change the working directory to the new directory, e.g.:

mkdir /data/develop/android/OmniROM_15.0
cd /data/develop/android/OmniROM_15.0



Then init the local repositories using the command:

repo init -u https://github.com/omnirom/android.git -b android-15 --git-lfs


Note that the command repo init only creates a hidden directory called .repo.

Next sync the local repositories.


There are now two commands necessary to sync the repositories (the instructions below are copied from https://github.com/omnirom/android/tree/android-15):

"
Add this alias in your ~/.bashrc for an automatically sync :

alias repo-lfs="repo sync && repo forall -c git lfs pull"

Then reload your file with source ~/.bashrc in the terminal

Then to sync up with the lfs repo:

repo-lfs
"

Notes

Another useful alias for the repository sync is:

alias repo-lfs-force="repo sync --force-sync && repo forall -c git lfs pull"




The initial repository sync will download all repositories necessary to create the OmniROM 15 image except the hardware dependent repositories (these repos are different for the various phone models).

Therefor you must add the repositories for the vendor and device tree for your phone to the manifests in the local repositories after the download finished.

This should be done in the file .repo/local_manifests/local_manifest.xml (just create the directory .repo/local_manifests if it does not exist).

For the ASUS Zenfone 8 the file should look like this:

[ OmniRom 15 - xtrnaw7@t15g /data/develop/android/OmniROM_15.0 ] $ date
Sat Mar  8 09:57:54 AM CET 2025
[ OmniRom 15 - xtrnaw7@t15g /data/develop/android/OmniROM_15.0 ] $


[ OmniRom 15 (devpool) - xtrnaw7@t15g /devpool001/develop/OmniROM_15.0 ] $ cat .repo/local_manifests/local_manifest.xml
<?xml version="1.0" encoding="UTF-8"?>

<manifest>
    <remote  name="DonkeyCoyote"
        fetch="https://github.com/DonkeyCoyote" />
    <project path="vendor/asus" name="proprietary_vendor_asus" remote="DonkeyCoyote" revision="android-15" />
    <project path="vendor/microg" name="android_prebuilts_prebuiltapks" remote="omnirom" revision="android-14.0" />
    <project path="vendor/images/asus" name="android_vendor_images_asus" remote="gitlab" revision="android-14.0" />
    <project path="vendor/gapps" name="android_vendor_gapps" remote="gitlab" revision="android-15" />
</manifest>
[ OmniRom 15 (devpool) - xtrnaw7@t15g /devpool001/develop/OmniROM_15.0 ] $



Notes:

The repository android_prebuilts_prebuiltapks is only necessary for OmniROM 15 images that should include the MicroG packages.

The repository android_vendor_gapps is only necessary for OmniROM 15 images that should include the Google Apps.

Update 08.03.2025

The repository for the directory tree vendor/asus was moved from github to gitlab:

[ OmniRom 15 - xtrnaw7@t15g /data/develop/android/OmniROM_15.0 ] $ diff .repo/local_manifests/local_manifest.xml.org  .repo/local_manifests/local_manifest.xml
6c6
<     <project path="vendor/asus" name="proprietary_vendor_asus" remote="DonkeyCoyote" revision="android-15" />
---
>     <project path="vendor/asus" name="android_vendor_asus" remote="gitlab" revision="android-15" />
[ OmniRom 15 - xtrnaw7@t15g /data/develop/android/OmniROM_15.0 ] $
 





The repositories configured in the file .repo/manifests/omni-private.xml are private repositories. To use these repositories, access to these repositories must be configured by the admin of the repositories (see https://github.com/omnirom/android). The packages installed using these repositories are only optional and OmniROM can be compiled without them.

To disable the private repositories comment or delete the lines starting with "<project path" in the file .repo/manifests/omni-private.xml -- but do NOT delete the file or remove the include statement for this file in the file .repo/manifests/omni-default.xml (as described here https://github.com/omnirom/android/tree/android-15):
 
The definition for the remote repository omnirom2 can be found in this file and omnirom2 is the default remote repository used to synchronize missing repositories in the python script roomservice.py.

Details


contents of the file .repo/manifests/omni-private.xml
[xtrnaw7@t15g /devpool001/develop/OmniROM_15.0]$ cat .repo/manifests/omni-private.xml
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
  <remote  name="omnirom2"
           fetch="ssh://git@github.com/omnirom"
           review="gerrit.omnirom.org" />

  <!-- private OmniROM Projects -->
  <project path="packages/apps/OmniSwitch" name="android_packages_apps_OmniSwitch" remote="omnirom2" revision="android-14.0" />
  <project path="packages/services/OmniJaws" name="android_packages_services_OmniJaws" remote="omnirom2" revision="android-15" />
  <project path="packages/apps/OmniRemote" name="android_packages_apps_OmniRemote" remote="omnirom2" revision="android-15" />
  <project path="packages/apps/OmniControl" name="android_packages_apps_OmniControl" remote="omnirom2" revision="android-15" />
  <project path="packages/apps/OmniOta" name="android_packages_apps_OmniOta" remote="omnirom2" revision="android-15" />
  <project path="packages/apps/OmniWallpaper" name="android_packages_apps_OmniWallpaper" remote="omnirom2" revision="android-14.0" />
</manifest>



grep "default_rem |default_team_rem "  ../OmniROM_14.0/vendor/omni/build/tools/roomservice.py

[xtrnaw7@t15g /datapool001/develop/OmniROM_15.0]$ egrep "default_rem |default_team_rem "  ../OmniROM_14.0/vendor/omni/build/tools/roomservice.py
default_rem = "omnirom2"
default_team_rem = "omnirom2"
[xtrnaw7@t15g /datapool001/develop/OmniROM_15.0]$





After you have updated the file local_manifest.xml, run another

repo-lfs

to synchronize the added repositories. This time the download will be faster as only the additional repos will be downloaded.


Now you can start the build with these commands:

# optional:
#
# to build an OmniROM image with MicroG packages, set the environment variable ROM_BUILDTYPE to MICROG before starting the build
# (of course this only works if the repositories with MicroG are configured in the manifest files)
#
# to build an OmniROM image with GAPPS packages, set the environment variable ROM_BUILDTYPE to GAPPS before starting the build.
# (of course this only works if the repositories with GAPPS are configured in the manifest files)
#
export ROM_BUILDTYPE=MICROG

. build/envsetup.sh

lunch omni_zenfone8-ap4a-user

brunch omni_zenfone8-ap4a-user


in the directory with the downloaded repositories (Note: The command "breakast" to list all possible targets does not work in the repositories for OmniROM 15)

Be aware that the first time the compile process may take a long time (4 hours or more on my Notebook)


If everything is OK, there will be a ZIP file with your own custom OmniROM 15 image in the directory ./out/target/product/zenfone8/ when the compilation script is finished, e.g. for images with the MicroG packages:

[ OmniRom 15 - xtrnaw7@t15g /data/develop/android/OmniROM_15.0 ] $ ls -l out/target/product/zenfone8/omni-15-*zip
-rw-rw-r--. 2 xtrnaw7 xtrnaw7 1405496265 Nov 21 23:50 out/target/product/zenfone8/omni-15-20241121-zenfone8-MICROG.zip
[ OmniRom 15 - xtrnaw7@t15g /data/develop/android/OmniROM_15.0 ] $
 


The image can now be installed on the ASUS Zenfone 8 with the LineageOS Recovery or TWRP.




Notes





Note that any new OmniROM 15 image created with brunch will overwrite the existing OmniROM 15 image (the name of the image is different, but the inodes used are the same for all zip files):

[ OmniRom 15 - xtrnaw7@t15g /data/develop/android/OmniROM_15.0 ] $ ls -il out/target/product/zenfone8/*zip
81841265 -rw-rw-r--. 3 xtrnaw7 xtrnaw7 1407118794 Nov 22 08:23 out/target/product/zenfone8/omni-15-20241121-zenfone8-MICROG.zip
81841265 -rw-rw-r--. 3 xtrnaw7 xtrnaw7 1407118794 Nov 22 08:23 out/target/product/zenfone8/omni-15-20241122-zenfone8-MICROG.zip
81841265 -rw-rw-r--. 3 xtrnaw7 xtrnaw7 1407118794 Nov 22 08:23 out/target/product/zenfone8/omni_zenfone8-ota.zip
[ OmniRom 15 - xtrnaw7@t15g /data/develop/android/OmniROM_15.0 ] $

[ OmniRom 15 - xtrnaw7@t15g /data/develop/android/OmniROM_15.0 ] $ cksum  out/target/product/zenfone8/*zip
3674363399 1407118794 out/target/product/zenfone8/omni-15-20241121-zenfone8-MICROG.zip
3674363399 1407118794 out/target/product/zenfone8/omni-15-20241122-zenfone8-MICROG.zip
3674363399 1407118794 out/target/product/zenfone8/omni_zenfone8-ota.zip
[ OmniRom 15 - xtrnaw7@t15g /data/develop/android/OmniROM_15.0 ] $


You should therefore copy the existing zip file with the image to a new directory before building a new image.



Certificates for the OS images

For OS images that are to be used on the phone for daily use, I strongly recommend creating your own certificates for the operating system.

In the OmniROM development directory tree the necessary files, platform.pk8 and platform.x509.pem, are in the directory

./build/make/target/product/security

in your build tree for the Custom ROM, e.g.

[ OmniROM 15 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $ ls -l ./build/make/target/product/security/platform.*
-rw-rw-r--. 1 xtrnaw7 xtrnaw7 1216 Nov 14 15:24 ./build/make/target/product/security/platform.pk8
-rw-rw-r--. 1 xtrnaw7 xtrnaw7 1675 Nov 14 15:24 ./build/make/target/product/security/platform.x509.pem
[ OmniROM 15 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $


Replace these files with your own certificate files and recreate the image using the command brunch (see above).


See here https://source.android.com/devices/tech/ota/sign_builds for how to create your own certificate.

To manually create the certificate and keys use these commands:
To manually create the certificate and keys use these commands:


Android uses 2048-bit RSA keys with public exponent 3. You can generate certificate/private key pairs using the openssl tool from openssl.org:

# generate RSA key
#
[xtrnaw7@t15g /data/develop/android/test1]$
openssl genrsa -3 -out temp.pem 2048
[xtrnaw7@t15g /data/develop/android/test1]$ ls -ltr
total 4
-rw-------. 1 xtrnaw7 xtrnaw7 1704 Nov 14 13:24 temp.pem


# create a certificate with the public part of the key
#
[xtrnaw7@t15g /data/develop/android/test1]$
openssl req -new -x509 -key temp.pem -out releasekey.x509.pem -days 10000 -subj  '/C=DE/ST=Hessen/L=Frankfurt am Main/O=Android/OU=Android/CN=Android/emailAddress=bnsmb01@gmail.com'
[xtrnaw7@t15g /data/develop/android/test1]$


[xtrnaw7@t15g /data/develop/android/test1]$ ls -ltr
total 8
-rw-------. 1 xtrnaw7 xtrnaw7 1704 Nov 14 13:24 temp.pem
-rw-rw-r--. 1 xtrnaw7 xtrnaw7 1456 Nov 14 13:25 releasekey.x509.pem
[xtrnaw7@t15g /data/develop/android/test1]$



# create a PKCS#8-formatted version of the private key
#
[xtrnaw7@t15g /data/develop/android/test1]$
openssl pkcs8 -in temp.pem -topk8 -outform DER -out releasekey.pk8 -nocrypt
[xtrnaw7@t15g /data/develop/android/test1]$



[xtrnaw7@t15g /data/develop/android/test1]$ ls -ltr
total 12
-rw-------. 1 xtrnaw7 xtrnaw7 1704 Nov 14 13:24 temp.pem
-rw-rw-r--. 1 xtrnaw7 xtrnaw7 1456 Nov 14 13:25 releasekey.x509.pem
-rw-------. 1 xtrnaw7 xtrnaw7 1218 Nov 14 13:25 releasekey.pk8
[xtrnaw7@t15g /data/develop/android/test1]$


# securely delete the temp.pem file

#
[xtrnaw7@t15g /data/develop/android/test1]$ shred --remove temp.pem
[xtrnaw7@t15g /data/develop/android/test1]$


[xtrnaw7@t15g /data/develop/android/test1]$ ls -ltr
total 8
-rw-rw-r--. 1 xtrnaw7 xtrnaw7 1456 Nov 14 13:25 releasekey.x509.pem
-rw-------. 1 xtrnaw7 xtrnaw7 1218 Nov 14 13:25 releasekey.pk8
[xtrnaw7@t15g /data/develop/android/test1]$ 


From the documentation:

The openssl pkcs8 command given above creates a .pk8 file with no password, suitable for use with the build system. To create a .pk8 secured with a password (which you should do for all actual release keys), replace the -nocrypt argument with -passout stdin; then openssl will encrypt the private key with a password read from standard input. No prompt is printed, so if stdin is the terminal the program will appear to hang when it's really just waiting for you to enter a password. Other values can be used for the-passout argument to read the password from other locations; for details, see the openssl documentation.

The temp.pem intermediate file contains the private key without any kind of password protection, so dispose of it thoughtfully when generating release keys. In particular, the GNUshred utility may not be effective on network or journaled filesystems. You can use a working directory located in a RAM disk (such as a tmpfs partition) when generating keys to ensure the intermediates are not inadvertently exposed.



To view the certificates in the repository used to build the images use this command (for all of the .pem files in that directory!):

openssl x509 -in ./build/make/target/product/security/platform.x509.pem -text -noout


To view the certificate used for the installed OS on the phone use the command

unzip -p /system/etc/security/otacerts.zip *.pem | openssl x509 -text


Note:

The executable openssl is not part of the standard Android OS and also not part of the OmniROM. A Magisk Module with openssl is available on my website : see here

The openssl binary from that Magisk Module can also be used without installing the Magisk Module. For that download the ZIP file with the Magisk Module and extract the openssl binary:

unzip -p openssl_3.3.1-v1.1.0.zip  system/usr/bin/openssl >openssl


Or download the openssl binary for Android on arm64 CPUs from here

https://bnsmb.de/files/public/Android/binaries_for_arm64/openssl


Now copy the file openssl just created to the phone into the directory /data/local/tmp and make it executable:

chmod 755 /data/local/tmp/openssl



Updating the local repositories

To update the local repositories, change the working directory to the directory with the repositories for OmniROM 15 and execute

repo-lfs

(This only works if you have created the bash alias as described above)


After the synchronization is complete, create a new ROM image using the commands described above.

It is recommended to update the local repositories and create a new image at least once a month after the new security patches for Android are added to the repositories for OmniROM 15.


To view the date of the security patch in the source files for the OmniROM 15 the shell script print_security_patch can be used; example:

[xtrnaw7@t15g /devpool001/develop/OmniROM_15.0]$ print_security_patch
Retrieving the security patch level for the repository at "/devpool001/develop/OmniROM_15.0" ...
The repository uses the new definitions
The current security patch is "2024-12-05"
The current build_id is "ap4a"
[xtrnaw7@t15g /devpool001/develop/OmniROM_15.0]$



To check if the new security patch has already been applied to the OmniROM repositories, check the Gerrit for OmniROM : https://gerrit.omnirom.org/q/status:merged


See How to apply the Android Security patches to a local repository for how to apply an Android Security patch to the local repository in case you want to manually add the Android security patch to your local repositories.



Moving the repositories to another directory

In case you want to move the repositories for OmniROM 15 to another directory or rename the directory with the repositories:

Be aware that the make scripts create some absolute links in the output directory; to list these absolute links use this command while in the directory with the repositories for OmniROM 15 :

find . -type l -ls | grep "$PWD"


e.g. there are currently still some absolute links in the output directory for OmniROM 15:

[ OmniRom 15 - xtrnaw7@t15g /data/develop/android/OmniROM_15.0 ] $  find . -type l -ls | grep "$PWD" | wc -l
8
[ OmniRom 15 - xtrnaw7@t15g /data/develop/android/OmniROM_15.0 ] $


[ OmniRom 15 - xtrnaw7@t15g /data/develop/android/OmniROM_15.0 ] $  find . -type l -ls | grep "$PWD"
 84156629      4 lrwxrwxrwx   1 xtrnaw7  xtrnaw7        93 Nov 21 10:42 ./out/soong/.intermediates/prebuilts/build-tools/prebuilt_py3-launcher-autorun/linux_glibc_x86_64/e0c56be2b0b4cd8e6040d6ad4670d513/py3-launcher-autorun -> /data/develop/android/OmniROM_15.0/prebuilts/build-tools/linux-x86/bin/py3-launcher-autorun64
 84157313      4 lrwxrwxrwx   1 xtrnaw7  xtrnaw7        73 Nov 21 23:30 ./out/soong/.intermediates/prebuilts/build-tools/m4/linux_glibc_x86_64/m4 -> /data/develop/android/OmniROM_15.0/prebuilts/build-tools/linux-x86/bin/m4
 84156618      4 lrwxrwxrwx   1 xtrnaw7  xtrnaw7        85 Nov 21 10:42 ./out/soong/.intermediates/prebuilts/build-tools/prebuilt_py3-launcher/linux_glibc_x86_64/e0c56be2b0b4cd8e6040d6ad4670d513/py3-launcher -> /data/develop/android/OmniROM_15.0/prebuilts/build-tools/linux-x86/bin/py3-launcher64
 93112008      0 lrwxrwxrwx   1 xtrnaw7  xtrnaw7        53 Nov 22 08:15 ./out/target/product/zenfone8/obj/DTBO_OBJ/source -> /data/develop/android/OmniROM_15.0/kernel/asus/sm8350
 92719408      0 lrwxrwxrwx   1 xtrnaw7  xtrnaw7        53 Nov 22 08:15 ./out/target/product/zenfone8/obj/DTB_OBJ/source -> /data/develop/android/OmniROM_15.0/kernel/asus/sm8350
 88787018      0 lrwxrwxrwx   1 xtrnaw7  xtrnaw7        53 Nov 22 08:17 ./out/target/product/zenfone8/obj/PACKAGING/kernel_modules_intermediates/lib/modules/5.4.147-Omni-qgki-perf-gf532250e9298/source -> /data/develop/android/OmniROM_15.0/kernel/asus/sm8350
 88787020      4 lrwxrwxrwx   1 xtrnaw7  xtrnaw7        77 Nov 21 23:46 ./out/target/product/zenfone8/obj/PACKAGING/kernel_modules_intermediates/lib/modules/5.4.147-Omni-qgki-perf-gf532250e9298/build -> /data/develop/android/OmniROM_15.0/out/target/product/zenfone8/obj/KERNEL_OBJ
 88920483      0 lrwxrwxrwx   1 xtrnaw7  xtrnaw7        53 Nov 22 08:15 ./out/target/product/zenfone8/obj/KERNEL_OBJ/source -> /data/develop/android/OmniROM_15.0/kernel/asus/sm8350
[ OmniRom 15 - xtrnaw7@t15g /data/develop/android/OmniROM_15.0 ] $



Before starting another build after moving the directories with the repositories you must correct these links (or clean the directory ./out)



Log files

The verbose log of the compile script is always written to a compressed file in the output directory, e.g.:

ls -ltr /data/develop/android/OmniROM_15.0/out/verbose.log*
[ OmniRom 15 - xtrnaw7@t15g /data/develop/android/OmniROM_15.0 ] $ ls -ltr /data/develop/android/OmniROM_15.0/out/verbose.log.*
-rw-rw-r--. 1 xtrnaw7 xtrnaw7 15784891 Nov 21 20:40 /data/develop/android/OmniROM_15.0/out/verbose.log.2.gz
-rw-rw-r--. 1 xtrnaw7 xtrnaw7  8424003 Nov 21 23:51 /data/develop/android/OmniROM_15.0/out/verbose.log.1.gz
-rw-rw-r--. 1 xtrnaw7 xtrnaw7    54282 Nov 22 08:23 /data/develop/android/OmniROM_15.0/out/verbose.log.gz
[ OmniRom 15 - xtrnaw7@t15g /data/develop/android/OmniROM_15.0 ] $




List available commands


To list all known commands for building the images use the alias hmm:

hmm
[ OmniRom 15 - xtrnaw7@t15g /data/develop/android/OmniROM_15.0 ] $ hmm

Run "m help" for help with the build system itself.

Invoke ". build/envsetup.sh" from your shell to add the following functions to your environment:
- lunch:      lunch <product_name>-<release_type>-<build_variant>
              Selects <product_name> as the product to build, and <build_variant> as the variant to
              build, and stores those selections in the environment to be read by subsequent
              invocations of 'm' etc.
- tapas:      tapas [<App1> <App2> ...] [arm|x86|arm64|x86_64] [eng|userdebug|user]
              Sets up the build environment for building unbundled apps (APKs).
- banchan:    banchan <module1> [<module2> ...] \
                      [arm|x86|arm64|riscv64|x86_64|arm64_only|x86_64only] [eng|userdebug|user]
              Sets up the build environment for building unbundled modules (APEXes).
- croot:      Changes directory to the top of the tree, or a subdirectory thereof.
- m:          Makes from the top of the tree.
- mm:         Builds and installs all of the modules in the current directory, and their
              dependencies.
- mmm:        Builds and installs all of the modules in the supplied directories, and their
              dependencies.
              To limit the modules being built use the syntax: mmm dir/:target1,target2.
- mma:        Same as 'mm'
- mmma:       Same as 'mmm'
- provision:  Flash device with all required partitions. Options will be passed on to fastboot.
- cgrep:      Greps on all local C/C++ files.
- ggrep:      Greps on all local Gradle files.
- gogrep:     Greps on all local Go files.
- jgrep:      Greps on all local Java files.
- jsongrep:   Greps on all local Json files.
- ktgrep:     Greps on all local Kotlin files.
- resgrep:    Greps on all local res/*.xml files.
- mangrep:    Greps on all local AndroidManifest.xml files.
- mgrep:      Greps on all local Makefiles and *.bp files.
- owngrep:    Greps on all local OWNERS files.
- rsgrep:     Greps on all local Rust files.
- sepgrep:    Greps on all local sepolicy files.
- sgrep:      Greps on all local source files.
- tomlgrep:   Greps on all local Toml files.
- pygrep:     Greps on all local Python files.
- godir:      Go to the directory containing a file.
- allmod:     List all modules.
- gomod:      Go to the directory containing a module.
- pathmod:    Get the directory containing a module.
- outmod:     Gets the location of a module's installed outputs with a certain extension.
- dirmods:    Gets the modules defined in a given directory.
- installmod: Adb installs a module's built APK.
- refreshmod: Refresh list of modules for allmod/gomod/pathmod/outmod/installmod.
- syswrite:   Remount partitions (e.g. system.img) as writable, rebooting if necessary.

Environment options:
- SANITIZE_HOST: Set to 'address' to use ASAN for all host modules.
- ANDROID_QUIET_BUILD: set to 'true' to display only the essential messages.

Look at the source to view more functions. The complete list is:
adb addcompletions add_lunch_combo banchan build_build_var_cache check_type _complete_android_module_names cproj _croot croot destroy_build_var_cache enable_zsh_completion fastboot _get_abs_build_var_cached _get_build_var_cached get_host_prebuilt_prefix get_make_command _gettop_once godir gomod _lunch lunch _lunch_completion _lunch_meat _lunch_usage make printconfig print_lunch_menu runhat set_global_paths set_lunch_paths set_sequence_number set_stuff_for_environment should_add_completion showcommands source_vendorsetup tapas validate_current_shell
[ OmniRom 15 - xtrnaw7@t15g /data/develop/android/OmniROM_15.0 ] $




Most of the commands used to build AOSP images are functions or aliases defined in the file ./build/envsetup. To check the source code for the commands, either read that file or use

typeset -f command




Trouble Shooting

see Some hints for repo sync troubleshooting for how to fix some common errors while executing the command "repo sync".

see Some hints for fixing errors building an Custom ROM Android image for how to fix some common errors while creating the image


Update 25.03.2025

see also How to change name of the ZIP file with the OS image while building a new image




History of this entry

08.03.2025

the repository for vendor/asus is now on gitlab.com


15.01.2025

reworked the HowTo: added missing infos and fixed typos

05.12.2024

corrected/added the infos about the repository necessary to create an OmniROM 15 image with GAPPS


29.11.2024

corrected the branch used for the repository "proprietary_vendor_asus" from DonkeyCoyote


24.11.2024

added infos about how to view the certificate used for the OS currently installed on the phone

22.11.2024

initial release


 

How to compile the OmniROM 16 Custom ROM for the ASUS Zenfone 8


URL: https://xdaforums.com/t/how-to-compile-the-omnirom-13-for-the-android-zenfone-8.4518733/

 
How to compile the OmniROM 16 Custom ROM for the ASUS Zenfone 8



This HowTo is about compiling the OmniROM 16 for the ASUS Zenfone 8.

See How to compile the OmniROM for the ASUS Zenfone 8 for instructions to compile the other versions of the OmniROM for the ASUS Zenfone 8.


Readers who have already built an earlier version of OmniROM can skip most of this post.

New/changed in this HowTos are the information about the recoveries that can be used to install the OmniROM and the details about the build_id used for the lunch and brunch commands
And the list of hardware dependent repositories for the ASUS Zenfone 8, of course.


The commands in this HowTo are intended for the Linux operating system, but it should not be too difficult to convert them into commands for the Windows operating system.




Compiling the Custom ROM OmniROM 16 from within Linux is again a very simple and straight forward process -- the developer for the OmniROM did once again a really amazing good job setting up the build environment for the OmniROM 6.

I'm repeating myself here - but it can't be said often enough.



Hardware requirements

Message from the repo tool:

"The minimum required amount of free memory is around 16GB, and even with that, some configurations may not work."

In my experience, the computer on which OmniROM is compiled should have at least 32 GB RAM and 4 CPU cores.


Note that the scripts used to create the OmniROM image start one workspace per CPU and each workspace requires about 4 GB of RAM. Plus about 2 GB RAM for the general tasks.

As of 17.07.2025, the repositories for OmniROM 16, MicroG, GAPPS, and the hardware-specific repositories for the ASUS Zenfone 8 occupy about 260 GB of disk space.

The compile process will occupy additional 65 GB for the temporary output files.
In total, the repositories for OmniROM 16 require around 400 GB of storage space (the space occupied increases with every "repo sync")



Prerequisites

Some of the repositories for OmniROM 16 are on https://gitlab.com and the access to these repositories for the repository sync is done via ssh. Therefore, to sync these repositories a user account on gitlab.com with configured public ssh key is required. The user account on gitlab.com is free of charge and the public ssh key can be uploaded into the user profile on gitlab.com (see here: https://docs.gitlab.com/ee/user/ssh.html)

The repositories on http://github.com are currently accessed via https but that might change in the future. Therefor it's recommended to create a user on github.com and add the ssh public key to the profile of that user also.

Note:

To check how the access to the repositories is configured use this command

[ OmniRom 16 - xtrnaw7@t15g /devpool001/develop/OmniROM_16.0 ] $ date
Thu Jul 17 08:22:22 PM CEST 2025
[ OmniRom 16 - xtrnaw7@t15g /devpool001/develop/OmniROM_16.0 ] $

[ OmniRom 16 - xtrnaw7@t15g /devpool001/develop/OmniROM_16.0 ] $ grep fetch $( find .repo -maxdepth 2   -name "*xml"  )
.repo/manifests/default.xml:           fetch="https://android.googlesource.com"
.repo/manifests/omni-aosp.xml:           fetch="https://github.com/" />
.repo/manifests/omni-aosp.xml:           fetch="ssh://git@gitlab.com/omnirom" />
.repo/manifests/omni-aosp.xml:           fetch="https://github.com/omnirom"
.repo/manifests/omni-aosp.xml:           fetch="ssh://git@github.com/omnirom"
.repo/manifests/omni-caf.xml:           fetch="https://github.com/" />
.repo/manifests/omni-caf.xml:           fetch="https://git.codelinaro.org/clo/la"
.repo/manifests/omni-private.xml:           fetch="ssh://git@github.com/omnirom"
.repo/local_manifests/local_manifest.xml:        fetch="https://github.com/DonkeyCoyote" />
[ OmniRom 16 - xtrnaw7@t15g /devpool001/develop/OmniROM_16.0 ] $ 



Use the commands

ssh git@github.com

ssh git@gitlab.com

to test the access via ssh and add the ssh hostkeys of the hosts github.com and gitab.com to the known_hosts file.


Or use

grep  "^gitlab.com"  ~/.ssh/known_hosts  || ssh-keyscan gitlab.com >>~/.ssh/known_hosts

grep  "^github.com"
  ~/.ssh/known_hosts || ssh-keyscan github.com >>~/.ssh/known_hosts

to add the ssh hostkeys of the repository server used to the local known_hosts file of the user used to retrieve the repositories.


It's recommended to start the ssh-agent and load the private ssh keys before starting the sync of the repositories, e.g. if no global ssh-agent is running use:

$( eval ssh-agent )
ssh-add

Use

ssh-add -l

to list the ssh keys already loaded by the ssh-agent.

Note

Example output for a working access:

[xtrnaw7@arcolinux OmniROM_15.0]$  ssh git@gitlab.com
PTY allocation request failed on channel 0
Welcome to GitLab, @bnsmb01!
Connection to gitlab.com closed.
[xtrnaw7@arcolinux OmniROM_15.0]$

[xtrnaw7@arcolinux OmniROM_15.0]$ ssh git@github.com
PTY allocation request failed on channel 0
Hi bnsmb! You've successfully authenticated, but GitHub does not provide shell access.
Connection to github.com closed.
[xtrnaw7@arcolinux OmniROM_15.0]$



If you have not used git on this machine before, you must set some global git variables:

git config --global user.email <your_email_address>

git config --global user.name <your name>




The tool repo is required to maintain the repositories for the OmniROM 16; you can download the tool "repo" from https://gerrit.googlesource.com/git-repo or download it with this command:

curl https://storage.googleapis.com/git-repo-downloads/repo > ./repo && chmod a+x ./repo  


The script repo should be added to a directory available via the environment variable PATH.

It's not necessary to install additional tools for creating an OmniROM 16 image -- all necessary tools to create the image are in the repositories for the OmniROM 16, with one exception:


If you are compiling the OmniROM image on a machine running Linux, the source code for some of the tools to create the OmniROM 16 image requires the header files and libraries for OpenSSL.

Under Fedora, these files can be installed using these commands:

sudo dnf install openssl openssl-libs openssl-devel

and additionally for distributions in which the OpenSSL engine is not part of the OpenSSL package anymore (as in Fedora 41):

sudo dnf install openssl-devel-engine




The repositories used for the OmniROM 16 use the git command line extension git lfs. At least in Fedora this extension is not installed by default while installing git. In Fedora git lfs can be installed using this command:

sudo dnf install git-lfs 


Use the command

git lfs install

to initialize git lfs extension.



Creating the local copies of the repositories for the OmniROM 16


Most (but not all) of the necessary steps to sync the repositories necessary to create an OmniROM 16 installation image are described in the section "Getting Started" here: https://github.com/omnirom/android/tree/android-16 but some instructions are missing the details.


To create a local copy of the repositories for OmniROM 16 these steps are required:


First create a new directory for the repositories and change the working directory to the new directory, e.g.:

mkdir /data/develop/android/OmniROM_16.0

cd /data/develop/android/OmniROM_16.0



Then init the local repositories using the command:

repo init -u https://github.com/omnirom/android.git -b android-16 --git-lfs


Note that the command repo init only creates a hidden directory called .repo.

Next sync the local repositories.

There are now two commands necessary to sync the repositories (the instructions below are copied from https://github.com/omnirom/android/tree/android-16):

"
Add this alias in your ~/.bashrc for an automatically sync :

alias repo-lfs="repo sync && repo forall -c git lfs pull"

Then reload your file with source ~/.bashrc in the terminal

Then to sync up with the lfs repo:

repo-lfs
"

Notes

Another useful alias for the repository sync is:

alias repo-lfs-force="repo sync --force-sync && repo forall -c git lfs pull"




The initial repository sync will download all repositories necessary to create the OmniROM 16 image except the hardware dependent repositories (these repos are different for the various phone models).

Therefor you must add the repositories for the vendor and device tree for your phone to the manifests in the local repositories after the download finished.

This should be done in the file .repo/local_manifests/local_manifest.xml (just create the directory .repo/local_manifests if it does not exist).

For the ASUS Zenfone 8 the file should look like this:

[xtrnaw7@gem10 /datapool04/develop/OmniROM_16.0]$ date
Fr 20. Feb 12:01:31 CET 2026
[xtrnaw7@gem10 /datapool04/develop/OmniROM_16.0]$

[xtrnaw7@gem10 /datapool04/develop/OmniROM_16.0]$ cat .repo/local_manifests/local_manifest.xml
<?xml version="1.0" encoding="UTF-8"?>

<manifest>
    <remote  name="DonkeyCoyote"
            fetch="https://github.com/DonkeyCoyote" />
    <project path="vendor/asus" name="android_vendor_asus" remote="gitlab" revision="android-16" />
    <project path="vendor/microg" name="android_prebuilts_prebuiltapks_bare" remote="omnirom" revision="android-16" />
    <project path="vendor/gapps" name="android_vendor_gapps" remote="gitlab" revision="android-16" />
</manifest>
[xtrnaw7@gem10 /datapool04/develop/OmniROM_16.0]$



Notes:

The repository android_prebuilts_prebuiltapks is only necessary for OmniROM 16 images that should include the MicroG packages.

The repository android_vendor_gapps is only necessary for OmniROM 16 images that should include the Google Apps.




The repositories configured in the file .repo/manifests/omni-private.xml are private repositories. To use these repositories, access to these repositories must be configured by the admin of the repositories (see https://github.com/omnirom/android). The packages installed using these repositories are only optional and OmniROM can be compiled without them.

To disable the private repositories comment or delete the lines starting with "<project path" in the file .repo/manifests/omni-private.xml -- but do NOT delete the file or remove the include statement for this file in the file .repo/manifests/omni-default.xml (as described here https://github.com/omnirom/android/tree/android-16):
 
The definition for the remote repository omnirom2 can be found in this file and omnirom2 is the default remote repository used to synchronize missing repositories in the python script roomservice.py.

Details


contents of the file .repo/manifests/omni-private.xml
  OmniRom 16 - xtrnaw7@t15g /devpool001/develop/OmniROM_16.0 ] $ date
Thu Jul 17 08:28:11 PM CEST 2025
[ OmniRom 16 - xtrnaw7@t15g /devpool001/develop/OmniROM_16.0 ] $

[ OmniRom 16 - xtrnaw7@t15g /devpool001/develop/OmniROM_16.0 ] $ cat .repo/manifests/omni-private.xml
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
  <remote  name="omnirom2"
           fetch="ssh://git@github.com/omnirom"
           review="gerrit.omnirom.org" />

  <!-- private OmniROM Projects -->
  <project path="packages/apps/OmniSwitch" name="android_packages_apps_OmniSwitch" remote="omnirom2" revision="android-14.0" />
  <project path="packages/services/OmniJaws" name="android_packages_services_OmniJaws" remote="omnirom2" revision="android-15" />
  <project path="packages/apps/OmniRemote" name="android_packages_apps_OmniRemote" remote="omnirom2" revision="android-15" />
  <project path="packages/apps/OmniControl" name="android_packages_apps_OmniControl" remote="omnirom2" revision="android-15" />
  <project path="packages/apps/OmniOta" name="android_packages_apps_OmniOta" remote="omnirom2" revision="android-15" />
  <project path="packages/apps/OmniWallpaper" name="android_packages_apps_OmniWallpaper" remote="omnirom2" revision="android-15" />
</manifest>
[ OmniRom 16 - xtrnaw7@t15g /devpool001/develop/OmniROM_16.0 ] $




grep "default_rem |default_team_rem "  ../OmniROM_14.0/vendor/omni/build/tools/roomservice.py

[ OmniRom 16 - xtrnaw7@t15g /devpool001/develop/OmniROM_16.0 ] $  egrep "default_rem |default_team_rem "  ../OmniROM_14.0/vendor/omni/build/tools/roomservice.py

default_rem = "omnirom2"
default_team_rem = "omnirom2"
[ OmniRom 16 - xtrnaw7@t15g /devpool001/develop/OmniROM_16.0 ] $




After you have updated the file local_manifest.xml, run another

repo-lfs

to synchronize the added repositories. This time the download will be faster as only the additional repos will be downloaded.


Now you can start the build with these commands:

# optional:
#
# to build an OmniROM image with MicroG packages, set the environment variable ROM_BUILDTYPE to MICROG before starting the build
# (of course this only works if the repositories with MicroG are configured in the manifest files)
#
# to build an OmniROM image with GAPPS packages, set the environment variable ROM_BUILDTYPE to GAPPS before starting the build.
# (of course this only works if the repositories with GAPPS are configured in the manifest files)
#
export ROM_BUILDTYPE=MICROG

. build/envsetup.sh

lunch omni_zenfone8-bp2a-user

brunch zenfone8 bp2a user


in the directory with the downloaded repositories (Note: The command "breakast" to list all possible targets does not work in the repositories for OmniROM 16)

Be aware that the first time the compile process may take a long time (4 hours or more)


Note that the build_id, bp2a in this example, is patchset dependent; bp2a is the value for the patchset 2025-06-05. To get the current build_id used in the repository use the script print_security_patch, e.g.

[xtrnaw7@t15g /devpool001/develop/OmniROM_16.0]$ print_security_patch
Retrieving the security patch level for the repository at "/devpool001/develop/OmniROM_16.0" ...
The repository uses the new definitions
The current security patch is "2025-06-05"
The current build_id is "bp2a"
[xtrnaw7@t15g /devpool001/develop/OmniROM_16.0]$

(The list of known build-ids is available here: https://source.android.com/docs/setup/reference/build-numbers)


If everything is OK, there will be a ZIP file with your own custom OmniROM 16 image in the directory ./out/target/product/zenfone8/ when the compilation script is finished, e.g. for images with the MicroG packages:

[ OmniRom 16 - xtrnaw7@t15g /data/develop/android/OmniROM_16.0 ] $  ls -i -l out/target/product/zenfone8/omni-16-*zip
97953082 -rw-rw-r--. 1 xtrnaw7 xtrnaw7 1426897040 Jul 17 19:16 out/target/product/zenfone8/omni-16-20250717-zenfone8-MICROG.zip
97953086 -rw-rw-r--. 3 xtrnaw7 xtrnaw7 1672061231 Jul 18 18:43 out/target/product/zenfone8/omni-16-20250718-zenfone8-GAPPS.zip
[ OmniRom 16 - xtrnaw7@t15g /data/develop/android/OmniROM_16.0 ] $ 


The image can now be installed on the ASUS Zenfone 8 with the LineageOS 18 Recovery or TWRP. You can also use the OrangeFox Recovery for the ASUS Zenfone 8 to install the OS image.
( see How to compile the OrangeFox Recovery for the ASUS Zenfone 8 for instructions to create an OrangeFox recovery for the ASUS Zenfone 8 or download the OrangeFox Recovery image fro the ASUS Zenfone 8 from here:
http://bnsmb.de/files/public/Android/OrangeFox-R11.3-Unofficial-I006D-2025-07-23.img)




Notes





Note that any new OmniROM 16 image created with the command brunch for the same ROM buildtype (e.g. MICROG or GAPPS) will overwrite the existing OmniROM 16 image (the name of the image is different, but the inodes used are the same for all zip files):

[ OmniRom 16 - xtrnaw7@t15g /devpool001/develop/OmniROM_16.0 ] $ ls -li out/target/product/zenfone8/*zip
5869545 -rw-rw-r--. 6 xtrnaw7 xtrnaw7 1426896732 Jul 24 18:58 out/target/product/zenfone8/omni-16-20250717-zenfone8-MICROG.zip
5869545 -rw-rw-r--. 6 xtrnaw7 xtrnaw7 1426896732 Jul 24 18:58 out/target/product/zenfone8/omni-16-20250719-zenfone8-MICROG.zip
5869545 -rw-rw-r--. 6 xtrnaw7 xtrnaw7 1426896732 Jul 24 18:58 out/target/product/zenfone8/omni-16-20250724-zenfone8-MICROG.zip
5869545 -rw-rw-r--. 6 xtrnaw7 xtrnaw7 1426896732 Jul 24 18:58 out/target/product/zenfone8/omni_zenfone8-ota.zip
[ OmniRom 16 - xtrnaw7@t15g /devpool001/develop/OmniROM_16.0 ] $

[ OmniRom 16 - xtrnaw7@t15g /devpool001/develop/OmniROM_16.0 ] $ cksum out/target/product/zenfone8/*zip
1710878806 1426896732 out/target/product/zenfone8/omni-16-20250717-zenfone8-MICROG.zip
1710878806 1426896732 out/target/product/zenfone8/omni-16-20250719-zenfone8-MICROG.zip
1710878806 1426896732 out/target/product/zenfone8/omni-16-20250724-zenfone8-MICROG.zip
1710878806 1426896732 out/target/product/zenfone8/omni_zenfone8-ota.zip
[ OmniRom 16 - xtrnaw7@t15g /devpool001/develop/OmniROM_16.0 ] $


You should therefore copy the existing zip file with the image to a new directory before building a new image.



Certificates for the OS images

For OS images that are to be used on the phone for daily use, I strongly recommend creating your own certificates for the operating system.

In the OmniROM development directory tree the necessary files, platform.pk8 and platform.x509.pem, are in the directory

./build/make/target/product/security

in your build tree for the Custom ROM, e.g.

[ OmniRom 15 - xtrnaw7@t15g /devpool001/develop/OmniROM_16.0 ] $ ls -l ./build/make/target/product/security/platform.*
-rw-rw-r--. 1 xtrnaw7 xtrnaw7 1219 Jul 17 16:43 ./build/make/target/product/security/platform.pk8
-rw-rw-r--. 1 xtrnaw7 xtrnaw7 1460 Jul 17 16:43 ./build/make/target/product/security/platform.x509.pem
[ OmniRom 15 - xtrnaw7@t15g /devpool001/develop/OmniROM_16.0 ] $


Replace these files with your own certificate files and recreate the image using the command brunch (see above).

Please note that there is more than one certificate in the directory  ./build/make/target/product/security. Which one is used depends on the type of ROM to be created (e.g. user, user-eng, debug). You should therefore replace all certificates in this directory with your own certificates.


See here https://source.android.com/devices/tech/ota/sign_builds for how to create your own certificate.

To manually create the certificate and keys use these commands:
To manually create the certificate and keys use these commands:


Android uses 2048-bit RSA keys with public exponent 3. You can generate certificate/private key pairs using the openssl tool from openssl.org:

# generate RSA key
#
[xtrnaw7@t15g /data/develop/android/test1]$
openssl genrsa -3 -out temp.pem 2048
[xtrnaw7@t15g /data/develop/android/test1]$ ls -ltr
total 4
-rw-------. 1 xtrnaw7 xtrnaw7 1704 Nov 14 13:24 temp.pem


# create a certificate with the public part of the key
#
[xtrnaw7@t15g /data/develop/android/test1]$
openssl req -new -x509 -key temp.pem -out releasekey.x509.pem -days 10000 -subj  '/C=DE/ST=Hessen/L=Frankfurt am Main/O=Android/OU=Android/CN=Android/emailAddress=bnsmb01@gmail.com'
[xtrnaw7@t15g /data/develop/android/test1]$


[xtrnaw7@t15g /data/develop/android/test1]$ ls -ltr
total 8
-rw-------. 1 xtrnaw7 xtrnaw7 1704 Nov 14 13:24 temp.pem
-rw-rw-r--. 1 xtrnaw7 xtrnaw7 1456 Nov 14 13:25 releasekey.x509.pem
[xtrnaw7@t15g /data/develop/android/test1]$



# create a PKCS#8-formatted version of the private key
#
[xtrnaw7@t15g /data/develop/android/test1]$
openssl pkcs8 -in temp.pem -topk8 -outform DER -out releasekey.pk8 -nocrypt
[xtrnaw7@t15g /data/develop/android/test1]$



[xtrnaw7@t15g /data/develop/android/test1]$ ls -ltr
total 12
-rw-------. 1 xtrnaw7 xtrnaw7 1704 Nov 14 13:24 temp.pem
-rw-rw-r--. 1 xtrnaw7 xtrnaw7 1456 Nov 14 13:25 releasekey.x509.pem
-rw-------. 1 xtrnaw7 xtrnaw7 1218 Nov 14 13:25 releasekey.pk8
[xtrnaw7@t15g /data/develop/android/test1]$


# securely delete the temp.pem file

#
[xtrnaw7@t15g /data/develop/android/test1]$ shred --remove temp.pem
[xtrnaw7@t15g /data/develop/android/test1]$


[xtrnaw7@t15g /data/develop/android/test1]$ ls -ltr
total 8
-rw-rw-r--. 1 xtrnaw7 xtrnaw7 1456 Nov 14 13:25 releasekey.x509.pem
-rw-------. 1 xtrnaw7 xtrnaw7 1218 Nov 14 13:25 releasekey.pk8
[xtrnaw7@t15g /data/develop/android/test1]$ 


From the documentation:

The openssl pkcs8 command given above creates a .pk8 file with no password, suitable for use with the build system. To create a .pk8 secured with a password (which you should do for all actual release keys), replace the -nocrypt argument with -passout stdin; then openssl will encrypt the private key with a password read from standard input. No prompt is printed, so if stdin is the terminal the program will appear to hang when it's really just waiting for you to enter a password. Other values can be used for the-passout argument to read the password from other locations; for details, see the openssl documentation.

The temp.pem intermediate file contains the private key without any kind of password protection, so dispose of it thoughtfully when generating release keys. In particular, the GNUshred utility may not be effective on network or journaled filesystems. You can use a working directory located in a RAM disk (such as a tmpfs partition) when generating keys to ensure the intermediates are not inadvertently exposed.



To view the certificates in the repository used to build the images use this command (for all of the .pem files in that directory!):

openssl x509 -in ./build/make/target/product/security/platform.x509.pem -text -noout


To view the certificate used for the installed OS on the phone use the command

unzip -p /system/etc/security/otacerts.zip *.pem | openssl x509 -text


Note:

The executable openssl is not part of the standard Android OS and also not part of the OmniROM. A Magisk Module with openssl is available on my website : see here

The openssl binary from that Magisk Module can also be used without installing the Magisk Module. For that download the ZIP file with the Magisk Module and extract the openssl binary:

  unzip -p openssl_*.zip  system/usr/bin/openssl >openssl


Or download the openssl binary for Android on arm64 CPUs from here

https://bnsmb.de/files/public/Android/binaries_for_arm64/openssl


Now copy the file openssl just created to the phone into the directory /data/local/tmp and make it executable:

chmod 755 /data/local/tmp/openssl



Updating the local repositories

To update the local repositories, change the working directory to the directory with the repositories for OmniROM 16 and execute

repo-lfs

(This only works if you have created the bash alias as described above)


After the synchronization is complete, create a new ROM image using the commands described above.

It is recommended to update the local repositories and create a new image at least once a month after the new security patches for Android are added to the repositories for OmniROM 16.


To view the date of the security patch in the source files for the OmniROM 16 the shell script print_security_patch can be used; example:

[ OmniRom 16 - xtrnaw7@t15g /devpool001/develop/OmniROM_16.0 ] $ date
Thu Jul 17 08:32:57 PM CEST 2025
[ OmniRom 16 - xtrnaw7@t15g /devpool001/develop/OmniROM_16.0 ] $

[ OmniRom 16 - xtrnaw7@t15g /devpool001/develop/OmniROM_16.0 ] $ print_security_patch
Retrieving the security patch level for the repository at "/devpool001/develop/OmniROM_16.0" ...
The repository uses the new definitions
The current security patch is "2025-06-05"
The current build_id is "bp2a"
[ OmniRom 16 - xtrnaw7@t15g /devpool001/develop/OmniROM_16.0 ] $




To check if the new security patch has already been applied to the OmniROM repositories, check the Gerrit for OmniROM : https://gerrit.omnirom.org/q/status:merged


See How to apply the Android Security patches to a local repository for how to apply an Android Security patch to the local repository in case you want to manually add the Android security patch to your local repositories.



Moving the repositories to another directory

In case you want to move the repositories for OmniROM 16 to another directory or rename the directory with the repositories:

Be aware that the make scripts create some absolute links in the output directory; to list these absolute links use this command while in the directory with the repositories for OmniROM 16 :

find . -type l -ls | grep "$PWD"


e.g. there are currently still some absolute links in the output directory for OmniROM 16:

[ OmniRom 16 - xtrnaw7@t15g /devpool001/develop/OmniROM_16.0 ] $ find . -type l -ls | grep "$PWD" | wc -l
7
[ OmniRom 16 - xtrnaw7@t15g /devpool001/develop/OmniROM_16.0 ] $

[ OmniRom 16 - xtrnaw7@t15g /devpool001/develop/OmniROM_16.0 ] $ find . -type l -ls | grep "$PWD"
  3880508      2 lrwxrwxrwx   1 xtrnaw7  xtrnaw7        83 Jul 17 08:21 ./out/soong/.intermediates/prebuilts/build-tools/prebuilt_py3-launcher/linux_glibc_x86_64/py3-launcher -> /devpool001/develop/OmniROM_16.0/prebuilts/build-tools/linux-x86/bin/py3-launcher64
  3880266      2 lrwxrwxrwx   1 xtrnaw7  xtrnaw7        91 Jul 17 08:21 ./out/soong/.intermediates/prebuilts/build-tools/prebuilt_py3-launcher-autorun/linux_glibc_x86_64/py3-launcher-autorun -> /devpool001/develop/OmniROM_16.0/prebuilts/build-tools/linux-x86/bin/py3-launcher-autorun64
  5836264      2 lrwxrwxrwx   1 xtrnaw7  xtrnaw7        51 Jul 17 19:08 ./out/target/product/zenfone8/obj/DTBO_OBJ/source -> /devpool001/develop/OmniROM_16.0/kernel/asus/sm8350
  5838361      2 lrwxrwxrwx   1 xtrnaw7  xtrnaw7        51 Jul 17 19:08 ./out/target/product/zenfone8/obj/KERNEL_OBJ/source -> /devpool001/develop/OmniROM_16.0/kernel/asus/sm8350
  5837427      2 lrwxrwxrwx   1 xtrnaw7  xtrnaw7        51 Jul 17 19:10 ./out/target/product/zenfone8/obj/PACKAGING/kernel_modules_intermediates/lib/modules/5.4.147-Omni-qgki-perf-g240d49fe1088/source -> /devpool001/develop/OmniROM_16.0/kernel/asus/sm8350
  5835666      2 lrwxrwxrwx   1 xtrnaw7  xtrnaw7        75 Jul 17 15:00 ./out/target/product/zenfone8/obj/PACKAGING/kernel_modules_intermediates/lib/modules/5.4.147-Omni-qgki-perf-g240d49fe1088/build -> /devpool001/develop/OmniROM_16.0/out/target/product/zenfone8/obj/KERNEL_OBJ
  5836865      2 lrwxrwxrwx   1 xtrnaw7  xtrnaw7        51 Jul 17 19:08 ./out/target/product/zenfone8/obj/DTB_OBJ/source -> /devpool001/develop/OmniROM_16.0/kernel/asus/sm8350
[ OmniRom 16 - xtrnaw7@t15g /devpool001/develop/OmniROM_16.0 ] $



Before starting another build after moving the directories with the repositories you must correct these links (or clean the directory ./out)



Log files

The verbose log of the compile script is always written to a compressed file in the output directory, e.g.:

ls -ltr  ./out/verbose.log*
[xtrnaw7@t15g /devpool001/develop/OmniROM_16.0]$ ls -ltr out/verbose.log.*
-rw-rw-r--. 1 xtrnaw7 xtrnaw7    18181 Jul 17 07:13 out/verbose.log.4.gz
-rw-rw-r--. 1 xtrnaw7 xtrnaw7 37965773 Jul 17 15:01 out/verbose.log.3.gz
-rw-rw-r--. 1 xtrnaw7 xtrnaw7    40313 Jul 17 15:10 out/verbose.log.2.gz
-rw-rw-r--. 1 xtrnaw7 xtrnaw7    71617 Jul 17 16:59 out/verbose.log.1.gz
-rw-rw-r--. 1 xtrnaw7 xtrnaw7    55089 Jul 17 19:16 out/verbose.log.gz
[xtrnaw7@t15g /devpool001/develop/OmniROM_16.0]$





List available commands


To list all known commands for building the images use the function hmm:

hmm
[ OmniRom 15 - xtrnaw7@t15g /data/develop/android/OmniROM_15.0 ] $ hmm

Run "m help" for help with the build system itself.

Invoke ". build/envsetup.sh" from your shell to add the following functions to your environment:
- lunch:      lunch <product_name>-<release_type>-<build_variant>
              Selects <product_name> as the product to build, and <build_variant> as the variant to
              build, and stores those selections in the environment to be read by subsequent
              invocations of 'm' etc.
- tapas:      tapas [<App1> <App2> ...] [arm|x86|arm64|x86_64] [eng|userdebug|user]
              Sets up the build environment for building unbundled apps (APKs).
- banchan:    banchan <module1> [<module2> ...] \
                      [arm|x86|arm64|riscv64|x86_64|arm64_only|x86_64only] [eng|userdebug|user]
              Sets up the build environment for building unbundled modules (APEXes).
- croot:      Changes directory to the top of the tree, or a subdirectory thereof.
- m:          Makes from the top of the tree.
- mm:         Builds and installs all of the modules in the current directory, and their
              dependencies.
- mmm:        Builds and installs all of the modules in the supplied directories, and their
              dependencies.
              To limit the modules being built use the syntax: mmm dir/:target1,target2.
- mma:        Same as 'mm'
- mmma:       Same as 'mmm'
- provision:  Flash device with all required partitions. Options will be passed on to fastboot.
- cgrep:      Greps on all local C/C++ files.
- ggrep:      Greps on all local Gradle files.
- gogrep:     Greps on all local Go files.
- jgrep:      Greps on all local Java files.
- jsongrep:   Greps on all local Json files.
- ktgrep:     Greps on all local Kotlin files.
- resgrep:    Greps on all local res/*.xml files.
- mangrep:    Greps on all local AndroidManifest.xml files.
- mgrep:      Greps on all local Makefiles and *.bp files.
- owngrep:    Greps on all local OWNERS files.
- rsgrep:     Greps on all local Rust files.
- sepgrep:    Greps on all local sepolicy files.
- sgrep:      Greps on all local source files.
- tomlgrep:   Greps on all local Toml files.
- pygrep:     Greps on all local Python files.
- godir:      Go to the directory containing a file.
- allmod:     List all modules.
- gomod:      Go to the directory containing a module.
- pathmod:    Get the directory containing a module.
- outmod:     Gets the location of a module's installed outputs with a certain extension.
- dirmods:    Gets the modules defined in a given directory.
- installmod: Adb installs a module's built APK.
- refreshmod: Refresh list of modules for allmod/gomod/pathmod/outmod/installmod.
- syswrite:   Remount partitions (e.g. system.img) as writable, rebooting if necessary.

Environment options:
- SANITIZE_HOST: Set to 'address' to use ASAN for all host modules.
- ANDROID_QUIET_BUILD: set to 'true' to display only the essential messages.

Look at the source to view more functions. The complete list is:
adb addcompletions add_lunch_combo banchan build_build_var_cache check_type _complete_android_module_names cproj _croot croot destroy_build_var_cache enable_zsh_completion fastboot _get_abs_build_var_cached _get_build_var_cached get_host_prebuilt_prefix get_make_command _gettop_once godir gomod _lunch lunch _lunch_completion _lunch_meat _lunch_usage make printconfig print_lunch_menu runhat set_global_paths set_lunch_paths set_sequence_number set_stuff_for_environment should_add_completion showcommands source_vendorsetup tapas validate_current_shell
[ OmniRom 15 - xtrnaw7@t15g /data/develop/android/OmniROM_15.0 ] $





Most of the commands used to build AOSP images are functions or aliases defined in the file ./build/envsetup. To check the source code for the commands, either read that file or use

typeset -f command




Trouble Shooting

see Some hints for repo sync troubleshooting for how to fix some common errors while executing the command "repo sync".

see Some hints for fixing errors building an Custom ROM Android image for how to fix some common errors while creating the image

see also How to change name of the ZIP file with the OS image while building a new image




 
 
History of this entry

24.07.2025

updated the infos about the recoveries that can be used to install the OmniROM image
fixed some minor typos


17.07.2025

initial release


 

Instructions to compile other Custom ROMs for the ASUS Zenfone 8



General hints for compiling other Custom ROMs


URL: not yet published


General hints for compiling other Custom ROMs
This section contains general hints for compiling LineageOS based Custom ROMs for the ASUS Zenfone 8 that apply to all Custom ROMs.



The perl binary in the repository for the LineageOS and LineageOS based Custom ROMs requires the library libcrypt.so.1 (even in the repositories for LineageOS 24.x). 

This library is missing in most current Linux Distributions and must be installed manually -- see libcrypt.so.1 is required to build a LineageOS based Custom ROM for details.

This also applies for the repositories with the OrangeFox recovery.


11.09.2026

To compile recent Custom ROMs based on LineageOS 24.x for the ASUS Zenfone 8 these device dependent repositories must be used:

<?xml version="1.0" encoding="UTF-8"?>
<manifest>

  <project path="device/asus/sake"   name="LineageOS/android_device_asus_sake" remote="github" revision="lineage-24.0" />

  <project path="vendor/asus/sake"   name="TheMuppets/proprietary_vendor_asus_sake"  remote="github" revision="lineage-23.2" />

  <project path="kernel/asus/sm8350" name="LineageOS/android_kernel_asus_sm8350" remote="github" revision="lineage-24.0" />

</manifest>


Note:

As of 20.09.2026 there is no revision 24.0 for the repository TheMuppets/proprietary_vendor_asus_sake.


29.01.2026

To compile recent Custom ROMs based on LineageOS 23.x (code bp4a or newer) for the ASUS Zenfone 8 these device dependent repositories must be used:

<?xml version="1.0" encoding="UTF-8"?>
<manifest>

  <project path="device/asus/sake"   name="LineageOS/android_device_asus_sake" remote="github" revision="lineage-23.2" />

  <project path="vendor/asus/sake"   name="TheMuppets/proprietary_vendor_asus_sake"  remote="github" revision="lineage-23.2"  />

  <project path="kernel/asus/sm8350" name="LineageOS/android_kernel_asus_sm8350" remote="github" revision="lineage-23.2" />

</manifest>



----


History of this entry

20.09.2026

add the hint about the libcryp library required by the perl binary in the repositories

11.09.2026

add the repository list for Lineage 24.0 based Custom ROMs for the ASUS Zenfone 8

29.01.2026

initial release


----



How to compile other Custom ROMs for the ASUS Zenfone 8


URL: https://xdaforums.com/t/how-to-compile-other-customroms-for-the-asus-zenfone-8.4753652/


How to compile other Custom ROMs for the ASUS Zenfone 8

This section contains links to instructions to compile various Custom ROMs and Recovery images for the ASUS Zenfone 8.

Note that the links to the instructions to compile the OmniROM for the ASUS Zenfone 8 can be found here: How to compile the OmniROM for the ASUS Zenfone 8


Please always check the section General hints for compiling other Custom ROMs before compiling one of the LineageOS based Custom ROMs for the ASUS Zenfone 8.


HowTos to compile other custom ROMs for the ASUS Zenfone 8 are :

Custom ROM
based on
HowTo
git repository
official supported?
Comment
LineageOS 22.2 (unofficial, Android 15)

How to compile LineageOS 22.x Custom ROM for the ASUS Zenfone 8
https://github.com/LineageOS/android.git no

LineageOS 22.2 (official, Android 15)

How to compile the official LineageOS 22.2 Custom ROM for the ASUS Zenfone 8 https://github.com/LineageOS/android.git yes

LineageOS 23.0 (official, Android 16)
How to compile the official LineageOS 23.0 Custom ROM for the ASUS Zenfone 8 https://github.com/LineageOS/android.git yes







/e/ (Android 13)
LineageOS 20.x
Compiling the /e/ Custom ROM for the ASUS Zenfone 8 using the docker image  
https://gitlab.e.foundation/e/os/releases.git yes (community)

/e/ (Android 15) LineageOS 22.x How to compile the /e/ based on Android 15 for the ASUS Zenfone 8
https://gitlab.e.foundation/e/os/releases.git yes (community)






crDroid 11.7 (Android 15)
LineageOS 22.x How to compile the crDroid 11.x Custom ROM for the ASUS Zenfone 8 
https://github.com/crdroidandroid/android.git no

crDroid 12.3 (Android 16)
LineageOS 23.x
How to compile the crDroid 12.x Custom ROM for the ASUS Zenfone 8 https://github.com/crdroidandroid/android.git no







evolutionX 10.7 (Android 15)
LineageOS 22.x How to compile the evolutionX 10.7 Custom ROM for the ASUS Zenfone 8 https://github.com/Evolution-X/manifest no

evolutionX 11.4 (Android 16) LineageOS 23.x
How to compile the evolutionX 11.4 Custom ROM for the ASUS Zenfone 8 https://github.com/Evolution-X/manifest no

evolutionX 11.6 (Android 16) LineageOS 23.2
How to compile the evolutionX 11.6 Custom ROM for the ASUS Zenfone 8 https://github.com/Evolution-X/manifest no







LMODroid 6.2 (Android 15)
LineageOS 22.x How to compile the LMODroid 6.x Custom ROM for the ASUS Zenfone 8
https://git.libremobileos.com/LMODroid/manifest.git yes







iodeOS 4.2 (Android 13)
LineageOS 20.x
How to compile the iodeOS 4.x Custom ROM for the ASUS Zenfone 8 https://gitlab.iode.tech/os/public/manifests/android.git no

iodeOS 6.x (Android 15)
LineageOS 22.x
How to compile the iodeOS 6.x Custom ROM for the ASUS Zenfone 8 https://gitlab.iode.tech/os/public/manifests/android.git no

iodeOS 7.x (Android 16) LineageoS 23.x
How to compile the iodeOS 7.x Custom ROM for the ASUS Zenfone 8 https://gitlab.iode.tech/os/public/manifests/android.git no







DerpFest 16.0 (Android 16)
LineageOS 23.x
How to compile the DerpFest 16.0 Custom ROM for the ASUS Zenfone 8 https://github.com/DerpFest-AOSP/android_manifest.git no









Instructions to compile the TWRP recovery and other recoveries for the ASUS Zenfone 8:

Recovery
HowTo
official
supported?
Comment
TWRP 
How to compile TWRP for the ASUS Zenfone8 yes
This recovery can be used if either OmniROM (any version), LineageOS 19.x or older, or the original Android from ASUS is installed on the phone




OrangeFox
How to compile the OrangeFox Recovery for the ASUS Zenfone 8 no
OrangeFox is a recovery based on TWRP 

This recovery can be used if either OmniROM (any version), LineageOS 19.x or older, or the original Android from ASUS is installed on the phone




TWRP
How to use TWRP if LineageOS 20.x is installed 
How to create a TWRP image for LineageOS based ROMs using a script  
no
This recovery can be used if Lineage 20.x, Lineage 21.x or any Custom ROM based on these LineageOS versions is installed.

Note that it's necessary to create a unique recovery image for each LineageOS version





OrangeFox
How to create a TWRP recovery image for LineageOS 22.x   no
This recovery can be used if Lineage 22.x or any Custom ROM based on this LineageOS version is installed.

Note that it's necessary to create a unique recovery image for each LineageOS version



  




A OrangeFox based recovery for any LineageOS based Custom ROMs on the ASUS Zenfone 8 can be build using the workflows in the repository

https://github.com/bnsmb/OrangeFox-Recovery-Builder-2024

Please check the readme of that repository for instructions to create the recovery.

Note that the workflows on GitHub run on a virtual machine GitHub on a server -- it's not necessary to install or compile anything on your local machine to create a recovery using these workflows.


How to build a Custom ROM with GAPPS for instructions to add the Google Apps (GAPPS) to an OS image

see How to build a Custom ROM with MicroG for instructions to add MicroG to an OS image


see How to compile a LineageOS based Custom ROM for a not official supported phone for general instructions to build an LineageOS based Custom ROM for a not official supported phone

see also this guide Partition images in the file payload.bin for the LineageOS   



History of this entry

12.11.2025

added the link to the instructions to compile iodeOS 4.2
added the link to the instructions to compile iodeOS 6.x
added the link to the generell instructions to build a LineageOS based Custom ROM for not supported phones


05.10.2025

added the link to the instructions to compile LMODroid 6.2
added the links to the HowTos for adding GAPPS or MicroG to an OS image


05.08.2025

initial release



 

Compiling the /e/ Custom ROM for the ASUS Zenfone 8 using the docker image


URL: https://xdaforums.com/t/compiling-e-for-the-asus-zenfone-8-using-the-docker-image.4725317/


Compiling the /e/ Custom ROM for the ASUS Zenfone 8 using the docker image


Update 28.07.2025

The instructions below are for compiling /e/ version based on Android 13.

See How to compile /e/ based on Android 15 for the ASUS Zenfone 8 for instructions to compile the /e/ version based on Android 15.



The official process for building /e/ is to use a Docker image provided by the company that maintains /e/. This is different from the build process for other Custom ROMs but in the end also quite simple.

The build instructions for /e/ are described here:  https://doc.e.foundation/support-topics/build-e

I recommend to read the instructions on that page before continueing with this HowTo.

If you are running Docker on Linux, it is strongly recommended to add your non-root user to the group docker and run all Docker commands as that user.
(without this configuration all docker commands must be executed as user root)

To create an /e/ OS image for the ASUS Zenfone 8, these instructions can be used with a small correction:

To create an /e/ OS image for a phone, you need the device ID for that phone. According to the build instructions for /e/, the device ID can be determined with the command

adb shell getprop ro.product.device

for a phone connected via USB to the PC. But for the ASUS Zenfone 8 running /e/ this fails:


# running OS on the ASUS Zenfone 8 is  /e/ 2.8 for this example; but it's the same if running for example in the OmniROM
#
[xtrnaw7@t15g /data/develop]$ adb shell getprop ro.product.device
ASUS_I006D
[xtrnaw7@t15g /data/develop]$

ASUS_I006D is not the correct build id for the ASUS Zenfone 8; the build id to create an /e/ OS image for the ASUS Zenfone 8 is "sake"


If you want to create an /e/ OS image for another phone and are not sure which device ID to use, see the official device list of /e/:

https://doc.e.foundation/devices


Without using a special configuration for the device-dependent repositories, the scripts used to compile /e/ try to download the necessary files for the device from the LineageOS repositories if possible (see the /e/ build instructions for restrictions).
This works fine for the ASUS Zenfone 8 and in principle it should be possible to build /e/ with the build instructions from https://doc.e.foundation/support-topics/build-e for all phones supported by LineageOS.


The command to install the docker image used to create community or unofficial OS images for /e/ is:

docker pull registry.gitlab.e.foundation:5000/e/os/docker-lineage-cicd:community


After installing the docker image and creating the necessary directories for the build as described in the build instructions the build can be started by starting the docker image.

The command I used to create an /e/ OS image for the ASUS Zenfone 8 is:

docker run \
    -e "BRANCH_NAME=v2.8-t" \
    -e "DEVICE_LIST=sake" \
    -e "DEVICE=ASUS_I006D" \
    -e "SIGN_BUILDS=true" \
    -e "SIGNATURE_SPOOFING=true" \
    -e "WITH_SU=true" \
    -e "CUSTOM_PACKAGES=GmsCore GsfProxy FakeStore MozillaNlpBackend NominatimNlpBackend com.google.android.maps.jar FDroid FDroidPrivilegedExtension" \
    -e "RELEASE_TYPE=UNOFFICIAL" \
    -e "CLEAN_OUTDIR=false" \
    -e "CLEAN_AFTER_BUILD=false" \
    -e "DELETE_OLD_LOGS=5" \
    -e "DELETE_OLD_ZIPS=5" \
    -v "/devpool001/develop/e/src:/srv/src" \
    -v "/devpool001/develop/e/zips:/srv/zips" \
    -v "/devpool001/develop/e/logs:/srv/logs" \
    -v "/devpool001/develop/e/tmp:/srv/tmp" \
    -v "/devpool001/develop/e/ccache:/srv/ccache" \
    -v "/devpool001/develop/e/keys:/srv/keys" \
    -v "/devpool001/develop/e/local_manifests:/srv/local_manifests" \
    -e "REPO=https://gitlab.e.foundation/e/os/releases.git" \
    registry.gitlab.e.foundation:5000/e/os/docker-lineage-cicd:community



The first execution of this command will download the necessary repositories with the source code to build the /e/ OS Image.
As of 11.03.2025 the initial repositories for building /e/ for the ASUS Zenfone 8 occupy about 235 GB of disk space; the space occupied after building an /e/ OS image with cleanup of the temporary files is about 245 GB.
Without a cleanup after the build of the /e/ OS image, the directories with the source for /e/ on the ASUS Zenfone 8 occupy about 310 GB.
Therefore I recommend to calculate with 400 GB disk space for building the /e/ OS image for the ASUS Zenfone 8.


The /e/ OS image will be created in the directory <basedir>/zips; the format for the filenames is:

e-codeversionnumber-osversion-YYYYMMDDbuildid-UNOFFICIAL-devicename.zip

e.g.

[xtrnaw7@t15g /devpool001/develop/e]$ ls -l zips/sake/*ASUS*
-rw-r--r--. 1 root root 1490443619 Mar 15 21:08 zips/sake/e-2.8-t-20250315-UNOFFICIAL-ASUS_I006D.zip
-rw-r--r--. 1 root root        109 Mar 15 21:08 zips/sake/e-2.8-t-20250315-UNOFFICIAL-ASUS_I006D.zip.sha256sum
[xtrnaw7@t15g /devpool001/develop/e]$






The build process for /e/ creates two log files:

The file

<basedir>/logs/repo-<yyyymmdd>.log

contains the logs of the repo commands; the log file used while building the image is in the directory

<basedir>logs/<device_id>

(<basedir> is the base directory for the directories used to build the OS image -- /devpool001/develop/e in the example command above)

e.g.

root@androiddev:/data/develop/android/e# find logs -ls
       34      1 drwxr-xr-x   3 xtrnaw7  xtrnaw7         4 Mar 12 06:34 logs
        3      1 drwxr-xr-x   2 root     root            3 Mar 11 16:27 logs/sake
        4      4 -rw-r--r--   1 root     root         8087 Mar 12 00:35 logs/sake/eos-2.9-20250311-UNOFFICIAL-sake.log
      384    487 -rw-r--r--   1 root     root      1636168 Mar 11 16:12 logs/repo-20250311.log
root@androiddev:/data/develop/android/e#


Note that the log file for creating the image (eos*.log) is not very detailed. Therefor it's recommended to use something like tee or script to write the output of the build command also to log file.




Without additional parameter for the build command, the build scripts delete all temporary files after the build of the /e/ OS image is complete.

To avoid this, add these parameters to the build command:

    -e "CLEAN_OUTDIR=false" \
    -e "CLEAN_AFTER_BUILD=false" \

This is very useful if you want to create the image more than once.


Add the parameter

    -e "DELETE_OLD_LOGS=5" \
    -e "DELETE_OLD_ZIPS=5" \


to keep n old zips and/or log files (n=5 in this example)


To start the docker container with an interactive shell use this command:

docker run -it --rm --entrypoint /bin/bash -v "$(pwd)":/srv/src registry.gitlab.e.foundation:5000/e/os/docker-lineage-cicd:community

or

docker run \
    -it --rm --entrypoint /bin/bash  \
    -e "BRANCH_NAME=v2.8-t" \
    -e "DEVICE_LIST=sake" \
    -e "DEVICE=ASUS_I006D" \
    -e "SIGN_BUILDS=true" \
    -e "SIGNATURE_SPOOFING=true" \
    -e "WITH_SU=true" \
    -e "CUSTOM_PACKAGES=GmsCore GsfProxy FakeStore MozillaNlpBackend NominatimNlpBackend com.google.android.maps.jar FDroid FDroidPrivilegedExtension" \
    -e "RELEASE_TYPE=UNOFFICIAL" \
    -e "CLEAN_OUTDIR=false" \
    -e "CLEAN_AFTER_BUILD=false" \
    -e "DELETE_OLD_LOGS=5" \
    -e "DELETE_OLD_ZIPS=5" \
    -v "/devpool001/develop/e/src:/srv/src" \
    -v "/devpool001/develop/e/zips:/srv/zips" \
    -v "/devpool001/develop/e/logs:/srv/logs" \
    -v "/devpool001/develop/e/tmp:/srv/tmp" \
    -v "/devpool001/develop/e/ccache:/srv/ccache" \
    -v "/devpool001/develop/e/keys:/srv/keys" \
    -v "/devpool001/develop/e/local_manifests:/srv/local_manifests" \
    -e "REPO=https://gitlab.e.foundation/e/os/releases.git" \
    registry.gitlab.e.foundation:5000/e/os/docker-lineage-cicd:community


Update 30.06.2025

To update the repository for /e/ to a new version just change the value for BRANCH_NAME in the command to start the docker instance, e.g.

Change

    -e "BRANCH_NAME=v2.8-t" \

to

    -e "BRANCH_NAME=v2.9-t" \





Useful links for building /e/


URL
Contents
https://gitlab.e.foundation/e/os/releases/-/tags The list of defined tags for /e/ 
https://gitlab.e.foundation/e/os/releases/-/branches
The list of defined branches for /e/ 
https://doc.e.foundation/support-topics/docker-command-details   Important parameter for the docker command for buildling /e/ 
https://gitlab.e.foundation/e/os/docker-lineage-cicd/-/blob/master/Dockerfile.community The list of environment variables that can be used for the docker command to build /e/ 
https://community.e.foundation/c/e-devices/unofficial-builds/ The discussion forum for unofficial builds of /e/
https://gitlab.e.foundation/e
repositories with the source code for /e/  

The prebuild /e/ OS images for the ASUS Zenfone 8 are available here:  https://doc.e.foundation/devices/sake

see here for infos about ugly TWRP images for /e/ 


Update 25.03.2025

see also How to change name of the ZIP file with the OS image while building a new image




History of this entry

30.06.2025

Add infos about how to update the repo


19.03.2025

added the commands to start the docker container with an interactive shell


15.03.2025

initial release


 

How to compile LineageOS 22.x Custom ROM for the ASUS Zenfone 8


URL: https://xdaforums.com/t/how-to-compile-lineageos-22-x-for-the-asus-zenfone-8.4726885/



Update 01.08.2025

see the section How to compile the official LineageOS 22.2 Custom ROM for the ASUS Zenfone 8 for instructions to compile the official LineageOS 22.2 for the ASUS Zenfone 8.



Update 23.07.2025


There are now official LineageOS 22.x images for the ASUS Zenfone 8 available:

https://download.lineageos.org/devices/sake/builds



How to compile LineageOS 22.x Custom ROM for the ASUS Zenfone 8


Notes:

The instructions in the original version of this HowTo only worked in my environment due to missing remnants from previous tests.
I updated the HowTo on 09.05.2025 with the support of the owner of the repositories used for device and manufacturer files, mikooomichael at gmail dot com.



Officially, the ASUS Zenfone 8 is no longer supported by the LineageOS and is no longer listed in the list of devices for the LineageOS: https://wiki.lineageos.org/devices/#asus.

However, the wiki pages for LineageOS on the ASUS Zenfone 8 are still directly accessable via these URLs:

https://wiki.lineageos.org/devices/sake/ Information about LineageOS for the ASUS Zenfone 8 
https://wiki.lineageos.org/devices/sake/build/ Instructions to build LineageOS for the ASUS Zenfone 8 


These wiki pages describe how to build the LineageOS up to version 20.x for the ASUS Zenfone 8 and are therefore not suitable for building the LineageOS 22.x for the ASUS Zenfone 8.


Nevertheless, LineageOS 22.x can also be build for the ASUS Zenfone 8 - - see for example this thread on XDA: https://xdaforums.com/t/unofficial-sake-lineageos.4641226/


I didn't find instructions on how to create a LineageOS 22.x image for the ASUS Zenfone 8, so I wrote this HowTo


This HowTo is for creating the image for LineageOS 22.2 - it may or may not work for other LineageOS 22.x versions (it does NOT work without additional steps for LineageOS 22.1)


First create the initial repository for LineageOS 22.2 using the repo tool as described on this page https://github.com/LineageOS/android:


repo init -u https://github.com/LineageOS/android.git -b lineage-22.2 --git-lfs --no-clone-bundle

repo sync -j$( nproc )

(The parameter -j defines the number of processors to be used by the repo command; the command nproc returns the number of installed CPUs in Linux)


Then add the repositories with the device dependent files for the ASUS Zenfone 8.

I recommend using the repositories from https://github.com/mikooomich, as the build works without errors with these repositories. To use these repositories, create the file local_manifests.xml like this:

[xtrnaw7@t15g /backup_pool001/data/develop/LineageOS_22.x]$ cat .repo/local_manifests/local_manifests.xml
<?xml version="1.0" encoding="UTF-8"?>

<manifest>

   <project path="device/asus/sake"   name="mikooomich/android_device_asus_sake" remote="github" revision="lineage-22.2" />
   <project path="vendor/asus/sake"   name="mikooomich/proprietary_vendor_asus_sake" remote="github" revision="lineage-22.2" />
   <project path="kernel/asus/sm8350" name="mikooomich/android_kernel_asus_sm8350" remote="github" revision="lineage-22.2" />

</manifest>



and do another sync using the repo tool to retrieve the hardware dependent source files:


repo sync


Now start the build using the commands:


source build/envsetup.sh

lunch lineage_sake-ap4a-user


brunch lineage_sake-ap4a-user


As usual, the image file is then created in the directory out/target/product/sake.




To include the GAPPS from MindTheGapps add these definitions to the file local_manifests.xml:

    <remote  name="gitlab" fetch="ssh://git@gitlab.com" />

    <project path="vendor/gapps" name="MindTheGapps/vendor_gapps" remote="gitlab" revision="vic" />

and do another sync

repo sync MindTheGapps/vendor_gapps


You need a user account on gitlab.com and a public ssh key to use this repository via ssh; creating a user on gitlab.com is free of charge.

In principle, accessing the gitlab repository via https should also work - but in my tests it didn't work for this repository. To access the gitlab repository via https use this repo definition in the xml file:

    <remote  name="gitlab" fetch="https://gitlab.com" />


Then add the lines

#
# MindTheGapps
#
WITH_GAPPS ?= false

ifeq ($(WITH_GAPPS),true)
  $(call inherit-product-if-exists,  vendor/gapps/arm64/arm64-vendor.mk )
endif

to the file

device/asus/sake/device.mk


Now set the environment variable WITH_GAPPS to true before starting the build to create an image with the GAPPS from MindTheGapps:

WITH_GAPPS=true  brunch lineage_sake-ap4a-user




Update 30.05.2025

Since 30.05.2025 it's again possible to use the "original" repository for the files in vendor/asus/sake again . To use that repository replace

    <project path="vendor/asus/sake"   name="mikooomich/proprietary_vendor_asus_sake" remote="github" revision="lineage-22.2" />

with

    <project name="TheMuppets/proprietary_vendor_asus_sake" path="vendor/asus/sake" remote="github"/>

in the file .repo/local_manifests/local_manifests.xml.



Update 01.08.2025

The perl binary in the repository for LineageOS needs an older libcrypt library.


If the library is required but missing, the build of the OS image will fail with error messages like these:

perl: error while loading shared libraries: libcrypt.so.1: cannot open shared object file: No such file or directory

perl: /lib64/libcrypt.so.1: version `GLIBC_2.2.5' not found (required by perl)


To check which libcrypt library is required by perl execute this command:

[xtrnaw7@t15g /devpool001/develop/LineageOS_22.2]$ ldd ./prebuilts/tools-lineage/linux-x86/bin/perl
    linux-vdso.so.1 (0x00007fd874449000)
    libdl.so.2 => /lib64/libdl.so.2 (0x00007fd87440b000)
    libm.so.6 => /lib64/libm.so.6 (0x00007fd873f1a000)
    libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fd874406000)
    libc.so.6 => /lib64/libc.so.6 (0x00007fd873d26000)
    libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007fd873cf0000)
    /lib64/ld-linux-x86-64.so.2 (0x00007fd87444b000)
[xtrnaw7@t15g /devpool001/develop/LineageOS_22.2]$

In most Linux distributions this version fo libcyrpt.so is not installed by default anymore. Therefor the package with the library must be installed manually. In Fedora this can be done using this command:

sudo dnf install libxcrypt-compat





Notes

see How to create a TWRP image for LineageOS based ROMs using a script for instructions to create a TWRP image for the LineageOS on the ASUS Zenfone 8.



Precompiled LineageOS 22.x images for the ASUS Zenfone 8 are available here: https://github.com/mikooomich/android_device_asus_sake/releases



To add GAPPS only for user and userdebug builds add these lines:

ifneq ($(TARGET_BUILD_VARIANT),eng)
  $(call inherit-product-if-exists, vendor/gapps/gapps.mk)
endif



Update 25.03.2025

see also How to change name of the ZIP file with the OS image while building a new image





History of this entry

01.08.2025

added infos about required libcrypt.so for the perl binary from the repository for LineageOS


30.05.2025

added the hint about the repository for vendor/asus/sake from TheMuppets


09.05.2025

corrected the instructions

24.03.2025

initial release




How to compile the /e/ Custom ROM based on Android 15 for the ASUS Zenfone 8


URL: https://xdaforums.com/t/how-to-compile-e-based-on-android-15-for-the-asus-zenfone-8.4752311/


How to compile the /e/ Custom ROM based on Android 15 for the ASUS Zenfone 8

There is now a new /e/ version for the ASUS Zenfone 8 based on LineageOS 22.x which is Android 15 available:  https://images.ecloud.global/community/sake/


To compile that /e/ version for the ASUS Zenfone 8 these instructions can be used:

# create a new directory for /e/ and change the working directory to that directory:
#
mkdir /datapool001/develop/e_a15

cd /datapool001/develop/e_a15


# init the repositories for /e/
#
repo init -u https://gitlab.e.foundation/e/os/releases.git -b refs/tags/v3.0.4-a15


# sync the repositories for /e/
#
repo sync -j$( nproc ) ; repo forall -c 'git lfs pull'


# create the manifest file for the repositories in vendor/asus/sake necessary for the ASUS Zenfone 8
#
mkdir -p
.repo/local_manifests

cat >>.repo/local_manifests/local_manifests.xml <<EOT
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
  <project name="TheMuppets/proprietary_vendor_asus_sake" path="vendor/asus/sake" revision="lineage-22.2" clone-depth="1" />
</manifest>
EOT

# sync the repository for the vendor files for the ASUS Zenfone 8
#
repo sync TheMuppets/proprietary_vendor_asus_sake

# init the environment
#
source build/envsetup.sh

# retrieve the repositories with the device files for the ASUS Zenfone 8 if necessarry and start the build
#
brunch sake


The ZIP file is then located in the directory out/target/product/sake, e.g:

[xtrnaw7@t15g /devpool001/develop/e/a15]$ ls -l out/target/product/sake/e-3.0.4-a15-*zip

-rw-rw-r--. 2 xtrnaw7 xtrnaw7 1512967634 Jul 29 16:13 out/target/product/sake/e-3.0.4-a15-20250729-UNOFFICIAL-sake.zip

[xtrnaw7@t15g /devpool001/develop/e/a15]$



Trouble Shooting

To fix an error message like this:

vendor/asus/sake/Android.mk:9: error: vendor/asus/sake/radio/abl.img SHA1 mismatch (b2c1c0e44ab421d525a7448e4c51eb6caa95a847 != 46f6d4535c45132c118279d805418cc5b5a6ab71).

Correct the sha1 values for the file abl.img in the file vendor/asus/sake/Android.mk, example:

[xtrnaw7@t15g /devpool001/develop/e/a15]$ diff vendor/asus/sake/Android.mk.org vendor/asus/sake/Android.mk
9c9
< $(call add-radio-file-sha1-checked,radio/abl.img,46f6d4535c45132c118279d805418cc5b5a6ab71)
---
> $(call add-radio-file-sha1-checked,radio/abl.img,b2c1c0e44ab421d525a7448e4c51eb6caa95a847)
[xtrnaw7@t15g /devpool001/develop/e/a15]$



In my tests with a repo sync done on 28.07.2025 all sha1 values in that file were incorrect. To create entries with correct sha1 values for all .img files for the file vendor/asus/sake/Android.mk this command can be used:

(cd vendor/asus/sake && sha1sum radio/*.img | awk '{ print "$(call add-radio-file-sha1-checked,"$2","$1")" }' )



Example
[xtrnaw7@t15g /datapool001/develop/e_a15]$ (cd vendor/asus/sake && sha1sum radio/*.img | awk '{ print "$(call add-radio-file-sha1-checked,"$2","$1")" }' )
$(call add-radio-file-sha1-checked,radio/abl.img,b2c1c0e44ab421d525a7448e4c51eb6caa95a847)
$(call add-radio-file-sha1-checked,radio/aop.img,810facb082733ed8c2607eef0c8ad44b26735bb1)
$(call add-radio-file-sha1-checked,radio/bluetooth.img,fdf8b5e5c8ae71a9b53d9d5f33ac4ba910495be8)
$(call add-radio-file-sha1-checked,radio/cpucp.img,4d369f26e6a98324f6cc6eeb9a7da22fc4b3f2a4)
$(call add-radio-file-sha1-checked,radio/devcfg.img,a4f4b4e833d345586de28e21d70202c3a1e4453b)
$(call add-radio-file-sha1-checked,radio/dsp.img,2893b36ce2f575326b75816b54cdb9b444e38e49)
$(call add-radio-file-sha1-checked,radio/featenabler.img,0a25e72de96a80c8439a79aa108eb8807bf18f16)
$(call add-radio-file-sha1-checked,radio/hyp.img,bb4bf7f97d71777f59097017273942ec80695473)
$(call add-radio-file-sha1-checked,radio/keymaster.img,17e759e31181c78d65e0efa0851d1ddf4983fa9e)
$(call add-radio-file-sha1-checked,radio/modem.img,4bf3ab6e54d74e4291a6cfee49c5ce19ca3e5bd0)
$(call add-radio-file-sha1-checked,radio/multiimgoem.img,a2a132a396a62019740548f256554b32aced505d)
$(call add-radio-file-sha1-checked,radio/qupfw.img,a524b40e82b27234ff7cfe52b23bab7cfe9b402e)
$(call add-radio-file-sha1-checked,radio/qweslicstore.img,53b7e8408020a1b30e3f3bf0bb4b4f70579a059d)
$(call add-radio-file-sha1-checked,radio/shrm.img,6d74454a364672853f3257fd8b124dfde1b73b1b)
$(call add-radio-file-sha1-checked,radio/tz.img,80f63ce00bc7260f95a84fd8195cba6250b6df04)
$(call add-radio-file-sha1-checked,radio/uefisecapp.img,921762d5c36762815189cc4f7b48b08c60f9ae70)
$(call add-radio-file-sha1-checked,radio/xbl_config.img,9df19e35ce264c114b3d9cfdf353d3d77c97e365)
$(call add-radio-file-sha1-checked,radio/xbl.img,1f4d6f807ee5c6484bda4c55acd840fdff197a18)
$(call add-radio-file-sha1-checked,radio/xrom.img,491e5c554126ae23c6947848b9490861ea6a6fb9)
[xtrnaw7@t15g /datapool001/develop/e_a15]$ 



Notes

As of 28.07.2025 the initial size of the repositories for /e/ for the ASUS Zenfone 8 is about 160 GB.


As of 28.07.2025, v3.0.4-a15 is the current tag used to create the OS for the ASUS Zenfone 8.

To get the current tag or branch to use, check the repository in a browser:

https://gitlab.e.foundation/e/os/releases.git

Or check the list of branches and tags in the repository using git:

git ls-remote --refs https://gitlab.e.foundation/e/os/releases.git


In most cases, the branch or tag to use is included in the name of the OS image available here https://images.ecloud.global/community/sake/, e.g.

The tag used to create the image

e-3.0.4-a15-20250712508365-community-sake.zip

is

v3.0.4-a15


The syntax to sync a tag is

repo init -u https://gitlab.e.foundation/e/os/releases.git -b refs/tags/<tag>


the syntax to sync a branch  is


repo init -u https://gitlab.e.foundation/e/os/releases.git -b refs/heads/<branch>

or

repo init -u https://gitlab.e.foundation/e/os/releases.git -b <branch>

A "tag" marks a fixed release; a "branch" is work in progress.



see How to create a TWRP recovery image for LineageOS 22.x  for how to create a TWRP image for this version of /e/ (which is LineageOS 22.x based)

see How to create a OrangeFox Recovery for LineageOS 22.x or newer on the ASUS Zenfone 8 using the OrangeFox Recovery Builder 2024 for instructions to create an OrangeFox recovery for LineageOS based Custom ROMs for the ASUS Zenfone 8 using the OrangeFox Recovery Builder on github.com.

see Compiling /e/ for the ASUS Zenfone 8 using the docker image for how to compile the Android 13 based /e/ version for the ASUS Zenfone 8.



Update 13.09.2025

To compile the /e/ OS version 3.1.1-a15 for the ASUS Zenfone 8, the above instructions can be used with the following changes:

The repo command to init the repository is

repo init -u https://gitlab.e.foundation/e/os/releases.git -b refs/tags/v3.1.1-a15

Before running the “brunch” command, you must remove references to parts that no longer exist in LineageOS from the file

device/asus/sake/lineage_sake.mk

To do this, simply delete the following lines in that file:

# LiveDisplay (deprecated since LOS 21+)
# PRODUCT_PACKAGES += \
#     vendor.lineage.livedisplay-service.sdm \
#     vendor.lineage.livedisplay-service.sysfs

Note that the sha1 check sums in the file vendor/asus/sake/Android.mk are still invalid in this release and the correction specified above must be applied


Notes

see also  How to compile the /e/ Custom ROM based on Android 16 for the ASUS Zenfone 8



History of this entry

13.09.2025

added instructions to compile /e/ OS 3.1.1-a15


28.07.2025

initial release




How to compile the /e/ Custom ROM based on Android 16 for the ASUS Zenfone 8



URL: https://xdaforums.com/t/how-to-compile-e-based-on-android-16-for-the-asus-zenfone-8.4783516/


How to compile the /e/ Custom ROM based on Android 16 for the ASUS Zenfone 8

There is now a new /e/ version for the ASUS Zenfone 8 based on LineageOS 23.x which is Android 16 available:  https://images.ecloud.global/community/sake/


The guide How to compile the /e/ Custom ROM based on Android 15 for the ASUS Zenfone 8 provides instructions for compiling an Android 15 based /e/ for the ASUS Zenfone 8 .

The instructions in this guide can also be used, with a few minor changes, to compile the Android 16 based /e/ for the ASUS Zenfone 8 :

The repo init command to initialize the local repositories with /e/ based on Android 16 is :

# 16.07.2026: repo init command corrected
#
repo init -u https://gitlab.e.foundation/e/os/android.git -b v4.0-a16  --git-lfs


The entry in the local manifest file for the ASUS Zenfone 8 related files is

  <project name="TheMuppets/proprietary_vendor_asus_sake" path="vendor/asus/sake" revision="lineage-23.0" clone-depth="1" />


Note

The tag used in this guide, v4.0-a16, is okay as of 16.07.2026; the tag will change in the future for further updates.

To determine the current tag, simply check the repository for https://gitlab.e.foundation/e/os/releases/-/releases

The work arounds in the guide to compile /e/ based on Android 15 are not necessary to compile /e/ based on Android 16.



History of this entry


16.07.2026

corrected the repo init command
corrected the URL for the list of releases


24.03.2026

initial release





How to compile the official LineageOS 22.2 Custom ROM for the ASUS Zenfone 8


URL: https://xdaforums.com/t/how-to-compile-the-official-lineageos-22-2-for-the-asus-zenfone-8.4752867/


How to compile the official LineageOS 22.x Custom ROM for the ASUS Zenfone 8

Since July 2025 there are now official LineageOS 22.x images for the ASUS Zenfone 8 available:

https://download.lineageos.org/devices/sake/builds


To compile the LineageOS 22.2 for the ASUS Zenfone 8 the instructions from the LineageOS wiki

https://wiki.lineageos.org/devices/sake/build/

can be used, but with a few small changes:


The device trees for the ASUS Zenfone 8 are already in repositories known by the build scripts for the LineageOS 22.2. Therefore, the lunch command copies the necessary repositories for the ASUS Zenfone 8 if they are missing in the local repository tree.


To add the vendor repositories for the ASUS Zenfone 8, add this local manifest

xtrnaw7@t540p:/devpool001/develop/LineageOS_22$ cat .repo/local_manifests/local_manifests.xml
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
   <project name="TheMuppets/proprietary_vendor_asus_sake" path="vendor/asus/sake" remote="github"/>
</manifest>
xtrnaw7@t540p:/devpool001/develop/LineageOS_22$


either before the first repo sync or after the repo sync. In the latter case, perform a new repo sync after you have added the local manifest.


The parameter for the lunch and brunch commands are also different

So, the commands to create the repositories and compile LineageOS 22.2 for the ASUS Zenfone 8 are (assuming the repo tool and the necessary OS tools are already installed):


# create the directory for the LineageOS 22.2 repositories

mkdir /devpool001/develop/LineageOS_22

cd
/devpool001/develop/LineageOS_22


# init the repositories for LineageOS 22.2
#
repo init -u https://github.com/LineageOS/android.git -b lineage-22.2 --git-lfs --no-clone-bundle


# add the required repositories for the vendor files of the ASUS Zenfone 8
#
mkdir -p  .repo/local_manifests/

cat >.repo/local_manifests/local_manifests.xml  <<EOT
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
   <project name="TheMuppets/proprietary_vendor_asus_sake" path="vendor/asus/sake" remote="github"/>
</manifest>
EOT


# download the repositories (-c = only download the current branch; -j4 = use 4 processes in parallel)
#
repo sync -j4 -c


# init the environment

source build/envsetup.sh


# prepare the build
#
lunch lineage_sake-bp1a-user


# start the build
#
brunch lineage_sake-bp1a-user


Notes:

bp1a is the build_id to be used for the build; as of 01.08.2025 this is bp1a for the LineageOS 22.2. The build_id may change after applying a patchset to the repositories with the LineageOS.


The build_id to be used can be retrieved from the repositories after the repo sync command is done:

Execute the script print_security_patch in the directory with the repositories for LineageOS 22.2 to print the build_id to be used:

xtrnaw7@t540p:/devpool001/develop/LineageOS_22$ print_security_patch
Retrieving the security patch level for the repository at "/devpool001/develop/LineageOS_22" ...
The repository uses the new definitions
The current security patch is "2025-05-05"
The current build_id is "bp1a"
xtrnaw7@t540p:/devpool001/develop/LineageOS_22


Note that the breakfast command does not work anymore when building the LineageOS 22.2 OS image.




Trouble Shooting

The perl binary in the repository for LineageOS 22.2 requires the library: libcrypt.so.1.

If this library is missing in the current Linux installation, the build of the LineageOS image will fail with error messages like these:

perl: error while loading shared libraries: libcrypt.so.1: cannot open shared object file: No such file or directory

or

perl: /lib64/libcrypt.so.1: version `GLIBC_2.2.5' not found (required by perl)


To check which libcrypt library is required by perl, run this command; if the required library version exists, the output should look like this:

[xtrnaw7@t15g /devpool001/develop/LineageOS_22.2]$ ldd ./prebuilts/tools-lineage/linux-x86/bin/perl
    linux-vdso.so.1 (0x00007fd874449000)
    libdl.so.2 => /lib64/libdl.so.2 (0x00007fd87440b000)
    libm.so.6 => /lib64/libm.so.6 (0x00007fd873f1a000)
    libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fd874406000)
    libc.so.6 => /lib64/libc.so.6 (0x00007fd873d26000)
    libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007fd873cf0000)
    /lib64/ld-linux-x86-64.so.2 (0x00007fd87444b000)
[xtrnaw7@t15g /devpool001/develop/LineageOS_22.2]$


In most Linux distributions, this version of libcyrpt.so is no longer installed by default. Therefore, the package with the library must be installed manually. In Fedora this can be done using this command:

sudo dnf install libxcrypt-compat



Notes

see the section How to compile other Custom_ROMs for the ASUS Zenfone 8 for a list of sections with instructions to compile other custom ROMs for the ASUS Zenfone 8 (e.g. LineageOS 22.x, /e/, crDroid, evolutionX, etc)
The entry also contains a list of sections with instructions to create TWRP or OrangeFox recovery images for the various custom ROMs.

see How to create a OrangeFox Recovery for LineageOS 22.x or newer on the ASUS Zenfone 8 using the OrangeFox Recovery Builder 2024 for instructions to create an OrangeFox recovery for LineageOS based Custom ROMs for the ASUS Zenfone 8 using the OrangeFox Recovery Builder on github.com.


History of this entry

01.08.2025

initial release





How to compile the official LineageOS 23.0 Custom ROM for the ASUS Zenfone 8


URL: https://xdaforums.com/t/how-to-compile-the-official-lineageos-23-0-custom-rom-for-the-asus-zenfone-8.4768940/


How to compile the official LineageOS 23.0 Custom ROM for the ASUS Zenfone 8

An official LineageOS 23.0 image for the ASUS Zenfone 8 is available at

https://download.lineageos.org/devices/sake/builds

Use the following instructions to compile the LineageOS 23.0 for the ASUS Zenfone 8:


The device tree for the ASUS Zenfone 8 is already in the repositories known by the build scripts for the LineageOS 23.0. Therefore, the lunch command copies the necessary repositories for the ASUS Zenfone 8 if they are missing in the local repositories. The only thing missing are the vendor repositories for the ASUS Zenfone 8.



The commands to create the repositories and compile LineageOS 23.0 for the ASUS Zenfone 8 are (assuming the repo tool and the necessary OS tools are already installed):


# create the directory for the LineageOS 23.0 repositories

mkdir /devpool001/develop/LineageOS_23

cd
/devpool001/develop/LineageOS_23


# init the repositories for LineageOS 23.0
#
repo init -u https://github.com/LineageOS/android.git -b lineage-23.0 --git-lfs --no-clone-bundle


# add the required repositories for the vendor files of the ASUS Zenfone 8
#
if [ ! -r
.repo/local_manifests/local_manifests.xml ] ; then
  mkdir -p  .repo/local_manifests/


   cat >.repo/local_manifests/local_manifests.xml  <<EOT
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
   <project name="TheMuppets/proprietary_vendor_asus_sake" path="vendor/asus/sake" remote="github"
revision="lineage-23.0"/>
</manifest>
EOT
fi


# download the repositories (-c = only download the current branch; -j4 = use 4 processes in parallel)
#
repo sync -j4 -c


# init the environment

source build/envsetup.sh


# prepare the build 
#
# 06.12.2025 : fixed the build_id (bp2a instead of bp1a)
#
lunch lineage_sake-bp2a-user


# start the build
#
brunch lineage_sake-bp2a-user


Notes:

bp2a is the build_id to be used for the build; as of 21.11.2025 this is bp2a for the LineageOS 23.0.  The build_id may change after applying a patchset to the repositories with the LineageOS.

The build_id to be used can be retrieved from the repositories after the repo sync command is done:

Execute the script print_security_patch in the directory with the repositories for LineageOS 23.0 to print the build_id to be used:

[xtrnaw7@t15g /devpool001/develop/LineageOS_23_original]$ print_security_patch
Retrieving the security patch level for the repository at "/devpool001/develop/LineageOS_23_original" ...
The repository uses the new definitions
The current security patch is "2025-08-05"
The current build_id is "bp2a"
[xtrnaw7@t15g /devpool001/develop/LineageOS_23_original]$


Note that the OS image created using the default config contains all partition images:

[xtrnaw7@t15g /devpool001/develop/LineageOS_23_original]$ view_payload_bin.sh out/target/product/sake/lineage-23.0-20251121-UNOFFICIAL-sake-MicroG.zip

Processing the file "out/target/product/sake/lineage-23.0-20251121-UNOFFICIAL-sake-MicroG.zip" ...
payload.bin: /tmp/payload.2345897/payload.bin
Payload Version: 2
Payload Manifest Length: 121049
Payload Manifest Signature Length: 267
Found partitions:
abl (602 kB), aop (246 kB), bluetooth (1.1 MB), boot (101 MB), cpucp (106 kB), devcfg (49 kB), dsp (67 MB), dtbo (25 MB), featenabler (90 kB), hyp (3.7 MB), keymaster (287 kB), modem (182 MB), multiimgoem (16 kB), odm (1.7 MB), product (813 MB), qupfw (57 kB), qweslicstore (262 kB), shrm (49 kB), system (1.1 GB), system_ext (384 MB), tz (3.8 MB), uefisecapp (127 kB), vbmeta (8.2 kB), vbmeta_system (4.1 kB), vendor (1.0 GB), vendor_boot (101 MB), vendor_dlkm (36 MB), xbl (3.7 MB), xbl_config (221 kB), xrom (537 MB)
[xtrnaw7@t15g /devpool001/develop/LineageOS_23_original]$


To create an OS Image with only images for the partitions used by the OS execute this command before starting the build:

#
# Optional: remove the images for the vendor specific partitions from the payload.bin file
#
cp device/asus/sake/BoardConfig.mk device/asus/sake/BoardConfig.mk.org
sed -i -e "s|include vendor/asus/sake/BoardConfigVendor.mk|#include vendor/asus/sake/BoardConfigVendor.mk|g"  device/asus/sake/BoardConfig.mk


The payload.bin file then contains these images only

[xtrnaw7@t15g /devpool001/develop/LineageOS_23_original]$ view_payload_bin.sh out/target/product/sake/lineage-23.0-20251121-UNOFFICIAL-sake-MicroG.zip

Processing the file "out/target/product/sake/lineage-23.0-20251121-UNOFFICIAL-sake-MicroG.zip" ...
payload.bin: /tmp/payload.2415682/payload.bin
Payload Version: 2
Payload Manifest Length: 98349
Payload Manifest Signature Length: 267
Found partitions:
boot (101 MB), dtbo (25 MB), odm (1.7 MB), product (813 MB), system (1.1 GB), system_ext (384 MB), vbmeta (8.2 kB), vbmeta_system (4.1 kB), vendor (1.0 GB), vendor_boot (101 MB), vendor_dlkm (36 MB)
[xtrnaw7@t15g /devpool001/develop/LineageOS_23_original]$


The script view_payload_bin.sh is available for download here: view_payload_bin.sh (the script needs the payload-dumper-go executable from here: https://github.com/ssut/payload-dumper-go)

see Partition images in the file payload.bin for the LineageOS for more details about the files in the payload.bin file.


Trouble Shooting


The perl binary in the repository for LineageOS 23.0 also requires the library: libcrypt.so.1 see libcrypt.so.1 is required to build a LineageOS based Custom ROM for details.


Notes

The official instructions to build the LineageOS for the ASUS Zenfone 8 are in the LineageOS wiki https://wiki.lineageos.org/devices/sake/build/


see the section How to compile other Custom_ROMs for the ASUS Zenfone 8 for a list of sections with instructions to compile other custom ROMs for the ASUS Zenfone 8 (e.g. LineageOS 22.x, /e/, crDroid, evolutionX, iodeOS, LMODroid, etc)
The entry also contains a list of sections with instructions to create TWRP or OrangeFox recovery images for the various custom ROMs and links to guides to add GAPPS or MicroG to a Custom ROM.

see How to create a OrangeFox Recovery for LineageOS 22.x or newer on the ASUS Zenfone 8 using the OrangeFox Recovery Builder 2024 for instructions to create an OrangeFox recovery for LineageOS based Custom ROMs for the ASUS Zenfone 8 using the OrangeFox Recovery Builder on github.com.



History of this entry

02.12.2025

updated the infos about the official LineageOS 23.0 OS Image for the ASUS Zenfone 8

21.11.2025

initial release





How to compile the official LineageOS 24.0 Custom ROM for the ASUS Zenfone 8



URL: https://xdaforums.com/t/how-to-compile-the-official-lineageos-24-0-custom-rom-for-the-asus-zenfone-8.4801584/
 

How to compile the official LineageOS 24.0 Custom ROM for the ASUS Zenfone 8

As of 12.09.2026 there is no official LineageOS 24.0 (= Android 17) image for the ASUS Zenfone 8 available yet at the download page for the OS images for that phone (https://download.lineageos.org/devices/sake/builds).


But you can use the following instructions to compile the LineageOS 24.0 for the ASUS Zenfone 8.


The device tree for the ASUS Zenfone 8 is already in the repositories known by the build scripts for the LineageOS 24.0. Therefore, the lunch command copies the necessary repositories for the ASUS Zenfone 8 if they are missing in the local repositories. The only thing missing are the vendor repositories for the ASUS Zenfone 8.


The commands to create the repositories and compile LineageOS 24.0 for the ASUS Zenfone 8 are (assuming the repo tool and the necessary OS tools are already installed):


# create the directory for the LineageOS 24.0 repositories

mkdir /devpool001/develop/LineageOS_24

cd
/devpool001/develop/LineageOS_24


# init the repositories for LineageOS 24.0
#
repo init -u https://github.com/LineageOS/android.git -b lineage-24.0 --git-lfs --no-clone-bundle


# add the required repositories for the vendor files of the ASUS Zenfone 8
#
if [ ! -r 
.repo/local_manifests/local_manifests.xml ] ; then
  mkdir -p  .repo/local_manifests/


#
# As of 12.09.2026 there is no revision 24.0 for this repository available
#
  cat >.repo/local_manifests/local_manifests.xml  <<EOT
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
   <project name="TheMuppets/proprietary_vendor_asus_sake" path="vendor/asus/sake" remote="github"
revision="lineage-23.2"/>
</manifest>
EOT
fi


# download the repositories (-c = only download the current branch; -j4 = use 4 processes in parallel)
#
repo sync -j4 -c


# init the environment

source build/envsetup.sh


# prepare the build 
#
lunch lineage_sake-cp2a-userdebug


# start the build
#
brunch lineage_sake-cp2a-user


Result:






The LineageOS 24.0 installation ZIP file created with the default config files for the ASUS Zenfone 8 contains images for all partitions:

[xtrnaw7@t15g /devpool001/data/develop/android/LineageOS_24]$ view_payload_bin.sh /data/backup/ASUS_ZENFONE8/Lineage-24-local/lineage-24.0-20260913-UNOFFICIAL-sake-MicroG.zip

Processing the file "/data/backup/ASUS_ZENFONE8/Lineage-24-local/lineage-24.0-20260913-UNOFFICIAL-sake-MicroG.zip" ...
payload.bin: /tmp/payload.20505/payload.bin
Payload Version: 2
Payload Manifest Length: 123860
Payload Manifest Signature Length: 267
Found partitions:
abl (602 kB), aop (246 kB), bluetooth (1.1 MB), boot (101 MB), cpucp (106 kB), devcfg (49 kB), dsp (67 MB), dtbo (25 MB), featenabler (90 kB), hyp (3.7 MB), keymaster (287 kB), modem (182 MB), multiimgoem (16 kB), odm (1.9 MB), product (830 MB), qupfw (57 kB), qweslicstore (262 kB), shrm (49 kB), system (1.1 GB), system_ext (400 MB), tz (3.8 MB), uefisecapp (127 kB), vbmeta (8.2 kB), vbmeta_system (4.1 kB), vendor (1.1 GB), vendor_boot (101 MB), vendor_dlkm (36 MB), xbl (3.7 MB), xbl_config (221 kB), xrom (537 MB)
[xtrnaw7@t15g /devpool001/data/develop/android/LineageOS_24]$


Therefore, it's not necessary to manually update the vendor* partitions before installing the LineageOS 24.0 image


To create an LineageOS 24.x image with MicroG execute the instructions from this HowTo

How to build a Custom ROM with MicroG

with one change: The command to download the partner_gms.mk file for LineageOS 24.0 is:

wget https://raw.githubusercontent.com/LineageOS/android_vendor_lineage/refs/heads/lineage-24.0/config/partner_gms.mk -O vendor/lineage/config/partner_gms.mk


Use the OrangeFox Recovery Builder 2024 to create an OrangeFox recovery for LineageOS 24.0 on the ASUS Zenfone 8 - see the instructions in the section

How to create a OrangeFox Recovery for LineageOS 22.x or newer on the ASUS Zenfone 8 using the OrangeFox Recovery Builder 2024


When installing the OS image using the OrangeFox recovery make sure to disable flashing the OrangeFox to the boot partition :

When booted in the OrangeFox Recovery; Open the Settings and untick in the section General "Reflash OrangeFox after flashing a ROM"


Notes

see also the hints in these sections

Memory usage while Building an Android 17 based custom ROM  

Flashing a different Custom ROM with OrangeFox on the ASUS Zenfone 8




History of this entry

14.09.2026

initial release






How to compile the crDroid 11.x Custom ROM for the ASUS Zenfone 8


URL: https://xdaforums.com/t/how-to-compile-the-crdroid-customrom-for-the-asus-zenfone-8.4753097/

 
How to compile the crDroid 11.x Custom ROM for the ASUS Zenfone 8

crDroid is another LineageOS based Custom ROM for Android phones. The ASUS Zenfone 8 is not officially supported by crDroid, but it is not that difficult to compile a crDroid OS image for the ASUS Zenfone 8.

To compile the crDroid 11.x Custom ROM for the ASUS Zenfone 8 these commands are necessary:


# create the directory for the repositories with crDroid
#
mkdir /devpool001/develop/crdroid11

cd /devpool001/develop/crdroid11


# init the repository tree
#
repo init -u https://github.com/crdroidandroid/android.git -b 15.0 --git-lfs

# synchronise the repositories
#
repo sync


# Add the necessary repositories for the ASUS Zenfone 8
#

mkdir -p .repo/local_manifests

cat >.repo/local_manifests/roomservice.xml <<EOT
<?xml version="1.0" encoding="UTF-8"?>
<manifest>

  <project path="device/asus/sake"   name="LineageOS/android_device_asus_sake" remote="github" revision="lineage-22.2" />

  <project path="vendor/asus/sake"   name="TheMuppets/proprietary_vendor_asus_sake"  remote="github" revision="lineage-22.2" />

  <project path="kernel/asus/sm8350" name="LineageOS/android_kernel_asus_sm8350" remote="github" revision="lineage-22.2" />

</manifest>
EOT


# sync the repositories for the ASUS Zenfone 8
#
repo sync LineageOS/android_device_asus_sake

repo sync LineageOS/android_kernel_asus_sm8350

repo sync TheMuppets/proprietary_vendor_asus_sake


# correct some files in the repositories
#

# replace "armv8-a" with "armv8-2a"
#
cp device/asus/sake/BoardConfig.mk device/asus/sake/BoardConfig.mk.org
sed  -i -e  "s/armv8-a/armv8-2a/g" device/asus/sake/BoardConfig.mk

# remove duplicate paths
#
if [ ! -r device/asus/sake/sepolicy/vendor/genfs_contexts.org ] ; then
  cp device/asus/sake/sepolicy/vendor/genfs_contexts device/asus/sake/sepolicy/vendor/genfs_contexts.org
  sed -i \
      -e "s|^genfscon sysfs /devices/platform/soc/17300000.qcom,lpass/wakeup|# genfscon sysfs /devices/platform/soc/17300000.qcom,lpass/wakeup|g" \
      -e "s|^enfscon sysfs /devices/platform/soc/188101c.qcom,spss/wakeup|# enfscon sysfs /devices/platform/soc/188101c.qcom,spss/wakeup|g" \
      -e "s|^enfscon sysfs /devices/platform/soc/5c00000.qcom,ssc/wakeup|# enfscon sysfs /devices/platform/soc/5c00000.qcom,ssc/wakeup |g" \
      device/asus/sake/sepolicy/vendor/genfs_contexts
fi

# init the environment
#
source build/envsetup.sh

# prepare the environment
#
lunch lineage_sake-bp1a-user

# start the build
#
brunch lineage_sake-bp1a-user


Check the result

xtrnaw7@t540p:/devpool001/develop/crdroid11$ ls -ltr out/target/product/sake/*zip
-rw-r--r--. 1 xtrnaw7 xtrnaw7 1334328430 Aug  3 12:20 out/target/product/sake/crDroidAndroid-15.0-20250803-sake-v11.7.zip
xtrnaw7@t540p:/devpool001/develop/crdroud11$




I have successfully installed the image on an ASUS Zenfone 8:





Notes

To get the build_id for the lunch and brunch command, bp1a in the examples above, use the script print_security_patch, e.g.:

xtrnaw7@t540p:/devpool001/develop/crdroid11$ print_security_patch
Retrieving the security patch level for the repository at "/devpool001/develop/crdroid11" ...
The repository uses the new definitions
The current security patch is "2025-05-05"
The current build_id is "bp1a"
xtrnaw7@t540p:/devpool001/develop/crdroid11


I have done some basic tests but I have not thoroughly tested the crDroid image for the ASUS Zenfone 8 - this is more or less just a proof of concept and an example of creating a LineageOS based Custom ROM for a phone that is supported by the LineageOS but, not the by LineageOS based Custom ROM.


see the section How to compile the OmniROM Custom ROM for the ASUS Zenfone 8 for HowTos to compile the OmniROM for the ASUS Zenfone 8.

see the section How to compile other Custom ROMs for the ASUS Zenfone 8 for a list of sections with instructions to compile other custom ROMs for the ASUS Zenfone 8 (e.g. LineageOS 22.x, /e/, crDroid, evolutionX, etc)
The entry also contains a list of sections with instructions to create TWRP or OrangeFox recovery images for the various custom ROMs.


see How to compile the evolutionX Custom ROM for the ASUS Zenfone 8 with kernelSU for instructions to add KernelSU-Next to the OS image (the instructions in that HowTo also work for the crDorid ROM)

see How to create a OrangeFox Recovery for LineageOS 22.x or newer on the ASUS Zenfone 8 using the OrangeFox Recovery Builder 2024 for instructions to create an OrangeFox recovery for LineageOS based Custom ROMs for the ASUS Zenfone 8 using the OrangeFox Recovery Builder on github.com.



History of this entry

03.08.2025

initial release


 


How to compile the crDroid 12.x Custom ROM for the ASUS Zenfone 8



URL: https://xdaforums.com/t/how-to-compile-the-crdroid-customrom-for-the-asus-zenfone-8.4753097/post-90374931


How to compile the crDroid 12.x Custom ROM for the ASUS Zenfone 8

crDroid is another LineageOS based Custom ROM for Android phones. The ASUS Zenfone 8 is not officially supported by crDroid, but it is not that difficult to compile a crDroid OS image for the ASUS Zenfone 8.

To compile the crDroid 12.x Custom ROM for the ASUS Zenfone 8 these commands are necessary:


# create the directory for the repositories with crDroid
#
mkdir /devpool001/develop/crdroid12

cd /devpool001/develop/crdroid12


# init the repository tree
#
repo init -u https://github.com/crdroidandroid/android.git -b 16.0 --git-lfs

# synchronise the repositories
#
repo sync


# Add the necessary repositories for the ASUS Zenfone 8
#

mkdir -p .repo/local_manifests

cat >.repo/local_manifests/roomservice.xml <<EOT
<?xml version="1.0" encoding="UTF-8"?>
<manifest>

  <project path="device/asus/sake"   name="LineageOS/android_device_asus_sake" remote="github" revision="lineage-23.0" />

  <project path="vendor/asus/sake"   name="TheMuppets/proprietary_vendor_asus_sake"  remote="github" revision="lineage-23.0" />

  <project path="kernel/asus/sm8350" name="LineageOS/android_kernel_asus_sm8350" remote="github" revision="lineage-23.0" />

</manifest>
EOT


# sync the repositories for the ASUS Zenfone 8
#
repo sync LineageOS/android_device_asus_sake

repo sync LineageOS/android_kernel_asus_sm8350

repo sync TheMuppets/proprietary_vendor_asus_sake


# correct some files in the repositories
#

# replace "armv8-a" with "armv8-2a"
#
cp device/asus/sake/BoardConfig.mk device/asus/sake/BoardConfig.mk.org
sed  -i -e  "s/armv8-a/armv8-2a/g" device/asus/sake/BoardConfig.mk

#
# Optional: remove the images for the vendor specific partitions from the payload.bin file
#
cp device/asus/sake/BoardConfig.mk device/asus/sake/BoardConfig.mk.org
sed -i -e "s|include vendor/asus/sake/BoardConfigVendor.mk|#include vendor/asus/sake/BoardConfigVendor.mk|g"  device/asus/sake/BoardConfig.mk


# init the environment

#
source build/envsetup.sh

# prepare the environment
#
lunch lineage_sake-bp1a-user

# start the build
#
brunch lineage_sake-bp2a-user


Check the result

[xtrnaw7@t540p /devpool001/develop/crdroid12]$ ls -l out/target/product/sake/*zip
-rw-r--r--. 1 xtrnaw7 xtrnaw7 1464939767 Nov 18 04:09 out/target/product/sake/crDroidAndroid-16.0-20251117-sake-v12.3.zip
[xtrnaw7@t540p /devpool001/develop/crdroid12]$




I have successfully installed the image on an ASUS Zenfone 8:





Notes

To get the build_id for the lunch and brunch command, bp1a in the examples above, use the script print_security_patch, e.g.:

xtrnaw7@t540p:/devpool001/develop/crdroid11$ print_security_patch
Retrieving the security patch level for the repository at "/devpool001/develop/crdroid11" ...
The repository uses the new definitions
The current security patch is "2025-05-05"
The current build_id is "bp1a"
xtrnaw7@t540p:/devpool001/develop/crdroid11


I have done some basic tests but I have not thoroughly tested the crDroid image for the ASUS Zenfone 8 - this is more or less just a proof of concept and an example of creating a LineageOS based Custom ROM for a phone that is supported by the LineageOS but, not the by LineageOS based Custom ROM.


see the section How to compile the OmniROM Custom ROM for the ASUS Zenfone 8 for HowTos to compile the OmniROM for the ASUS Zenfone 8.

see the section How to compile other Custom ROMs for the ASUS Zenfone 8 for a list of sections with instructions to compile other custom ROMs for the ASUS Zenfone 8 (e.g. LineageOS 22.x, /e/, crDroid, evolutionX, etc)
The entry also contains a list of sections with instructions to create TWRP or OrangeFox recovery images for the various custom ROMs.


see How to compile the evolutionX Custom ROM for the ASUS Zenfone 8 with kernelSU for instructions to add KernelSU-Next to the OS image (the instructions in that HowTo also work for the crDorid ROM)

see How to create a OrangeFox Recovery for LineageOS 22.x or newer on the ASUS Zenfone 8 using the OrangeFox Recovery Builder 2024 for instructions to create an OrangeFox recovery for LineageOS based Custom ROMs for the ASUS Zenfone 8 using the OrangeFox Recovery Builder on github.com.


see here for details about the partitions in the OS image




History of this entry

18.11.2025

initial release



 

How to compile the evolutionX 10.7 Custom ROM for the ASUS Zenfone 8


URL: https://xdaforums.com/t/how-to-compile-the-evolutionx-custom-rom-for-the-asus-zenfone-8.4753244/


How to compile the evolutionX 10.7 Custom ROM for the ASUS Zenfone 8

evolutionX is another LineageOS based Custom ROM for Android phones. The ASUS Zenfone 8 is not officially supported by evolutionX, but it is not that difficult to compile a evolutionX OS image for the ASUS Zenfone 8.

To compile the evolutionX Custom ROM for the ASUS Zenfone 8 these commands are necessary (see also the evolutionX wiki):


# create the directory for the repositories for evolutionX
#
mkdir /devpool001/develop/evolutionX

cd /devpool001/develop/evolutionX


# init the repositories for evolutionX  (vic = Android 15)
#
repo init -u https://github.com/Evolution-X/manifest -b vic --git-lfs


# create the manifest file with the repositories for the ASUS Zenfone 8
#
mkdir -p .repo/local_manifests

cat >.repo/local_manifests/asus_sake.xml <<EOT
<?xml version="1.0" encoding="UTF-8"?>
<manifest>

  <project path="device/asus/sake"   name="LineageOS/android_device_asus_sake" remote="github" revision="lineage-22.2" />

  <project path="vendor/asus/sake"   name="TheMuppets/proprietary_vendor_asus_sake"  remote="github"/>

  <project path="kernel/asus/sm8350" name="LineageOS/android_kernel_asus_sm8350" remote="github" revision="lineage-22.2" />

</manifest>
EOT


# synchronize the repositories
#
repo sync -c -j4 --force-sync --no-clone-bundle --no-tags


# prepare the build environment
#
source build/envsetup.sh

lunch lineage_sake-bp1a-userdebug


# start the build
#
m evolution


Check the result

[xtrnaw7@t540p evolutionX]$ ls -l out/target/product/sake/EvolutionX-*zip
-rw-r--r--. 1 xtrnaw7 xtrnaw7 2362271330 Aug  5 06:59 out/target/product/sake/EvolutionX-15.0-20250804-sake-10.7-Unofficial.zip
[xtrnaw7@t540p evolutionX]




I have successfully installed the image on an ASUS Zenfone 8:




ASUS_I006D:/ $ getprop | egrep -i "evol|fingerprint"
[persist.sys.pihooks_FINGERPRINT]: [google/panther_beta/panther:16/BP31.250523.010/13667654:user/release-keys]
[ro.bootimage.build.fingerprint]: [asus/twrp_I006D/I006D:99.87.36/SP2A.220405.004/xtrnaw707262051:eng/test-keys]
[ro.build.fingerprint]: [asus/WW_I006D/ASUS_I006D:13/TKQ1.220807.001/33.0210.0210.332:user/release-keys]
[ro.build.version.preview_sdk_fingerprint]: [REL]
[ro.evolution.build.version]: [EvolutionX-15.0-20250804-sake-10.7-Unofficial]
[ro.evolution.device]: [sake]
[ro.evolution.display.version]: [v10.7-20250804]
[ro.evolution.version]: [15.0]
[ro.evolutionlegal.url]: [https://evolution-x.org/legal.php]
[ro.hardware.fingerprint]: [goodixfp]
[ro.odm.build.fingerprint]: [asus/WW_I006D/ASUS_I006D:13/TKQ1.220807.001/33.0210.0210.332:user/release-keys]
[ro.product.build.fingerprint]: [asus/WW_I006D/ASUS_I006D:13/TKQ1.220807.001/33.0210.0210.332:user/release-keys]
[ro.system.build.fingerprint]: [asus/WW_I006D/ASUS_I006D:13/TKQ1.220807.001/33.0210.0210.332:user/release-keys]
[ro.system_ext.build.fingerprint]: [asus/WW_I006D/ASUS_I006D:13/TKQ1.220807.001/33.0210.0210.332:user/release-keys]
[ro.vendor.build.fingerprint]: [asus/WW_I006D/ASUS_I006D:13/TKQ1.220807.001/33.0210.0210.332:user/release-keys]
[ro.vendor_dlkm.build.fingerprint]: [asus/WW_I006D/ASUS_I006D:13/TKQ1.220807.001/33.0210.0210.332:user/release-keys]
ASUS_I006D:/ $



Notes

see the Evolution WIki for the supported build flags. To use a build flag, simply export the flag as environment variable before starting the build, e.g

to disable GAPPS use

export WITH_GMS=false


Note that I do not know why the security patch in the EvolutionX GUI on the phone is 1. July 2025. Google did not release a new patchset in July 2025. The patchset info in the source code is:

xtrnaw7@t540p:/devpool001/develop/evolutionX$ print_security_patch
Retrieving the security patch level for the repository at "/devpool001/develop/evolutionX" ...
The repository uses the new definitions
The current security patch is "2025-05-05"
The current build_id is "bp1a"
xtrnaw7@t540p:/devpool001/develop/evolutionX$


Note that the script print_security_patch also prints the build_id that must be used in the parameter for the lunch and brunch commands ( bp1a in this example)


I have done some basic tests but I have not thoroughly tested the evolutionX image for the ASUS Zenfone 8 - this is more or less just a proof of concept and an example of creating a LineageOS based Custom ROM for a phone that is supported by the LineageOS but, not the by LineageOS based Custom ROM.


see the section How to compile the OmniROM Custom ROM for the ASUS Zenfone 8 for HowTos to compile the OmniROM for the ASUS Zenfone 8.

see the section How to compile other Custom ROMs for the ASUS Zenfone 8 for a list of HowTos with instructions to compile other custom ROMs for the ASUS Zenfone 8 (e.g. LineageOS 22.x, /e/, crDroid, evolutionX, etc)
The entry also contains a list of sections with instructions to create TWRP or OrangeFox recovery images for the various custom ROMs.


Note that the OS image for the ASUS Zenfone 8 created with these instructions does not contain KernelSU.

see How to compile the evolutionX Custom ROM for the ASUS Zenfone 8 with kernelSU for instructions to add KernelSU-Next to the OS image.


see How to create a OrangeFox Recovery for LineageOS 22.x or newer on the ASUS Zenfone 8 using the OrangeFox Recovery Builder 2024 for instructions to create an OrangeFox recovery for LineageOS based Custom ROMs for the ASUS Zenfone 8 using the OrangeFox Recovery Builder on github.com.
 



History of this entry

17.11.2025

added the missing command "source build/envsetup.sh" to the instructions


04.08.2025

initial release





How to compile the evolutionX 11.4 Custom ROM for the ASUS Zenfone 8


URL: https://xdaforums.com/t/how-to-compile-the-evolutionx-11-4-custom-rom-for-the-asus-zenfone-8.4768958/

How to compile the evolutionX 11.4 Custom ROM for the ASUS Zenfone 8
evolutionX is another LineageOS based Custom ROM for Android phones. The ASUS Zenfone 8 is not officially supported by evolutionX, but it is not that difficult to compile an evolutionX OS image for the ASUS Zenfone 8.

To compile the evolutionX 11.4 Custom ROM for the ASUS Zenfone 8 these commands are necessary (see also the evolutionX wiki):


# create the directory for the repositories for evolutionX
#
mkdir /devpool001/develop/evolutionX

cd /devpool001/develop/evolutionX


# init the repositories for evolutionX (bka = Android 16)
#
repo init -u https://github.com/Evolution-X/manifest -b bka --git-lfs


# create the manifest file with the repositories for the ASUS Zenfone 8
#
mkdir -p .repo/local_manifests

cat >.repo/local_manifests/asus_sake.xml <<EOT
<?xml version="1.0" encoding="UTF-8"?>
<manifest>

  <project path="device/asus/sake"   name="LineageOS/android_device_asus_sake" remote="github" revision="lineage-23.0" />

  <project path="vendor/asus/sake"   name="TheMuppets/proprietary_vendor_asus_sake"  remote="github" revision="lineage-23.0" />

  <project path="kernel/asus/sm8350" name="LineageOS/android_kernel_asus_sm8350" remote="github" revision="lineage-23.0" />

</manifest>
EOT


# synchronize the repositories
#
repo sync -c -j4 --force-sync --no-clone-bundle --no-tags


#
# Optional: remove the images for the vendor specific partitions from the payload.bin file
#
cp device/asus/sake/BoardConfig.mk device/asus/sake/BoardConfig.mk.org
sed -i -e "s|include vendor/asus/sake/BoardConfigVendor.mk|#include vendor/asus/sake/BoardConfigVendor.mk|g"  device/asus/sake/BoardConfig.mk


# prepare the build environment
#
source build/envsetup.sh

lunch lineage_sake-bp2a-userdebug


# start the build
#
m evolution



Check the result

[xtrnaw7@t15g /devpool001/develop/evolutionX_11.4]$ ls -l out/target/product/sake/*.zip
-rw-rw-r--. 1 xtrnaw7 xtrnaw7 2514572498 Nov 18 21:16 out/target/product/sake/EvolutionX-16.0-20251118-sake-11.4.1-Unofficial.zip
[xtrnaw7@t15g /devpool001/develop/evolutionX_11.4]$



I have successfully installed the image on an ASUS Zenfone 8:





ASUS_I006D:/ $  getprop | egrep -i "evol|fingerprint"
[persist.sys.pihooks_FINGERPRINT]: [google/cheetah_beta/cheetah:16/BP41.250916.012.A1/14330953:user/release-keys]
[ro.build.fingerprint]: [google/cheetah_beta/cheetah:16/BP41.250916.012.A1/14330953:user/release-keys]
[ro.build.version.preview_sdk_fingerprint]: [REL]
[ro.evolution.build.version]: [EvolutionX-16.0-20251118-sake-11.4.1-Unofficial]
[ro.evolution.device]: [sake]
[ro.evolution.display.version]: [v11.4.1-20251118]
[ro.evolution.version]: [16.0]
[ro.evolutionlegal.url]: [https://evolution-x.org/legal.php]
[ro.hardware.fingerprint]: [goodixfp]
[ro.odm.build.fingerprint]: [google/cheetah_beta/cheetah:16/BP41.250916.012.A1/14330953:user/release-keys]
[ro.product.build.fingerprint]: [google/cheetah_beta/cheetah:16/BP41.250916.012.A1/14330953:user/release-keys]
[ro.system.build.fingerprint]: [google/cheetah_beta/cheetah:16/BP41.250916.012.A1/14330953:user/release-keys]
[ro.system_ext.build.fingerprint]: [google/cheetah_beta/cheetah:16/BP41.250916.012.A1/14330953:user/release-keys]
[ro.vendor.build.fingerprint]: [google/cheetah_beta/cheetah:16/BP41.250916.012.A1/14330953:user/release-keys]
[ro.vendor_dlkm.build.fingerprint]: [google/cheetah_beta/cheetah:16/BP41.250916.012.A1/14330953:user/release-keys]
ASUS_I006D:/ $




Notes

see the Evolution WIki for the supported build flags. To use a build flag, simply export the flag as environment variable before starting the build, e.g

to disable GAPPS use

export WITH_GMS=false


Use the script print_security_patch to print the build_id that must be used in the parameter for the lunch and brunch commands ( bp2a in this example):

[xtrnaw7@t15g /devpool001/develop/evolutionX_11.4]$ print_security_patch
Retrieving the security patch level for the repository at "/devpool001/develop/evolutionX_11.4" ...
The repository uses the new definitions
The current security patch is "2025-08-05"
The current build_id is "bp2a"
[xtrnaw7@t15g /devpool001/develop/evolutionX_11.4]$
 

Note that the OS image created using the default config contains all partition images:

[xtrnaw7@t15g /devpool001/develop/evolutionX_11.4]$ view_payload_bin.sh out/target/product/sake/EvolutionX-16.0-20251118-sake-11.4.1-Unofficial-all.zip

Processing the file "out/target/product/sake/EvolutionX-16.0-20251118-sake-11.4.1-Unofficial-all.zip" ...
payload.bin: /tmp/payload.2544810/payload.bin
Payload Version: 2
Payload Manifest Length: 185331
Payload Manifest Signature Length: 267
Found partitions:
abl (602 kB), aop (246 kB), bluetooth (1.1 MB), boot (101 MB), cpucp (106 kB), devcfg (49 kB), dsp (67 MB), dtbo (25 MB), featenabler (90 kB), hyp (3.7 MB), keymaster (287 kB), modem (182 MB), multiimgoem (16 kB), odm (1.7 MB), product (3.0 GB), qupfw (57 kB), qweslicstore (262 kB), shrm (49 kB), system (1.1 GB), system_ext (541 MB), tz (3.8 MB), uefisecapp (127 kB), vbmeta (8.2 kB), vbmeta_system (4.1 kB), vendor (1.0 GB), vendor_boot (101 MB), vendor_dlkm (36 MB), xbl (3.7 MB), xbl_config (221 kB), xrom (537 MB)
[xtrnaw7@t15g /devpool001/develop/evolutionX_11.4]$



To create an OS image only with images for the OS dependent partitions, remove the config for the vendor specific partitions from the file device/asus/sake/BoardConfig.mk (see the instructions above)
See here for details about the partitions in the OS image


see the section How to compile the OmniROM Custom ROM for the ASUS Zenfone 8 for guides to compile the OmniROM for the ASUS Zenfone 8.


see the section How to compile other Custom ROMs for the ASUS Zenfone 8 for a list of HowTos with instructions to compile other custom ROMs for the ASUS Zenfone 8 (e.g. LineageOS 22.x, /e/, crDroid, evolutionX, etc)
The entry also contains a list of sections with instructions to create TWRP or OrangeFox recovery images for the various custom ROMs.


Note that the OS image for the ASUS Zenfone 8 created with these instructions does not contain KernelSU.

see How to compile the evolutionX Custom ROM for the ASUS Zenfone 8 with kernelSU for instructions to add KernelSU-Next to the OS image.
However, please note that as of 21.11.2025, I have not been able to create a bootable boot.img file with KernelSU for this evolutionX version.


see How to create a OrangeFox Recovery for LineageOS 22.x or newer on the ASUS Zenfone 8 using the OrangeFox Recovery Builder 2024 for instructions to create an OrangeFox recovery for LineageOS based Custom ROMs for the ASUS Zenfone 8 that supports mounting all partitions (including /data) using the OrangeFox Recovery Builder on github.com. 



History of this entry

22.11.2025

replaced the command  " brunch lineage_sake-bp2a-userdebug"  with "m eovlution"


18.11.2025

initial release




How to compile the evolutionX 11.6 Custom ROM for the ASUS Zenfone 8


URL: not yet published


How to compile the evolutionX 11.6 Custom ROM for the ASUS Zenfone 8

To compile the evolutionX 11.6 Custom ROM for the ASUS Zenfone 8 use the instructions to install the evolution 11.4 Custom ROM with these modifications:

The command to init the repo is:

# init the repositories for evolutionX

repo init -u https://github.com/Evolution-X/manifest -b bq2 --git-lfs


The manifest for the ASUS Zenfone 8 related repositories is:

# create the manifest file with the repositories for the ASUS Zenfone 8
#
mkdir -p .repo/local_manifests

cat >.repo/local_manifests/asus_sake.xml <<EOT
<?xml version="1.0" encoding="UTF-8"?>
<manifest>

  <project path="device/asus/sake"   name="LineageOS/android_device_asus_sake" remote="github" revision="lineage-23.2" />

  <project path="vendor/asus/sake"   name="TheMuppets/proprietary_vendor_asus_sake"  remote="github" revision="lineage-23.2" />

  <project path="kernel/asus/sm8350" name="LineageOS/android_kernel_asus_sm8350" remote="github" revision="lineage-23.2" />

</manifest>
EOT


The lunch command for compiling the evolutionX 11.6 is

lunch lineage_sake-bp4a-userdebug


((see also the original instructions to build the EvolutionX Custom ROM : https://github.com/Evolution-X/manifest))


I successfully installed evolutionX 11.6 on my ASUS Zenfone 8:








History of this entry

29.01.2026

initial release





How to compile the evolutionX 12.x Custom ROM for the ASUS Zenfone 8


URL: https://xdaforums.com/t/guide-how-to-compile-a-lineageos-24-based-customrom-for-a-phone-supported-by-lineageos-but-not-by-the-customrom.4801826/


How to compile the evolutionX 12.x Custom ROM for the ASUS Zenfone 8

EvolutionX is a LineageOS based Custom ROM that is official not supported for the ASUS Zenfone 8.

I successfully compiled the EvolutionX 12.x Custom ROM (= LineageOS 24 based; LineageOS 24 is Android 17) for the ASUS Zenfone 8 with the commands listed below..


# create a directory for the repositories
#
mkdir -p /devpool002/develop/evolutionX/evolutionX_12.x


# init the repositories
#
cd /devpool002/develop/evolutionX/evolutionX_12.x

repo init -u https://github.com/Evolution-X/manifest -b cnb --git-lfs &&  \
  repo sync -c -j$(nproc --all) --force-sync --no-clone-bundle --no-tags


# add the repositories for the ASUS Zenfone 8
#
if [ ! -r .repo/local_manifests/asus_sake.xml ] ; then
  mkdir -p .repo/local_manifests
#
# As of 12.09.2026 there is no revision 24.0 for the repository "
TheMuppets/proprietary_vendor_asus_sake" available
#

  cat  .repo/local_manifests/asus_sake.xml <<EOT

<?xml version="1.0" encoding="UTF-8"?>
<manifest>

  <project path="device/asus/sake"   name="LineageOS/android_device_asus_sake" remote="github" revision="lineage-24.0" />

  <project path="vendor/asus/sake"   name="TheMuppets/proprietary_vendor_asus_sake"  remote="github" revision="lineage-23.2" />

  <project path="kernel/asus/sm8350" name="LineageOS/android_kernel_asus_sm8350" remote="github" revision="lineage-24.0" />

</manifest
EOT

# sync the repositories for the ASUS Zenfone 8
#
  repo sync

fi

# correct the BoardConfig.mk file for the ASUS Zenfone 8

#
if [ -r device/asus/sake/BoardConfig.mk ] ; then

# create a backup of the original BoardConfig.mk file
#
  [ ! -r device/asus/sake/BoardConfig.mk.org ] && cp device/asus/sake/BoardConfig.mk device/asus/sake/BoardConfig.mk.org

# Optional: Correct the CPU variant in the BoardConfig.mk file
#
  grep TARGET_2ND_ARCH_VARIANT device/asus/sake/BoardConfig.mk |grep armv8-2a >/dev/null

  if [ $? -ne 0 ] ; then
    sed -i -e "s/TARGET_2ND_ARCH_VARIANT := armv8-a/TARGET_2ND_ARCH_VARIANT := armv8-2a/g" device/asus/sake/BoardConfig.mk
  fi


# Optional create an image with only the mandatory partitions (with the default config the images for all partitions are in the ZIP file with the OS image)
#
  sed -i -e "s#^include vendor/asus/sake/BoardConfigVendor.mk##g" device/asus/sake/BoardConfig.mk

else

  echo "ERROR: device/asus/sake/BoardConfig.mk does not exist"
fi


# build the image
#
source build/envsetup.sh


lunch lineage_sake-cp2a-userdebug && \
   m evolution


Result





To create an EvolutionX 12.x image with MicroG instead of the Google Apps execute the instructions from this Guide

How to create an evolutionX Custom ROM image with MicroG

with one change: The command to download the partner_gms.mk file for Evolution 12.x is:

wget https://raw.githubusercontent.com/LineageOS/android_vendor_lineage/refs/heads/lineage-24.0/config/partner_gms.mk -O vendor/lineage/config/partner_gms.mk


Use the OrangeFox Recovery Builder 2024 to create an OrangeFox recovery for EvolutionX 12.x on the ASUS Zenfone 8 - see the instructions in the section

How to create a OrangeFox Recovery for LineageOS 22.x or newer on the ASUS Zenfone 8 using the OrangeFox Recovery Builder 2024



Notes


see also the hints in these sections :

Memory usage while Building an Android 17 based custom ROM

Flashing a different Custom ROM with OrangeFox on the ASUS Zenfone 8


for further documentation see these Guides:

How to compile the evolutionX 11.6 Custom ROM for the ASUS Zenfone 8

How to compile the evolutionX 11.4 Custom ROM for the ASUS Zenfone 8

How to compile the evolutionX Custom ROM for the ASUS Zenfone 8 with kernelSU

How to compile the evolutionX 10.7 Custom ROM for the ASUS Zenfone 8



----

History of this entry

14.09.2026

initial release


----
  

How to compile the evolutionX Custom ROM for the ASUS Zenfone 8 with kernelSU


URL: https://xdaforums.com/t/how-to-compile-the-evolutionx-custom-rom-for-the-asus-zenfone-8-with-kernelsu.4754054/


How to compile the evolutionX Custom ROM for the ASUS Zenfone 8 with kernelSU


Update 19.11.2025

I have successfully created a working boot.img file with KernelSU for evolutionX 10.7 using the instructions below, but I have not yet managed to create a working boot.img file with KernelSU for evolutionX 11.4.




The sections above with instructions to compile the EvolutionX Custom ROM contains the instructions to compile the evolutionX custom ROM for the ASUS Zenfone 8.
The OS image created with these instructions does not contain kernelSU, unlike the official builds for evolutionX for other phones.


To compile the evolutionX for the ASUS Zenfone 8 with kernelSU, these instructions can be used:


The repositories for kernelSU can not be used to add kernelSU to the evolutionX image for the ASUS Zenfone 8 because the current kernelSU sources no longer support the kernel version used on this phone.

Therefore, Instead of the original kernelSU source, we use the source for KernelSU-Next: KernelSU-Next supports the old kernel versions out of the box.

To add KernelSU-Next to the OS image, change the working directory to the top directory with the repositories for evolutionX and then execute these commands (see also https://kernelsu-next.github.io/webpage/pages/installation.html)

(These commands only need to be executed once to add the KernelSU-Next repository to the repositories for evolutionX)


# change the current working directory to the kernel source directory
#
cd ./kernel/asus/sm8350

# retrieve the setup script for KernelSU-Next and execute it (the script installs and configures the KernelSU-Next repository)
#
curl -LSs "https://raw.githubusercontent.com/KernelSU-Next/KernelSU-Next/next/kernel/setup.sh" | bash -


# add the necessary compile flag for KernelSU-Next to the Makefile
#
cp drivers/kernelsu/Makefile  drivers/kernelsu/Makefile.org

( echo "ccflags-y += -DKSU_NEXT" ; cat drivers/kernelsu/Makefile.org ) >drivers/kernelsu/Makefile


The build the image for the boot partition:

# init the build environment (if not already done)
#
cd -
source build/envsetup.sh

# if not already done - execute lunch also, e.g for the ASUS Zenfone 8:
#
lunch lineage_sake-bp2a-userdebug

# create the boot image

#
mka clobber; mka bootimage



If the build of the boot image is successfull, the boot image is in the file

out/target/product/sake/boot.img


To test the boot image (assuming evolutionX is currently installed on the phone):

adb reboot bootloader ;  fastboot boot out/target/product/sake/boot.img


This command boots the phone from the just created boot partition image into the OS installed on the phone.


To check if KernelSU-Next is working, download and install the KernelSU-Next app from https://github.com/KernelSU-Next/KernelSU-Next/releases/:

KERNELSU_NEXT_APK="KernelSU_Next_v1.0.9_12797-release.apk"

# download the apk to the PC
#
wget -O "${KERNELSU_NEXT_APK}"  "https://github.com/KernelSU-Next/KernelSU-Next/releases/download/v1.0.9/${KERNELSU_NEXT_APK}"

# install the apk on the phone using "adb shell" on the PC (or copy the apk to the phone and install it using the Android GUI)
#
cat "${KERNELSU_NEXT_APK}" | adb shell pm install -S $( stat -c "%s"  "${KERNELSU_NEXT_APK}" )


If everything is okay, the app should look like this:




Now simply create a new OS image with KernelSU-Next using the standard build commands:

# init the environment (if not already done)
#
source build/envsetup.sh

lunch lineage_sake-bp1a-userdebug

m evolution


Notes

To build an OS image without KernelSU-Next, delete the line

ccflags-y += -DKSU_NEXT

in the file

./kernel/asus/sm8350/drivers/kernelsu/Makefile

and recreate the image.

Please note that the environment variables in the session where the build is started are not inherited by the process executing make to compile the kernel.


To change the name of the ZIP file with the OS image for builds with enabled KernelSU-Next add the lines

ifeq ($(WITH_KSU_NEXT),true)
EVO_VERSION := ${EVO_VERSION}-ksu
endif

to the file

./vendor/lineage/config/version.mk

before the line starting with

LINEAGE_VERSION :=

and define the environment variable

WITH_KSU_NEXT=true

before starting the build (The string -ksu can be replaced with any other string).



The boot.img file created for the evolutionX Custom ROM can also be used to add KernelSU-Next to other ROMs for the ASUS Zenfone 8 based on LineageOS 22.2 that are using the same kernel sources (like crDroid 11.7)

As of 09.08.2025 the current version of the KernelSU-Next app is 1.0.9 - it's recommended to check https://github.com/KernelSU-Next/KernelSU-Next/releases/ for a newer version of the apk (use the link "Show all n assets" on that page to see the apks)

There is no pre-compiled kernelSU image for the kernel used in the evolutionX Custom ROM (kernelSU only supplies precompiled kernels for Linux Kernel 5.10 or newer).

To create a kernel without kernelSU, delete the line

ccflags-y += -DKSU_NEXT

in the file drivers/kernelsu/Makefile and recreate the kernel


TroubleShooting

If the build of the boot image with KernelSU fails with the error message:

ld.lld: error: undefined symbol: path_umount

disable the umount for all kernel versions in the function ksu_umount_mnt like this:

static int ksu_umount_mnt(struct path *path, int flags)
{
        // TODO: umount for non GKI kernel
        return -ENOSYS;
}

The function is in the file drivers/kernelsu/core_hook.c.


To stop or start the KernelSU-Next app in a shell, these commands can be use:

# stop the KernelSU-Next app
#
am force-stop com.rifsxd.ksunext

# start the KernelSU-Next app
#
am start -n com.rifsxd.ksunext/.ui.MainActivity


If KernelSU-Next is not working at all or not working as expected you can enable kernel debug messages:

To compile the kernel with debug code add the statements

CONFIG_DYNAMIC_DEBUG=y
CONFIG_DEBUG_KERNEL=y
CONFIG_KSU_DEBUG=y


to the kernel config file and recompile the kernel. In the source for the ASUS Zenfone 8 the file with the kernel config is:

/devpool001/develop/OmniROM_16.0/kernel/asus/sm8350/arch/arm64/configs/vendor/zf8_defconfig

The final kernel config used to compile the kernel is in the file:

/devpool001/develop/OmniROM_16.0/out/target/product/zenfone8/obj/KERNEL_OBJ/.config


If the kernel was built with the options

CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y

the config is available while the kernel is booted:

cat /proc/config.gz | gzip -d > kernel.config


To enable the filesystem

/sys/kernel/debug

add the option

CONFIG_DEBUG_FS=y

to the kernel config.

Note that in my tests the kernel from the OmniROM 16 for the ASUS Zenfone 8 did not boot a kernel compiled with this setting


see also https://kernelsu.org/guide/how-to-build.html

----



History of this entry

19.11.2025

added the info about disabling the function ksu_umount_mnt
corrected the command to install the app KernelSU_Next_v1.0.9_12797-release.apk
added the link to the original documentation
added the info about not working boot.img with KernelSU for evolutionX 11.4


11.08.2025

added trouble shooting infos


09.08.2025

initial release






How to create an evolutionX Custom ROM image with MicroG


URL: https://xdaforums.com/t/guide-how-to-create-an-evolutionx-custom-rom-image-with-microg.4769168/


How to create an evolutionX Custom ROM image with MicroG

Because the LineageOS supports signature spoofing for MicroG since February 2025, it is now quite easy to create an evolutionX image with MicroG.

To create an evolutionX Custom ROM with MicroG the following instructions can be used:

First add the repository for MicroG:

cat >.repo/local_manifests/microg.xml <<EOT
<?xml version="1.0" encoding="UTF-8"?>
<manifest>

    <project path="vendor/partner_gms" name="lineageos4microg/android_vendor_partner_gms" remote="github" revision="master" />

</manifest>
EOT

# download the repository
#
repo sync vendor/partner_gms


Next add the makefile for the MicroG packages from the LineageOS repository:

wget https://raw.githubusercontent.com/LineageOS/android_vendor_lineage/refs/heads/lineage-23.0/config/partner_gms.mk -O vendor/lineage/config/partner_gms.mk

The config file for the MicroG packages uses the flag WITH_GMS to distinguish between images with and without MicroG. The variable WITH_GMS is already used in the config files for evolutionX to enable or disable the GAPPS packages.
Therefore, change that variable in the makefile for the MicroG packages:

sed -i -e "s/WITH_GMS/WITH_MICROG/g"  vendor/lineage/config/partner_gms.mk

Then add the makefile for the MicroG packages to the list of make files for the evolutionX image:

cp  vendor/lineage/config/common.mk vendor/lineage/config/common.mk.org
echo "-include vendor/lineage/config/partner_gms.mk" >>vendor/lineage/config/common.mk

Optional, to change the name of the ZIP file with the MicroG packages add the lines

ifeq ($(WITH_MICROG),true)
EVO_VERSION := $(EVO_VERSION_BASE)-Microg
endif

to the file

vendor/lineage/config/version.mk

after the lines

ifeq ($(WITH_GMS),true)
EVO_VERSION := $(EVO_VERSION_BASE)
else
EVO_VERSION := $(EVO_VERSION_BASE)-Vanilla
endif


Now you can create an evolutionX OS image with MicroG using these commands:

# Note : "sake" in this example is the code for the ASUS Zenfone 8 ; to create an image for another phone change it accordingly
#        dito for the build id ("bp2a" in this example)
#
source build/envsetup.sh

lunch lineage_sake-bp2a-userdebug

# Disable GAPPS
#
export WITH_GMS=false

# enable MicroG
#
export WITH_MICROG=true

m evolution


Notes

An OS image may contain GAPPS or MicroG but not both. To abort the build if both are enabled, add code like this to the file BoardConfig.mk for your phone, e.g. for the ASUS Zenfone 8 in the file:

device/asus/sake/BoardConfig.mk

ifeq ($(WITH_GMS),true)
  ifeq ($(WITH_MICROG),true)
    $(error WITH_GMS and WITH_MICROG are set!)
  endif
endif

see How to build a Custom ROM with MicroG for general instructions to add MicroG to a LineageOS based OS



History of this entry

11.09.2026

Corrected the code to create the XML file with the repository for MicroG (replace "echo" with "cat")
Added the missing command "source build/envsetup.sh" to the instructiosn to build the image
 
22.11.2025

initial release





How to compile the LMODroid 6.x Custom ROM for the ASUS Zenfone 8


URL: https://xdaforums.com/t/how-to-compile-lmodroid-6-x-for-the-asus-zenfone-8.4762570/


How to compile the LMODroid 6.x Custom ROM for the ASUS Zenfone 8

LMODroid is another LineageOS based Custom ROM.

AFAIK the LMODroid images for the ASUS Zenfone 8 were discontinued in 2023.

But now, October 2025, there are new OS images with LMODroid for the ASUS Zenfone 8 available.

The LMODroid OS images can be downloaded from here:

https://get.libremobileos.com/devices/sake/builds


As of 05.10.2025 the latest version of LMODroid for the ASUS Zenfone 8 is 6.2 -- this is Android 15.



To compile LMODroid 6.x yourself, follow these instructions:

# init the repositories with LMODroid

repo init -u https://git.libremobileos.com/LMODroid/manifest.git -b fifteen-qpr2 --git-lfs

# add the repositories for the ASUS Zenfone 8
#
mkdir -p .repo/local_manifests

cat >>.repo/local_manifests/local_manifests.xml  <<EOT
<manifest>

    <remote  name="github"
        fetch="ssh://git@github.com" />

  <project path="device/asus/sake"   name="LMODroid-Devices/device_asus_sake" remote="github" revision="fifteen-qpr2" />

  <project path="vendor/asus/sake"   name="TheMuppets/proprietary_vendor_asus_sake"  remote="github" revision="lineage-22.2" />

  <project path="kernel/asus/sm8350" name="LineageOS/android_kernel_asus_sm8350" remote="github" revision="lineage-22.2" />

</manifest>
EOT

# sync the repositories
#
repo sync -c -j$(nproc --all) --force-sync --no-clone-bundle --no-tags

# setup the build environment
#
source build/envsetup.sh

# prepare the build
#
lunch lmodroid_sake-bp1a-user

# build the OS
#
brunch lmodroid_sake-bp1a-user




Notes:

Use the script print_security_patch to get the release version for the lunch and brunch commands, e.g:

xtrnaw7@t540p:/devpool001/develop/LMODroid_6.x$ print_security_patch
Retrieving the security patch level for the repository at "/devpool001/develop/LMODroid_6.x" ...
The repository uses the new definitions
The current security patch is "2025-05-05"
The current build_id is "bp1a"
xtrnaw7@t540p:/devpool001/develop/LMODroid_6.x$
 

See How to build a Custom ROM with GAPPS for instructions to add GAPPS to the OS image with LMODroid 
The repository with device dependent files for LMODroid is here: https://git.libremobileos.com/LMODroid-Devices

The gerrit for LMODroid is here:  https://gerrit.libremobileos.com/q/status:open+-is:wip

see the section How to compile other Custom ROMs for the ASUS Zenfone 8 for a list of HowTos with instructions to compile other custom ROMs for the ASUS Zenfone 8 (e.g. LineageOS 22.x, /e/, crDroid, evolutionX, etc)
The entry also contains a list of sections with instructions to create TWRP or OrangeFox recovery images for the various custom ROMs.




History of this entry

05.10.2025

initial release



 

How to compile the iodeOS 4.x Custom ROM for the ASUS Zenfone 8


URL: https://xdaforums.com/t/how-to-compile-the-iodeos-4-x-for-the-asus-zenfone-8.4767607/


How to compile the iodeOS 4.x Custom ROM for the ASUS Zenfone 8

iodeOS is another LineageOS based Custom ROM that does not support the ASUS Zenfone 8 but can be easily build for the ASUS Zenfone 8.


The official instructions to build the iodeOS are here

https://gitlab.iode.tech/os/public/manifests/android



To build an iodeOS 4.x image (based on LineageOS 20 = Android 13) for the ASUS Zenfone 8 execute these steps:

# define some variables

# branch to use (v4 is LineageOS 20 = Android 13)
#
BRANCH="v4-staging"

LINEAGE_VERSION="
lineage-20"

LOCAL_DIR="
/datapool001/develop/iodeos/4.x"


# create a new directory for the iodeOS repositories
#
mkdir -p "${LOCAL_DIR}"

cd "${LOCAL_DIR}"


# init the iodeOS repositories
#
repo init -u https://gitlab.iode.tech/os/public/manifests/android.git -b ${BRANCH}


mkdir -p .repo/local_manifests

# ignore the repositories for the emulator
#
cat >.repo/local_manifests/remove-bloat.xml <<EOT
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
    <remove-project name="device/generic/mini-emulator-arm64" />
    <remove-project name="device/generic/mini-emulator-x86" />
    <remove-project name="device/generic/mini-emulator-x86_64" />
</manifest>
EOT


# add the repositories necessary for building an OS image for the ASUS Zenfone 8
#
cat >.repo/local_manifests/local_manifests.xml <<EOT
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
  <project name="TheMuppets/proprietary_vendor_asus_sake" path="vendor/asus/sake" revision="${
LINEAGE_VERSION}" clone-depth="1" />
</manifest>
EOT


# download the repositories with the source code for the iodeOS
#
repo sync --force-sync

# download the Git LFS stored objects

cd "${LOCAL_DIR}"/vendor/extra

git lfs pull iode ${BRANCH}

cd
"${LOCAL_DIR}"


# prepare the build environment
#
source build/envsetup.sh


# the lunch command downloads the missing repositories for the ASUS Zenfone 8

#
lunch lineage_sake-user




# start the build
#
time brunch lineage_sake-user


I have successfully installed the image on the ASUS Zenfone 8:






Notes

There is also a docker image for building the iodeOS :

https://github.com/petefoth/IodeBuild

Te docker image can also be used to build an image for an unsupported device but I did not test that yet.


Use the OrangeFox Recovery Builder 2024 to create a OrangeFox recovery for iodeOS 6.x on the ASUS Zenfone 8.


see the section How to compile other Custom ROMs for the ASUS Zenfone 8 for a list of HowTos with instructions to compile other custom ROMs for the ASUS Zenfone 8 (e.g. LineageOS 22.x, /e/, crDroid, evolutionX, etc)
The entry also contains a list of sections with instructions to create TWRP or OrangeFox recovery images for the various custom ROMs.


see How to compile the iodeOS 6.x Custom ROM for the ASUS Zenfone 8 for instructions to compile iodeOS 6.x for the ASUS Zenfone 8.



History of this entry


16.11.2025

added screenshot

11.11.2025

initial release





How to compile the iodeOS 6.x Custom ROM for the ASUS Zenfone 8


URL: https://xdaforums.com/t/how-to-compile-the-iodeos-6-x-for-the-asus-zenfone-8.4767906/


How to compile the iodeOS 6.x Custom ROM for the ASUS Zenfone 8

iodeOS is another LineageOS based Custom ROM that does not support the ASUS Zenfone 8 but can be easily build for the ASUS Zenfone 8.


The official instructions to build the iodeOS are here

https://gitlab.iode.tech/os/public/manifests/android



To build an iodeOS 6.x image (= LineageOS 21 = Android 14) for the ASUS Zenfone 8 execute these steps:


# define some variables

# branch to use
(v6 is LineageOS 22 = Android 15)
#
BRANCH="v6.9"

LINEAGE_VERSION="
lineage-22.2"

LOCAL_DIR="
/datapool001/develop/iodeos/6.x"


# create a new directory for the iodeOS repositories
#
mkdir -p "${LOCAL_DIR}"

cd "${LOCAL_DIR}"


# init the iodeOS repositories
#
repo init -u https://gitlab.iode.tech/os/public/manifests/android.git -b ${BRANCH}


# download the repositories with the source code for the iodeOS
#
repo sync --force-sync

# download the Git LFS stored objects

cd "${LOCAL_DIR}"/vendor/extra

git lfs pull iode ${BRANCH}

cd
"${LOCAL_DIR}"


# add the repositories necessary for building an OS image for the ASUS Zenfone 8
#
mkdir -p .repo/local_manifests

cat >.repo/local_manifests/local_manifests.xml <<EOT
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
  <project name="TheMuppets/proprietary_vendor_asus_sake" path="vendor/asus/sake" revision="${
LINEAGE_VERSION}" clone-depth="1" />
</manifest>
EOT


# download the LineageOS repositories for vendor/asus
#
repo sync TheMuppets/proprietary_vendor_asus_sake


# cleanup the local repositories
#
# When testing the build of iodeOS 6.x on my PC, I had to clean up the local repositories with the following commands:

# In my tests the sync of the repository for OpenEUICC.apk always failed when executing the "repo sync" command but manually syncing the repository works.
# As of 14.11.2025 the config files for the build require this repository for OpenEUICC
#
if [  ! -r packages/apps/OpenEUICC/OpenEUICC.apk ] ; then
  sed -i -e 's|<project path="packages/apps/OpenEUICC" name="lineage/packages_apps_OpenEUICC" remote="iode" />|<project path="packages/apps/OpenEUICC" name="lineage/packages_apps_OpenEUICC" remote="iode" revision="v6.8" />|g'
  repo sync lineage/packages_apps_OpenEUICC
fi

#
# As of 14.11.2025 there are two directories for OpenEUICC in the repository tree -- only one of them is required -> disable the duplicate package
#
if [ -r packages/apps/OpenEUICC/OpenEUICC.apk -a -r vendor/extra/prebuilts/OpenEUICC/OpenEUICC.apk ] ; then
   mv vendor/extra/prebuilts/OpenEUICC/Android.mk vendor/extra/prebuilts/OpenEUICC/Android.mk.org
fi


# In my tests at 14.11.2025 the "repo sync" command did not resolve the lfs pointer for the chromium-webview package -> download the real webview.apk manually file if necessary
#
file  external/chromium-webview/prebuilt/arm64/webview.apk  | grep "Android package" >/dev/null || \
 ( cd  external/chromium-webview/prebuilt/arm64 && git lfs pull )


# correct the SHA1 checksum for the image files for the ASUS Zenfone 8
#
cp vendor/asus/sake/Android.mk vendor/asus/sake/Android.mk.org

cat >vendor/asus/sake/Android.mk <<EOT
#
# Automatically generated file. DO NOT MODIFY
#

LOCAL_PATH := \$(call my-dir)

ifeq (\$(TARGET_DEVICE),sake)
$(cd vendor/asus/sake && sha1sum radio/*.img | awk '{ print "$(call add-radio-file-sha1-checked,"$2","$1")" }' )
endif
EOT

# prepare the build environment
#
source build/envsetup.sh

# the lunch command downloads the missing repositories for the ASUS Zenfone 8
#
lunch lineage_sake-bp1a-user


# IMPORTANT: remove the images for the vendor specific partitions from the payload.bin file
#
cp device/asus/sake/BoardConfig.mk device/asus/sake/BoardConfig.mk.org
sed -i -e "s|include vendor/asus/sake/BoardConfigVendor.mk|#include vendor/asus/sake/BoardConfigVendor.mk|g"  device/asus/sake/BoardConfig.mk


# start the build
#
time brunch lineage_sake-bp1a-user


Check the result:

[xtrnaw7@t540p /devpool001/develop/iodeos/6.x]$ ls -l out/target/product/sake/*zip
-rw-r--r--. 2 xtrnaw7 xtrnaw7 1467208397 Nov 14 00:04 out/target/product/sake/iode-6.9-20251113-sake.zip
-rw-r--r--. 2 xtrnaw7 xtrnaw7 1467208397 Nov 14 00:04 out/target/product/sake/lineage_sake-ota.zip
[xtrnaw7@t540p /devpool001/develop/iodeos/6.x]$


WARNING:

Make sure, that the OS image with iodeOS 6.x does NOT contain images for vendor specific partitions (like abl, aop, etc).
If the OS image contains images for the vendor specific partitions, the ASUS Zenfone 8 no longer starts up and only boots into EDL mode!
In this case, the vendor-specific partitions must be restored in EDL mode so that the phone boots again (see here for instructions to restore the partitions in EDL mode)

The instructions in this guide correct the build configuration files accordingly so that only the images with the partitions for the OS are in the payload.bin file. However, it is still recommended to check the contents of the payload.bin file after creating the operating system image to ensure that this is indeed the case.

The payload.bin file may only contain images for these partitions:


    boot
    dtbo
    odm
    product
    system
    system_ext
    vbmeta
    vbmeta_system
    vendor
    vendor_dlkm
    vendor_boot

Use a payload dumper like https://github.com/ssut/payload-dumper-go to extract the files in the file payload.bin
.

Example
[xtrnaw7@t15g /datapool001/develop/iodeos/6.x]$ mkdir temp
[xtrnaw7@t15g /datapool001/develop/iodeos/6.x]$

[xtrnaw7@t15g /datapool001/develop/iodeos/6.x]$ cd temp
[xtrnaw7@t15g /datapool001/develop/iodeos/6.x]$

[xtrnaw7@t15g /datapool001/develop/iodeos/6.x/temp]$ unzip ../out/target/product/sake/iode-6.9-20251116-sake.zip payload.bin
Archive:  ../out/target/product/sake/iode-6.9-20251116-sake.zip
signed by SignApk
 extracting: payload.bin            
[xtrnaw7@t15g /datapool001/develop/iodeos/6.x]$

[xtrnaw7@t15g /datapool001/develop/iodeos/6.x/temp]$ ls -lh payload.bin
-rw-r--r--. 1 xtrnaw7 xtrnaw7 1.4G Jan  1  2009 payload.bin
[xtrnaw7@t15g /datapool001/develop/iodeos/6.x/temp]$


[xtrnaw7@t15g /datapool001/develop/iodeos/6.x/temp]$ payload-dumper-go -l payload.bin
payload.bin: payload.bin
Payload Version: 2
Payload Manifest Length: 136341
Payload Manifest Signature Length: 267
Found partitions:
boot (101 MB), dtbo (25 MB), odm (1.5 MB), product (2.1 GB), system (1.1 GB), system_ext (487 MB), vbmeta (8.2 kB), vbmeta_system (4.1 kB), vendor (1.0 GB), vendor_boot (101 MB), vendor_dlkm (37 MB)
[xtrnaw7@t15g /datapool001/develop/iodeos/6.x/temp]$



(see also Partition images in the file payload.bin for the LineageOS)


see also here for details about the partitions in the OS image


I successfully installed iodeOS 6.9 on my ASUS Zenfone 8:







Notes

Use the script print_security_patch to get the build ID for the lunch and brunch commands ("bp1a" in this example), e.g.:

[xtrnaw7@t15g /datapool001/develop/iodeos/6.x]$ print_security_patch
Retrieving the security patch level for the repository at "/datapool001/develop/iodeos/6.x" ...
The repository uses the new definitions
The current security patch is "2025-05-05"
The current build_id is "bp1a"
[xtrnaw7@t15g /datapool001/develop/iodeos/6.x]$


Use the OrangeFox Recovery Builder 2024 to create an OrangeFox recovery for iodeOS 6.x on the ASUS Zenfone 8.


There is also a docker image for building the iodeOS :

https://github.com/petefoth/IodeBuild

Te docker image can also be used to build an image for an unsupported device but I did not test that yet.


see How to compile the iodeOS 4.x Custom ROM for the ASUS Zenfone 8 for instructions to compile iodeOS 4.x for the ASUS Zenfone 8.


see the section How to compile other Custom ROMs for the ASUS Zenfone 8 for a list of HowTos with instructions to compile other custom ROMs for the ASUS Zenfone 8 (e.g. LineageOS 22.x, /e/, crDroid, evolutionX, etc)
The entry also contains a list of sections with instructions to create TWRP or OrangeFox recovery images for the various custom ROMs.




History of this entry

31.01.2026

corrected the instructions to build the iode OS (the order of the commands was wrong)


16.11.2025

added instructions to remove the images of vendor specific partitions from the file payload.bin in the ZIP file with the OS image

14.11.2025

initial release





How to compile the iodeOS 7.x Custom ROM for the ASUS Zenfone 8


URL: not yet published


How to compile the iodeOS 7.x Custom ROM for the ASUS Zenfone 8

iodeOS is another LineageOS based Custom ROM that does not support the ASUS Zenfone 8 but can be easily build for the ASUS Zenfone 8.


The official instructions to build the iodeOS are here

https://gitlab.iode.tech/os/public/manifests/android



To compile the iodeOS 7.x Custom ROM for the ASUS Zenfone 8 these commands can be use:


# define some variables

# branch to use (v7 is LineageOS 23 = Android 16)
#
BRANCH="v7.1"

LINEAGE_VERSION="lineage-23.0"

LOCAL_DIR="/datapool001/develop/iodeos/7.x"


# create a new directory for the iodeOS repositories
#
mkdir -p "${LOCAL_DIR}"

cd "${LOCAL_DIR}"


# init the iodeOS repositories
#
repo init -u https://gitlab.iode.tech/os/public/manifests/android.git -b ${BRANCH}


# add the repositories necessary for building an OS image for the ASUS Zenfone 8
#
mkdir -p .repo/local_manifests

cat >.repo/local_manifests/local_manifests.xml <<EOT
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
  <project name="TheMuppets/proprietary_vendor_asus_sake" path="vendor/asus/sake" revision="${LINEAGE_VERSION}" clone-depth="1" />
</manifest>
EOT


# download the repositories with the source code for the iodeOS
#
repo sync --force-sync


# download the Git LFS stored objects

cd "${LOCAL_DIR}"/vendor/extra

git lfs pull iode ${BRANCH}

cd "${LOCAL_DIR}"


# download the lfs object for webview.apk if necessary

file external/chromium-webview/prebuilt/arm64/webview.apk  | grep "Android package" >/dev/null || \
 ( cd  external/chromium-webview/prebuilt/arm64 && git lfs pull )


# correct the SHA1 check sum for the image files for the ASUS Zenfone 8

cp vendor/asus/sake/Android.mk vendor/asus/sake/Android.mk.org

cat >vendor/asus/sake/Android.mk <<EOT
#
# Automatically generated file. DO NOT MODIFY
#

LOCAL_PATH := \$(call my-dir)

ifeq (\$(TARGET_DEVICE),sake)
$(cd vendor/asus/sake && sha1sum radio/*.img | awk '{ print "$(call add-radio-file-sha1-checked,"$2","$1")" }' )
endif
EOT


# prepare the build environment
#
source build/envsetup.sh

# the lunch command downloads the missing repositories for the ASUS Zenfone 8
#
lunch lineage_sake-bp2a-user


# IMPORTANT: remove the images for the vendor specific partitions from the payload.bin file
#
cp device/asus/sake/BoardConfig.mk device/asus/sake/BoardConfig.mk.org
sed -i -e "s|include vendor/asus/sake/BoardConfigVendor.mk|#include vendor/asus/sake/BoardConfigVendor.mk|g"  device/asus/sake/BoardConfig.mk


# start the build
#
brunch lineage_sake-bp2a-user


I have successfully compiled and installed an iodeOS 7.1 image for the ASUS Zenfone 8:





History of this entry

01.02.2026

initial release





How to compile the DerpFest 16.0 Custom ROM for the ASUS Zenfone 8


URL: https://xdaforums.com/t/how-to-compile-the-derpfest-custom-rom-for-the-asus-zenfone-8-or-any-other-phone-supported-by-the-lineageos.4772592/


How to compile the DerpFest 16.0 Custom ROM for the ASUS Zenfone 8

DerpFest is another LineageOS based Custom ROM that does not support the ASUS Zenfone 8 but can be easily compiled for the ASUS Zenfone 8 (or for other phones supported by LineageOS).

To compile DerpFest for another phone configure the correct repository for the vendor files for that phone and simply replace the codename "sake" in the instructions below with the code name for that other phone (see https://wiki.lineageos.org/devices/ for the device names of the phones supported by the LineageOS)


The official instructions to build the DerpFest Custom ROM (including basic instructions to build the Custom ROM for not official supported phones) are here:

https://derpfest.org/build

The DerpFest Custom ROM can be compiled for the ASUS Zenfone 8 using the instructions from that page and some minor additional tasks:


To build an DerpFest 16.0 image (= LineageOS 23 = Android 16) for the ASUS Zenfone 8 execute these steps:


# create a directory for the repositories with the source code
#
mkdir /devpool001/develop/derpfest/16

cd /devpool001/develop/derpfest/16

# init the repositories with the source code
#
repo init -u https://github.com/DerpFest-AOSP/android_manifest.git  -b 16 --git-lfs

# add the repository with the vendor specific files for the ASUS Zenfone 8 (= codename "sake")
#
cat >.repo/local_manifests/asus_sake.xml <<EOT
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
   <project name="TheMuppets/proprietary_vendor_asus_sake" path="vendor/asus/sake" remote="github" revision="lineage-23.0"/>
</manifest>
EOT

# download the repositories with the source code
#
repo sync -c -j$(nproc --all) --force-sync --no-clone-bundle --no-tags

# init the build environment
#
. build/envsetup.sh


# (optional) replace "armv8-a" with "armv8-2a"
#
[ ! -r
device/asus/sake/BoardConfig.mk.org ] && cp device/asus/sake/BoardConfig.mk device/asus/sake/BoardConfig.mk.org
sed  -i -e  "s/armv8-a/armv8-2a/g" device/asus/sake/BoardConfig.mk


# optional: do not add the images for not mandatory partitions to the ZIP file with the OS image
#
[ ! -r device/asus/sake/BoardConfig.mk.org ] && cp device/asus/sake/BoardConfig.mk device/asus/sake/BoardConfig.mk.org
sed -i -e "s|include vendor/asus/sake/BoardConfigVendor.mk|#include vendor/asus/sake/BoardConfigVendor.mk|g"  device/asus/sake/BoardConfig.mk


#
# Notes : According to the official build instructions "bp2a" is a fixed value for building this Custom ROM
#         The lunch command will download the repositories with the device tree and the kernel for the ASUS Zenfone 8 from the LineageOS repositories
#
lunch lineage_sake-bp2a-user

# start the build
#
mka derp


Result:







How to create a DerpFest Custom ROM without GAPPS

In the default config, the DerpFest Custom ROM is always built with the Google Apps (GAPPS). To create a DerpFest Custom ROM without GAPPS, disable adding GAPPS to the Custom ROM using these commands before starting the build:

cp ./vendor/google/gms/Android.bp vendor/google/gms/Android.bp.org
echo >./vendor/google/gms/Android.bp

cp ./vendor/google/gms/gms-vendor.mk ./vendor/google/gms/gms-vendor.mk.org
echo >./vendor/google/gms/gms-vendor.mk


Note:

DerpFest contains code that requires GAPPS to be installed. Therefore, error messages or harmless app crashes will occur if DerpFest is created without GAPPS. To work around these issues, either install MicroG or modify the source code:

Details
One file that must be changed to avoid error messages and crashes is
   
frameworks/base/core/java/com/android/internal/util/PropImitationHooks.java

To build a DerpFest OS image without GAPPS modify the file like this:

# diff -u frameworks/base/core/java/com/android/internal/util/PropImitationHooks.java.orgframeworks/base/core/java/com/android/internal/util/PropImitationHooks.java
--- frameworks/base/core/java/com/android/internal/util/PropImitationHooks.java.org    2025-12-19 10:02:23.257638106 +0100
+++ frameworks/base/core/java/com/android/internal/util/PropImitationHooks.java    2025-12-19 14:36:49.326216146 +0100
@@ -49,6 +49,7 @@
 import java.util.Locale;
 import java.util.Map;
 import java.util.Set;
+import android.content.pm.PackageManager;
 
 /**
  * @hide
@@ -417,26 +418,35 @@
         return false;
     }
 
-    public static boolean shouldBypassTaskPermission(Context context) {
-        // GMS/Finsky don't have MANAGE_ACTIVITY_TASKS permission
-        final int callingUid = Binder.getCallingUid();
+public static boolean shouldBypassTaskPermission(Context context) {
+    final int callingUid = Binder.getCallingUid();
+    PackageManager pm = context.getPackageManager();
+
+    try {
+        if (isPackageInstalled(pm, PACKAGE_GMS)) {
+            int gmsUid = pm.getApplicationInfo(PACKAGE_GMS, 0).uid;
+            if (callingUid == gmsUid) return true;
+        }
+
+        if (isPackageInstalled(pm, PACKAGE_FINSKY)) {
+            int finskyUid = pm.getApplicationInfo(PACKAGE_FINSKY, 0).uid;
+            if (callingUid == finskyUid) return true;
+        }
+    } catch (Exception e) {
+        // ignore silently in no-GApps builds
+    }
 
-        try {
-            int gmsUid = context.getPackageManager()
-                    .getApplicationInfo(PACKAGE_GMS, 0).uid;
-            int finskyUid = context.getPackageManager()
-                    .getApplicationInfo(PACKAGE_FINSKY, 0).uid;
-
-            dlog("shouldBypassTaskPermission: gmsUid:" + gmsUid +
-                    " finskyUid:" + finskyUid +
-                    " callingUid:" + callingUid);
+    return false;
+}
 
-            return (callingUid == gmsUid || callingUid == finskyUid);
-        } catch (Exception e) {
-            Log.e(TAG, "shouldBypassTaskPermission: unable to get gms/finsky uid", e);
-            return false;
-        }
+private static boolean isPackageInstalled(PackageManager pm, String pkg) {
+    try {
+        pm.getApplicationInfo(pkg, 0);
+        return true;
+    } catch (PackageManager.NameNotFoundException e) {
+        return false;
     }
+}
 
     private static boolean isCallerPlayIntegrity() {
         return Arrays.stream(Thread.currentThread().getStackTrace())


Note:

There may be other source files with code that depends on the installed GAPPS.

----


How to create a DerpFest Custom ROM with MicroG

To create a DerpFest Custom ROM with MicroG remove the GAPPS from the build config (see above) and then add the MicroG packages using the instructions from this HowTo.

Be aware that the default build type for DerpFest is "user". Therefore, the check for a debug build must be disabled in the file

frameworks/base/services/core/java/com/android/server/pm/ComputerEngine.java

e.g.:

# diff -u  frameworks/base/services/core/java/com/android/server/pm/ComputerEngine.java.orgframeworks/base/services/core/java/com/android/server/pm/ComputerEngine.java
--- frameworks/base/services/core/java/com/android/server/pm/ComputerEngine.java.org    2025-12-19 11:31:41.969478777 +0100
+++ frameworks/base/services/core/java/com/android/server/pm/ComputerEngine.java    2025-12-19 11:32:06.336292561 +0100
@@ -1493,9 +1493,9 @@
     private static native boolean isDebuggable();
 
     public static boolean isMicrogSigned(AndroidPackage p) {
-        if (!isDebuggable()) {
-            return false;
-        }
+//        if (!isDebuggable()) {
+//            return false;
+//        }
 
         // Allowlist the following apps:
         // * com.android.vending - microG Companion


Please note that I have NOT tested whether DerpFest's spoofing feature also works with MicroG instead of GAPPS!





Notes



When creating the DerpFest Custom ROM for the ASUS Zenfone 8 with repositories synched on 17.12.2025, the build failed due to duplicate SELinux Context definitions with error messages like these:

[ 66% 134675/203893] //system/sepolicy:vendor_sepolicy.cil.raw Building cil for vendor_sepolicy.cil.raw [common]
FAILED: out/soong/.intermediates/system/sepolicy/vendor_sepolicy.cil.raw/android_common/sake/vendor_sepolicy.cil.raw
out/host/linux-x86/bin/checkpolicy -C -M -c 30 -o out/soong/.intermediates/system/sepolicy/vendor_sepolicy.cil.raw/android_common/sake/vendor_sepolicy.cil.raw out/soong/.intermediates/system/sepolicy/vendor_sepolicy.conf/android_common/sake/vendor_sepolicy.conf && out/host/linux-x86/bin/build_sepolicy filter_out -f out/soong/.intermediates/system/sepolicy/reqd_policy_mask.cil/android_common/reqd_policy_mask.cil -t out/soong/.intermediates/system/sepolicy/vendor_sepolicy.cil.raw/android_common/sake/vendor_sepolicy.cil.raw # hash of input list: a280144da0c8859377c73359c948fbeb843fd873e0d070f8a10d6bffdb95c042
device/asus/sake/sepolicy/vendor/genfs_contexts:41:ERROR 'duplicate entry for genfs entry (sysfs, /devices/platform/soc/188101c.qcom,spss/subsys5/wakeup)' at token 'genfscon' on line 64577:
genfscon sysfs /devices/platform/soc/5c00000.qcom,ssc/subsys7/wakeup                                                                u:object_r:sysfs_wakeup:s0
genfscon sysfs /devices/platform/soc/188101c.qcom,spss/subsys5/wakeup                                                               u:object_r:sysfs_wakeup:s0
checkpolicy:  error(s) encountered while parsing configuration
11:38:40 ninja failed with: exit status 1


To fix these errors, I removed all duplicate SELinux context definitions with the commands listed below:

Commands to delete duplicate SELinux context definitions
sed -i -e "/\/devices\/platform\/soc\/5c00000.qcom,ssc\/subsys7\/wakeup/ s/^genfscon/#genfscon/g" device/asus/sake/sepolicy/vendor/genfs_contexts.

sed -i -e "/\/devices\/platform\/soc\/188101c.qcom,spss\/subsys5\/wakeup/ s/^genfscon/#genfscon/g" device/asus/sake/sepolicy/vendor/genfs_contexts

sed -i -e "/\/devices\/platform\/soc\/890000.qcom,qup_uart\/wakeup/ s/^genfscon/#genfscon/g" device/asus/sake/sepolicy/vendor/genfs_contexts

sed -i -e "/\/devices\/platform\/soc\/894000.i2c\/i2c-6\/6-0068\/wakeup/ s/^genfscon/#genfscon/g" device/asus/sake/sepolicy/vendor/genfs_contexts

sed -i -e "/\/devices\/platform\/soc\/98900000.qcom,turing\/subsys4\/wakeup/ s/^genfscon/#genfscon/g" device/asus/sake/sepolicy/vendor/genfs_contexts

sed -i -e "/\/devices\/platform\/soc\/98900000.qcom,turing\/wakeup/ s/^genfscon/#genfscon/g" device/asus/sake/sepolicy/vendor/genfs_contexts

sed -i -e "/\/devices\/platform\/soc\/aab0000.qcom,venus\/subsys10\/wakeup/ s/^genfscon/#genfscon/g" device/asus/sake/sepolicy/vendor/genfs_contexts

sed -i -e "/\/devices\/platform\/soc\/abb0000.qcom,evass\/subsys1\/wakeup/ s/^genfscon/#genfscon/g" device/asus/sake/sepolicy/vendor/genfs_contexts

sed -i -e "/\/devices\/platform\/soc\/abb0000.qcom,evass\/wakeup/ s/^genfscon/#genfscon/g" device/asus/sake/sepolicy/vendor/genfs_contexts

sed -i -e "/\/devices\/platform\/soc\/b0000000.qcom,cnss-qca6490\/subsys9\/wakeup/ s/^genfscon/#genfscon/g" device/asus/sake/sepolicy/vendor/genfs_contexts

sed -i -e "/\ \/devices\/platform\/soc\/c440000.qcom,spmi\/spmi-0\/spmi0-03\/c440000.qcom,spmi:qcom,pm8350b@3:qcom,amoled\/wakeup/ s/^genfscon/#genfscon/g" device/asus/sake/sepolicy/vendor/genfs_contexts

sed -i -e "/\/devices\/platform\/soc\/soc:qcom,ipa_fws\/subsys0\/wakeup/ s/^genfscon/#genfscon/g" device/asus/sake/sepolicy/vendor/genfs_contexts


sed -i -e "/\/devices\/platform\/soc\/soc:qcom,kgsl-hyp\/subsys3\/wakeup/ s/^genfscon/#genfscon/g" device/asus/sake/sepolicy/vendor/genfs_contexts

sed -i -e "/\/devices\/platform\/soc\/soc:qcom,ipa_fws\/subsys0\/wakeup/ s/^genfscon/#genfscon/g" device/asus/sake/sepolicy/vendor/genfs_contexts

sed -i -e "/\/devices\/platform\/soc\/soc:qcom,trustedvm@d0800000\/subsys2\/wakeup/ s/^genfscon/#genfscon/g" device/asus/sake/sepolicy/vendor/genfs_contexts






If you change one of the apk files in the directory

vendor/google/gms/proprietary

keep in mind that the script

vendor/google/gms/vendorsetup.sh

that is executed by the script

source build/envsetup.sh

always overwrites some of the apk files:

cat vendor/google/gms/vendorsetup.sh
[xtrnaw7@gem10 /devpool001/develop/derpfest/16]$ cat vendor/google/gms/vendorsetup.sh
# Merge GMS blobs
cat vendor/google/gms/proprietary/product/priv-app/Messages/Messages.apk.part* > vendor/google/gms/proprietary/product/priv-app/Messages/Messages.apk
cat vendor/google/gms/proprietary/product/priv-app/GmsCore/GmsCore.apk.part* > vendor/google/gms/proprietary/product/priv-app/GmsCore/GmsCore.apk
cat vendor/google/gms/proprietary/product/priv-app/Velvet/Velvet.apk.part* > vendor/google/gms/proprietary/product/priv-app/Velvet/Velvet.apk
cat vendor/google/gms/proprietary/product/app/TrichromeLibrary64/TrichromeLibrary64.apk.part* > vendor/google/gms/proprietary/product/app/TrichromeLibrary64/TrichromeLibrary64.apk
cat vendor/google/gms/proprietary/product/app/Gmail2/Gmail2.apk.part* > vendor/google/gms/proprietary/product/app/Gmail2/Gmail2.apk
cat vendor/google/gms/proprietary/product/app/Photos/Photos.apk.part* > vendor/google/gms/proprietary/product/app/Photos/Photos.apk
cat vendor/google/gms/proprietary/product/app/YouTube/YouTube.apk.part* > vendor/google/gms/proprietary/product/app/YouTube/YouTube.apk
cat vendor/google/gms/proprietary/product/app/Maps/Maps.apk.part* > vendor/google/gms/proprietary/product/app/Maps/Maps.apk
[xtrnaw7@gem10 /devpool001/develop/derpfest/16]$


----



The DerpFest Custom ROM uses the default recovery from LineageOS with one additional restriction:

In the default build, adb access is only possible as user shell -- there is no root access in the recovery .



To create another flavour of the DerpFest Custom ROM use the command

derpfest <codename>

e.g. for the ASUS Zenfone 8:

derpfest sake




History of this entry

19.09.2026

corrected the command to create manifest file with the vendor files for the ASUS Zenfone 8 ; the exetension of the manifest file must be .xml -- not html


18.09.2026

corrected the command to create manifest file with the vendor files for the ASUS Zenfone 8

21.12.2025

corrected a syntax error in the commands to correct the SELinux contexts

20.12.2025

initial release





How to compile the DerpFest 17.0 Custom ROM for the ASUS Zenfone 8


URL: https://xdaforums.com/t/guide-how-to-compile-the-customrom-derpfest-17-android-17-for-a-phone-not-official-supported-by-this-custom-rom.4802285/


How to compile the DerpFest 17.0 Custom ROM for the ASUS Zenfone 8

DerpFest is another LineageOS based Custom ROM that does not support the ASUS Zenfone 8 but can be easily compiled for the ASUS Zenfone 8 (or for other phones supported by LineageOS).

To compile DerpFest for another phone configure the correct repository for the vendor files for that phone and simply replace the codename "sake" in the instructions below with the code name for that other phone (see https://wiki.lineageos.org/devices/ for the device names of the phones supported by the LineageOS)


The official instructions to build the DerpFest Custom ROM (including basic instructions to build the Custom ROM for a not official supported phone) are here:

https://derpfest.org/build


The DerpFest Custom ROM can be compiled for the ASUS Zenfone 8 using the instructions from that page and some minor additional tasks:


To build an DerpFest 17.0 image (= LineageOS 24 = Android 17) for the ASUS Zenfone 8 execute these steps:


# create a directory for the repositories with the source code
#
mkdir /devpool001/develop/derpfest/17

cd /devpool001/develop/derpfest/17


# init the repositories with the source code
#
repo init -u https://github.com/DerpFest-AOSP/android_manifest.git  -b 17 --git-lfs

# The repositories with the device tree and the kernel for the ASUS Zenfone 8 are part of the repositories with the LineageOS; the
# "lunch" command downloads these repositories automatically if necessary
#
# add the repository with the vendor specific files for the ASUS Zenfone 8 (= codename "sake")
#
# Note: As of 19.09.2026 there is no revision 24.0 for the repository with the vendor files for sake
#
cat >.repo/local_manifests/asus_sake.xml <<EOT
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
   <project name="TheMuppets/proprietary_vendor_asus_sake" path="vendor/asus/sake" remote="github" revision="lineage-23.2"/>
</manifest>
EOT


# ----------------------------------------------------------------------------------------------

# download the repositories with the source code
#
repo sync -c -j$(nproc --all) --force-sync --no-clone-bundle --no-tags


# ----------------------------------------------------------------------------------------------

# init the build environment
#
. build/envsetup.sh


# ----------------------------------------------------------------------------------------------

# prepare the environment for the build and download the repositories with the device tree and the kernel if not already done
#
lunch lineage_sake-cp2a-userdebug


# ----------------------------------------------------------------------------------------------

# as of 19.09.2026 there is a permission for com.google.android.deskclock missing
#
# -> add the permission "android.permission.SCHEDULE_EXACT_ALARM" for com.google.android.deskclock if it is missing
#
# Note: Without this permission the phone is in a boot loop after booting from the new created image
#
XML_FILE="vendor/pixel/gms/common/proprietary/product/etc/permissions/privapp-permissions-google-p.xml"

sed -n '/<privapp-permissions package="com.google.android.deskclock">/,/<\/privapp-permissions>/p' ${XML_FILE} | grep android.permission.SCHEDULE_EXACT_ALARM >/dev/null
if [ $? -ne 0 ]; then
   [ ! -r ${XML_FILE}.org ] && cp ${XML_FILE} ${XML_FILE}.org
   sed -i -e 's#<privapp-permissions package="com.google.android.deskclock">#<privapp-permissions package="com.google.android.deskclock">\n      <permission name="android.permission.SCHEDULE_EXACT_ALARM"/>#g' \
${XML_FILE}

fi


# ----------------------------------------------------------------------------------------------

# optional: replace "armv8-a" with "armv8-2a"
#
[ ! -r device/asus/sake/BoardConfig.mk.org ] && cp device/asus/sake/BoardConfig.mk device/asus/sake/BoardConfig.mk.org
sed  -i -e  "s/armv8-a/armv8-2a/g" device/asus/sake/BoardConfig.mk


# ----------------------------------------------------------------------------------------------
# optional: do not add the images for not mandatory partitions to the ZIP file with the OS image
#
[ ! -r device/asus/sake/BoardConfig.mk.org ] && cp device/asus/sake/BoardConfig.mk device/asus/sake/BoardConfig.mk.org
sed -i -e "s|include vendor/asus/sake/BoardConfigVendor.mk|#include vendor/asus/sake/BoardConfigVendor.mk|g"  device/asus/sake/BoardConfig.mk


# ----------------------------------------------------------------------------------------------
# optional: remove GBoard (the Google keyboard (com.android.inputmethod.latin) that does not work very well in Custom ROMs
#
grep LatinIMEGooglePrebuilt vendor/pixel/gms/common/common-vendor.mk >/dev/null
if [ $? -eq 0 ] ; then
  [ -r vendor/pixel/gms/common/common-vendor.mk ] && cp vendor/pixel/gms/common/common-vendor.mk vendor/pixel/gms/common/common-vendor.mk.org
  sed -i -e "/LatinIMEGooglePrebuilt.*/d"  vendor/pixel/gms/common/common-vendor.mk
fi

# ----------------------------------------------------------------------------------------------
 
# start the build
#
m derp



Result:






Use the OrangeFox Recovery Builder 2024 to create an OrangeFox recovery for DerpFest 17 on the ASUS Zenfone 8 - see the instructions in the section

How to create a OrangeFox Recovery for LineageOS 22.x or newer on the ASUS Zenfone 8 using the OrangeFox Recovery Builder 2024




History of this entry

19.09.2026

initial release



 

Instructions to compile TWRP for the ASUS Zenfone 8 

 


How to compile TWRP for the ASUS Zenfone 8


URL: https://xdaforums.com/t/how-to-compile-twrp-for-the-asus-zenfone-8.4523817/



Update 14.02.2026

As of today, TWRP 3.7.0.1 for the ASUS Zenfone 8 only partially works if OmniROM 16.x based on Android 16 QPR2 or newer is installed on the ASUS Zenfone 8. Therefore, it's recommended to use OrangeFox instead.
There is no official OrangeFox recovery for the ASUS Zenfone 8 but it's simple to create it -- see here for instructions.




How to compile TWRP for the ASUS Zenfone 8


There are a lot of web pages about building your own TWRP image in the internet but at least I did not find a HowTo with all necessary instructions and infos in one place.

Therefor I wrote this little HowTo about building a TWRP image for the ASUS Zenfone 8. The instructions in the HowTo can also be used to create TWRP images for other phones supported by TWRP.

Note that this HowTo can only be used for phones that are officially supported by TWRP. The HowTo is for a PC running the Linux OS.


In the end, creating a TWRP image is also quite easy once you know how it works, thanks to the well-done setup of the development environment by the TWRP developer.


Prereqs

The repositories with the manifests for TWRP are here https://github.com/minimal-manifest-twrp and the repositories with the TWRP files and the device trees for the phones supported by TWRP are here: https://github.com/TeamWin. So you need access to github for creating your own TWRP image.

The tool repo is required to maintain the repositories for TWRP; you can download repo from https://gerrit.googlesource.com/git-repo

It's not necessary to install additional tools for creating an TWRP image -- all necessary tools to create the image are in the repositories for TWRP.


Note

To check if there is a repository with the device tree for another phone for TWRP use the search function on the page https://github.com/TeamWin and search for the device ID of the phone.

To search via script use (I006D is the device ID for the ASUS Zenfone 8):

wget "https://api.github.com/search/repositories?q=I006D" -O ./repository_list


search example for the ASUS Zenfone 8
[ OmniRom 13 Dev - xtrnaw7@t15g /data/develop/android/twrpX ] $ wget "https://api.github.com/search/repositories?q=I006D" -O ./repository_list
--2022-11-27 09:20:27--  https://api.github.com/search/repositories?q=I006D
Resolving api.github.com (api.github.com)... 140.82.121.5
Connecting to api.github.com (api.github.com)|140.82.121.5|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/json]
Saving to: ‘./repository_list’

./repository_list                                      [ <=>                                                                                                            ]  46.30K  --.-KB/s    in 0.01s  


2022-11-27 09:20:28 (3.55 MB/s) - ‘./repository_list’ saved [47414]

[ OmniRom 13 Dev - xtrnaw7@t15g /data/develop/android/twrpX ] $

[ OmniRom 13 Dev - xtrnaw7@t15g /data/develop/android/twrpX ] $ grep "full_name"  ./repository_list
      "full_name": "CaptainThrowback/android_device_asus_I006D",
      "full_name": "nguyenhung9xdev2022/android_kernel_asus_I006D",
      "full_name": "nguyenhung9xdev2022/android_vendor_asus_I006D",
      "full_name": "nguyenhung9xdev2022/android_device_asus_I006D",
      "full_name": "asus-development/android_device_asus_I006D",
      "full_name": "OpenPecha-Data/I006D4C7E",
      "full_name": "dmd79/android_device_asus_I006D",
[ OmniRom 13 Dev - xtrnaw7@t15g /data/develop/android/twrpX ] $



To get the device ID for a phone execute :

adb shell getprop ro.product.system.device

e,g.

#
# on a PC for a connected ASUS Zenfone 8
#
[xtrnaw7@t15g /data/develop/android/twrp]$ adb shell getprop ro.product.system.device
I006D
[xtrnaw7@t15g /data/develop/android/twrp]$

#
# on the ZUK Z2 Pro
#
z2_row:/ # getprop ro.product.system.device
z2_row
z2_row:/ #


The device ID is required for the lunch command used to copy the repositories with the device trees (see below).



Building the ROM

First copy the necessary repositories for building TWRP to your local machine using these commands:

#
# create a new directory for the repositories (optional)
#
mkdir twrp
cd twrp

# init the local repositories
#
# As of 27.11.2022 the latest version of the TWRP repositories is 12.1 ;
# to download the default repository version you can omit the parameter "-b twrp-12.1"
# As of 27.11.2022 the repositories for TWRP 12.1 use about 45 GB;
# to save some space (about 12 GB) you could add the parameter
--depth=1
#
repo init -u https://github.com/minimal-manifest-twrp/platform_manifest_twrp_aosp.git -b twrp-12.1

# sync the repositories (Parameter-j8
= use 8 parallel jobs; adjust this parameter to the number of CPU available on your PC)
#
repo sync -c -j8 --force-sync --no-clone-bundle --no-tags



Next add the device dependent repositories for the ASUS Zenfone 8.

The format of the parameter for the lunch command is

twrp_<device_id>-eng

So the parameter for the ASUS Zenfone 8 is twrp_I006D-eng.


#
# init the environment to build the TWRP image
#
. build/envsetup.sh

export ALLOW_MISSING_DEPENDENCIES=true

lunch twrp_I006D-eng



lunch example
TWRP Dev - xtrnaw7@t15g /data/develop/android/twrp ] $ lunch twrp_I006D-eng
In file included from build/make/core/config.mk:313:
In file included from build/make/core/envsetup.mk:312:
build/make/core/product_config.mk:160: error: Can not locate config makefile for product "twrp_I006D".
11:35:37 dumpvars failed with: exit status 1
Device I006D not found. Attempting to retrieve device repository from TeamWin Github (http://github.com/TeamWin).
Found repository: android_device_asus_I006D
Checking branch info
Calculated revision: android-12.1
Adding dependency:
Repository: android_device_asus_I006D
Branch: android-12.1
Remote: TeamWin
Path: device/asus/I006D

Syncing repository to retrieve project.
Fetching: 100% (1/1), done in 12.846s
NOT Garbage collecting: 0% (0/1), done in 0.001s
repo sync has finished successfully.
Repository synced!
Looking for dependencies
Adding dependencies to manifest

Adding dependency:
Repository: android_device_asus_sm8350-common
Branch: android-12.1
Remote: TeamWin
Path: device/asus/sm8350-common

Syncing dependencies
Fetching: 100% (1/1), done in 15.848s
NOT Garbage collecting: 0% (0/1), done in 0.001s
repo sync has finished successfully.
Looking for dependencies
device/asus/sm8350-common has no additional dependencies.
Done

============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=99.87.36
TARGET_PRODUCT=twrp_I006D
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=generic
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv8-a
TARGET_2ND_CPU_VARIANT=generic
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-6.0.9-200.fc36.x86_64-x86_64-Fedora-Linux-36-(MATE-Compiz)
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=SP2A.220405.004
OUT_DIR=out
PRODUCT_SOONG_NAMESPACES=device/asus/sm8350-common
============================================
[ TWRP Dev - xtrnaw7@t15g /data/develop/android/twrp ] $




And final build the TWRP image

mka bootimage


mka bootimage example
[ TWRP Dev - xtrnaw7@t15g /data/develop/android/twrp ] $ time mka bootimage
build/make/core/soong_config.mk:197: warning: BOARD_PLAT_PUBLIC_SEPOLICY_DIR has been deprecated. Use SYSTEM_EXT_PUBLIC_SEPOLICY_DIRS instead.
build/make/core/soong_config.mk:198: warning: BOARD_PLAT_PRIVATE_SEPOLICY_DIR has been deprecated. Use SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS instead.
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=99.87.36
TARGET_PRODUCT=twrp_I006D
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=generic
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv8-a
TARGET_2ND_CPU_VARIANT=generic
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-6.0.9-200.fc36.x86_64-x86_64-Fedora-Linux-36-(MATE-Compiz)
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=SP2A.220405.004
OUT_DIR=out
PRODUCT_SOONG_NAMESPACES=device/asus/sm8350-common
============================================
[ 78% 246/312] including bootable/recovery/Android.mk ...
bootable/recovery/prebuilt/Android.mk:437: warning: vendor_hw: bootable/recovery/prebuilt/relink.sh out/target/product/I006D/recovery/root/vendor/bin/hw
[ 95% 299/312] including system/sepolicy/Android.mk ...
system/sepolicy/Android.mk:57: warning: BOARD_PLAT_PUBLIC_SEPOLICY_DIR has been deprecated. Use SYSTEM_EXT_PUBLIC_SEPOLICY_DIRS instead.
system/sepolicy/Android.mk:62: warning: BOARD_PLAT_PRIVATE_SEPOLICY_DIR has been deprecated. Use SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS instead.
[ 30% 8637/28297] //bionic/libc:libc_bionic clang arch-arm64/bionic/setjmp.S
....
Removing unneeded service: keymaster-4-1-citadel

Service_Cleanup script complete.

[100% 28297/28297] Target boot image from recovery: out/target/product/I006D/boot.img

#### build completed successfully (14:50 (mm:ss)) ####


real 14m50.110s
user 182m6.217s
sys 11m58.492s
[ TWRP Dev - xtrnaw7@t15g /data/develop/android/twrp ] $



Note:

For devices without A/B devices use mka recoveryimage.


The TWRP image will be created in file boot.img in the directory ./out/target/product/I006D, e.g.:

[ TWRP Dev - xtrnaw7@t15g /data/develop/android/twrp ] $ ls -ltr out/target/product/I006D/boot.img
-rw-rw-r--. 1 xtrnaw7 xtrnaw7 100663296 Nov 27 12:06 out/target/product/I006D/boot.img
[ TWRP Dev - xtrnaw7@t15g /data/develop/android/twrp ] $ 


To test the image just boot the phone from the image

adb reboot bootloader

sudo fastboot boot out/target/product/I006D/boot.img


And check if the boot was succesfull:

[ OmniRom 13 Dev - xtrnaw7@t15g /data/develop/android/twrpX ] $  adb shell getprop ro.bootmode
unknown
[ OmniRom 13 Dev - xtrnaw7@t15g /data/develop/android/twrpX ] $

unknown is the expected value here.


Trouble Shooting

On some pages I found a hint that the build scripts require python2 and will not work with python3. But this is most probably not true anymore because building the image with python3 worked without problems.


It's strongly recommended to use separate sessions for compiling OmniROM or TWRP or even different versions of TWRP:

All these build environments define the same commands in the file ./build/envsetup.sh but with different functionality.


As of 27.11.2022 there are only 2 branches in the repository with the manifests for TWRP : version 11 and version 12.1.
If there is no branch for one of these versions in the repositories for the device tree of the phone for which you want to create a TWRP image the lunch command will fail.

The repositories with the manifests for TWRP prior to version 11 can be fetched with this command:

# Minimal manifest for building TWRP for devices shipped with Android 5.1 through Android 9.0
#
repo init -u https://github.com/minimal-manifest-twrp/platform_manifest_twrp_omni.git -b twrp-9.0


Note that the lunch command in the old repositories does work different 


The warning message

[ OmniRom 16 - xtrnaw7@t15g //devpool001/develop/twrp_dev002 ] $ . build/envsetup.sh
Warning: completion file /devpool001/develop/twrp_dev002/tools/asuite/asuite.sh not found
[ OmniRom 16 - xtrnaw7@t15g //devpool001/develop/twrp_dev002 ]

can be ignored - asuite.sh a script used for the Android Studio Suite that is not used for building the TWRP image.


Notes:

The URL to the repository with the device tree for a phone is also on the page for the device on the TWRP device list: https://twrp.me/Devices/

See https://unofficialtwrp.com/build-compile-twrp-recovery/ for other possible settings for the build

see here for How to add additional files to an TWRP image

see also How to compile the image for TWRP 3.7.0.12-1 w/ the bootctl binary      

XDA Forum thread about compiling TWRP: How to compile TWRP touch recovery

see also OrangeFox Recovery using the OrangeFox Recovery Builder 2024 for a method to build the  TWRP recovery image or the OrangeFox recovery image on github.com




How to compile the image for TWRP 3.7.0.12-1 w/ the bootctl binary


URL: https://xdaforums.com/t/how-to-compile-the-image-for-twrp-3-7-0-12-1-w-the-bootctl-binary.4650684/


How to compile the image for TWRP 3.7.0.12-1 w/ the bootctl binary
In the official images for TWRP version 3.7.0.12-1 the binaries

bootctl
lpdump
lpdumpd
lptools


are not included anymore - see here: https://github.com/TeamWin/android_bootable_recovery/commit/aa3c77a0b5364782ab734cd8c511b85798d7452d

But it's simple to create your own TWRP image that again contains these binaries:

The post How to compile TWRP for the ASUS Zenfone8 describes in general how to compile the TWRP image.

To compile a TWRP image for version 3.7.0.12-1 that contains the missing binaries, use these commands:

# make the directory with the TWRP source the working directory
#
cd /data/develop/android/twrp

. build/envsetup.sh

export ALLOW_MISSING_DEPENDENCIES=true

# set this variable to include the missing binaries in the TWRP image
#
export TW_INCLUDE_LPDUMP=yes

# create a TRWP image for the ASUS Zenfone 8 (change the parameter for lunch to match your phone!)
#
lunch twrp_I006D-eng

mka bootimage





Instructions to compile OrangeFox for the ASUS Zenfone 8



How to compile the OrangeFox Recovery for the ASUS Zenfone 8


URL: https://xdaforums.com/t/how-to-compile-the-orangefox-recovery-for-the-asus-zenfone-8.4692137/


How to compile the OrangeFox Recovery for the ASUS Zenfone 8

The OrangeFox Recovery (https://wiki.orangefox.tech/) is a recovery for Android phones based on TWRP. There is currently no official build of the OrangeFox recovery image for the ASUS Zenfone 8 (see https://orangefox.download/ for the list of officially supported phones) but it's quite simple to create an OrangeFox recovery image for the ASUS Zenfone 8.

There is a detailed guide on how to create an OrangeFox recovery image: https://wiki.orangefox.tech/en/dev/building. This guide is sufficient to create an OrangeFox recovery image for someone who knows how to build an Android ROM.

In this post, I document the steps I took to successfully compile an OrangeFox recovery image for the ASUS Zenfone 8 using the instructions from that page.


First create and init the repository for the OrangeFox recovery image using the instructions from the OrangeFox wiki:


cd /devpool001/develop/orangefox/

mkdir ./OrangeFox_sync
cd ./OrangeFox_sync

git clone https://gitlab.com/OrangeFox/sync.git

cd ./sync/

./orangefox_sync.sh --branch 12.1 --path  /devpool001/develop/orangefox/fox_12.1


The repositories for the OrangeFox recovery images are now in the directory /devpool001/develop/orangefox/fox_12.1.


Now we need the device tree for the ASUS Zenfone 8. Because there is already a TRWP image for the ASUS Zenfone 8 it's not necessary to create a device tree for that phone from scratch. The lunch command automatically downloads the device tree from the TWRP repositories for the phone.

Therefor to start the build use these commands:

cd /devpool001/develop/orangefox/fox_12.1

export ALLOW_MISSING_DEPENDENCIES=true

export FOX_BUILD_DEVICE=I006D

export LC_ALL="C"

# This variable is necessary for installing the recovery via zip file
#
export TARGET_DEVICE_ALT="gssi,ASUS_I006D"


source build/envsetup.sh

lunch twrp_I006D-eng

mka adbd bootimage



Example output
[ OrangeFox DEV - xtrnaw7@t15g /devpool001/develop/orangefox/fox_12.1 ] $ ls -l device/
total 1
drwxrwxr-x. 4 xtrnaw7 xtrnaw7 4 Sep 10 22:15 qcom
drwxrwxr-x. 2 xtrnaw7 xtrnaw7 2 Sep 10 22:19 xiaomi
[ OrangeFox DEV - xtrnaw7@t15g /devpool001/develop/orangefox/fox_12.1 ] $

[ OrangeFox DEV - xtrnaw7@t15g /devpool001/develop/orangefox/fox_12.1 ] $ export ALLOW_MISSING_DEPENDENCIES=true
[ OrangeFox DEV - xtrnaw7@t15g /devpool001/develop/orangefox/fox_12.1 ] $
[ OrangeFox DEV - xtrnaw7@t15g /devpool001/develop/orangefox/fox_12.1 ] $ export FOX_BUILD_DEVICE=I006D
[ OrangeFox DEV - xtrnaw7@t15g /devpool001/develop/orangefox/fox_12.1 ] $
[ OrangeFox DEV - xtrnaw7@t15g /devpool001/develop/orangefox/fox_12.1 ] $ export LC_ALL="C"
[ OrangeFox DEV - xtrnaw7@t15g /devpool001/develop/orangefox/fox_12.1 ] $
[ OrangeFox DEV - xtrnaw7@t15g /devpool001/develop/orangefox/fox_12.1 ] $ export TARGET_DEVICE_ALT="gssi,ASUS_I006D"
[ OrangeFox DEV - xtrnaw7@t15g /devpool001/develop/orangefox/fox_12.1 ] $
[ OrangeFox DEV - xtrnaw7@t15g /devpool001/develop/orangefox/fox_12.1 ] $
[ OrangeFox DEV - xtrnaw7@t15g /devpool001/develop/orangefox/fox_12.1 ] $ source build/envsetup.sh                 
[ OrangeFox DEV - xtrnaw7@t15g /devpool001/develop/orangefox/fox_12.1 ] $
[ OrangeFox DEV - xtrnaw7@t15g /devpool001/develop/orangefox/fox_12.1 ] $ lunch twrp_I006D-eng
In file included from build/make/core/config.mk:313:
In file included from build/make/core/envsetup.mk:312:
build/make/core/product_config.mk:160: error: Can not locate config makefile for product "twrp_I006D".
13:00:32 dumpvars failed with: exit status 1
Device I006D not found. Attempting to retrieve device repository from TeamWin Github (http://github.com/TeamWin).
Found repository: android_device_asus_I006D
Checking branch info
Calculated revision: android-12.1
Adding dependency:
Repository: android_device_asus_I006D
Branch: android-12.1
Remote: TeamWin
Path: device/asus/I006D

Syncing repository to retrieve project.
Fetching: 100% (1/1), done in 5.643s
repo sync has finished successfully.
Repository synced!
Looking for dependencies
Adding dependencies to manifest

Adding dependency:
Repository: android_device_asus_sm8350-common
Branch: android-12.1
Remote: TeamWin
Path: device/asus/sm8350-common

Syncing dependencies
Fetching: 100% (1/1), done in 2.980s
repo sync has finished successfully.
Looking for dependencies
device/asus/sm8350-common has no additional dependencies.
Done

============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=99.87.36
TARGET_PRODUCT=twrp_I006D
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=generic
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv8-a
TARGET_2ND_CPU_VARIANT=generic
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-6.10.8-100.fc39.x86_64-x86_64-Fedora-Linux-39-(MATE-Compiz)
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=SP2A.220405.004
OUT_DIR=/devpool001/develop/orangefox/fox_12.1/out
PRODUCT_SOONG_NAMESPACES=device/asus/sm8350-common
============================================
[ OrangeFox DEV - xtrnaw7@t15g /devpool001/develop/orangefox/fox_12.1 ] $

[ OrangeFox DEV - xtrnaw7@t15g /devpool001/develop/orangefox/fox_12.1 ] $ du -hs device/asus/*
20M    device/asus/I006D
19M    device/asus/sm8350-common
[ OrangeFox DEV - xtrnaw7@t15g /devpool001/develop/orangefox/fox_12.1 ] $
[ OrangeFox DEV - xtrnaw7@t15g /devpool001/develop/orangefox/fox_12.1 ] $ mka adbd bootimage

build/make/core/soong_config.mk:194: warning: BOARD_PLAT_PUBLIC_SEPOLICY_DIR has been deprecated. Use SYSTEM_EXT_PUBLIC_SEPOLICY_DIRS instead.
build/make/core/soong_config.mk:195: warning: BOARD_PLAT_PRIVATE_SEPOLICY_DIR has been deprecated. Use SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS instead.
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=99.87.36
TARGET_PRODUCT=twrp_I006D
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=generic
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv8-a
TARGET_2ND_CPU_VARIANT=generic
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-6.10.8-100.fc39.x86_64-x86_64-Fedora-Linux-39-(MATE-Compiz)
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=SP2A.220405.004
OUT_DIR=/devpool001/develop/orangefox/fox_12.1/out
PRODUCT_SOONG_NAMESPACES=device/asus/sm8350-common
....


-


When done, you should get a success message: