-
What is the purpose of this tutorial?
Understand that more and more you need a good PC/laptop/notebook equipment to compile Custom Recovery. Unfortunately, many people cannot or do not have the time to test/compile the device tree.
-
Why am I writing this?
Because I appreciate the presence of good people who share their experience, and the more people who help, the better.
-
Who are these instructions for?
First, people who want to help themselves. Then these people will be able to help others.
-
Is programming experience necessary?
It depends on how much you want to learn, some steps are important and others will be done automatically. A good Device Tree setup&configs saves you time. It has always been said in fact and will never change.
-
Who made it work?
It involves many people, most notably a special character called @rokibhasansagar. You can then search for the topic on Github.
-
What version of Linux is the process running on?
Usually Ubuntu version 18.04.6 [deprecated by github] - but there are other projects with Ubuntu 20.04. Works successfully:
2022/07/08 => TWRP-based 5.X ~ 12.X are ALL COMPILED SUCCESSFULLY
Scripts have been updated for some time and the improvements have been good. Bodya-Kolibass - Was one of the authors of the speed improvement - Set Swap Space. CaptainThrowback - One of the TeamWin guys who helped the most with the TWRP code at the moment. And others (us) who tested and put something to improve the assembly code.............
Action-TWRP-Builder: https://github.com/azwhikaru/Action-TWRP-Builder
Others: https://github.com/rokibhasansagar/Recovery-Compiler
-
-
Save lopestom/d85ce99bb244d308c5e681db31018626 to your computer and use it in GitHub Desktop.
-
First of all, you must have a ✨github account✨.
-
Save the Device Tree as follows:
device_manufactor_devicename
Exmaple: device_ulefone_Armor_10_5G
* TWRP-A11+ * twrp_ - Click to open
|__ prebuilt
|__ recovery/......
| Android.mk -------------------------------- twrp_Armor_10_5G
|||||||||||||||||||| -------------------------- COMMON_LUNCH_CHOICES := twrp_Armor_10_5G -eng
| AndroidProducts.mk --------------- twrp_Armor_10_5G
| BoardConfig.mk --------------- device/ulefone/Armor_10_5G
| device.mk --------------- device/ulefone/Armor_10_5G
| twrp_Armor_10_5G.mk --------------- ..... vendor/twrp/config/common.mk
| Any other files you need.
* TWRP-A10-* - ** PBRP ** omni_ - Click to open
|__ prebuilt
|__ recovery/......
| Android.mk -------------------------------- omni_Armor_10_5G
|||||||||||||||||||| -------------------------- COMMON_LUNCH_CHOICES := omni_Armor_10_5G -eng
| AndroidProducts.mk --------------- omni_Armor_10_5G
| BoardConfig.mk --------------- device/ulefone/Armor_10_5G
| device.mk --------------- device/ulefone/Armor_10_5G
| twrp_Armor_10_5G.mk --------------- ..... vendor/pb/config/common.mk
| Any other files you need.
-
Login to your github.
- Understand that device_tree must be in public mode. If it's private, the Actions won't work.
-
Fork the Action-TWRP-Builder project. Copy (fork) the Action-TWRP-Builder project to your github account or you can copy the script files into a folder directly in your device tree.
-
Log in to your account under Settings
Confirm access.
Set the Select scopes options to any options or whatever is needed for the token to have the necessary permissions.
-
Remember the word you created and copy the access key (token) somewhere for future use.
You will see that letters and numbers will be generated that will be the key (token) to be used in the Custom Recovery project.
- Example of Generated key token: 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
-
If you want copying the Action-TWRP-Builder into your repository DT
-
Go to your Action-TWRP-Builder project and select the
Settings option
and selectSecrets
.-
Pay attention to the
New repository secret
parameter. -
In the name, write the secret word (in our case
TEST
) and copy the key (token).
-
-
Go to the
Action-TWRP-Builder/.github/workflows/Recovery Build.yml
and edit the file. About workflows- Enter the secret word (TEST) into the project.
- Change the
user.name
anduser.email
to your own - The last lines will contain:
secrets.GITHUB_TOKEN
- GITHUB_TOKEN ==>>
TEST
-
Replace the word with
secrets.TEST
-
- GITHUB_TOKEN ==>>
-
Go to
Actions
. Please confirm your understanding for use.-
You will see the
All workflows
option. SelectRecovery Build
and you will seeRun workflow
option on the right. -
Feel free if you want to change something in the settings table of Run Workflow. Please review this in **.
Review the options and customize how you want to use Custom Recovery in the codebase (TWRP; Fox; PBRP; ....).
PS: In the
azwhikaru/Action-TWRP-Builder
only support TWRP and SHRP compilation. -
** Note that you can customize part of the device tree.
Parameter Description - The setting depends on the Android version you are building.
Please read about Minimal Manifest Source Code twrp_aosp & twrp_omni and look the branch options. So relook Actions on github about A10- and A11+ for understand.
Run workflow table - Click to open
MANIFEST_URL ---> Source Code link of Custom Recovery in the github: https:// github.com/minimal-manifest-twrp/platform_manifest_twrp_omni
MANIFEST_BRANCH ---> Android version: twrp-9.0
DEVICE_TREE_URL ---> Device Tree (DT) repository link on github: https:// github.com/azw…device_xiaomi_archytas
DEVICE_TREE_BRANCH ---> Device Tree branch: twrp-9.0
DEVICE_PATH ---> Device compilation Path from DT - BoardConfig.mk: device/xiaomi/Archytas
COMMON_TREE_URL (if no common tree, leave blank) ---> If your DT uses Common Tree then put the github link of that here.
COMMON_PATH (if no common tree, leave blank) ---> If your DT uses Common Tree so that's have Common Path then put the path of Commom Tree.
DEVICE_NAME ---> Device .name or.device: Archytas
MAKEFILE_NAME ---> Branch of Source code from MANIFEST_URL: omni_DEVICE_NAME
BUILD_TARGET ---> The partition the recovery_ramdisk is on: recovery
-
At the end, select
Run workflow
and the project will run automatically.- Keep an eye out for
FAILs
& Errors or save time with other tasks. If you don't receive an error notification e-mail within forty minutes, rejoice/be glad and wait.
Sometimes you may experience a build time of over 1 hour and 30 minutes. Even so, some information in the
Building Recovery
tab may happen and usually it may haveFAILED
orerror
even at 99% or 100%. Watch out for theerror
because this is something you should fix in your Device Tree.-
If you want to see in the launch part if the img file was created.
- Keep an eye out for
-
Where does the compiled file go (img and zip for PBRP - img for TWRP)?
-
Select the link for Release and you will see an
img file
and azipped device tree
(Source code) file.
- Some interesting details for checking/error logging.
-
On the right is an image of a gear. Tighten the gear.
-
Download_log_archive: You will download task-separated files from a script.
It will contain everything that happened in the early stages through to the late stages. View_raw_logs: will open a log text file on a page https://pipelines.actions.githubusercontent.com/ page with all the steps in one place.
-
If everything went well during the build (there is no guarantee that the recovery.img or boot.img file will be correct); in the Release part you will see an img file to download and test immediately.
-
Interesting readings and files for Mediatek devices
Not everything is there, but if you know what you need or want, just search: https://github.com/orgs/mtk-watch/repositories
-
If you can read Android Mediatek code, you will know how to add shortcuts to the mtXXXX device tree.
Consult the mtXXXX device tree
Understanding the Building Soong - logic
Thanks and Notes
Thanks Github for releasing Actions Free (limited time/size but has).
Thanks github experts users that create actions-workflows scripts free to anyone use and have good learning/experience with building/compiling custom recoveries
@lopestom for Custom Recovery for MediaTek devices guide.
Thanks of the Source Code Custom Recovery to @TeamWin and to all the people who help update that, as well as the people who help Mediatek devices to have a more functional Custom Recovery.
Thanks to all the people who left some Mediatek device tree repository available so that other users can fork and not waste too much time creating a device tree from nothing.
Thanks to @SebaUbuntu for twrpdtgen.
How I write in gist: Writing on github
you are pro sir thanks for help
Thanks guys.
Although this tutorial is outdated, it was one of the first to exist. Obviously over time, the Build Custom Recovery script has been improved and changed many times.
But, I still believe it has been an interesting reference for unexperienced users.
thanks so much for this tutorial 🥰