How to build working vendor image? - Android Q&A, Help & Troubleshooting

I have been trying to build a custom aosp based ROM for pixel 4a, I have made changes to few xml files that goes into vendor/etc/ folder. I built a script to extract vendor blobs from the official vendor image provided by google and also generated build instructions for corresponding files.
I'm able to build the vendor image successfully. All the vendor files are present in the custom built vendor img, when I checked.
After flashing the images, the phone gets stuck in google logo.
I have made sure that bootloader is unlocked., osp version and vendor build version match.
1. Is there a way to build vendor image? Is my approach correct?
2. How can boot loop be debugged? -- ADB is not available at this point of time in boot process.. I'm also not able to boot into recovery, I keep getting bootloader screen.
Any help, links, refs, guides would be helpful

If you are rooting after or during the build process both boot.img and vendor_boot.img files need to be patched. If you are at bootloader(fastboot) you can fastboot flash vendor.img etc

toolhas4degrees said:
If you are rooting after or during the build process both boot.img and vendor_boot.img files need to be patched. If you are at bootloader(fastboot) you can fastboot flash vendor.img etc
Click to expand...
Click to collapse
I'm able to flash the vendor image. I don't want to root the phone. When I use the official vendor image, the phone boots but not when I use vendor image that I built. Is there a way to build vendor image? or How can I debug boot loop?

toolhas4degrees said:
If you are rooting after or during the build process both boot.img and vendor_boot.img files need to be patched. If you are at bootloader(fastboot) you can fastboot flash vendor.img etc
Click to expand...
Click to collapse
Yes, he can use magisk manager to patch the image then flash them in fastboot mode using adb like you said

poppopret_ said:
I have been trying to build a custom aosp based ROM for pixel 4a, I have made changes to few xml files that goes into vendor/etc/ folder. I built a script to extract vendor blobs from the official vendor image provided by google and also generated build instructions for corresponding files.
I'm able to build the vendor image successfully. All the vendor files are present in the custom built vendor img, when I checked.
After flashing the images, the phone gets stuck in google logo.
I have made sure that bootloader is unlocked., osp version and vendor build version match.
1. Is there a way to build vendor image? Is my approach correct?
2. How can boot loop be debugged? -- ADB is not available at this point of time in boot process.. I'm also not able to boot into recovery, I keep getting bootloader screen.
Any help, links, refs, guides would be helpful
Click to expand...
Click to collapse
Did you already check the tutorials or how-to's available on XDA e.g. the tutorials of @AlaskaLinuxUser like
[Guide][Video Tutorial] How to build Custom ROMs and Kernels![10,P,O,N,M,L]
Hey everyone! There is also a telegram channel where you can drop in for some help: https://t.me/joinchat/HR_8JgyDBdw_DvmndPl0kg I really hope that you have enjoyed the series, and that it was helpful to you in your Android career! Praise...
forum.xda-developers.com
or
[Guide][Video Tutorial] Intermediate to Advanced Custom Rom and Kernel Building
Hey everyone! There is also a telegram channel where you can drop in for some help: https://t.me/joinchat/HR_8JgyDBdw_DvmndPl0kg I really hope that you have enjoyed the series, and that it is helpful to you in your Android career! Praise God...
forum.xda-developers.com
The XDA University might also be of good help:
XDA-University
Tutorials, How-To Guides and More. Learn about mobile phone development, hacking, flashing, rooting and many other topics!
forum.xda-developers.com
Just search a bit and you'll find much more.

Related

oneplus 7 pro, any non stock kernel refuses to boot

