[HELP] I need help on choosing which boot.img - Magisk

I need help, I'm really lost trying to root my device I own a REVVL V+ which that phone is really rare, I managed to get the Stock ROM for it. When I was trying to get the boot.img so I can patch it on Magisk there's two boot.img:
boot_a.img
boot_b.img
So, what I can do?

That's odd. There is a scheme for Android phones to use two "slots" for seamless system updates, so for kernel and system partitions there's two slots for each: boot_a/boot_b, system_a/system_b.
What I would do in your case is use a tool to compare the two and determine if there's any differences. If not, it doesn't matter which one you use. It's odd that they provide two boot images; for most A/B phones, only one boot image is used, which can be applied to one or both slots.

Related

About flashing "system" partition only?

Is it possible to take a firmware from another phone, say S4, from LineageOS and flash only the System partition? I know all the hardware drivers reside in the Kernel. But will there have to be certain files changed in the System to make it work? Just looking for ways to get unmolested LineageOS on my phone.

Alcatel 5033d -> Customize original firmware

Hello all,
First of all, I'm not very familiar with recovery/rooting on phones. Although my daytime job is customizing embedded linux, so I have some knowledge
I got my hand on a few Alcatel 5033d devices, on which I want to run a software I created. However, this software needs access the notifications. And Android GO doesn't allow that. So I need to change the low-ram flag in build.prop. If possible I also want to remove the google apps from it and make my app a system app. But for the rest I'm happy, so don't need linageos or anything.
Is there a way to make a custom system.img, based on the original one, with only build.prop changed and load this complete firmware via the original recovery mode? I already saw you could load things via sdcard (adb doesn't work in stock recovery -> authentication required).
I already tried mtk-su (worked on a tablet before), but I guess that flaw is already patched
Something to try
This is from my head so if this doesnt work im sorry
1. install a custom rom.
2. install magisk onto the custom rom.
3. make a copy of the boot image
4. use "Mobile upgrade S" from alcatel to restore your phone
5. flash the backed up boot image from before.
6. if your lucky you may have root on the original system partition.
P.S i would use https://forum.xda-developers.com/alcatel-1/development/alcatel-1-root-achieved-t3970713 rom because it doesnt touch the boot partition.

ROG 2 phone soft bricked

Hello,
today I did have a strange experience with my ROG 2 and my best guess is that there is some UFS problem, but a second opinion or ideas are welcome.
During a bike ride when I was wifi scanning (apps: "Tower collector", "Radio Beacon"), navigating and listening to an audio book, the phone just went dark. I thought from previous experience on a Note 3 that it might have overheated. Pretty much stress proofed from the previous phone.
Yes - it was warm in its bike pocket but really not overly hot.
The phone is an ebay buy 2 months old and has been ever since with omnirom, stable so far. I only noticed that the RGB LED here has no blue light, but I plainly did not care.
I tried to boot it after some 10 minutes again and the phone would not go past its omnirom boot screen until it reboots after some time, boot loops.
30 Minutes later at home I wondered then what is going on, and I copied off the TWRP backup from the phone I took two days ago, just in case.
I then tried to restore the same backup, but the phone switched off during restore after ~30%. This was reproducible, so I thought this may be something with the backup, maybe I cannot restore a partition. When I restore I had all partitions marked and I tested them one by one. The restore of single partitions worked, one by one, except vendor as it was marked read only and data as it failed unpacking (my recent backup then is dead?).
I then tried formatting the partitions, so "data", originally f2fs. I lack experience with journal recovery on f2fs so went to ext4. System was ext4 and was just wiped. I lost of course other data on the internal storage so tried to restore again with my copied backup. It restores, but it cannot boot and just bootloops. I now formatted all partitions, including vendor.
Finally, I tried downloading omnirom again and installed it. It won't boot, it doesn't even get to the boot animation, but just boot loops.
I reformatted data back to f2fs. But no change here.
Trying more: lineageos won't flash for unknown reasons, it immediately dies as "Error installing zip file". Checksum of the downloaded zip is correct.
I downloaded a stock rom and installed it. This is now the best result so far - It does want to boot.
Here I get a boot animation and this incredibly lame "tching" sound (it is a phone, not a sword...). But it also stops there and never continues. Yes, first boot takes longer, but not 10 minutes.
Any ideas what else to try with this phone?
So far, I can boot twrp via sideload and interact with it fine. But that will be it; ran out of ideas.
Happy for suggestions.
Gaya
Use raw firmware to restore everything.
Install latest firmware zip on both slots.
After installing custom roms go to wipe -> format data by typing yes. Otherwise rom wont boot
thanks for getting back, If by raw firmware you meant the ASUS stock, I did. Not sure why data wipe after installation or double install to a/b partition would make a difference, but in the end I am new to this a/b concept, looks though like standard dual boot to me. Tried it, but no difference.
- installed asus firmware to inactive B
- switched to B partition
- installed asus firmware to inactive A
- wiped data
- started, so far same behaviour after 15 minutes of waiting (boot animation with sound, then it repeats boot animation until ...).
There are Two kind of rom raw firmware (used to restore bricked device) and recovery rom (zip file we use for update)
Raw firmware will flash ROM to both the slots, while recovery rom only flash to one slot. So you need to Only select reboot to recovery after flashing ROM to switch to the updated slot.
No, stock rom is not exactly raw firmware. RAW firmware uses EDL mode (in bootloader) to flash the stock rom. Download A10 raw from here version .90.
when extracting it you will see some files.
Steps To flash Raw:
* enable usb debugging in phone.
*connect the phone via side port to pc
open command prompt and run this command
adb devices
adb reboot bootloader
Now go to the folder where you extracted the raw firmware & run "flashall_AFT.cmd" as admin
wait [there will be no output]. After 15 -20 mins your device should boot. If you have any old version stock rom data the phone will carry the data to new version. If you have any custom rom/ updated version of stock rom data, it will ask to factory reset, so do that.
wiping is not exactly formatting so do it the right way
Why format: the one where you format by typing "yes" .If you switch between Roms ( stock to custom or vice versa) and go back to older versions (v .100 to .60) the old/previous rom data cant be used with new one so you must format data.
when formatting is not necessary : If you want to upgrade both stock images (version .90 to .100) & custom rom (v 1 to 1.2) i.e., flashing stock rom and then custom rom over it, you dont need to format data because you can reuse the data from custom rom to updated custom rom.
A/B device use two partition instead of one. so the upgrade can happen in the background. On restart you will switched to updated slot. So room for error is less.
The wiping here should be the same as formatting, as it is running the mke2fs (as per TWRP settings). But raw rom I do not have (I believe).
The link you have there seems broken, could you repost it again?
I did download the stock ROM earlier from ASUS directly, to not violate policies, HTTP links etc, here is only the path on asus . com
pub/ASUS/ZenFone/ZS660KL/UL-ASUS_I001_1-ASUS-17.0240.2103.75-1.1.229-user.zip
That is the one I installed via recovery. Am not sure what is in your mentioned flashall_AFT.cmd though, but suspect some adb sideload at least.
I eventually succeeded, but of course would liek to know
1) why
2) what happened?
I did follow a video about flashing the stock rom, basically as you explained (factory reset and data wipe), twice to a and b partition. That made the device bootable. Why is this needed?
I tested wiping system again (I am used to doing clean flashes) and installed omnirom again, and it failed booting.
I installed again the a/b with stocks, factory reset and data wipe and installed omnirom as dirty flash. All is well.
Now I was able to restore my backup finally without the device switching off and it did not complain about the data backup. So finally I am with my phone again rom and copy data to my fresh partition.
as to 1) why?
I understand a/b partition as sort of windows/linux dual boot with a more separate bootloader maybe. So I do not see the point in flashing the stock rom twice or in rendering the device unbootable when wiping system.
and as 2) what happened.
I may only guess: I did an omnirom upgrade 2 days earlier that worked fine and was the reason for my nandroid.
During my ride, the phone had some whateverissue and rebooted. I am unsure whether i tested booting but assume that after the upgrade it flashed to the other partition and it was not bootable. It does not make sense as this would make a/B partitions rather hard for custom rom makers, e.g. people complaining all the time.
Other guess: there was a file system issue with f2fs. Problem with data partition seems to cause bigger issues.
When I flash to ext4 after testing the bootable rom with a wiped data, it would not boot anymore. After factory reset again, it mke2fs the data partition again, back to f2fs and the device booted again happily.
Thanks for the help. Happy to know/learn more about this issue, as I would love to prevent or handle them quicker with more of I know what I'm doing.
Android Dual Partition (A/B) is made for seamless updates i.e, Dual system/vendor partition but uses same data partition. Lets say you are currently in slot A when you apply system update the slot B gets updated. As always rebooting the device switches to the B partition after update. & further update flashes the system to the A partition.
Basically there is no need to flash stock rom twice, unless you are coming from stock [one partition might be in higher firmware version than other] or there is new stock version with some minor/major upgrades to firmware files.
Our custom ROMs are not stand alone, Mostly it only replaces the system files and keep the vendor same as stock. (also this keeps the ROM update file size to be minimum)
you might even have different version of Android in A/B partition.
Here is a scenario on How A/B works:
Say you are currently using your device in B-slot and A9 so partition on slot-A will be A9 partition slot-B be A9. After that you are doing system update to A10 from System update (not via TWRP)
now you will have A10 on slot-A and A9 on slot-B.
then you want to go to custom rom, so you flashed say omni on A-slot and rebooted & it will surely work.
After that you are using inbuild system update from custom rom any applied it. now the system update will overwrite the A9's system files but (the device specifically needs A10s vendor to work properly). Now comes the fun part i.e., soft brick, boot looping, and corrupt images
That's why you have to flash latest stock to both A and B slots, and overwrite them all with system files from custom rom (also should be flashed once in slots A and B) to get neat experience from custom ROMs.
If you understand what was written above, then you will know the reason behind soft brick.
stock rom flashed only once (firmware image variation may affect stability)
custom rom only flashed in one slot (switching slot will boot loop device)
Not using Reboot to recovery to flash (you will be flashing to the same slot over and over & thus rebooting will boot loop)
Not formatting data ( Just Maybe, your custom ROM and stock uses different file system for data partition)
For Raw files search "ASUS rog 2 RAW firmware images" those files will be around 3 GB in size.

