boot.img and recovery.img too big - Moto G4 Plus Questions & Answers

So, what i've done is downloaded the LineageOS 8.1 repo and used the kernel and device tree from JLeeblanch and succesfully build a 64bit ROM and flashed it. No problems there.
The boot.img is 10640K in size and recovery.img is 16442K. Both within the limits of the boot and recovery partition of 16.8M and 16.9M
The problems start when i enable "Loadable Module Support" in de kernels config. First of all i needed to edit the BoardConfig.mk to expand the boot and recovery partition to (both) 32M in order to let it build. It did, and it gave me a boot.img of 21884K and a recovery.img of 23118K. Since the partitions on the device itself are smaller i decided to resize the partitions using parted. Which seemed to work, but after a reboot the original partition table is back to normal.
So my questions are:
1) why do the boot.img and recovery.img grow so much after just enabling "Loadable Module Support"
2) why does parted let me edit the partition table but gets 'reset' after a reboot
Thanks for helping

Related

(WIP) Magisk/Root installation

So this morning, we finally got our hands on some factory images. That is the good news. The bad news is that so far I am unable to get Magisk to work. Anyone else get it to work yet?
Here is what I have done:
1) Download the latest (5.4) magisk manager apk [Thread | Direct Link]
2) Set the update channel to both stable (14.0) and beta (14.3)
3) Choose install from stock boot img (with and without keep dm-verity and force encryption)
4) Copy the patched boot img from your phone:
Code:
adb pull /sdcard/MagiskManager/patched_boot.img .
4) Flash the modified boot.img in fastboot
Code:
fastboot flash boot patched_boot.img
Results:
1) With 14.0, the system boots up fine, but magisk isn't installed
2) With 14.3, I get bootloops, and have to reflash the stock boot.img in order to get it to boot.
Might be worth noting that the patched boot img is significantly smaller than the original one (about 25mb vs 40mb)
I tried the same thing with 14.3 only and it says it patches the boot.img that I pulled from the image. I then reboot and I am not rooted. Is there suppose to be an option to patch the second slot?
Once you patch the stock boot.img it should tell you where it placed the patched img. For me it was /sdcard/MagiskManager/patched_boot.img
You need to pull that img file, reboot to bootloader and fastboot flash that.
skaforey said:
Once you patch the stock boot.img it should tell you where it placed the patched img. For me it was /sdcard/MagiskManager/patched_boot.img
You need to pull that img file, reboot to bootloader and fastboot flash that.
Click to expand...
Click to collapse
Ok, I see you have to manually apply the patched boot img. This is my first Pixel, came from a 6P where I just used twrp to install magisk. Guess we need to wait for a newer Magisk.
stevetrooper said:
Ok, I see you have to manually apply the patched boot img. This is my first Pixel, came from a 6P where I just used twrp to install magisk. Guess we need to wait for a newer Magisk.
Click to expand...
Click to collapse
Can you try flashing the patched boot.img? If you get into a bootloop, simply hold power and volume down to get back into bootloader mode and reflash the stock boot img
skaforey said:
Can you try flashing the patched boot.img? If you get into a bootloop, simply hold power and volume down to get back into bootloader mode and reflash the stock boot img
Click to expand...
Click to collapse
My PC is at home, will have to try later tonight. I suspect that it will boot loop like yours, since the patched img is only 25 megs and the original was 40.
Try the app One Click Auto Brick. ?
I tried it and it did the same bootlooping you described.
Were you guys able to flash the factory image and get it to boot past the google screen?
I've been through the same process. I manually flashed the patched_boot.img and got stuck in a bootloop. Had to flash the factory boot to get back up and going. @topjohnwu do you have any insight on this?
Just wondering, have you run
Code:
fastboot flashing unlock_critical
? Just saw it in this post: https://forum.xda-developers.com/showpost.php?p=74271129&postcount=6
gakio12 said:
Just wondering, have you run
Code:
fastboot flashing unlock_critical
? Just saw it in this post: https://forum.xda-developers.com/showpost.php?p=74271129&postcount=6
Click to expand...
Click to collapse
This might pertain to flashing an updated bootloader. The boot image flashed fine, just bootlooped, so I don't think that's the problem.
teshxx said:
Were you guys able to flash the factory image and get it to boot past the google screen?
Click to expand...
Click to collapse
I had to re-extract the boot.img from the factory image and flash it manually again to get it to boot. A flash-all did not seem to get it.
Code:
Fastboot flash boot boot.img
I dont have my 2XL yet, but I grabbed the factory image and yanked the boot out of it then used Magisk Manager on my MXPE to patch the img. I've unpacked both images to compare them and it's definitely patching it and the patched one doesn't seem to be missing anything so I'm fairly certain the size difference is due to the patched image not being padded to the 40MB size of the boot partition. So probably not something to worry about.
It looks like my device will be here wednesday. If nobody else has cracked this case by then I'll start poking around. If anyone else is poking around and looking for ideas. I would start by unpacking and repacking the normal boot.img and flashing it just to make sure it boots. Assuming it does then modify the default.prop on the patched_boot.img to enable insecure adb during boot so that adb logcat can be run while it's booting and maybe get an idea of what's going on.
The only problem I see with your process is patching it in another device will likely cause problems because it was patched using the wrong vendor image.
northmendo said:
The only problem I see with your process is patching it in another device will likely cause problems because it was patched using the wrong vendor image.
Click to expand...
Click to collapse
Oh yeah, I wouldn't try to flash what I made from another device. I mainly wanted to see what, if anything magisk manager would do with it. If someone wants to upload a patched_boot.img they made on their 2XL so I can look into it when I get home from work tomorrow that would be appreciated.
Maybe I'll get lucky and get mine tomorrow.
I can do that. I'll create one first thing in the morning.
What's the best way to look at the contents of the img files? Preferably on Windows
update:
I mounted both the stock boot.img file and patched boot.img files and it does appear that changes are being made.
Here are the files that are different between the 2:
Code:
ramdisk/init
The patched boot img contains additional files that seem normal:
Code:
ramdisk/overlay/sbin/magisk (binary file)
ramdisk/overlay/init.magisk.rc
In addition, I found the backup of the main init file that was changed in ramdisk/.backup/init
Here are the contents of the init.magisk.rc file
Code:
# Triggers
on post-fs
start logd
start magisk_daemon
wait /dev/.magisk.unblock 5
rm /dev/.magisk.unblock
start magisk_pfs
wait /dev/.magisk.unblock 10
on post-fs-data
load_persist_props
rm /dev/.magisk.unblock
start magisk_pfsd
wait /dev/.magisk.unblock 10
# Services
# Self recoverable service
service magisk_daemon /sbin/magisk --daemon
user root
seclabel u:r:su:s0
# launch post-fs script
service magisk_pfs /sbin/magisk --post-fs
user root
seclabel u:r:su:s0
oneshot
# launch post-fs-data script
service magisk_pfsd /sbin/magisk --post-fs-data
user root
seclabel u:r:su:s0
oneshot
# launch late_start script
service magisk_service /sbin/magisk --service
class late_start
user root
seclabel u:r:su:s0
oneshot
# STOCKSHA1=6d4d920f9d0b6eee52de8a95614a9884ef80d732
Not sure if this is useful to anyone, but maybe it will be.
One thing I noticed was the the . rc file contained references to /dev/.magisk and /sbin/magisk but I do not see those files in the patched boot img (only in the overlay folder, and maybe that's all that's needed, I don't know nearly enough about this to say for sure).
But, perhaps that's part of the problem?
Could the title of this thread be changed? Very clearly not a guide or even a WIP.. It's a question/discussion on what might work to get Magisk working.

Looking for thorough flashing guide

Hi,
Does a thorough guide exist on how to flash custom ROM on this phone?
I have done quite a lot of flashing in my life but can't a ROM flashed for the love of God.
Got TWRP installed, ADB works, cables are good.
Thanks!
After quite some hours I finally managed to get Havoc Pie running (GSI ARM64 AB, downloaded here).
My first problem was the fact that you need to be on stock Oreo before starting, this took me a while to figure out.
I used the most recent 'back to stock' Oreo from this page.
After installing this, I booted up, and went straight for enabling USB-debugging in Developer options.
Then do ADB REBOOT BOOTLOADER to enter fastboot mode.
There I erased system on both A and B partitions by using FASTBOOT ERASE SYSTEM command, then FASTBOOT SET_ACTIVE OTHER to switch to the other partition, and then once more FASTBOOT ERASE SYSTEM to also erase the system on this partition.
After that I ran FASTBOOT FLASH SYSTEM Havoc-OS-v2.0-20181027-GSI-ARM64-AB-Official.img, on the one partition, then FASTBOOT SET_ACTIVE OTHER and after that FASTBOOT FLASH SYSTEM Havoc-OS-v2.0-20181027-GSI-ARM64-AB-Official.img to flash it on the other partition.
After that I installed TWRP by running FASTBOOT FLASH BOOT twrp-3.2.3-0-mata.img (downloadable here).
After that, I rebooted into TWRP recovery by running ADB REBOOT RECOVERY.
There, I put twrp-installer-mata-3.2.3-0.zip (downloadable at the previously mentioned TWRP website) on internal memory and flashed it.
This automatically flashes both A and B partitions (switching between A and B at the reboot screen).
After doing that, I wiped /DATA on both A and B.
Then I put the Havoc-OS-v2.0-20181027-GSI-ARM64-AB-Official.img on internal memory and flashed it on /SYSTEM for both A and B.
Then it is time for GAPPS.
As I prefer Stock GAPPS with my own GAPPS-CONFIG.TXT, I ran into the Error 70: because of the large size of Havoc, there is not enough room for large GAPPS.
So because of that I needed to do the Resize /SYSTEM partition for both A and B (in the Advanced wipe menu section).
After that I was able to flash my Stock GAPPS on both A and B.
Now I need some rest to regain my sanity before I tackle rooting the ROM.
I probably did too much double stuff, but it is not easy to know when only A or B needs to be done.
Comments and tips are welcome.
Waancho said:
After quite some hours I finally managed to get Havoc Pie running (GSI ARM64 AB, downloaded here).
My first problem was the fact that you need to be on stock Oreo before starting, this took me a while to figure out.
I used the most recent 'back to stock' Oreo from this page.
After installing this, I booted up, and went straight for enabling USB-debugging in Developer options.
Then do ADB REBOOT BOOTLOADER to enter fastboot mode.
There I erased system on both A and B partitions by using FASTBOOT ERASE SYSTEM command, then FASTBOOT SET_ACTIVE OTHER to switch to the other partition, and then once more FASTBOOT ERASE SYSTEM to also erase the system on this partition.
After that I ran FASTBOOT FLASH SYSTEM Havoc-OS-v2.0-20181027-GSI-ARM64-AB-Official.img, on the one partition, then FASTBOOT SET_ACTIVE OTHER and after that FASTBOOT FLASH SYSTEM Havoc-OS-v2.0-20181027-GSI-ARM64-AB-Official.img to flash it on the other partition.
After that I installed TWRP by running FASTBOOT FLASH BOOT twrp-3.2.3-0-mata.img (downloadable here).
After that, I rebooted into TWRP recovery by running ADB REBOOT RECOVERY.
There, I put twrp-installer-mata-3.2.3-0.zip (downloadable at the previously mentioned TWRP website) on internal memory and flashed it.
This automatically flashes both A and B partitions (switching between A and B at the reboot screen).
After doing that, I wiped /DATA on both A and B.
Then I put the Havoc-OS-v2.0-20181027-GSI-ARM64-AB-Official.img on internal memory and flashed it on /SYSTEM for both A and B.
Then it is time for GAPPS.
As I prefer Stock GAPPS with my own GAPPS-CONFIG.TXT, I ran into the Error 70: because of the large size of Havoc, there is not enough room for large GAPPS.
So because of that I needed to do the Resize /SYSTEM partition for both A and B (in the Advanced wipe menu section).
After that I was able to flash my Stock GAPPS on both A and B.
Now I need some rest to regain my sanity before I tackle rooting the ROM.
I probably did too much double stuff, but it is not easy to know when only A or B needs to be done.
Comments and tips are welcome.
Click to expand...
Click to collapse
Wow, here's all i did :
Flashing ProjectTreble GSIs on the Essential using TWRP
1) either boot or fastboot into TWRP
2) Wipe Cache, System, and Data (1 GSI required internal to be wiped, i forget which)
3) From Main Menu, select Install and Flash UN-ZIPPED A/B system.img
4) Reboot Recovery (It's going to say there's no OS, act like you didnt see it.)
5) Reboot System and Enjoy!
6) Most of the later GSIs from October to Present I have flashed and am happy to say
they all contain pre-installed Magisk and ALL but 1 contains Gapps.
AndroidDevices said:
Wow, here's all i did :
Flashing ProjectTreble GSIs on the Essential using TWRP
1) either boot or fastboot into TWRP
2) Wipe Cache, System, and Data (1 GSI required internal to be wiped, i forget which)
3) From Main Menu, select Install and Flash UN-ZIPPED A/B system.img
4) Reboot Recovery (It's going to say there's no OS, act like you didnt see it.)
5) Reboot System and Enjoy!
6) Most of the later GSIs from October to Present I have flashed and am happy to say
they all contain pre-installed Magisk and ALL but 1 contains Gapps.
Click to expand...
Click to collapse
Thanks!
Next time i will try your method.
For some reason, if i did anything different, the phone would just keep rebooting into recovery.
And of course, the ROM that i chose (Havoc) did not have Magisk pre-installed.
I am now back to stock and liking it, which says a lot about the PH-1 software!
Waancho said:
Thanks!
Next time i will try your method.
For some reason, if i did anything different, the phone would just keep rebooting into recovery.
And of course, the ROM that i chose (Havoc) did not have Magisk pre-installed.
I am now back to stock and liking it, which says a lot about the PH-1 software!
Click to expand...
Click to collapse
It does have Magisk installed, it should if its one of the newer builds and all you need to do is install Magisk Manager which in turn activates Magisk
Installing Magisk manager was one of the first things I did, but unfortunately, the latest version A/B Havoc at the aforementioned link did not have Magisk.
There's about 6 or 7 and probably a bunch of YouTube's
Sent from my PH-1 using XDA Labs