Dear specialists on the XDA,
Normally I ask no questions in order to save the precious time of people, however this time I have a problem which I fail to understand and cannot resolve using the documentation available on the internet.
I have committed extensive reading and know how to build software but am simply missing a link here.
Trying to boot a home build kernel on a oneplus7 pro device with no luck so far.
Here is the situation so far: I have after hours of headaches successfully built myself a kernel straight from the stock sources. No alterations just using the msm8150-perf.defconfig file and build successfully with clang 9.0.5. There are only a few warnings nothing serious and the dtb has many warnings but I get what I need. I have done this before for my oneplus 3 and indeed the kernel was working.
Assuming the kernel is in a functional state. I used the latest version of android image kitchen to unpack the boot image which I extracted (from the right active slot) and replaced the kernel file and repacked the boot.img successfully into a new image file.
No luck after trying to boot into the image using fastboot. Screen hangs forever. Bootloader is unlocked btw
So far I have tried:
1. Signing the boot image using boot signer
2. Unpack/repack using android image editor (which signs the image)
3. Repack using different kernel image files from xda which I expect to be good and working
4. Flash signed image straight into active slot.
5. Completely read through the anykernel1, 2 and 3 scripts to find answers.
No matter what I try. Kernel does not boot. Either the fastboot screen hangs forever or the system reboots back into its currently working active slot.
I have to add that this bootimage contains magisk.
I am out of ideas. Please help me out. I hope that you can point me into a good direction.

[TOOL][OOS AC01AA/BA/DA] Root and Fastboot script to Oneplus Nord

That device can't install TWRP yet, so only method that OPN users have to root his phones is that:
https://forum.xda-developers.com/oneplus-nord/how-to/guide-how-to-root-oneplus-nord-t4139411
I think to simplyfy that method in two scripts, one to extract payload.bin and root your phone, and another to convert that extracted payload.bin to fastboot installable ROM.
Make sure that you have python installed in your computer before use it.
Here is the steps to use it:
1. Download any OxygenOS update from Some_Random_Username's Repo:
https://forum.xda-developers.com/oneplus-nord/how-to/oneplus-nord-repo-oxygen-os-builds-t4138085
2. Download the script:
English v1 version for Windows: https://www.androidfilehost.com/?fid=8889791610682922150
Spanish v1 version for Windows: https://www.androidfilehost.com/?fid=8889791610682922151
3. Extract the script on any folder
4. Extract "payload.bin" file from OxygenOS update, downloaded previously on step 1
5. Execute "payload.bat" and follow the steps on the script
OPTIONAL: After root your phone or extract "payload.bin" file, you can use "flash-all.bat" file from scripts file to flash whole OxygenOS update from fastboot mode!
TIPS:
- As Some_Random_Username said, you should backup your /persist once rooted (dd if=/dev/block/bootdevice/by-name/persist of=/sdcard/persist.img) and save it somewhere on your cloud/computer, because this might save you from a broken fingerprint sensor and an RMA in the future if it turns out this device has same issue as 8-series when it comes to crossflash regional builds of OOS.
This step will be include to the script in the future
Credits:
@topjohnwu for making Magisk
@Some_Random_Username for original guide and updated repo build of Oxygen OS
@mauronofrio for original fastboot script
Reserved
You can fastboot boot twrp.img and then flash magisk, so flashing a boot image is not the only way to root.
Yup:good:
The fastboot roms are already available in the dedicated thread and with the twrp i made you can flash magisk and also stock roms, i really don't know at what this is needed
mauronofrio said:
The fastboot roms are already available in the dedicated thread and with the twrp i made you can flash magisk and also stock roms, i really don't know at what this is needed
Click to expand...
Click to collapse
goRt said:
You can fastboot boot twrp.img and then flash magisk, so flashing a boot image is not the only way to root.
Click to expand...
Click to collapse
I know that fastboot roms is already in the dedicated thread, but maybe isn't updated or any people want to extract himself (for example, now you don't have latest 10.5.5 version uploaded!)
Also with TWRP, you can't install it as normal recovery yet, so maybe people want to do and try it with fastboot method, and can use my script for help himselves.
That is another and automated method to help people only
dimusa said:
I know that fastboot roms is already in the dedicated thread, but maybe isn't updated or any people want to extract himself (for example, now you don't have latest 10.5.5 version uploaded!)
Also with TWRP, you can't install it as normal recovery yet, so maybe people want to do and try it with fastboot method, and can use my script for help himselves.
That is another and automated method to help people only
Click to expand...
Click to collapse
Twrp can also be flashed if needed

