How to flash a kernel on android device with two boot partitions. - Android Software/Hacking General [Developers Only]

Hi,
I have an android device and its kernel source code. I am able to compile the kernel source code and get "Image.gz-dtb" image file.
Now I need to flash it on my android device.
As per my knowledge the step required to flashing a kernel image on android device is as following:
Android Image Kitchen
Pull your device's boot image from the latest image available for your device (whether it be a ROM or stock)
Download the latest Android Image Kitchen from this thread.
Run the following with the boot image:
Code:
unpackimg.sh <image_name>.img
Locate the zImage file and replace it with your kernel image (rename it to what came out of the boot image)
Run the following to repack:
Code:
repackimg.sh
Flash the new boot image with fastboot or TWRP!
These steps are copied from:
https://forum.xda-developers.com/an...oid-kernel-t3627297/post72806131#post72806131
I am facing a problem in following these steps because the device I am using has two boot partitions i.e.
boot_a -> /dev/block/sde11
boot_b -> /dev/block/sde39
So I am not able to proceed with the first step to pull the boot image.
I can pull both image with dd command i.e. `dd if=/dev/block/sde11 of=/sdcard/boot_a.img` and `dd if=/dev/block/sde39 of=/sdcard/boot_b.img` but I don't know what should I do after that because I have only single image file generated from the source code.
I searched over the internet for A/B partitioning and I found that these are used for seamless updates i.e. One partition is active at a time and another partition which is inactive can be used to flash the update. On reboot, another partition will become active and One partition will become inactive. More Info: https://www.xda-developers.com/how-...ess-updates-affect-custom-development-on-xda/
If my understanding is true then I just need to follow following steps to find the correct image to be used at the first step of flashing the kernel:
1. fastboot getvar all | grep “current-slot”
2. dd if=<path to boot of active slot> of=/sdcard/boot.img
3. Continue with boot.img and flash the kernel with above written steps for flashing a kernel.
Anyone who has this knowledge, please confirm. I will be very thankful to you.

Related

[Q] Boot custom image without flashing it