[RECOVERY][STABLE]Unoffical TWRP for Xiaomi Mi A3[laurel_sprout]

Team Win Recovery Project 3.x, or twrp3 for short, is a custom recovery built with ease of use and customization in mind. Its a fully touch driven user interface no more volume rocker or power buttons to mash. The GUI is also fully XML driven and completely theme-able. You can change just about every aspect of the look and feel.
Code:
#include <std_disclaimer.h>
/*
*
* We are not responsible for bricked devices, dead SD cards,
* thermonuclear war, or you getting fired because the alarm app failed. Please
* do some research if you have any concerns about features included in this ROM
* before flashing it! YOU are choosing to make these modifications, and if
* you point the finger at us for messing up your device, we will laugh at you.
*
*/
Whats Working?
Everything is working
Can change Slot A/Slot B on twrp
SDcard and OTG working
Decryption of Data working
Flashing of roms work pie and even Q roms work.
HOW TO UPDATE a ROM and Keep TWRP and ROOT:
Before all Disable all magisk modules for boths methods
- Put rom.zip, twrp installer.zip and magisk.zip on your internal storage or sdcard;
- Flash Rom;
- Flash TWRP Installer;
- Flash magisk(recommend to use Magisk v19.4);
- Reboot.
Download:
TWRP 3.3.1-2 Unofficial Installer by Nikesh Kataria
TWRP 3.3.1-2 Unofficial by Nikesh Kataria
Donations:
Credits:
Thanks to @mauronofrio for a great help to make a stable recovery
Thanks to @Typhus_ for hardcore testing
Thanks to @prakash78 for testing
Contributors
Nik001
Source Code: https://github.com/Nikesh001/android_device_xiaomi_laurel_sprout-twrp
Version Information
Status: Stable
Created 2019-10-21
Reserved
This man -> @Nik001 deserves a beer!!!
Thank you for delivering us a fully working TWRP for laurel_sprout!
Cheers!
Typhus_ said:
This man -> @Nik001 deserves a beer!!!
Thank you for delivering us a fully working TWRP for laurel_sprout!
Cheers!
Click to expand...
Click to collapse
Welcome and thank you for testing twrp.:fingers-crossed:
Thank u peru sir
A3 real modding let's start
Good Job @Nik001
Anyone tell how to flash twrp... proper commands
Please
---------- Post added at 10:44 PM ---------- Previous post was at 10:42 PM ----------
Is that tested anyone.
Stock fw 10.3.8 (global) not booting with this twrp - in 10.3.8 audio modules have strange dependence "saved_command_line" symbol from kernel. For loading this modules need patch kernel sources -
diff --git a/init/main.c b/init/main.c
index 6d1880f0b852..2106f54a7008 100644
--- a/init/main.c
+++ b/init/main.c
@@ -128,6 +128,7 @@ void (*__initdata late_time_init)(void);
char __initdata boot_command_line[COMMAND_LINE_SIZE];
/* Untouched saved command line (eg. for /proc) */
char *saved_command_line;
+EXPORT_SYMBOL_GPL(saved_command_line);
/* Command line for parameter parsing */
static char *static_command_line;
/* Command line for per-initcall parameter parsing */
Click to expand...
Click to collapse
Proper install method explained
Hello!
Please, @Nik001, update the OP with the install method that I'm going to describe next, ok?
It's just to avoid future complications (lost of Wi-Fi, sound, etc...) for "not that experienced users".
Your bootloader must be unlocked. If it's not, then follow step 1 of the instructions provided HERE.
Download TWRP zip file and copy it to your device (internal or external storage)
Download TWRP img file and and store it, on the folder where you have adb and fastboot files, on your PC
Open a cmd line and execute these commands (being on that folder, of course):
adb devices (to make sure your device is detected)
adb reboot bootloader (to reboot into fastboot mode)
fastboot getvar current-slot (to check what's your current active slot)
fastboot set_active b (if your active slot was a, if it was b then change it to a)
fastboot erase boot
fastboot flash boot twrp-3.3.1-2-unofficial-laurel_sprout.img
fastboot reboot (NOTE : Before hitting "Enter", long press Vol + on your device until you see the Android One logo. By doing this your device will be forced to boot into Recovery and not into System)​
When TWRP recovery boots, if you have a stock boot.img that matches the build on this "currently active" slot, flash it into boot partition. If you don't have, then just ignore this step...(it's not mandatory)
Install the TWRP zip (always install the latest build available)
Change slot to the one that was active on the beginning of these steps and reboot to Recovery (just to make sure that the slot, in fact, was changed)
Reboot to System
Why do I suggest this?
By doing this method (which seems more complicated but, trust me, it's how it should be done) we will flash TWRP img into the "inactive" slot, thus, not breaking anything on the "currently active" slot. When TWRP boots, it will patch both slots boot ramdisks. But the thing is, on the "currently active" slot (the one inactive on the beginning) it will patch the TWRP img but, on the "currently inactive" slot (the one that was active on the beginning), it will patch the stock boot.img, thus, no bug will happen that usually appears when a user accidentally flashes the wrong boot.img into boot partition.
On the other hand, if we have a stock boot.img, that matches the build on the "inactive" slot, we could flash it into boot partition before installing the zip that patches ramdisk. By doing this we will patch both stock boot.img present on both slots (instead of patching TWRP img and boot.img).
Cheers!
Sapper Morton said:
The method Typhus shared works 100% of the times; however I must say, I don't use it, just preference; as it follows, instead of flashing into the inactive slot, I flash the pre_patched boot image into the active slot, this of course will mostly like break network and other components on the ROM, if you mismatch image versions; however, if you flash the stock boot image (using install button, inside TWRP, tapping into 'images', select your stock boot.img) and then patch it using the TWRP Installer right after, you will be using the right image, so no problem will occur, and mostly important, no slot change is needed. Both methods works, choose what you prefer, just read it carefully and I repeat, always use the same boot image from your firmware, a lot of confusion comes to the fact, that when you uses TWRP.img or Magisk.img they aren't boot images, but they are; A/B partition scheme doesn't use some individual partitions anymore, as /recovery, thus is extremely important to patch your boot image, where the recovery, kernel and other components now lives.
Click to expand...
Click to collapse
So, in other words, your method is this (correct me if I'm wrong):
Download TWRP zip file and copy it to your device (internal or external storage)
Download TWRP img file and and store it, on the folder where you have adb and fastboot files, on your PC
Open a cmd line and execute these commands (beeing on that folder, of course):
adb devices (to make sure your device is detected)
adb reboot bootloader (to reboot into fastboot mode)
fastboot erase boot
fastboot flash boot twrp-3.3.1-2-unofficial-laurel_sprout.img
fastboot reboot (NOTE : Before hitting "Enter", long press Vol + on your device until you see the Android One logo. By doing this your device will be forced to boot into Recovery and not into System)​
Flash stock boot.img that matches your current build using TWRP install Image feature, into boot partition
Install the TWRP zip (always install the latest build available)
Reboot to System
Is that it?
If it is, the only downside I see is that, when a new version comes out (through OTA for example), you'll first need to get your hands on a stock boot.img that matches the new build.
Right?
Cheers!
Typhus_ said:
So, in other words, your method is this (correct me if I'm wrong):
Download TWRP zip file and copy it to your device (internal or external storage)
Download TWRP img file and and store it, on the folder where you have adb and fastboot files, on your PC
Open a cmd line and execute these commands (beeing on that folder, of course):
adb devices (to make sure your device is detected)
adb reboot bootloader (to reboot into fastboot mode)
fastboot erase boot
fastboot flash boot twrp-3.3.1-2-unofficial-laurel_sprout.img
fastboot reboot (NOTE : Before hitting "Enter", long press Vol + on your device until you see the Android One logo. By doing this your device will be forced to boot into Recovery and not into System)
Flash stock boot.img that matches your current build using TWRP install Image feature, into boot partition
Install the TWRP zip (always install the latest build available)
Reboot to System
Is that it?
If it is, the only downside I see is that, when a new version comes out (through OTA for example), you'll first need to get your hands on a stock boot.img that matches the new build.
Right?
Cheers!
Click to expand...
Click to collapse
As someone who just wants to root his phone with TWRP and few magisk modules, and not miss out on OTAs, seeing these many methods is so confusing and overwhelming ?
After flashing recovery from pc..then go for fastboot reboot from minimal adb and " volume+ key" i saw error in my phone "no command"
Sapper Morton said:
Use the method Typhus explained, it's more simple in the long run; there will be no need to manually flash stock boot image afterwards, since Magisk will have done a proper backup, thus, you will only need to use 'restore image' feature inside Magisk Manager; When taking an OTA, make sure to read the complete Magisk documentation before proceeding:
https://topjohnwu.github.io/Magisk/tutorials.html
Click to expand...
Click to collapse
Thank you! I will do that. But one more thing I'd like to ask. Do you know where I could find the boot image for 10.3.8.0.PFQMIXM? I checked git for dumps, but I couldn't find the boot image for this one.
Sapper Morton said:
Sure, read the OP; Typhus has linked a couple of boot images, including 10.3.8.0 PFQMIXM.
https://forum.xda-developers.com/mi-a3/how-to/guide-how-to-root-mi-a3-magisk-t3958509
Click to expand...
Click to collapse
Sick! Thank you very much, sir!
What about flashing this on an already rooted phone with Magisk modules and the previously available TWRP by mauronofrio? Any complicated procedures? Is slot changing etc still necessary?
Makishima said:
What about flashing this on an already rooted phone with Magisk modules and the previously available TWRP by mauronofrio? Any complicated procedures? Is slot changing etc still necessary?
Click to expand...
Click to collapse
In that case, obviously, simply flash the new TWRP zip.
The install method I've explained is for everyone who never had TWRP, or Magisk patched boot, installed on the device.
Makishima said:
What about flashing this on an already rooted phone with Magisk modules and the previously available TWRP by mauronofrio? Any complicated procedures? Is slot changing etc still necessary?
Click to expand...
Click to collapse
Just flash the zip in twrp that you have.
That's what I did and it worked no problem on pe ROM
Typhus_ said:
In that case, obviously, simply flash the new TWRP zip.
The install method I've explained is for everyone who never had TWRP, or Magisk patched boot, installed on the device.
Click to expand...
Click to collapse
I did as you said but it says 'NOTE: You are now unrooted!'. Do I need to flash Magisk again?
Makishima said:
I did as you said but it says 'NOTE: You are now unrooted!'. Do I need to flash Magisk again?
Click to expand...
Click to collapse
Yes, that's right.

Root Pixel 3a on LineageOS with Magisk

Hello!
I want to root a degoogleifyed Pixel 3a on LineageOS 17.1 using Magisk, but I'm not sure to understand which boot.img use for this.
For an other phone, I found the boot.img in the last nightly build on lineageosroms.com. The sargo one don't seem to contain it.
I've already read some how to (like this one), but I would like to have confirmation that it apply to LineageOS. Could some confirm that I should:
1. download the boot.img directly from Google
2. patch it with Magisk
3. reboot into fastboot mode
4. flash the phone with command:
fastboot flash boot /path/to/magisk_patched.img
Sorry in advance if the answer seems obvious. My English is not very good and I start with these manipulations, so I'm a little afraid of miss something.
_yoxd said:
Hello!
I want to root a degoogleifyed Pixel 3a on LineageOS 17.1 using Magisk, but I'm not sure to understand which boot.img use for this.
For an other phone, I found the boot.img in the last nightly build on lineageosroms.com. The sargo one don't seem to contain it.
I've already read some how to (like this one), but I would like to have confirmation that it apply to LineageOS. Could some confirm that I should:
1. download the boot.img directly from Google
2. patch it with Magisk
3. reboot into fastboot mode
4. flash the phone with command:
fastboot flash boot /path/to/magisk_patched.img
Sorry in advance if the answer seems obvious. My English is not very good and I start with these manipulations, so I'm a little afraid of miss something.
Click to expand...
Click to collapse
The boot.img is in the firmware but must be extracted to get to it. Since it is different than stock, you should use it, if needed. I can get it for you later. This wasn't zipped, just renamed by afding .zip to the end so it would upload.
Thank you Tulsadiver! Your answer helped me to understand what to do.
In case it could help someone else, that's what I did:
1. download the last nightly build on https://download.lineageos.org/sargo
2. unzip it
3. dump the boot.img from the payload.bin using this guide (if you use Linux)
4. patch the boot.img with Magisk
5. reboot the phone into fastboot mode:
adb reboot fastboot
6. flash the phone with commands:
fastboot flash boot magisk_patched.img
fastboot flash boot_b magisk_patched.img
The phone is now rooted!
I installed Lineage and rooted it last night. I followed the instructions and patched the stock boot.img from Google. Boy was that mistake! My digitizer stopped working. I then patched the Lineage RECOVERY image from the Lineage website. Now my phone is rooted perfectly!
ackliph said:
I installed Lineage and rooted it last night. I followed the instructions and patched the stock boot.img from Google. Boy was that mistake! My digitizer stopped working. I then patched the Lineage RECOVERY image from the Lineage website. Now my phone is rooted perfectly!
Click to expand...
Click to collapse
Roger that. Download the Lineage recovery image that's dated same as the Lineage rom build you are using and patch it using magisk manager and flash to boot partition. sudo fastboot flash boot lineage-18.1-2021xxxx.recovery.img --slot all (enter) You should be good then. Both boot and recovery sort of reside in the same place (boot) as there is no longer a recovery partition on A/B partition devices and everything nowadays that's Android is A/B partition. Works for me on my Pixels.

(closed)Fastboot bootloop

Hi gyes, I have redmi k20, when I flash magisk patched recovery image then device stuck at fastboot, so I flash original recovery image for device , then it start in normal mode, so device can't rooted, so pls any one guide me to root device with magisk.
Thanks...
wakram001 said:
Hi gyes, I have redmi k20, when I flash magisk patched recovery image then device stuck at fastboot, so I flash original recovery image for device , then it start in normal mode, so device can't rooted, so pls any one guide me to root device with magisk.
Thanks...
Click to expand...
Click to collapse
You have to patch boot.img and flash the patched img to Boot
Btw, there were two guides in the Guides section about the same (stating exactly the same: extract boot ing, patch and flash).
Guides (in the Redmi K20/Mi 9T section) are old and maybe from the times of A9 MIUI 10 - but the same method still works for A11 / MIUI 12.x
Hence, you can have in parallel both Magisk (in Boot partition) and TWRP (in Recovery partition)
boot.img must be extracted from exactly the same firmware package (recovery/zip or fastboot/tgz) that you have installed to your phone.
Or you can patch boot.emmc.win TWRP backup file of your Boot partition (instead of exteacted boot.img file)
You can flash from Fastboot of from TWRP
If using TWRP, use the latest official twrp-3.5.2_9-0-davinci
My device has no ramdisk.
I have already tried with boot image but magisk patched boot image not flash, it show error.
Thanks for reply...
zgfg said:
You have to patch boot.img and flash the patched img to Boot
Btw, there were two guides in the Guides section about the same (stating exactly the same: extract boot ing, patch and flash).
Guides (in the Redmi K20/Mi 9T section) are old and maybe from the times of A9 MIUI 10 - but the same method still works for A11 / MIUI 12.x
Hence, you can have in parallel both Magisk (in Boot partition) and TWRP (in Recovery partition)
boot.img must be extracted from exactly the same firmware package (recovery/zip or fastboot/tgz) that you have installed to your phone.
Or you can patch boot.emmc.win TWRP backup file of your Boot partition (instead of exteacted boot.img file)
You can flash from Fastboot of from TWRP
If using TWRP, use the latest official twrp-3.5.2_9-0-davinci
Click to expand...
Click to collapse
My device has no ramdisk, A 10 miui 12.
I have already tried with boot image but magisk patched boot image not flash, it show error.
Thanks for reply...
wakram001 said:
My device has no ramdisk, A 10 miui 12.
I have already tried with boot image but magisk patched boot image not flash, it show error.
Thanks for reply...
Click to expand...
Click to collapse
Don't pay attention to what Magisk says (No Ramdisk).
Brw, there is some (albeit small prints) note about 'No Ramdisk' devices in the Magisk guide on the official Magisk Github - saying that on some (not sure does it mention Xoaomi) boot.img must be patched
I use this method since A9/MIUI 10 till now on A11/MIUI 12.6 and never had problems - see also my screenshot (Magisk installed, saying No Ramdisk but I installed Magisk by patching boot img)
Also, if it won't work, just flash the original boot.img
wakram001 said:
My device has no ramdisk, A 10 miui 12.
I have already tried with boot image but magisk patched boot image not flash, it show error.
Thanks for reply...
Click to expand...
Click to collapse
What error?
Command for Fastboot flashing must be:
fastboot flash boot <patched-boot-img>
Try again and post the error screenshot
When patching, you must not tick Recovery option (since you are not patching Recovery)
You can read also discussion about patching boot img
(where the same has been asked and answered many times) for Xiaomi phones in the General Magisk Support thread on XDA
Edit:
You can also only temporarily (one time) boot to the patched boot img by:
fastboot boot <patched boot img>
(Observe that flash command is omitted)
Then if ok, flash it permanently
Btw, always make sure that Fastboot is properly connected:
fastboot devices
Btw, another similar thread - Mi 9T Pro (doesn't matter), MIUI 12, disbelief about patching boot.img (and possible bootloop with the solution, in case of previously installed Magisk modules):
Does patched boot.img Magisk work on MIUI V12.5.1.0? (Edit: Yes it does!)
Just curious if anyone has any insight as to whether I can use the Magisk app to patch the newest boot.img (12.5.1.0 global / Android 11 / mi9t pro) and whether it will go smoothly if I install it via fastboot flash boot patchedmagiskhere.img? I...
forum.xda-developers.com
Magisk patched boot image is working properly. Now I have rooted device.
Thanks.

Categories

Resources