I compiled the official kernel for Realme X2 Pro but how do I install them?

I was able to compile the realme X2 Pro's official kernel release from https://github.com/realme-kernel-opensource/realmeX2pro-X3-AndroidR-kernel-source and I got 3 files generated in arch/arm64/boot folder.
They are:
Image
Image-dtb
Image-dtb-hdr
I just wanted to know how to move further to be able to flash just this kernel (I have a GSI image flashed on /system from TWRP).
Based on the partitions I saw from TWRP, the ones I feel relevant are: Boot partition, Dtbo partition, Vendor Image partition. Which one is it and how do I package the kernel/device tree blob file above to be able to flash to one of these via fastboot? Is that even a valid operation?
I don't want to risk a trial and error approach and possibly screw up further (I have backups of these partitions, but still I'd love to get some insights from the community who might've done this before)
Thanks!

Difference: Get Magisk through custom recovery vs patched firmware?

Any difference?
It depends on the device.
For devices where flashing individual partitions can be done directly via bootloader, patching the boot image is generally preferred. However, some devices don't allow this, such as Samsung, so you have 3 options, which may or may not work well:
Extract the boot image from the AP.tar and repack it, then flash in Odin (easy to get wrong)
Patch the AP.tar in Magisk (difficult because this is the "main" firmware package and is quite large)
Flash a custom recovery if one is available, then flash Magisk in recovery (seems to work pretty well)
V0latyle said:
It depends on the device.
For devices where flashing individual partitions can be done directly via bootloader, patching the boot image is generally preferred. However, some devices don't allow this, such as Samsung, so you have 3 options, which may or may not work well:
Extract the boot image from the AP.tar and repack it, then flash in Odin (easy to get wrong)
Patch the AP.tar in Magisk (difficult because this is the "main" firmware package and is quite large)
Flash a custom recovery if one is available, then flash Magisk in recovery (seems to work pretty well)
Click to expand...
Click to collapse
I did number 2. How is it difficult? How is 1 more dangerous than 2?
Arealhooman said:
I did number 2. How is it difficult? How is 1 more dangerous than 2?
Click to expand...
Click to collapse
It's difficult because it's a large file, and since Magisk doesn't run on PC, there's no easy and quick way to patch it.
I never said 1 is dangerous, just easy to get wrong. Samsung repackages their images as lz4 files, so while you can extract boot.img.lz4 from the AP.tar using 7Zip, extracting boot.img from the lz4 file is another story. I tried using a 7zip plugin; it didn't work for me. Then, once you've patched it, you have to figure out how to flash it to the device. If you want to use Odin, you have to repackage the file. You can use TWRP to install images, but at that point you might as well just install Magisk via TWRP and skip the whole process.
V0latyle said:
It's difficult because it's a large file, and since Magisk doesn't run on PC, there's no easy and quick way to patch it.
I never said 1 is dangerous, just easy to get wrong. Samsung repackages their images as lz4 files, so while you can extract boot.img.lz4 from the AP.tar using 7Zip, extracting boot.img from the lz4 file is another story. I tried using a 7zip plugin; it didn't work for me. Then, once you've patched it, you have to figure out how to flash it to the device. If you want to use Odin, you have to repackage the file. You can use TWRP to install images, but at that point you might as well just install Magisk via TWRP and skip the whole process.
Click to expand...
Click to collapse
I did it the Al way becasue I don’t have twrp for my device. I used Adb push and pull for magisk. Btw after I rooted my device is expired int little problems (eg. When swiping out apps, the one on the top doesn’t move down, my device restarts upon connecting wifi). Do you think I’m okay like I am or I should redo?
Arealhooman said:
I did it the Al way becasue I don’t have twrp for my device. I used Adb push and pull for magisk. Btw after I rooted my device is expired int little problems (eg. When swiping out apps, the one on the top doesn’t move down, my device restarts upon connecting wifi). Do you think I’m okay like I am or I should redo?
Click to expand...
Click to collapse
No idea how to help with that, sorry.
Thanks for explaination anyway

Categories

Resources