topjohnwu / Magisk

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

Teclast P80X(G5K8) [cpu: SC9863A] soft bricked after installing Magisk patched boot image #4969

Closed mocarela closed 2 years ago

mocarela commented 2 years ago

Device: Teclast P80X(G5K8) [cpu: SC9863A] Android version: 9 Magisk version name: 7e9d451 Magisk version code: 23014

P80X:/ $ cat /proc/mounts
/dev/root / ext4 ro,seclabel,relatime,block_validity,delalloc,barrier,user_xattr 0 0
devtmpfs /dev devtmpfs rw,seclabel,relatime,size=930056k,nr_inodes=232514,mode=755 0 0
tmpfs /dev tmpfs rw,seclabel,nosuid,relatime,mode=755 0 0
devpts /dev/pts devpts rw,seclabel,relatime,mode=600 0 0
proc /proc proc rw,relatime,gid=3009,hidepid=2 0 0
sysfs /sys sysfs rw,seclabel,relatime 0 0
selinuxfs /sys/fs/selinux selinuxfs rw,relatime 0 0
tmpfs /mnt tmpfs rw,seclabel,nosuid,nodev,noexec,relatime,mode=755,gid=1000 0 0
/dev/block/platform/soc/soc:ap-ahb/20600000.sdio/by-name/product /product ext4 ro,seclabel,relatime,block_validity,delalloc,barrier,user_xattr 0 0
/dev/block/platform/soc/soc:ap-ahb/20600000.sdio/by-name/vendor /vendor ext4 ro,seclabel,relatime,block_validity,delalloc,barrier,user_xattr 0 0
none /acct cgroup rw,nosuid,nodev,noexec,relatime,cpuacct 0 0
debugfs /sys/kernel/debug debugfs rw,seclabel,relatime 0 0
none /dev/stune cgroup rw,nosuid,nodev,noexec,relatime,schedtune 0 0
none /config configfs rw,nosuid,nodev,noexec,relatime 0 0
none /dev/cpuctl cgroup rw,nosuid,nodev,noexec,relatime,cpu 0 0
none /dev/cpuset cgroup rw,nosuid,nodev,noexec,relatime,cpuset,noprefix,release_agent=/sbin/cpuset_release_agent 0 0
pstore /sys/fs/pstore pstore rw,seclabel,nosuid,nodev,noexec,relatime 0 0
adb /dev/usb-ffs/adb functionfs rw,relatime 0 0
tracefs /sys/kernel/debug/tracing tracefs rw,seclabel,relatime 0 0
/dev/block/platform/soc/soc:ap-ahb/20600000.sdio/by-name/userdata /data f2fs rw,lazytime,seclabel,nosuid,nodev,noatime,background_gc=on,discard,no_heap,user_xattr,inline_xattr,inline_data,inline_dentry,flush_merge,extent_cache,mode=adaptive,active_logs=6,reserve_root=51200,resuid=0,resgid=0,alloc_mode=default,fsync_mode=posix 0 0
/dev/block/platform/soc/soc:ap-ahb/20600000.sdio/by-name/cache /cache ext4 rw,seclabel,nosuid,nodev,noatime,noauto_da_alloc,data=ordered 0 0
/dev/block/platform/soc/soc:ap-ahb/20600000.sdio/by-name/prodnv /mnt/vendor ext4 rw,seclabel,nosuid,nodev,noatime,block_validity,delalloc,barrier,noauto_da_alloc,user_xattr 0 0
tmpfs /storage tmpfs rw,seclabel,nosuid,nodev,noexec,relatime,mode=755,gid=1000 0 0
/data/media /mnt/runtime/default/emulated sdcardfs rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=1015,multiuser,mask=6,derive_gid,default_normal 0 0
/data/media /storage/emulated sdcardfs rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=1015,multiuser,mask=6,derive_gid,default_normal 0 0
/data/media /mnt/runtime/read/emulated sdcardfs rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=9997,multiuser,mask=23,derive_gid,default_normal 0 0
/data/media /mnt/runtime/write/emulated sdcardfs rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=9997,multiuser,mask=7,derive_gid,default_normal 0 0
P80X:/ $

The tablet hangs on boot logo after patched and signed boot image is flashed with fastboot (together with custom signed vbmeta). If Magisk's patching step is omitted (still re-signing the stock boot image) then everything works as expected. This makes me think the problem is in magisk.

Willing to provide any info needed to address the issue.

osm0sis commented 2 years ago

You need to provide logs from the failed boot, logs from the boot patching, and the untouched original ROM boot.img. Did any older Magisk version work?

mocarela commented 2 years ago

Did any older Magisk version work?

This is the first time I'm trying to root this tablet. There are several models (G5Kn, n=1...8) and from the reports on the net for n=1..4 it works, and for n=6,8 it definitely doesn't. On the device itself I only tried with the latest canary. On other devices (if it is valid at all to do that!?) I have tried it with most if not all stable releases down to 20.4. None of them worked. But again... are the results independent on the device where the procedure is run? I have also tried (with versions containing x86 executables) to patch it on Linux PC... the same result. Sometimes it hangs on boot logo, sometimes it bootloops and nothing can be done to bring it back to life except to flash the stock rom.

You need to provide logs from the failed boot

This would be kind of a problem, because I have no idea how to grab them. :-( Any hint?

, logs from the boot patching, and the untouched original ROM boot.img.

Give me a couple of days to get to the tablet, please.

, and the untouched original ROM boot.img.

Here it is zipped... boot.zip

I appreciate your willingness to deal with the issue.

osm0sis commented 2 years ago

Hardest devices to support are ones without ramdisks...


Android Image Kitchen - UnpackImg Script
by osm0sis @ xda-developers

Supplied image: boot.img

Setting up work folders...

Image type: AOSP

Signature with "AVBv2" type detected.

Splitting image to "split_img/"...
ANDROID! magic found at: 0
BOARD_KERNEL_CMDLINE console=ttyS1,115200n8 buildvariant=user
BOARD_KERNEL_BASE 0x00000000
BOARD_NAME 
BOARD_PAGE_SIZE 2048
BOARD_HASH_TYPE sha1
BOARD_KERNEL_OFFSET 0x00008000
BOARD_RAMDISK_OFFSET 0x05400000
BOARD_SECOND_OFFSET 0x00f00000
BOARD_TAGS_OFFSET 0x00000100
BOARD_OS_VERSION 9.0.0
BOARD_OS_PATCH_LEVEL 2019-05
BOARD_HEADER_VERSION 1
BOARD_HEADER_SIZE 1648

Warning: No ramdisk found to be unpacked!

Done!
mocarela commented 2 years ago

Hardest devices to support are ones without ramdisks...

Actually I spotted this but didn't pay attention. As I read on the "Installation" page there is still a chance for me with recovery mode. Is it worthy to try? If yes, does this mean I have to patch the boot image with recovery option and flash it to recovery partition? And if you don't mind... is it OK to do it on a linux box with x86 binaries or I have to do it directly on a device where the image is supposed to be flashed?

osm0sis commented 2 years ago

No you patch the recovery partition (i.e. a recovery.img dump) itself. Worth a try. Better on device using the app.

mocarela commented 2 years ago

No you patch the recovery partition (i.e. a recovery.img dump) itself. Worth a try. Better on device using the app.

This was the key to the solution. Everything is fine now after going the recovery way. Thanks a lot!!!!!!!!!