This may seem an already (10 times) solved question, but I'm unable to boot my Mogo G with a custom boot.img instead of the one flashed on the device.
The phone is an XT1032, currently running KitKat 4.4.4, and I use the latest SDK tools.
I download the stock firmware from sbf.droid-developers.org/phone.php, where I choose RETAIL-FR_FALCON_KLB20.9-1.10-1.24-1.1_cid7_CFC_1FF_SVC.xml.zip
I extract the boot.img file using standard unzip tools, and the zImage and initrd.img files using abootimg
Code:
adb reboot-bootloader
The phone reboots and gets to the fastboot menu
Code:
fastboot boot zImage initrd.img
The console output seems right:
Code:
creating boot image...
creating boot image - 6975488 bytes
downloading 'boot.img'...
OKAY [ 0.336s]
booting...
OKAY [ 0.244s]
finished. total time: 0.580s
The device tries to reboot, but stops at the first "M Powered by Android" splash screen
I wait one minute
I hard reboot the device by holding the power button
The device reboots, but has to pass an unusual step, "Updating Android/Optimization application ..."
I'm quite sure the same method was successful a few months ago, so what has since changed:
The device's firmware was upgraded from 4.4.3 to 4.4.4
The SDK tools were upgraded from ? to 23.0.2
I don't remember whether the firmware was available as a tar.gz or a xml.zip file, but I think it was a tar.gz, and I'm near certain I then used the SDK provided fastboot tool. Today, the firmware is available as an xml.zip file, and I think I have to use the Motorola specific fastboot tool (anyway I've tried both, for identical results)
Could anyone point me toward what I'm missing or doing wrong ?
Thanks.
Why did u extract the boot.img?
Maybe wrong kernel?
And whats about the kernel modules of your custom kernel?
sub77 said:
Why did u extract the boot.img?
Click to expand...
Click to collapse
I simply want a basic way to boot a custom initial ramdisk, without flashing it to the device. So I download the stock firmware archive, unzip it, extract the initial ramdisk (initrd.img) from the boot image, modify it, and repack it using abootimg.
And then:
Code:
fastboot boot zImage initrd.img
For me, this command conform to both the SDK provided fastboot and the Motorola specific one shows in it's help message:
Code:
boot <kernel> [ <ramdisk> ]
I'm not sure anymore of the above command's correctness:
Some information may be missing, as when you expand the boot image (boot.img) you get three files : a kernel (zImage), an initial ramdisk (initrd.img), but also some metadata (in bootimg.cfg); and this metadata is lost when I use "fastboot boot zImage initrd.img". I may try to give this information using additional fastboot options
I even suspect that a few months ago, I used fastboot with a full boot.img image as parameter, though this does not seem to fit the help message above
sub77 said:
Maybe wrong kernel?
And whats about the kernel modules of your custom kernel?
Click to expand...
Click to collapse
As I told you, I'm not currently working on the kernel, and I'm testing with _unmodified_ kernel image (zImage) and initial ramdisk (initird.img), as extracted by "abootimg -x".
Again, any idea is welcome.

[MAGISK][ROOT][BOOT.IMG] How to patch the Oneplus 8, 8T and 8 Pro stock Boot Image (boot.img) from the currently installed Stock ROM

Quick and concise how to for obtaining a Stock Boot Image from your Oneplus 8, 8T or 8 Pro device and patching with Magisk to create a fastboot flashable patched boot.img.
DISCLAIMER:
Code:
#include <std_disclaimer.h>
/*
*
* We are not responsible for bricked, broken or dead devices. This is a high-level
* how to for users with a basic knowledge of ADB and Fastboot. YOU alone are
* choosing to make these modifications, and you are solely responsible for your
* device's fit for use and wellbeing.
*
* Backup your data!
*
*/
PREREQUISITS:
An unpatched Stock Boot.img running on your device
General knowledge and understanding of ADB and Fastboot
Download latest op8, op8p, or op8t Horizon Kernel img from [e.g., op8p_7.img]:
https://dl.akr-developers.com/?dir=oneplus/horizon_kernel/R/images
Download latest Magisk Canary build from Github [e.g., app-debug.apk]:
https://raw.githubusercontent.com/topjohnwu/magisk_files/canary/app-debug.apk
DEVICE/PC OPERATIONS:
→ ADB
Enumerate devices
Code:
adb devices
Boot into Fastboot
Code:
reboot bootloader
→ FASTBOOT
Enumerate devices
Code:
fastboot devices
Determine the current slot (A/B), whichever slot you're on should be the "good" img
Code:
fastboot getvar current-slot
Boot with the custom kernel downloaded from Horizon to use root [NOTE: Include the full path of the img if not in the same directory]
e.g., fastboot boot "C:\Users\User\Downloads\op8p_R7.img"​
Code:
fastboot boot xxxxxxx.img
→ ADB
Copy the boot.img from each slot to the root of the device
Code:
adb shell
su
dd if=/dev/block/sde11 of=/sdcard/boot_a.img
dd if=/dev/block/sde35 of=/sdcard/boot_b.img
→ Android Device [NOTE: Some Android 11 devices experience patching issues on the Beta Channel like bootloop] [NOTE: Some users experience issues on Canary like no SIM detected; if so switch to Beta]
Install Magisk app-debug.apk (Canary)
Go to Settings → Update Channel → Canary
Go to Home → Install → Install → Select and Patch A File
Navigate to internal storage and select the stock boot.img [choose the img from whichever slot you're on]
When it’s done patching copy the file, named magisk_patched.img, from the root → Downloads of your device to PC
→ ADB
Code:
reboot bootloader
→ FASTBOOT
Test to ensure it boots before flashing; if not you'll need to patch the other img
Code:
fastboot boot magisk_patched.img
→ Android Device
If the device boots and you have root in the Magisk Manager app, reboot the device into Fastboot then flash the active slot [NOTE: Both slots do not need to be flashed; just the current active slot]
→ FASTBOOT
Flash the patched image file [NOTE: Include the full path of the img if not in the same directory]
e.g., fastboot flash boot_b "C:\Users\User\Downloads\magisk_patched.img"
Code:
fastboot flash boot magisk_patched.img
fastboot reboot
- OR -​
Code:
fastboot flash boot_a magisk_patched.img
fastboot reboot
- OR -​
Code:
fastboot flash boot_b magisk_patched.img
fastboot reboot
ADDITIONAL RESOURSES:
→ FASTBOOT
If you need to set the other slot to be the active slot use:
Code:
fastboot --set-active=a
- OR -​
Code:
fastboot --set-active=b
→ ADB
ADB Magisk Bootloop Fix
Code:
adb shell
magisk --remove-modules
→ OTA Help
Magisk stock boot.img missing fix [NOTE: Android 11 onwards, the /sbin folder might not exist, so Magisk will randomly create a folder under /dev and use it as the base folder]
Rename to: stock_boot_0.img
Compress with gzip = stock_boot_0.img.gz
Copy stock_boot_0.img.gz file to the root of: /data
Edit the config file: /dev/xxxxxxx/.magisk/config → Change SHA1= to 0
Magisk Manager → Uninstall Magisk → Restore Images
→ ADB
Determine the random folder name generated by Magisk on Android 11+
Code:
ls -laR /dev | grep '.magisk/rootdir'
→ ADB
Determine the Boot Image partition location [NOTE: Will list all partitions; look for boot_a and boot_b]
Code:
ls /dev/block/bootdevice/by-name/ -all
Tried some other way on android 11 but failed, so back to android 10.
maybe i won't get android 11 until TWRP is work.
can't easily backup data without root is very annoying, thanks for the work!
I have followed every step, but root only last until I restart my Oneplus.
What am I doing wrong? Why want the device stay rooted?
mrram said:
I have followed every step, but root only last until I restart my Oneplus.
What am I doing wrong? Why want the device stay rooted?
Click to expand...
Click to collapse
Guessing here, but have a second look at these two commands:
Code:
fastboot boot magisk_patched.img
△ This will NOT flash the rooted image, it will only boot up once so you can test it or use it for temporary root
verses
Code:
fastboot flash boot magisk_patched.img
▲ This will flash the rooted image and is used after you've tested the patched image to be sure it doesn't bootloop and to have persistent root
If I use this Horizon kernel to boot with root on 11.0.4.4, could I use directly Magisk 22.0 to root the device permanently? Thanks in advance.
MagikGab said:
If I use this Horizon kernel to boot with root on 11.0.4.4, could I use directly Magisk 22.0 to root the device permanently? Thanks in advance.
Click to expand...
Click to collapse
I only use the Horizon to boot then grab my kernel to patch with Magisk. You could use the Horizon kernel, but you would have to flash it, not just boot it. So, root device, backup stock dtbo, flash Horizon & dtbo, re-root if lost during flash. I would recommend against that until there's a custom recovery available in case there were any issues. Additionally, you must backup your stock dtbo if you ever want to return to stock. You should visit the Horizon thread for more details, but again if you're not familiar with kennel mods you might not want to start learning on a device without a custom recovery.
CarvedArt said:
I only use the Horizon to boot then grab my kernel to patch with Magisk. You could use the Horizon kernel, but you would have to flash it, not just boot it. So, root device, backup stock dtbo, flash Horizon & dtbo, re-root if lost during flash. I would recommend against that until there's a custom recovery available in case there were any issues. Additionally, you must backup your stock dtbo if you ever want to return to stock. You should visit the Horizon thread for more details, but again if you're not familiar with kennel mods you might not want to start learning on a device without a custom recovery.
Click to expand...
Click to collapse
I'd like only to root my device, remaining as more stock as possible, for now. If I want to avoid using a custom kernel (also for the rooting process), should I extract the boot.img with Python, then patch it with Magisk 22? Thanks in advance for your reply, but I'm coming from a Xiaomi that was quite easier to root
MagikGab said:
I'd like only to root my device, remaining as more stock as possible, for now. If I want to avoid using a custom kernel (also for the rooting process), should I extract the boot.img with Python, then patch it with Magisk 22? Thanks in advance for your reply, but I'm coming from a Xiaomi that was quite easier to root
Click to expand...
Click to collapse
Just follow the steps above -- that'll get you a stock kernel (your current kernel) patched with Magisk and permanently rooted. The above process is only using the Horizon kernel to boot your device with root so that you can extract your kernel and patch it. The final result will be as stock as you can get with root.
Hey everyone. OP8 Pro user here. Just took OTA going from 11.0.9.9 running Magisk Canary 23 to the newest 11.0.10.10. I restored images before taking the OTA and reinstalled magisk to the other slot like I always do to retain root. Ive now lost root and am trying to boot the last two versions of the Horizon kernel. Ive tried the two latest ones (r9.2 and r9.2.1 from February 2021) and while they do boot my phone, I cant get SU access to extract the stock images.
Anything else that anyone things I should try? All i want from Christmas is root.
Isn't there a more easy way to obtain root?
That's strange. I use OnePlus smartphones with LineageOS for years now and cannot remember to execute such a complicated procedure. Just now I got a OnrPlus 8, installed LineageOS and Magisk and restored my apps with Titanium. So, it definitely worked.
Now, after a Lineage system update, root is gone.
Unfortunately I cannot tell exactly how I installed Magisk. I have a very poor memory. Think I just installed the app and said either just "install" or patched the zip with TRWP
But I definitely never downloaded or extracted any boot image manually.
Has anyone an explanation for this?
Even more strange: I just tried to flash magisk.zip again with TRWP. Now it tells me
"Magisk patched boot image detected"
and later:
"Failed to mount '/system_root' (Device or resource busy)"
After reboot the Magisk app now offers me three choices in the install tab:
- choose a file and patch (only this one existed before)
- direct installation (recommended)
- install into inactive slot (after OTA)
I don't understand the last one and tried the recommendet one.
Now, root is there again. Do I have to do this after each update? With my OnePlus5 I didn't.
Unfortunately I have another problem with my OnePlus8 and Lineage:
I'm using AdAway which replaces the hosts file, but on my OP8 it cannot.
"Unable to cppy the hosts file to /System partition. Please check if the Magisk Systemless module is active"
What does it mean? The Magisk app says: "ramdisk yes"
tosho1 said:
Unfortunately I have another problem with my OnePlus8 and Lineage:
I'm using AdAway which replaces the hosts file, but on my OP8 it cannot.
"Unable to cppy the hosts file to /System partition. Please check if the Magisk Systemless module is active"
What does it mean? The Magisk app says: "ramdisk yes"
Click to expand...
Click to collapse
Magisk → Settings (Gear icon) → Systemless hosts ← Click it
tosho1 said:
Isn't there a more easy way to obtain root?
That's strange. I use OnePlus smartphones with LineageOS for years now and cannot remember to execute such a complicated procedure. Just now I got a OnrPlus 8, installed LineageOS and Magisk and restored my apps with Titanium. So, it definitely worked.
Now, after a Lineage system update, root is gone.
Unfortunately I cannot tell exactly how I installed Magisk. I have a very poor memory. Think I just installed the app and said either just "install" or patched the zip with TRWP
But I definitely never downloaded or extracted any boot image manually.
Has anyone an explanation for this?
Even more strange: I just tried to flash magisk.zip again with TRWP. Now it tells me
"Magisk patched boot image detected"
and later:
"Failed to mount '/system_root' (Device or resource busy)"
After reboot the Magisk app now offers me three choices in the install tab:
- choose a file and patch (only this one existed before)
- direct installation (recommended)
- install into inactive slot (after OTA)
I don't understand the last one and tried the recommendet one.
Now, root is there again. Do I have to do this after each update? With my OnePlus5 I didn't.
Click to expand...
Click to collapse
LineageOS is not the stock ROM so it's slightly different and not covered in this thread.
Thank you, CarvedArt. I wasn't aware of this.
Does anyone have the latest stable Android 13 patched boot image for the IN2015 that they can share with me ?

Guide to Install GApps and Magisk on Custom ROMs for Nokia 7.2

While I was trying to install GApps for Lineage OS 18.1 on my Nokia 7.2, I always lost my wi-fi. This is apparently due to flashing TWRP as boot image, which replaces the stock boot messing with wi-fi as the boot image has thee kernel.
Although, I did figure it out, it took me three days to get a proper solution from multiple sources. Here, I will explain how to install Lineage OS 18.1 on Nokia 7.2 with Gapps and Magisk. This can be applied to other ROMs as well. I am assuming you are on stock firmware.
Requirements:
Any custom ROM without GApps
vbmeta file
vendor image
Gapps zip file of your choice
platform-tools
twrp image
magisk file
payload dumper tool
Preperation:
The wifi stops working because we change the boot image. To prevent this, we must flash the boot image of the rom after we are done with our work with TWRP
For this, we ,ust get the boot image for the ROM. As this is not available readily, we must extract it from the ROM zip
Install latest python on your pc
Get the payload dumper tool from the link given below. Extract the contents into the root directory of python. It should be in C:\Users\USER-NAME\AppData\Local\Programs\Python\Python <version number>
Extract the ROM zip into any folder. Copy the payload.bin file and paste it in the folder where you put the payload dumper tool
Open a command prompt in the python root folder and type
Code:
python -m pip install -r requirements.txt
Then type
Code:
python payload_dumper.py payload.bin
After it finishes, go to the folder named Output inside the python folder. Here there will be a file named boot.bin. Rename this as lineage_boot.bin and paste it into the platform tools folder
Installation:
Download the twrp image, rename it to twrp.img and place it in the platform-tools folder. Connect your phone to the computer, switch on usb debugging on your phone.
Open command shell in the platform-tools folder and type
Code:
adb reboot bootloader
. In the bootloader, type
Code:
fastboot flash boot_b twrp.img
.
Next, type
Code:
fastboot --set-active=b
and then reboot to recovery using volume buttons and selecting using power button
In TWRP swipe to allow modifications. Copy your ROM and vendor image files to your SD Card. Now, click wipe, format data and type yes. Go back to home screen and the press install. Select your ROM file and install it. Sometimes it is required to flash vendor image. In that case flash that too. This step is required for Lineage OS 18.1
Now on the twrp home screen, tap on reboot. At the bottom, the current slot should be B. Tap slot A. THis changes the active slot to A. Now go back and tap on bootloader, this should boot you to the bootloader.
Take your vbmeta.img file and place it in the platform tools folder. Now, while in the bootloader mode, type,
Code:
fastboot flash vbmeta_a --disable-verity --disable-verification vbmeta.img
Next type
Code:
fastboot flash boot_a twrp.img
and boot to recovery using volume buttons
Now, press install in TWRP and select install and install the GApps file and reboot to bootloader
Next, in the bootloader type
Code:
fastboot flash boot_a lineage_boot.img
. Now start your phone. You should have lineage os with GApps
Installing Magisk:
Copy the lineage_boot.img into your phone. Download magisk.apk file from the link given below
Install the magisk app and open it. If it asks for additional setup select no. Beside the magisk option select install. Under options, if Recovery Mode is selected, deselect it and click next.
Now click on Select and patch a file under method. Select the lineage_boot.img
The patched image will be saved in downloads folder. Rename this file to lineage_magisk.img and copy it to the platform tools folder on your computer. Reboot your phone to bootloader mode
On your computer in the command window opened in the platform tools folder, type,
Code:
fastboot flash boot lineage_magisk.img
Reboot and you will have a rooted lineage os with GApps
Files:
Lineage OS 18.1 and vbmeta.img
TWRP
vendor
NikGApps
Payload Dumper tool
platform tools
Magisk
Guides that I Followed:
Extracting boot.img from ROM zip
Installing magisk using patched boot image
Credits:
Raghu varma for Lineage OS 18.1 port and twrp
Providers of the guides mentioned above
Hi @Ujwal2000 thanks for the guide.
I am using the stock android 10 rom and magisk patch method.
This also leads to non working wifi and magisk does not recognize that its installed.
Which steps of your guide apply to the stock rom?
i do not need gapps nor twrp I guess I only wanted to root the stock rom with magisk.
For stock, use this guide. They maintain a repository if patched boot images
Guide - How to root the Nokia 7.2 and Nokia 6.2 using Magisk
Nokia 7.2 and Nokia 6.2 come with an unlockable bootloader. The thing that compliments unlocked bootloader best is root access. So, this guide will help you in rooting the Nokia 7.2 or Nokia 6.2. You have a choice between Magisk patched boot images and TWRP recovery. I’d recommend going the...
www.techmesto.com
@Ujwal2000 , can you please look at my posting here? Thank you.
after fallowing the steps(except installing lineageOS with twrp flash everything was encrypted even tough i have the bootloader unlocked, managed to install it via adb sideload) the wifi doesnt work at all. When i try to turn it on is switches off on its own. Do anyone know a fix?
i had problem with latest version of python (3.10), version 3.7 was working for me

[Guide][Installation][Fix]Switching from stock ROM to custom ROMs + Installing stock ROM after a brick or other Failures ( Mi A2 Lite - Daisy)

This guide is general guide for the installation of custom ROMs. I will also include guide to install stock ROM on devices which have been bricked or for solving various problem which you may encounter in custom ROMs. There are other guides for the same purpose but most of them are outdated and many of you seem to ignore old guide despite the fact that those guides can be helpful.
This is guide is only relevant for installation of custom ROMs which were released up to the date of posting this guide or up to android version 11. Recovering a bricked device can be done in the same way as to this one but installation instruction for devices with android version greater than 11 may differ.
DISCLAMER
Code:
I am NOT responsible for bricked devices,
thermonuclear war or for you getting fired because your alarm app failed.
Make sure the bootloader is unlocked and never lock the bootloader
How to unlock bootloader ?
>See in this thread.
Hard Brick, Soft brick, Problems in custom rom due to bad base, installation of base for switching to custom roms: windows linux
Installation of stock ROM through fastboot : The reply below
Migration from stock base to custom ROM : CLEAN FLASH
Migration between different version of same custom ROM : DIRTY FLASH
FOR SPECIFIC THREADS
Oragne Fox For Daisy
TWRP For Daisy
Magisk
CREDITS:
LInkBoi for his previous guide and TWRP
DarthJabba9 for Orange Fox Recovery
Every pros in daisy telegram groups.
EDL FLASHING (For windows only)​
EDL flashing can be helpful when flashing every partition of device is needed either for clean stock base or after brick or after some failure.
EDL flashing can be the final resort when everything else fails.
PREREQUISITES
1) A good USB cable, your phone
2) A PC with either windows or linux
3) Fastboot drivers from google and edl drivers from qualcomm
4) Platform tools from google
5)Fastboot rom. This should be full rom in .tgz format.
6)Xiaomi flash tool (LATEST VERSION AVAILABLE)
Install the adb and fastboot drivers from google. If you are on windows 10 or greater then you can also use "windows update > optional updates" to update adb and fastboot drivers + edl drivers. For the installation of drivers always use trusted sources and don't turn of driver signature enforcement if you can.
Extract the platform tools in a convenient folder, we will be doing our operations from this folder for fastboot and adb opeartions. Extract the fastboot ROM and place that in convenient folder as well. And for xiaomi flash tool extract the zip and launch XiaoMiFlash.exe .
If you can access fastboot in you phone then the phone can be booted into edl mode through fastboot else you have to take out back cover and short the testpoint pins to make the device boot into edl mode (see the attached image ).
If you can access fastboot. Boot into fastboot and type the following command in terminal.
To check if device is connected properly and drivers are properly installed
If no devices is shown then connect device properly with good usb cable and check the drivers.
Code:
fastboot devices
To boot phone into edl mode. This is only possible if the bootloader is unlocked else testpoint-edl is the only option
Code:
fastboot oem edl
The device should be shown as COM device in device manager ( Windows ). If not then either drivers aren't installed properly or your phone isn't in edl mode.
Now click on refresh button in xiaomi flash tool. Your device should be recognized as com device. Set the path to the images folder ( extracted fastboot rom ). Select CLEAN ALL option . If everything is good then click
on FLASH. The flashing process should start now. After the process completes keep pressing power button to boot device into the currently installed ROM.
Just install the rom and setup once even if you're going to flash custom rom next. This reduces various problems which may come in custom ROMs.
If any error occurs then try the following:
Make sure you are using latest flash tool.
Good fastboot rom (shouldn't be corrupted )
Good USB cable and try different ports of the PC.
The flashing should be done immediately after booting to edl. If not then take out battery and reconnect it if you have back cover open(In case of hard brick). Or keep pressing power button and volume down to boot into fastboot and boot to edl mode again from the above instructions(If fastboot is accessible)
For booting to edl using testpoint:
> Take out backcover
> Disconnect battery
> Short the pins
> Flash
> Connect battery after flashing is complete
> Keep pressing power button to boot into system.
qdl flashing ( linux only )​
For very detailed guide github -> bkerler edl
Thanks to DEFXZ and LinkBoi for suggesting this alternative.
Make sure you have platform tools, fastboot rom and other prerequisites to detect device properly.
clone the repository in convenient place
Code:
git clone https://git.linaro.org/landing-teams/working/qualcomm/qdl.git --depth=1
change to qdl directory
Code:
cd qdl
Build qdl tool
Code:
make
Finally flash the rom
Code:
./qdl --storage emmc --include /path/to/stock/images /path/to/stock/images/prog_emmc_firehose_8953_ddr.mbn /path/to/stock/images/rawprogram0.xml /path/to/stock/images/patch0.xml
The paths are the paths to various files inside the images folder which will be obtained after fastboot rom is extracted.
For further informations:
Original github link
qdl discussion in XDA
FASTBOOT FLASHING​
PREREQUISITES
FASTBOOT DRIVERS
PLATFORM TOOLS
FASTBOOT ROM
GOOD USB CABLE
PC WITH WORKING USB PORT
See this for meeting prerequisites.
Install fastboot drivers, connect device to PC via USB.
Extract platform tools into a convenient folder.
Extract fastboot ROM into a convenient folder.
Go to platform tools folder ( this will contain files and executable like fastboot.exe) and open powershell or any terminal window there
[ shift + right click and select open (powershell) window here ]
Type this command to see everything worked correctly.
Code:
fastboot devices
If not then check every step properly.
Now execute the script to flash the ROM.
Execute flash_all.bat script for windows PC.
Execute flash_all.sh script for linux PC.
If platform tools cannot be accessed system wide then.
Code:
./fastboot devices
will provide fastboot devices information.
For flashing drag and drop flash_all.bat or flash_all.sh file into the terminal.
Code:
'/media/user001/user/daisy/stock_roms/daisy_global_images_V10.0.18.0.PDLMIXM_9.0/flash_all.sh'
It will look something like this in linux and similar in windows.
If any error occurs the search for particular error. Most of the times the error is due to corrupted fastboot ROM or bad connection between phone and PC.
FINALLY! FLASHING CUSTOM ROM​
STEP 0
Flash(if not flashed already) the stock base recommended by particular ROM, if the ROM doesn't recommend a specific stock base flash 10.0.18.0 from the above instructions.
PREREQUISITES
TWRP or ORANGE FOX RECOVERY
Fastboot drivers and platform tools (details above )
The ROM which you want to flash, choose from here
GAPPS package if rom is vanilla and you want to install it.
Magisk if you want to root.
As you may have known by experience, our device doesn't have recovery partition so, flashing recovery through fastboot isn't possible. For flashing recovery first we need to boot recovery image and then only we can flash it.
If you want to use twrp:
Download both twrp*.zip and twrp*.img and place it in a convenient place.
If you want to use orange fox recovery:
Download orangeFox*.zip and extract it.
Keep both the .zip and .img file in convenient place.
If you have sdcard then copy ROM file, gapps, magisk, twrp or orange fox files into sdcard.
If not then there will be further instructions.
Now, connect the phone to the PC via USB and enable usb debugging. And open terminal in the platform tools folder as in above instructions.
Check device connectivity:
Code:
adb devices
Reboot into fastboot:
Code:
adb reboot bootloader
Check device connectivity:
Code:
fastboot devices
Lets check if the bootloader is unlocked:
Code:
fastboot oem device-info
If bootloader isn't unlocked you won't be able to flash custom recovery into the device. So, first unlock the bootloader. This should be allowed in the developers option of your phone first. This will factory reset the device.
Code:
fastboot oem unlock
Now if everything is good then it's time to boot into custom recovery:
Code:
fastboot boot recovery.img
recover.img is name of image of whichever custom recovery you want to use.
Code:
fastboot boot '/media/user001/storage (1)/daisy/twrp/twrp-3.5.2_9-2-daisy-unofficial.img'
It's like this in my case. You can drag and drop after typing fastboot boot
The phone should now boot into custom recovery. If it ask for decryption then your lockscreen password should work there.
if you want to flash recovery only then find the recovery.zip you want and flash it.
The steps further is also valid for moving between different custom roms. The term used for such process is CLEAN FLASH.
For Flashing custom ROMS :
SOMETIMES FLASHING INSTRUCTIONS MAY DIFFER SO, BE SURE TO CROSS CHECK FOR INSTRUCTION IN ROM SPECIFIC XDA THREAD OR TELEGRAM GROUP
The following action will wipe userdata if not wiped already. Be sure to backup data before these steps. Also if you encounter any future problems full backup from custom recovery may be able to solve most of the problems. So, be sure to keep full backup(including every partition) of your device.
Go to main menu > wipe > select all except internal storage and microSD.
Swipe right to perform wipe.
Install custom recovery by flashing recovery.zip
(This is done in case adb push doesn't work below and sdcard isn't available for flashing)
Again go to main menu > wipe > format data
Type yes and press enter.
If you don't have files in your sdcard then:
push rom file + gapps + other files into your device through adb push.
The command will be something like this:
Code:
adb push '/media/user001/storage (1)/daisy/posp/potato_daisy-11-20210919-dumaloo.v4.2.3+20.Community.zip' /sdcard
If adb push fails to work then you can reboot recovery and simply copy the files through file explorer.
Reboot to recovery only if you had installed recovery after wiping system else the device will soft brick
Now flash the rom.zip by selecting the file and swiping right.
Flash custom recovery if the ROM doesn't contain recovery
We have to change current slot even if we don't want to flash anymore things.
Latest recoveries changes slot automatically So, go to main menu > reboot > recovery
Now flash files which you want to flash i.e. gapps and magisk.
Again, Don't flash gapps if the ROM is of Gapps variant
Most of the roms now have implemented FBE (File Based Encryption ). So, you need to format data before rebooting to system. Again, check for specific ROM installation instruction if that is required or not. If you keep data from previous ROM that won't be considered a clean flash so, for proper clean flash format data before rebooting to system.
reboot system
MOVING BETWEEN DIFFERENT VERSION OF SAME CUSTOM ROM
Dirty flash or OTA ​
Most of the newer ROMs have seamless update ( even the unofficial ones ). The OTA update is simple. Just go to updater ( in settings > system or native app, depends upon the rom). If your ROM is of vanilla version then make sure gapps and/or magisk which you have installed, your ROM and custom recovery all support addon.d survival script. If they don't then you may have to flash everything again after update process is complete.
If custom recovery itself doesn't support update then you may need to choose different recovery or dirty flash ROM from the recovery. Don't worry most of the roms and both the recoveries for daisy support OTA and addon.d survival.
DIRTY FLASH​The process of flashing a ROM on top of existing one keeping the /data partition intact is known as dirty flashing. Such flashing must be done only on different builds of same ROM and it isn't recommended to flash build of lower version on top of higher version.
The steps for dirty flashing:
Download the update package.
Reboot to recovery
Enter password for decryption if encrypted.
Flash the update.zip package.
Reboot recovery, if recovery/rom doesn't support survival of recovery then flash recovery before rebooting to recovery.
If gapps and/or magisk survival isn't supported then flash gapps and magisk, make sure gapps is of the same type which was flashed before.
reboot system
Hi @user-001 thanks for this.
I'm on a stock A2 lite thats never had anything done to it , am i right in thinking i follow the clean flash section ?
You mention in there
We have to change current slot even if we don't want to flash anymore things.
Click to expand...
Click to collapse
I'm not fully sure what that involves could you break it down the steps a little for me.
I've downloaded all the files and am set up but i'm unsure on the Flashing fastbbot section where you say to use these files..
Execute flash_all.bat script for windows PC.
Click to expand...
Click to collapse
Is this a section i can bypass ? if not where can i get them from ?
Cheers
steve.loveday said:
Hi @user-001 thanks for this.
I'm on a stock A2 lite thats never had anything done to it , am i right in thinking i follow the clean flash section ?
You mention in there
I'm not fully sure what that involves could you break it down the steps a little for me.
I've downloaded all the files and am set up but i'm unsure on the Flashing fastbbot section where you say to use these files..
Is this a section i can bypass ? if not where can i get them from ?
Cheers
Click to expand...
Click to collapse
1) Yes you should follow clean flash instructions.
2)Changing of slot is done in custom recovery. Precisely in the reboot menu. But newer recoveries automatically switch the slot after flashing the rom , just be sure to reboot to recovery after flashing the recovery zip file.
3) the flash_all.bat script will be inside the extracted rom(fastboot rom) folder. You can use xiaomiflash too for flashing through fastboot.
user-001 said:
1) Yes you should follow clean flash instructions.
2)Changing of slot is done in custom recovery. Precisely in the reboot menu. But newer recoveries automatically switch the slot after flashing the rom , just be sure to reboot to recovery after flashing the recovery zip file.
3) the flash_all.bat script will be inside the extracted rom(fastboot rom) folder. You can use xiaomiflash too for flashing through fastboot.
Click to expand...
Click to collapse
Hi thanks for the reply,
I'm getting confused with all the various guides all seem to want you to do it a different way.
As i'm wanting Lineage thier instructions are...
Installation:
Download the latest build from here
Download LinkBoi00's version of TWRP here
Reboot to bootloader (adb reboot bootloader)
Fastboot into TWRP recovery (fastboot boot twrp*.img)
Do a factory reset in TWRP
Flash the latest build of Lineage OS
Boot into your new phone
Click to expand...
Click to collapse
Theres no mention of the edl or fastboot flashing and also the fastbot rom i downloaded doesnt have the flash_all.bat script in the zip file.
So do i follow thier instructions or these ones ?
Cheers
steve.loveday said:
Theres no mention of the edl or fastboot flashing and also the fastbot rom i downloaded doesnt have the flash_all.bat script in the zip file.
So do i follow thier instructions or these ones ?
Cheers
Click to expand...
Click to collapse
This guide deals with how to do something rather than what to do, meaning you should always do what particular rom suggests but the way to do this is mentioned here.
edl or fastboot flashing comes under clean flashing with new base, most of the time you aren't required to do this.
The script should be clean_all.bat or something similar just don't execute script with lock in the name(it will lock the bootloader)
And if you're already on the recommended base you don't have to flash the fastboot rom.
First of all, thank you very much for the detailed guide. What you have done here took a lot of work to do but it will help a lot of people (including me) to understand, albeit rudimentarily, the structures and functions of the devices etc.
For all that, thanks again.
When I start using the guide, I will update this post with any questions, such as :
fastboot boot '/media/user001/storage (1)/daisy/twrp/twrp-3.5.2_9-2-daisy-unofficial.img'
why not doing below? (For those who, like me, are not very familiar with linux.)
1. > adb push <twrp.img> /sdcard or same adb push "C:\platform-tools\twrp-3.5.2_9-2-daisy-unofficial.img" /sdcard
( which means push <file> from "adb|platform-tools\ folder" (eg. C:\platform-tools\)
into the root of <internal storage> | /storage/emulated/0 )
2. Reboot from adb to fastboot:
> adb reboot bootloader
3. Boot the image from <internal storage>:
> fastboot boot /sdcard/twrp-3.5.2_9-2-daisy-unofficial.img
What is the "Red" pointed and "Yellow" addresses"?
fastboot boot '/media/user001/storage (1)/daisy/twrp/twrp-3.5.2_9-2-daisy-unofficial.img'
I followed your "EDL FLASHING" post (#2) and it worked exactly as you mention!
In short, I was comming from unsuccessful flashing... but this is out of topic.
For me, did not worked the first time (after restarts) but the other day worked perfect.
The point is, most of times, it's becase windowz drivers.
We have to point that windowz needs their time to take the drivers in place. So, be patient and leave windowz to (not forced) restart(s).
AntonyMan said:
What is the "Red" pointed and "Yellow" addresses"?
fastboot boot '/media/user001/storage (1)/daisy/twrp/twrp-3.5.2_9-2-daisy-unofficial.img'
Click to expand...
Click to collapse
That must be your terminal representing different type of character in different colors.
Or, Are you talking about something else ?
steve.loveday said:
Theres no mention of the edl or fastboot flashing and also the fastbot rom i downloaded doesnt have the flash_all.bat script in the zip file.
So do i follow thier instructions or these ones ?
Cheers
Click to expand...
Click to collapse
For future references, the extracted fastboot ROM should be like this and you need to execute flash_all.bat or flash_all.sh script depending upon your OS or terminal.
user-001 said:
That must be your terminal representing different type of character in different colors.
Or, Are you talking about something else ?
Click to expand...
Click to collapse
Of course I'm talking about something else. lol
I was talking about that 'strange' address. fastboot boot '/media/user001/storage (1)/daisy/twrp/twrp-3.5.2_9-2-daisy-unofficial.img' (explained in post #11)
There is not such a directories in my miA2Lite phone. Obviously, it's because you are on Linux or Mac (UNIX). On Windowz 'command prompt' syntax it's slightly different.
Thus, I typed fastboot boot "/sdcard/twrp-3.5.2_9-2-daisy-unofficial.img"
* /sdcard is the root of <internal storage> directory.
** On Windows, double quote the address, if it's include spaces.
AntonyMan said:
Of course I'm talking about something else. lol
I was talking about that 'strange' address. There is not such a directories in my miA2Lite phone.
Thus, I typed fastboot boot "/sdcard/twrp-3.5.2_9-2-daisy-unofficial.img"
* /sdcard is the root of <internal storage> directory.
** On Windows, double quote the address, if it's include spaces.
Click to expand...
Click to collapse
The twrp image was on my pc(linux) i was booting directly from pc's terminal. And if you use only adb(or fastboot) then the paths are pc's absolute paths.

Alldocube T803 rooted Android 10/11 only

This process is very time consuming and tedious, you will need to use both windows and linux for this process and you will need to have patience as well as general information from Hovatek.
YES your bootloader MUST be unlocked first.
you need need to download RD tool app and stock oem firmware for the device.
extract the vbmeta-sign.img then extract your vbmeta-keys with extractor and place all keys in 'keys' folder.
patch oem boot.img with magisk and unpack it with android image kitchen, and repack, this will generate a smaller boot.img that is normal.
use avbtool command python avbtool add_hash_footer to sign and inflate your small patched boot.img to normal size.
use avbtool command python avbtool make_vbmeta_image to generate your custom-signed-vbmeta.img file will only be 16kb that is normal.
use vbmeta_pad.py command to inflate custom-signed-vbmeta.img file back to 1024kb stock size.
Once you have generated all your modified files its time to flash via RD tools
load the stock oem .pac firmware and under settings only select FDL1 and 2 , vbmeta and boot. double click to look for your custom vbmeta and boot-patched.img and flash it.
You will most likely be in a non booting state with only a quick boot logo flash then a black screen.
Now close RD tools and reload it again and this time select FDL1 and 2, and select your stock oem vbmeta-sign.img only and flash.
you will boot into android with magisk root.
If you flash custom files and fails to boot after flashing stock oem vbmeta-sign then flash all stock oem files to return to a factory state and retrace any errors or missed steps. read and re-read all steps to get a better understanding and double and triple check linux commands.
AVB_tools
avbtools.7z
drive.google.com
I have a alldocube smile 1 (t803), but I have no ability to do all the repacking of root.img. However, rooting is necessary to install the tool such as XX-net. Will you send me the two magisked images and the tool to flash them back. Thank you. My gmail: wu.gt.kent

Categories

Resources