Teclast T40 Plus Root

Received the tablet in the mail, and now looking to root via Magisk (and ideally a custom recovery like TWRP).
I found this video describing a way to download the stock ROM from Teclast:
Has anyone achieved root on this device? Can anyone confirm Treble ROM compatability for GSI A/B?
On the russian forum 4pda somebody posted the patched boot.img and vbmeta.img files required for rooting.
If anyone is registered on the forum he might try to grab the files, for me it gives 404 error when trying to download, though im not registered..
Teclast T40 Plus - Обсуждение - 4PDA
Teclast T40 Plus - Обсуждение, Планшет, 10,4
4pda.to
NightLord said:
On the russian forum 4pda somebody posted the patched boot.img and vbmeta.img files required for rooting.
If anyone is registered on the forum he might try to grab the files, for me it gives 404 error when trying to download, though im not registered..
Teclast T40 Plus - Обсуждение - 4PDA
Teclast T40 Plus - Обсуждение, Планшет, 10,4
4pda.to
Click to expand...
Click to collapse
Good find, but the link no longer works. It gives me a 404: https://4pda.to/forum/dl/post/24458874/T40_Plus_root.7z
My guess is it would work if we were logged in, its just that i cant create an account since i cannot get past rhe russian captcha
Yeah, I also can't register without knowing the Russian keyboard layout and how to identify the characters. Perhaps someone with this knowledge can register and attach the required images to root here?
Slightly off topic while someone manages to grab the files from 4pda
Do you actually get 50000+ gpu score in antutu with the t40? I have the maxpad i11 which is in theory the same hardware, and I only get 42000. I even flashed the t40 firmware on the device, but gpu score didnt budge.
To be on topic: if you want root, you may also flash phhuson's treble GSI rom-s. I tried his version of android 12, and it works, and has root.
NightLord said:
Slightly off topic while someone manages to grab the files from 4pda
Do you actually get 50000+ gpu score in antutu with the t40? I have the maxpad i11 which is in theory the same hardware, and I only get 42000. I even flashed the t40 firmware on the device, but gpu score didnt budge.
To be on topic: if you want root, you may also flash phhuson's treble GSI rom-s. I tried his version of android 12, and it works, and has root.
Click to expand...
Click to collapse
These ROMs? https://github.com/phhusson/treble_experimentations/releases
ForgottenSolstace said:
These ROMs? https://github.com/phhusson/treble_experimentations/releases
Click to expand...
Click to collapse
Yes.
You can either install them via DSU as dual-boot OS beside your stock rom, or just flash system partition (inside super) via fastbootd (you are going to have to delete product partition to have enough space inside super for the system image) and use them as primary OS.
Gotcha:
Just ordered a T40 Plus, did you manage to get root?
Flashing the boot and vbmeta partitions with the images attached to my previous post will grant you root on the stock t40 plus firmware.
I myself moved on to using android 12 gsi images.
NightLord said:
Flashing the boot and vbmeta partitions with the images attached to my previous post will grant you root on the stock t40 plus firmware.
I myself moved on to using android 12 gsi images.
Click to expand...
Click to collapse
Hi NightLord, can you explain easily the root steps for this device? do we need the software that we see in the video at the beginning or is ADB enough?
Marynboy78 said:
Hi NightLord, can you explain easily the root steps for this device? do we need the software that we see in the video at the beginning or is ADB enough?
Click to expand...
Click to collapse
Hey,
You need to use the spreadtrum research download tool (RDT), not the one seen in tthe video in the first post.
See this guide on how to use the RDT.
The basic concept is that you need to download the official firmware from the teclast homepage, load it into RDT, uncheck all partitions (save for those that are compulsory and cannot be unchecked), select only boot and vbmeta partitions, and as images to be flashed you need to browse the ones found in the archive I posted, instead of those found in the original firmware package.
Begin flashing, your device will perform a hard reset, and then you should boot into rooted firmware.
Theoretically you should be able to flash both partitions (boot and vbmeta) via fastboot too, but when I tried, i got an error message saying boot.img was too large or something. Flashing via RDT went without problem. The only caveat is that flashing via RDT will always hard reset your device.
NightLord said:
Flashing the boot and vbmeta partitions with the images attached to my previous post will grant you root on the stock t40 plus firmware.
I myself moved on to using android 12 gsi images.
Click to expand...
Click to collapse
How to install android 12 gsi on this device?
marinzrncic said:
How to install android 12 gsi on this device?
Click to expand...
Click to collapse
First you need to unlock the bootloader. You need to be patient when you are flashing the unlock, my device took some 10 mins to complete, but in the end it succeeded (on the 2nd try, mind you.)
Here is a guide for unlocking in windows, though it is in russian (Im attaching the required modified fastboot in case you cannot download it from 4pda).
When you're done unlocking the bootloader, you've already done the hard part.
Next, download your preferred GSI image from Google, from phhusson's, or whatever else you find (Pixel Experience for eg.). Mind you, that the image from Google contains the Android 12L version.
Next you will flash your active system partition with the GSI image. To do that, initate ADB connection to your tablet, then enter fastbootd, by issuing the command:
fastboot reboot fastboot
you can check your active system slot by:
fastboot getvar all (but it will be slot "a" unless you have received an OTA update previously)
you need to free up some space by deleting the logical partition product otherwise you wont be able to flash your gsi:
fastboot delete-logical-partition product_a
(in case your active slot is "a")
then you can move forward to actually flashing your GSI:
fastboot flash system_a whateverisyourimagefilename.img
Lastly, you will need to wipe userdata, which can be done on the tablet by switching to recovery from fastbootd, and then selecting wipe userdata, or maybe the fastboot -w command does the same.
Reboot, and enjoy your GSI.
I'm using the Google 12L GSI, and it is perfectly stable for daily usage. For bluetooth audio to work, you will have to disable bluetooth a2dp hardware offload in developer options.
NightLord said:
First you need to unlock the bootloader. You need to be patient when you are flashing the unlock, my device took some 10 mins to complete, but in the end it succeeded (on the 2nd try, mind you.)
Here is a guide for unlocking in windows, though it is in russian (Im attaching the required modified fastboot in case you cannot download it from 4pda).
When you're done unlocking the bootloader, you've already done the hard part.
Next, download your preferred GSI image from Google, from phhusson's, or whatever else you find (Pixel Experience for eg.). Mind you, that the image from Google contains the Android 12L version.
Next you will flash your active system partition with the GSI image. To do that, initate ADB connection to your tablet, then enter fastbootd, by issuing the command:
fastboot reboot fastboot
you can check your active system slot by:
fastboot getvar all (but it will be slot "a" unless you have received an OTA update previously)
you need to free up some space by deleting the logical partition product otherwise you wont be able to flash your gsi:
fastboot delete-logical-partition product_a
(in case your active slot is "a")
then you can move forward to actually flashing your GSI:
fastboot flash system_a whateverisyourimagefilename.img
Lastly, you will need to wipe userdata, which can be done on the tablet by switching to recovery from fastbootd, and then selecting wipe userdata, or maybe the fastboot -w command does the same.
Reboot, and enjoy your GSI.
I'm using the Google 12L GSI, and it is perfectly stable for daily usage. For bluetooth audio to work, you will have to disable bluetooth a2dp hardware offload in developer options.
Click to expand...
Click to collapse
thank you very much
NightLord said:
Hey,
You need to use the spreadtrum research download tool (RDT), not the one seen in tthe video in the first post.
See this guide on how to use the RDT.
The basic concept is that you need to download the official firmware from the teclast homepage, load it into RDT, uncheck all partitions (save for those that are compulsory and cannot be unchecked), select only boot and vbmeta partitions, and as images to be flashed you need to browse the ones found in the archive I posted, instead of those found in the original firmware package.
Begin flashing, your device will perform a hard reset, and then you should boot into rooted firmware.
Click to expand...
Click to collapse
Did we need unlock bootloader first or we can flash root without unlock bootloader?
Thx
ardianz said:
Did we need unlock bootloader first or we can flash root without unlock bootloader?
Thx
Click to expand...
Click to collapse
I have no idea because I havent tried yet. But I would guess it might be possible that you can flash the patched boot.img along with vbmeta.img with RDT, and it might work, if they do pass Android Verified Boot check.
NightLord said:
Gotcha:
Click to expand...
Click to collapse
will these files work on android 10 or android 11? I have a unisoc T618 and unisoc T310. I was hoping to flash both tablets to get root access.
and also do you have a twrp for T40_plus or any unisoc generic twrp?

