How to get kernel, device tree and vendor blobs? - Android General

I've seen one tutorial on developing custom rom from source. To do that device specific files like kernel, device tree and vendor blobs are needed. I have following problems regarding those files.
* Kernel - I have zip file of kernel downloaded from my device manufacturer site. How can i make use of that to build a rom?
* device tree - I'm not able to find a device tree for my device anywhere (github or anywhere), how can I build device tree using (kernel/stockrom...)
I'm totally new for this so I don't know if it is even possible or not. Or Is there any other way to create device tree.
* vendor blobs - I've same problem for vendor blobs as in device tree.
~ so from where and how I can extract or create device tree and vendor?
~ and make things ready to develop a custom rom
My device is HTC one (m8 eye)
code name : melsuhl

Related

How to find Kernel, device tree and vendor blobs?

I've seen one tutorial on developing custom rom from source. To do that device specific files like kernel, device tree and vendor blobs are needed. I have following problems regarding those files.
* Kernel - I have zip file of kernel downloaded from my device manufacturer site. How can i make use of that to build a rom?
* device tree - I'm not able to find a device tree for my device anywhere (github or anywhere), how can I build device tree using (kernel/stockrom...)
I'm totally new for this so I don't know if it is even possible or not. Or Is there any other way to create device tree.
* vendor blobs - I've same problem for vendor blobs as in device tree.
~ so from where and how I can extract or create device tree and vendor?
~ and make things ready to develop a custom rom
My device is HTC one (m8 eye)
code name : melsuhl

Push vendor

Hi,
I have successfully build Lineageos .
Vendor tree kernel from exynos7850 source github
.
Problem is someone already pushed vendor and he build lineage. But some features are not working.
While I didn't sync repo last 1day. I have made changes in my local directory and got that build with minimum bug . Now I want to push the vendor. I an noob so please elaborate this git things

[GUIDE]How to Integrate your Treble and NonTreble Kernel Builds into 1 ZIP[QCOM]

Introduction
In this guide, I will be using @krasCGQ's https://github.com/KudProject/AnyKernel2
You should know-
How to build a kernel properly.
How to use AnyKernel2 for making flashable zips.
I might not be able to answer all your questions as I am a bit busy these days so sorry!
Part 1: Changes to the kernel
1. You must firstly disable BUILD_ARM64_APPENDED_DTB_IMAGE in your defconfig(Check this for reference - https://github.com/rupansh/chimera_nich/commit/7af580533c79e179d146516a845301a32fe99220)
2. Secondly, you will have to find which dts your device uses. Its quite easy to figure that out just open arch/arm/boot/dts/qcom/Makefile in your source and find your chipset's config line. To figure out which one you should use, you can
check the history of the qcom folder in the dts folder.(You can check the history of the Makefile as well) here's are two example commits -
https://github.com/rupansh/chimera_...90747ba#diff-fb8cf9a1a0b868557516caf54f4e966b (My non treble source)
https://github.com/rupansh/chimera_...a778661#diff-fb8cf9a1a0b868557516caf54f4e966b (My treble source)
As you can see, the dtb i will need is msm8937-pmi8950-qrd-wt88537_64.dtb for non treble source and msm8937-pmi8950-qrd-sku1.dtb for Treble source. Sometimes it is just obvious which one to use(i.e it will have your device codename in some cases)
3.All right once you have found out which dtb you will need, build the kernel like you normally do(In this case an Image.gz-dtb won't be made by the way)
Next, you need to cd to <outdir>/arch/arm64/boot/dts/qcom and you will find your required dtb there in your respective sources.
Part 2: Changes to AnyKernel2
1. either you can clone https://github.com/KudProject/AnyKernel2 and delete the files in ramdisk and edit anykernel.sh according to your AnyKernel2 script, or
2. you can use these two commits for reference-
https://github.com/KudProject/AnyKernel2/commit/b55c00085c5bd3859627f579150cbd6d9687c0a0 && https://github.com/KudProject/AnyKernel2/commit/f4602f721631f95134a78b8c7eccccd3f5cd98f5 and edit your anykernel2 script accordingly. The changes are quite simple to understand. He simply added an "if" condition. It looks for ro.treble.enabled in buildprop and "if" the script finds it, treble DTB is combined with Image.gz(Which I will explain where to get) "else", (which means the other possibility which is if it doesn't find ro.treble.enabled) it simply flashes non-treble DTB with Image.gz . (Someone with basic coding knowledge can figure that out + it is quite well explained in the commit)
3. Once you have made your AnyKernel2 script ready to integrate, lets move to the next part
Part 3: Adding Required Files
1. Make a folder called "treble-supported" in the modified AnyKernel2 and copy your device specific dtb from your treble source to the folder.
2. Similarly, Make a folder called "treble-unsupported" in the modified AnyKernel2 and copy your device specific dtb from non-treble source to the folder.
3. make a dir called "kernel" in the Anykernel2 folder and copy Image.gz from any one of your source from <outdir>/arch/arm64/boot to it. (I just used the one from my treble source, Maybe you can use other sources as well but I can't confirm! An experienced person will tell you about that )
4. Zip the folder like you usually do and flash it! If it doesn't boot, You may have done something wrong with the script or more likely used an incorrect dtb!(Please don't use Image.gz-dtb). If it does boot, Congratulations!
Notes
1. You can name the folders(treble-supported and treble-unsupported) anything you want them to be as long as you make changes to the update binary
2. This script only detects on devices that have actually ported treble instead and it won't work with those that have only ported a seperste vendor
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
Also this is my first guide so please do tell if I did/said something wrong
Here's my fork if you want to check - https://github.com/rupansh/AnyKernel2
Credits -
1. @krasCGQ
2. @osm0sis
3. @tanish2k09 (For bringing me to the the android dev world)
Anyone I missed! (Please reply here or message me if I have!)​
To note,
You can name them anything, as long as update-binary is also modified to point to the respective folders correctly.
Detection only works for differentiating treble-enabled and non-treble. It won't work for device that has "ported" separate vendor partition but not enabling treble yet.
Sent from my Redmi Note 4 using XDA Labs
krasCGQ said:
To note,
You can name them anything, as long as update-binary is also modified to point to the respective folders correctly.
Detection only works for differentiating treble-enabled and non-treble. It won't work for device that has "ported" separate vendor partition but not enabling treble yet.
Sent from my Redmi Note 4 using XDA Labs
Click to expand...
Click to collapse
Thanks for telling i will add this to notes
Awesome @rupanshji

Twrp Ulefone Armor-6E

Twrp 3.3.1 built from Omni 9.0 minimal manifest.
bootable/recovery folder has several patches merged in , intended to assist in proper /data decryption.
Build tree used was forked from Armor 6 tree, some changes made to mk files and tree source to match the 6E.
Data decryption not working, same as with the version from armor 6.
GitHub build tree. HERE
GitHub device dump HERE
Android File host folder HERE
.
I did not keep this phone. So I will not be making any updates to this twrp.

Extract vendor blobs and make a device tree

I'm trying since many time to get a Lineage os build for my device, which is a Samsung A20s |SM-A207F| (codename: a20s) with OneUI 3 (android R) but i'm limited for the following reasons:
There are no device tree to work with.
No vendor blobs to work with
How I get device tree and vendor blob using stock rom or from any other methods

Categories

Resources