topjohnwu / Magisk

The Magic Mask for Android
GNU General Public License v3.0
49.02k stars 12.61k forks source link

Phone cant mount partitions after installing magisk (it can manually) #8518

Closed LiterallyUser closed 4 weeks ago

LiterallyUser commented 1 month ago

Hello! i am experiencing problem with installing magisk. Currently i am using CrDroid 10.1 gsi and every time i install it (replace boot.img) my phone hangs at 'Tecno' logo and doesnt boot. however, if i will run this:

mount /dev/block/mapper/userdata /data -t f2fs -f mount /dev/block/by-name/prodnv /mnt/vendor -t ext4 -f mount /dev/block/by-name/socko_a /mnt/vendor/socko sleep 2 insmod /mnt/vendor/socko/mali_kbase.ko insmod /mnt/vendor/socko/adaptive-ts.ko

The phone will boot up to os but wont have other modules like camera, figerprint and etc. Some logs on bootup: логи1.txt

Also if i will try to flash install.zip using twrp it will error out with "unsupported image" (probably fstab related)

(i tried multiple magisk versions INCLUDING the latest and dev one) Device: Android version: 14 Magisk version name: cant find Magisk version code: 28001

LiterallyUser commented 1 month ago

mounts.txt ^^^ cat /proc/mounts on a working phone

LiterallyUser commented 1 month ago

some more logcat magisk 28001 debug.txt mounts.txt proc mount on non booting.txt dmesg right when phone is available for adb.txt stuff

theintel commented 1 month ago

Does your phone have vbmeta partition? (Check stock ROM) If there is vbmeta.img, then you have to add the signature of the modified boot.img to the vbmeta and flash both.

LiterallyUser commented 1 month ago

then you have to add the signature of the modified boot.img

i think its not the case here since magisk works perfectly in stock os

theintel commented 1 month ago

I see. And Crdroid doesn’t have vbmeta either then?

LiterallyUser commented 1 month ago

looks like yeah since it is just a gsi. By the way i am manually signing boot image using vbmeta thing

LiterallyUser commented 1 month ago

(rsa4096_vbmeta.pem)

LiterallyUser commented 1 month ago

(this is the only way to make phone accept boot image and boot, this works perfectly fine on stock os)

LiterallyUser commented 1 month ago

also i should mention that it will be in this half-booted state after rooting it if i am using ANY gsi

theintel commented 1 month ago

For me, the stock rom had vbmeta. I had to manually sign the modified boot.img, then add that signature to vbmeta_modified.img. After flashing them both, it still didn’t boot. The stock rom was somewhat aggressive. The only way was:

Only then it booted without issues. If everything else fails, maybe try this (tiresome) method.

LiterallyUser commented 1 month ago

i will try to soon!

LiterallyUser commented 1 month ago

my stock image also has vbmeta but it is packed in .pac file and idk how to take it out

theintel commented 1 month ago

Pac file? Sounds familiar. Does your phone have spreadtrum (SPD) chipset?

LiterallyUser commented 1 month ago

mhm

LiterallyUser commented 1 month ago

Unisoc T606

theintel commented 1 month ago

Then you have to use SPD Research Tool to unpack that pac file.

LiterallyUser commented 1 month ago

Noted.

LiterallyUser commented 1 month ago

Gotta to do this now

LiterallyUser commented 1 month ago

BUT how to add signature to vbmeta?

theintel commented 1 month ago

Long process. But I think I can guide you through.

Pac file tutorial: https://www.hovatek.com/forum/thread-1231.html

LiterallyUser commented 1 month ago

i already know how to flash it since i did this multiple time :D

theintel commented 1 month ago

vdmeta_modified.img making tutorial: https://www.hovatek.com/forum/thread-32664.html

But first make sure that your rom has vbmeta.img (could be vbmeta_a.img). Check in SPD Upgrade Tool flashing page.

LiterallyUser commented 1 month ago

i am using this tool to sign boot tho-

theintel commented 1 month ago

Great. Go the extra mile and follow the tutorial thoroughly. You can ask here if you get stuck.

LiterallyUser commented 1 month ago

for some reason when i am trying to load image in research tool it says "error 3508"

theintel commented 1 month ago

BTW, many versions of SPD Upgrade Tool / Research Tool couldn’t flash my device successfully. I had to try them one by one until I found a working version.

So make sure that you can successfully flash the stock/custom rom before tweaking partitions. Things can go wrong very often.

LiterallyUser commented 1 month ago

for some reason only upgrade tool works for my rom

theintel commented 1 month ago

Keep trying these until you find a working one: https://spdflashtool.com/category/research-tool

For me, Research Tool version R23.19.3301 worked.

LiterallyUser commented 1 month ago

THIS ONE WORKED!

LiterallyUser commented 1 month ago

it seems like there are 5 vbmetas....

theintel commented 1 month ago

vbmeta-sign.img (partition name vbmeta_a) matters the most. Ignore others for now. Is there any vbmeta_b?

theintel commented 1 month ago

THIS ONE WORKED!

Can you imagine that they provide broken software releases! And we have to figure out which one works.

LiterallyUser commented 1 month ago

nope, only a

LiterallyUser commented 1 month ago

the a\b thingy is kinda broken on this device

theintel commented 1 month ago

nope, only a

OK cool. Keep going. You need to extract signatures one by one and save them. Long process. Needs hex editing. Take your time. Don't rush anything. One bit of wrongly copied hex data can ruin hours of work.

the a\b thingy is kinda broken on this device

That's Unisoc way of doing things maybe.

LiterallyUser commented 1 month ago

it looks like whole thing hanged and now everything expect browser for some reason is irresponsive

LiterallyUser commented 1 month ago

oh, i see why now, i have 0kb of storage left. Well, i will clean stuff out and will continue this thing, however its kind of late time for me rn

theintel commented 1 month ago

oh, i see why now, i have 0kb of storage left. Well, i will clean stuff out and will continue this thing, however its kind of late time for me rn

I'm tired too. TTYL.

mgnoon009 commented 1 month ago

LiterallyUser commented 4 weeks ago

Problem solved after installing android 12 gsi

LiterallyUser commented 4 weeks ago

So it looks like my phone just stops working correctly with modified boot on new gsis, android 12 lineage worked so problem solved

theintel commented 4 weeks ago

Great!