Question WIP - Compiling Kernel / TWRP

Hi all,
I have been looking into compiling the kernel and TWRP for this device.
For the kernel, it compiles but does not boot (Will invvestigate later ).
The TWRP does not boot, most likely related to boardconfig.mk. I am unable to find the kernel base or offsets. Can anyone assist in discovering this information? I have tried unpacking boot.img and the current tools does not show this information.
Shaky156 said:
Hi all,
I have been looking into compiling the kernel and TWRP for this device.
For the kernel, it compiles but does not boot (Will invvestigate later ).
The TWRP does not boot, most likely related to boardconfig.mk. I am unable to find the kernel base or offsets. Can anyone assist in discovering this information? I have tried unpacking boot.img and the current tools does not show this information.
Click to expand...
Click to collapse
Hello. I manage to create TWRP for this device.
It is currently tested on a device running the laster firmware RUI 4.0_C.13 but it should work in RUI 3.0. Decryption works, MTP didn't yet.

Question how to root with magisk?

Hi everyone, I prefer remain with the Chinese rom for a while but I'd like to root my moto x40 with magisk.
I've tried but after flashing the patched boot.img the phone boot normally. the firmware has vbmeta so I followed the procedure suggested by the guide in this situations.
the weird thing is the patched root remain exactly with the same original dimensions.
I think this is an a type partition firmware due to boot.img presence but there is also a file called vendor_boot.img. according with this article seems an a/b type.
Vendor Boot Partitions | Android Open Source Project
source.android.com
I attach a screen of the firmware content, the log of patched boot file and the adb process.
Please, can anyone explain me how can I root successfully? thanks
Did you unlock the bootloader? Once done you need to flash a patched init_boot.img instead of boot.img through fastboot.
This guide should be useful (it's for the Pixel 7s, but should work with this phone, and of course use the init_boot.img from the original ROM file for your phone)
Hope that helps
hi, thank you for the answer.
yes the bootloader was unlocked.
This rom is the same as my phone's. I had take by lolinet.
unfortunately magisk is unable to patch vendor_boot , I'm trying to attach it.
Is Someone able to patch?
vendor_boot.img
Shared with Dropbox
www.dropbox.com
This is my vendor-boot
Do you lose VPN access after bootloader unlocked?
No, I didn't lose
mikaelcbr2 said:
hi, thank you for the answer.
yes the bootloader was unlocked.
This rom is the same as my phone's. I had take by lolinet.
unfortunately magisk is unable to patch vendor_boot , I'm trying to attach it.
Is Someone able to patch?
Click to expand...
Click to collapse
You need to patch init_boot.img using Magisk, and flash both init_boot_a and init_boot_b with the patched file through fastboot
sooyong94 said:
You need to patch init_boot.img using Magisk, and flash both init_boot_a and init_boot_b with the patched file through fastboot
Click to expand...
Click to collapse
Yes I followed the guide, thanks

Categories

Resources