topjohnwu / Magisk

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

Bootloop after installing the patched boot image on Android 11 on Sony Xperia 5 II (needed system_ext removed from fstab) #3752

Closed nezorflame closed 2 years ago

nezorflame commented 3 years ago

ISSUE DESCRIPTION

After trying to install Magisk with the patched magisk_boot.img from the latest Canary (and Beta) version of the Manager, the device is unable to boot and goes into the bootloop.

The reboot occurs right after the SONY logo shows up, hence ADB is not able to connect to the device (previously enabled on the working unrooted system). So logcat and dmesg seem unable to be acquired.

fastboot boot also fails to execute (was trying to do what was suggested in https://github.com/topjohnwu/Magisk/issues/3292#issuecomment-707997803, but it seems that it doesn't work with the unmodified version of the boot image as well):

❯ fastboot boot .\magisk_patched_boot_X-FLASH-ALL-2389.img

Sending 'boot.img' (98304 KB)                      OKAY [  2.397s]
Booting                                            FAILED (remote: 'unknown command')
fastboot: error: Command failed

DEVICE DESCRIPTION

Model: Sony Xperia 5 II (XQ-AS52) Android version: 11 System build version: 58.1.A.1.178 Security patch version: December 2020 Google Play update version: January 2021

Boot image from the system: boot_X-FLASH-ALL-2389.img (GDrive)

/proc/mounts output ``` /dev/block/dm-5 / ext4 ro,seclabel,relatime,discard 0 0 tmpfs /dev tmpfs rw,seclabel,nosuid,relatime,size=3927372k,nr_inodes=981843,mode=755 0 0 devpts /dev/pts devpts rw,seclabel,relatime,mode=600,ptmxmode=000 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,size=3927372k,nr_inodes=981843,mode=755,gid=1000 0 0 tmpfs /mnt/installer tmpfs rw,seclabel,nosuid,nodev,noexec,relatime,size=3927372k,nr_inodes=981843,mode=755,gid=1000 0 0 tmpfs /mnt/androidwritable tmpfs rw,seclabel,nosuid,nodev,noexec,relatime,size=3927372k,nr_inodes=981843,mode=755,gid=1000 0 0 /dev/block/by-name/metadata /metadata ext4 rw,seclabel,nosuid,nodev,noatime,discard 0 0 /dev/block/dm-6 /product ext4 ro,seclabel,relatime,discard 0 0 /dev/block/dm-7 /vendor ext4 ro,seclabel,relatime,discard 0 0 /dev/block/dm-8 /odm ext4 ro,seclabel,relatime,discard 0 0 tmpfs /apex tmpfs rw,seclabel,nosuid,nodev,noexec,relatime,size=3927372k,nr_inodes=981843,mode=755 0 0 tmpfs /linkerconfig tmpfs rw,seclabel,nosuid,nodev,noexec,relatime,size=3927372k,nr_inodes=981843,mode=755 0 0 none /dev/blkio cgroup rw,nosuid,nodev,noexec,relatime,blkio 0 0 none /dev/cg2_bpf cgroup2 rw,nosuid,nodev,noexec,relatime 0 0 none /dev/cpuctl cgroup rw,nosuid,nodev,noexec,relatime,cpu 0 0 none /acct cgroup rw,nosuid,nodev,noexec,relatime,cpuacct 0 0 none /dev/cpuset cgroup rw,nosuid,nodev,noexec,relatime,cpuset,noprefix,release_agent=/sbin/cpuset_release_agent 0 0 none /dev/freezer cgroup rw,nosuid,nodev,noexec,relatime,freezer 0 0 none /dev/memcg cgroup rw,nosuid,nodev,noexec,relatime,memory 0 0 none /dev/stune cgroup rw,nosuid,nodev,noexec,relatime,schedtune 0 0 tracefs /sys/kernel/tracing tracefs rw,seclabel,relatime 0 0 none /config configfs rw,nosuid,nodev,noexec,relatime 0 0 binder /dev/binderfs binder rw,relatime,max=1048576,stats=global 0 0 none /sys/fs/fuse/connections fusectl rw,relatime 0 0 bpf /sys/fs/bpf bpf rw,nosuid,nodev,noexec,relatime 0 0 pstore /sys/fs/pstore pstore rw,seclabel,nosuid,nodev,noexec,relatime 0 0 /dev/block/bootdevice/by-name/persist /mnt/vendor/persist ext4 rw,seclabel,nosuid,nodev,noatime,discard 0 0 /dev/block/bootdevice/by-name/spunvm /mnt/vendor/spunvm vfat rw,context=u:object_r:vendor_spunvm_file:s0,noatime,uid=1000,gid=1000,fmask=0007,dmask=0007,allow_utime=0020,codepage=437,iocharset=iso8859-1,shortname=lower,errors=remount-ro 0 0 /dev/block/bootdevice/by-name/modem_a /vendor/firmware_mnt vfat ro,context=u:object_r:firmware_file:s0,relatime,uid=1000,gid=1000,fmask=0337,dmask=0227,codepage=437,iocharset=iso8859-1,shortname=lower,errors=remount-ro 0 0 /dev/block/bootdevice/by-name/dsp_a /vendor/dsp ext4 ro,seclabel,nosuid,nodev,relatime 0 0 /dev/block/bootdevice/by-name/bluetooth_a /vendor/bt_firmware vfat ro,context=u:object_r:bt_firmware_file:s0,relatime,uid=1002,gid=3002,fmask=0337,dmask=0227,codepage=437,iocharset=iso8859-1,shortname=lower,errors=remount-ro 0 0 /dev/block/dm-9 /oem ext4 ro,seclabel,relatime 0 0 /dev/block/bootdevice/by-name/appslog /mnt/rca ext4 rw,seclabel,nosuid,nodev,noexec,noatime,discard 0 0 /dev/block/bootdevice/by-name/diag /mnt/idd ext4 rw,seclabel,nosuid,nodev,noexec,noatime,discard 0 0 /dev/block/bootdevice/by-name/userdata /data f2fs rw,lazytime,seclabel,nosuid,nodev,noatime,background_gc=on,discard,no_heap,user_xattr,inline_xattr,acl,inline_data,inline_dentry,flush_merge,extent_cache,mode=adaptive,active_logs=6,reserve_root=32768,resuid=0,resgid=1065,inlinecrypt,alloc_mode=default,fsync_mode=nobarrier 0 0 tmpfs /linkerconfig tmpfs rw,seclabel,nosuid,nodev,noexec,relatime,size=3927372k,nr_inodes=981843,mode=755 0 0 /dev/block/bootdevice/by-name/userdata /data/user/0 f2fs rw,lazytime,seclabel,nosuid,nodev,noatime,background_gc=on,discard,no_heap,user_xattr,inline_xattr,acl,inline_data,inline_dentry,flush_merge,extent_cache,mode=adaptive,active_logs=6,reserve_root=32768,resuid=0,resgid=1065,inlinecrypt,alloc_mode=default,fsync_mode=nobarrier 0 0 tmpfs /data_mirror tmpfs rw,seclabel,nosuid,nodev,noexec,relatime,size=3927372k,nr_inodes=981843,mode=700,gid=1000 0 0 /dev/block/bootdevice/by-name/userdata /data_mirror/data_ce/null f2fs rw,lazytime,seclabel,nosuid,nodev,noatime,background_gc=on,discard,no_heap,user_xattr,inline_xattr,acl,inline_data,inline_dentry,flush_merge,extent_cache,mode=adaptive,active_logs=6,reserve_root=32768,resuid=0,resgid=1065,inlinecrypt,alloc_mode=default,fsync_mode=nobarrier 0 0 /dev/block/bootdevice/by-name/userdata /data_mirror/data_ce/null/0 f2fs rw,lazytime,seclabel,nosuid,nodev,noatime,background_gc=on,discard,no_heap,user_xattr,inline_xattr,acl,inline_data,inline_dentry,flush_merge,extent_cache,mode=adaptive,active_logs=6,reserve_root=32768,resuid=0,resgid=1065,inlinecrypt,alloc_mode=default,fsync_mode=nobarrier 0 0 /dev/block/bootdevice/by-name/userdata /data_mirror/data_de/null f2fs rw,lazytime,seclabel,nosuid,nodev,noatime,background_gc=on,discard,no_heap,user_xattr,inline_xattr,acl,inline_data,inline_dentry,flush_merge,extent_cache,mode=adaptive,active_logs=6,reserve_root=32768,resuid=0,resgid=1065,inlinecrypt,alloc_mode=default,fsync_mode=nobarrier 0 0 /dev/block/bootdevice/by-name/userdata /data_mirror/cur_profiles f2fs rw,lazytime,seclabel,nosuid,nodev,noatime,background_gc=on,discard,no_heap,user_xattr,inline_xattr,acl,inline_data,inline_dentry,flush_merge,extent_cache,mode=adaptive,active_logs=6,reserve_root=32768,resuid=0,resgid=1065,inlinecrypt,alloc_mode=default,fsync_mode=nobarrier 0 0 /dev/block/dm-10 /apex/com.android.neuralnetworks@300901600 ext4 ro,dirsync,seclabel,nodev,noatime 0 0 /dev/block/dm-10 /apex/com.android.neuralnetworks ext4 ro,dirsync,seclabel,nodev,noatime 0 0 /dev/block/dm-11 /apex/com.android.conscrypt@301300300 ext4 ro,dirsync,seclabel,nodev,noatime 0 0 /dev/block/dm-11 /apex/com.android.conscrypt ext4 ro,dirsync,seclabel,nodev,noatime 0 0 /dev/block/dm-12 /apex/com.android.ipsec@301500700 ext4 ro,dirsync,seclabel,nodev,noatime 0 0 /dev/block/dm-12 /apex/com.android.ipsec ext4 ro,dirsync,seclabel,nodev,noatime 0 0 /dev/block/dm-13 /apex/com.android.wifi@301500700 ext4 ro,dirsync,seclabel,nodev,noatime 0 0 /dev/block/dm-13 /apex/com.android.wifi ext4 ro,dirsync,seclabel,nodev,noatime 0 0 /dev/block/dm-14 /apex/com.android.resolv@301500700 ext4 ro,dirsync,seclabel,nodev,noatime 0 0 /dev/block/dm-14 /apex/com.android.resolv ext4 ro,dirsync,seclabel,nodev,noatime 0 0 /dev/block/dm-15 /apex/com.android.extservices@301500700 ext4 ro,dirsync,seclabel,nodev,noatime 0 0 /dev/block/dm-15 /apex/com.android.extservices ext4 ro,dirsync,seclabel,nodev,noatime 0 0 /dev/block/dm-16 /apex/com.android.tzdata@301500700 ext4 ro,dirsync,seclabel,nodev,noatime 0 0 /dev/block/dm-16 /apex/com.android.tzdata ext4 ro,dirsync,seclabel,nodev,noatime 0 0 /dev/block/dm-17 /apex/com.android.media@301500800 ext4 ro,dirsync,seclabel,nodev,noatime 0 0 /dev/block/dm-17 /apex/com.android.media ext4 ro,dirsync,seclabel,nodev,noatime 0 0 /dev/block/dm-18 /apex/com.android.mediaprovider@301501400 ext4 ro,dirsync,seclabel,nodev,noatime 0 0 /dev/block/dm-18 /apex/com.android.mediaprovider ext4 ro,dirsync,seclabel,nodev,noatime 0 0 /dev/block/dm-19 /apex/com.android.tethering@301400200 ext4 ro,dirsync,seclabel,nodev,noatime 0 0 /dev/block/dm-19 /apex/com.android.tethering ext4 ro,dirsync,seclabel,nodev,noatime 0 0 /dev/block/dm-20 /apex/com.android.cellbroadcast@301501400 ext4 ro,dirsync,seclabel,nodev,noatime 0 0 /dev/block/dm-20 /apex/com.android.cellbroadcast ext4 ro,dirsync,seclabel,nodev,noatime 0 0 /dev/block/dm-21 /apex/com.android.sdkext@300901600 ext4 ro,dirsync,seclabel,nodev,noatime 0 0 /dev/block/dm-21 /apex/com.android.sdkext ext4 ro,dirsync,seclabel,nodev,noatime 0 0 /dev/block/dm-22 /apex/com.android.media.swcodec@301500900 ext4 ro,dirsync,seclabel,nodev,noatime 0 0 /dev/block/dm-22 /apex/com.android.media.swcodec ext4 ro,dirsync,seclabel,nodev,noatime 0 0 /dev/block/dm-23 /apex/com.android.permission@301501400 ext4 ro,dirsync,seclabel,nodev,noatime 0 0 /dev/block/dm-23 /apex/com.android.permission ext4 ro,dirsync,seclabel,nodev,noatime 0 0 /dev/block/dm-24 /apex/com.android.adbd@301400200 ext4 ro,dirsync,seclabel,nodev,noatime 0 0 /dev/block/dm-24 /apex/com.android.adbd ext4 ro,dirsync,seclabel,nodev,noatime 0 0 /dev/block/dm-25 /apex/com.android.os.statsd@301400200 ext4 ro,dirsync,seclabel,nodev,noatime 0 0 /dev/block/dm-25 /apex/com.android.os.statsd ext4 ro,dirsync,seclabel,nodev,noatime 0 0 /dev/block/loop22 /apex/com.android.vndk.v30@1 ext4 ro,dirsync,seclabel,nodev,noatime 0 0 /dev/block/loop22 /apex/com.android.vndk.v30 ext4 ro,dirsync,seclabel,nodev,noatime 0 0 /dev/block/loop23 /apex/com.android.art@1 ext4 ro,dirsync,seclabel,nodev,noatime 0 0 /dev/block/loop23 /apex/com.android.art ext4 ro,dirsync,seclabel,nodev,noatime 0 0 /dev/block/loop24 /apex/com.android.runtime@1 ext4 ro,dirsync,seclabel,nodev,noatime 0 0 /dev/block/loop24 /apex/com.android.runtime ext4 ro,dirsync,seclabel,nodev,noatime 0 0 /dev/block/loop25 /apex/com.android.i18n@1 ext4 ro,dirsync,seclabel,nodev,noatime 0 0 /dev/block/loop25 /apex/com.android.i18n ext4 ro,dirsync,seclabel,nodev,noatime 0 0 /dev/block/loop26 /apex/com.android.apex.cts.shim@1 ext4 ro,dirsync,seclabel,nodev,noatime 0 0 /dev/block/loop26 /apex/com.android.apex.cts.shim ext4 ro,dirsync,seclabel,nodev,noatime 0 0 /dev/block/bootdevice/by-name/LTALabel /mnt/lta-label ext4 rw,seclabel,nosuid,nodev,noexec,noatime,nobarrier 0 0 tmpfs /storage tmpfs rw,seclabel,nosuid,nodev,noexec,relatime,size=3927372k,nr_inodes=981843,mode=755,gid=1000 0 0 adb /dev/usb-ffs/adb functionfs rw,relatime 0 0 diag /dev/ffs-diag functionfs rw,relatime 0 0 diag_mdm /dev/ffs-diag-1 functionfs rw,relatime 0 0 diag_mdm2 /dev/ffs-diag-2 functionfs rw,relatime 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,unshared_obb 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,unshared_obb 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,unshared_obb 0 0 /data/media /mnt/runtime/full/emulated sdcardfs rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=9997,multiuser,mask=7,derive_gid,default_normal,unshared_obb 0 0 /dev/fuse /storage/emulated fuse rw,lazytime,nosuid,nodev,noexec,noatime,user_id=0,group_id=0,allow_other 0 0 /dev/fuse /mnt/installer/0/emulated fuse rw,lazytime,nosuid,nodev,noexec,noatime,user_id=0,group_id=0,allow_other 0 0 /dev/fuse /mnt/androidwritable/0/emulated fuse rw,lazytime,nosuid,nodev,noexec,noatime,user_id=0,group_id=0,allow_other 0 0 /dev/fuse /mnt/user/0/emulated fuse rw,lazytime,nosuid,nodev,noexec,noatime,user_id=0,group_id=0,allow_other 0 0 /data/media /mnt/pass_through/0/emulated sdcardfs rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=9997,multiuser,mask=7,derive_gid,default_normal,unshared_obb 0 0 /data/media /mnt/androidwritable/0/emulated/0/Android/data sdcardfs rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=1015,multiuser,mask=6,derive_gid,default_normal,unshared_obb 0 0 /data/media /mnt/installer/0/emulated/0/Android/data sdcardfs rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=1015,multiuser,mask=6,derive_gid,default_normal,unshared_obb 0 0 /data/media /storage/emulated/0/Android/data sdcardfs rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=1015,multiuser,mask=6,derive_gid,default_normal,unshared_obb 0 0 /data/media /mnt/user/0/emulated/0/Android/data sdcardfs rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=1015,multiuser,mask=6,derive_gid,default_normal,unshared_obb 0 0 /data/media /mnt/androidwritable/0/emulated/0/Android/obb sdcardfs rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=1015,multiuser,mask=6,derive_gid,default_normal,unshared_obb 0 0 /data/media /storage/emulated/0/Android/obb sdcardfs rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=1015,multiuser,mask=6,derive_gid,default_normal,unshared_obb 0 0 /data/media /mnt/user/0/emulated/0/Android/obb sdcardfs rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=1015,multiuser,mask=6,derive_gid,default_normal,unshared_obb 0 0 /data/media /mnt/installer/0/emulated/0/Android/obb sdcardfs rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=9997,multiuser,mask=7,derive_gid,default_normal,unshared_obb 0 0 /dev/block/vold/public:179,1 /mnt/media_rw/3931-3334 texfat rw,dirsync,nosuid,nodev,noexec,noatime,uid=1023,gid=1023,umask=0007,allow_utime=0020,codepage=437,iocharset=utf8,min_prealloc_size=64k,max_prealloc_size=375560k,writeback_boundary=4M,readahead=4M,fail_safe,inode64,hidden=show,errors=continue 0 0 /mnt/media_rw/3931-3334 /mnt/runtime/default/3931-3334 sdcardfs rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=1015,mask=6,nocache 0 0 /mnt/media_rw/3931-3334 /mnt/runtime/read/3931-3334 sdcardfs rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=9997,mask=18,nocache 0 0 /mnt/media_rw/3931-3334 /mnt/runtime/write/3931-3334 sdcardfs rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=9997,mask=18,nocache 0 0 /mnt/media_rw/3931-3334 /mnt/runtime/full/3931-3334 sdcardfs rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=9997,mask=7,nocache 0 0 /dev/fuse /storage/3931-3334 fuse rw,lazytime,nosuid,nodev,noexec,noatime,user_id=0,group_id=0,allow_other 0 0 /dev/fuse /mnt/installer/0/3931-3334 fuse rw,lazytime,nosuid,nodev,noexec,noatime,user_id=0,group_id=0,allow_other 0 0 /dev/fuse /mnt/androidwritable/0/3931-3334 fuse rw,lazytime,nosuid,nodev,noexec,noatime,user_id=0,group_id=0,allow_other 0 0 /dev/fuse /mnt/user/0/3931-3334 fuse rw,lazytime,nosuid,nodev,noexec,noatime,user_id=0,group_id=0,allow_other 0 0 /mnt/media_rw/3931-3334 /mnt/pass_through/0/3931-3334 sdcardfs rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=9997,mask=7,nocache 0 0 ```

MAGISK SETUP DESCRIPTION

Manager version: latest Canary (https://github.com/topjohnwu/magisk_files/commit/f595d0624b70289ed273f933a33075fee986b533) Installation method: patching boot image

nezorflame commented 3 years ago

It seems like Xperia 1 II users have the same issue: https://forum.xda-developers.com/t/android-11-is-here.4203093/page-2

Lishoo commented 3 years ago

Hi, try to install this zip in the modules -> install from memory and see if the problem is fixed. modMagisk-v21.4.zip

nezorflame commented 3 years ago

@Lishoo that's impossible since Magisk is not installed. Trying to install it is what causes this issue.

nezorflame commented 3 years ago

Got more info: found a working version of Lineage recovery and used that to sideload older versions of Magisk. Device booted only when I used v20.4, any newer version refuses to boot past the SONY logo.

While allowing me to boot, it seems that the actual install did nothing as Magisk is not detected as installed, like as if I flashed uninstaller instead of the Magisk zip. Tried using older commit for stable.json to use as a custom channel to patch the image from thr Manager - no luck either. If any logs are required, I'll be happy to help.

Jayram2000 commented 3 years ago

Having a similar issue on my XQ-AS72 (the dual sim model) of the Xperia 5 II (PDX 206).

Using the same firmware version, I cannot get a patched boot.img to boot, it simply hard boot loops the phone.

Alternatively, I tried using adb sideload to sideload the magisk installer zip file and it seems to work. When I try to boot my device, it gets to the boot animation, but hangs there indefinitely.

This is all trying to use Magisk v21.4, on the latest Xperia Firmware version, 51.1.A.1.178 (Android 11).

Miustone commented 3 years ago

Well, it would help if you would tell us what you have done exactly...

How did You flash the patched Magisk Kernel? Only fastboot flash boot boot.img? Or specifically did boot_a and boot_b? Which size do your images have? Same as the OG boot image one? Tried to change the boot slot after flashing?

Recoveries aside from TWRP may also have a hard time flashing Magisk after what I've read. So a patched image over fastboot should be the way to go anyways...

(Reference: Pixel Devices/Experience)

nezorflame commented 3 years ago
  1. As always with A/B devices, by
fastboot flash boot_a magisk_boot.img
fastboot flash boot_b magisk_boot.img
  1. Sizes are identical:
  1. I flashed it with bootloader, as the command states, like I always do.

I did not use fastbootd for this, just the actual bootloader.

thematrixdev commented 3 years ago

I have met the same issue. I am here to wait for the solution.

Yoannjap commented 3 years ago

I have met the same issue. I am here to wait for the solution.

The same!

hellobbn commented 3 years ago

I am having the same issue on Xperia 1 ii and I managed to get some dmesg from pstore (see attachments). It seems that the init process cannot find and mount the system_ext partition. The fstab for Xperia 1 II (Android 11) from stock boot.img is also attached. Magisk_R_Dumps.zip

Edit: This seems to be sony's fault, I deleted the system_ext entry in the fstab in boot.img and it boots fine (with Magisk)

Yoannjap commented 3 years ago

Edit: This seems to be sony's fault, I deleted the system_ext entry in the fstab in boot.img and it boots fine (with Magisk)

And there's no risk to delete system_ext in fstab?

hellobbn commented 3 years ago

Edit: This seems to be sony's fault, I deleted the system_ext entry in the fstab in boot.img and it boots fine (with Magisk)

And there's no risk to delete system_ext in fstab?

Yes, system_ext does not seem to be a partition, nor a dynamic partition.

Yoannjap commented 3 years ago

Edit: This seems to be sony's fault, I deleted the system_ext entry in the fstab in boot.img and it boots fine (with Magisk)

And there's no risk to delete system_ext in fstab?

Yes, system_ext does not seem to be a partition, nor a dynamic partition.

Ok then, tout make my day beauiful. Thanks a lot.

Could you juste for me and people who don't know how to do :

EDIT: For those who'd like to test, a man on XDA published a working Android 11 stock kernel into which MagiSK is censed to be included. But I haven't tested it yet.

nezorflame commented 3 years ago

@hellobbn thanks for the research! Any chance we could pass this through to the Xperia 1/5/10 II maintainers?

tobise commented 3 years ago

@hellobbn sorry for bothering, did you mean delete this line image in fstab.qcom after patching with magisk?

hellobbn commented 3 years ago

@hellobbn sorry for bothering, did you mean delete this line image in fstab.qcom after patching with magisk?

Yes.

notes: IMHO, the magisk patches the boot.img and replaces the stock init program with its own init. While the original init can boot the system fine, the magisk version can't. Both patched and stock fstab have this entry.

tobise commented 3 years ago

Apparently system_ext does not exist in fstab before android 11,why sony adds this in their 11 firmware is a mystery.

tobise commented 3 years ago

@hellobbn sorry for bothering, did you mean delete this line image in fstab.qcom after patching with magisk?

Yes.

notes: IMHO, the magisk patches the boot.img and replaces the stock init program with its own init. While the original init can boot the system fine, the magisk version can't. Both patched and stock fstab have this entry.

thanks, was trying to make it work on x1ii

hellobbn commented 3 years ago

Apparently system_ext does not exist in fstab before android 11,why sony adds this in their 11 firmware is a mystery.

system_ext is introduced in android 11 I think. 🤔

ref: https://source.android.com/devices/bootloader/partitions#designating-critical-partitions

thematrixdev commented 3 years ago

@hellobbn sorry for bothering, did you mean delete this line image in fstab.qcom after patching with magisk?

Yes. notes: IMHO, the magisk patches the boot.img and replaces the stock init program with its own init. While the original init can boot the system fine, the magisk version can't. Both patched and stock fstab have this entry.

thanks, was trying to make it work on x1ii

I have unpacked the image and modified the file. May I know how to pack everything back to an img file?

hellobbn commented 3 years ago

@hellobbn sorry for bothering, did you mean delete this line image in fstab.qcom after patching with magisk?

Yes. notes: IMHO, the magisk patches the boot.img and replaces the stock init program with its own init. While the original init can boot the system fine, the magisk version can't. Both patched and stock fstab have this entry.

thanks, was trying to make it work on x1ii

I have unpacked the image and modified the file. May I know how to pack everything back to an img file?

You can try android image kitchen

tobise commented 3 years ago

oh, briliant. by the way, I use image you can try finding this on XDA created by osm0sis.

thematrixdev commented 3 years ago

@hellobbn sorry for bothering, did you mean delete this line image in fstab.qcom after patching with magisk?

Yes. notes: IMHO, the magisk patches the boot.img and replaces the stock init program with its own init. While the original init can boot the system fine, the magisk version can't. Both patched and stock fstab have this entry.

thanks, was trying to make it work on x1ii

I have unpacked the image and modified the file. May I know how to pack everything back to an img file?

You can try android image kitchen

omg... this tool is super handy! thank you!

[ EDIT ] I see "Warning: Using cpio 2.13 may result in an unusable repack; downgrade to 2.12 to be safe!" How to install cpio=2.12? It has been in 2.13 for a long long time.

hellobbn commented 3 years ago

@hellobbn sorry for bothering, did you mean delete this line image in fstab.qcom after patching with magisk?

Yes. notes: IMHO, the magisk patches the boot.img and replaces the stock init program with its own init. While the original init can boot the system fine, the magisk version can't. Both patched and stock fstab have this entry.

thanks, was trying to make it work on x1ii

I have unpacked the image and modified the file. May I know how to pack everything back to an img file?

You can try android image kitchen

omg... this tool is super handy! thank you!

[ EDIT ] I see "Warning: Using cpio 2.13 may result in an unusable repack; downgrade to 2.12 to be safe!" How to install cpio=2.12? It has been in 2.13 for a long long time.

I am using cpio 2.13 and it works fine.

thematrixdev commented 3 years ago

Should I modify the fstab.qcom inside ramdisk folder or split_img/boot.img-ramdisk.cpio.gz ?

hellobbn commented 3 years ago

Should I modify the fstab.qcom inside ramdisk folder or split_img/boot.img-ramdisk.cpio.gz ?

ramdisk folder

thematrixdev commented 3 years ago

I have tried modifying the img but my Xperia5II cannot boot with it.

  1. unsin boot_X-FLASH-ALL-2389.sin and got boot_X-FLASH-ALL-2389.img
  2. unpackimg.sh
  3. modify ramdisk/fstab.qcom
  4. repackimg
  5. adb push, Magisk patches, adb pull, fastboot flash boot_a and fastboot flash boot_b

My phone shows red LED and reboots. bootloop.

hellobbn commented 3 years ago

I have tried modifying the img but my Xperia5II cannot boot with it.

  1. unsin boot_X-FLASH-ALL-2389.sin and got boot_X-FLASH-ALL-2389.img
  2. unpackimg.sh
  3. modify ramdisk/fstab.qcom
  4. repackimg
  5. adb push, Magisk patches, adb pull, fastboot flash boot_a and fastboot flash boot_b

My phone shows red LED and reboots. bootloop.

Interesting, can you try modifying the magisk patched boot.img instead of the stock boot.img?

If that does not work, can you post the pstore log which may contain useful kernel panic logs? Here is the steps:

  1. Flash the Orange Fox recovery for Xperia 5 ii in xda
  2. Boot the system once (it will boot loop as you said)
  3. Boot to recovery, adb pull the files in /sys/fs/pstore and post it here

And there is a boot.img which is already modified in xda, you can compare that with yours and see what's different.

thematrixdev commented 3 years ago

Just tried Magisk patching official boot.img, modify fstab, repack and flash. Same problem.

I can still see [ 1.170283] init: Failed to mount /system_ext: No such device or address in the log... Strange...

I have copied the official boot.img to same level of unpackimg.sh. After running repackimg.sh, the repacked image will replace the original boot.img, right?

hellobbn commented 3 years ago

Just tried Magisk patching official boot.img, modify fstab, repack and flash. Same problem.

I can still see [ 1.170283] init: Failed to mount /system_ext: No such device or address in the log... Strange...

I have copied the official boot.img to same level of unpackimg.sh. After running repackimg.sh, the repacked image will replace the original boot.img, right?

..No, a new image will be created 😂

thematrixdev commented 3 years ago

Just tried Magisk patching official boot.img, modify fstab, repack and flash. Same problem. I can still see [ 1.170283] init: Failed to mount /system_ext: No such device or address in the log... Strange... I have copied the official boot.img to same level of unpackimg.sh. After running repackimg.sh, the repacked image will replace the original boot.img, right?

..No, a new image will be created

Oh f... I see image-new.img now... I am dumb...

By the way, how to type an emoji in this textbox? I don't see I can insert any.

hellobbn commented 3 years ago

Just tried Magisk patching official boot.img, modify fstab, repack and flash. Same problem. I can still see [ 1.170283] init: Failed to mount /system_ext: No such device or address in the log... Strange... I have copied the official boot.img to same level of unpackimg.sh. After running repackimg.sh, the repacked image will replace the original boot.img, right?

..No, a new image will be created

Oh f... I see image-new.img now... I am dumb...

By the way, how to type an emoji in this textbox? I don't see I can insert any.

I am using GBoard which can type emoji.

thematrixdev commented 3 years ago

Got the SafetyNet pass again! Love you guys!

VWK8 commented 3 years ago

Just tried Magisk patching official boot.img, modify fstab, repack and flash. Same problem. I can still see [ 1.170283] init: Failed to mount /system_ext: No such device or address in the log... Strange... I have copied the official boot.img to same level of unpackimg.sh. After running repackimg.sh, the repacked image will replace the original boot.img, right?

..No, a new image will be created

Oh f... I see image-new.img now... I am dumb...

By the way, how to type an emoji in this textbox? I don't see I can insert any.

how could you make a working boot.img? I downloaded the AIK for Windows (https://forum.xda-developers.com/t/tool-android-image-kitchen-unpack-repack-kernel-ramdisk-win-android-linux-mac.2073775/), put the stock boot.img and just did unpacking and repacking. With this simple unchanged boot.img, my device does not boot at all (writes that the software is damaged and after 5 seconds there will be a shutdown).

thematrixdev commented 3 years ago

Just tried Magisk patching official boot.img, modify fstab, repack and flash. Same problem. I can still see [ 1.170283] init: Failed to mount /system_ext: No such device or address in the log... Strange... I have copied the official boot.img to same level of unpackimg.sh. After running repackimg.sh, the repacked image will replace the original boot.img, right?

..No, a new image will be created

Oh f... I see image-new.img now... I am dumb... By the way, how to type an emoji in this textbox? I don't see I can insert any.

how could you make a working boot.img? I downloaded the AIK for Windows (https://forum.xda-developers.com/t/tool-android-image-kitchen-unpack-repack-kernel-ramdisk-win-android-linux-mac.2073775/), put the stock boot.img and just did unpacking and repacking. With this simple unchanged boot.img, my device does not boot at all (writes that the software is damaged and after 5 seconds there will be a shutdown).

There will be a new image file generated. boot.img has not been touched by the script at all.

VWK8 commented 3 years ago

Just tried Magisk patching official boot.img, modify fstab, repack and flash. Same problem. I can still see [ 1.170283] init: Failed to mount /system_ext: No such device or address in the log... Strange... I have copied the official boot.img to same level of unpackimg.sh. After running repackimg.sh, the repacked image will replace the original boot.img, right?

..No, a new image will be created

Oh f... I see image-new.img now... I am dumb... By the way, how to type an emoji in this textbox? I don't see I can insert any.

how could you make a working boot.img? I downloaded the AIK for Windows (https://forum.xda-developers.com/t/tool-android-image-kitchen-unpack-repack-kernel-ramdisk-win-android-linux-mac.2073775/), put the stock boot.img and just did unpacking and repacking. With this simple unchanged boot.img, my device does not boot at all (writes that the software is damaged and after 5 seconds there will be a shutdown).

There will be a new image file generated. boot.img has not been touched by the script at all.

I wanted to say that after that, with the new image-new.img, my device does not load. Does this AIK exactly support Android 11? :)

thematrixdev commented 3 years ago

Just tried Magisk patching official boot.img, modify fstab, repack and flash. Same problem. I can still see [ 1.170283] init: Failed to mount /system_ext: No such device or address in the log... Strange... I have copied the official boot.img to same level of unpackimg.sh. After running repackimg.sh, the repacked image will replace the original boot.img, right?

..No, a new image will be created

Oh f... I see image-new.img now... I am dumb... By the way, how to type an emoji in this textbox? I don't see I can insert any.

how could you make a working boot.img? I downloaded the AIK for Windows (https://forum.xda-developers.com/t/tool-android-image-kitchen-unpack-repack-kernel-ramdisk-win-android-linux-mac.2073775/), put the stock boot.img and just did unpacking and repacking. With this simple unchanged boot.img, my device does not boot at all (writes that the software is damaged and after 5 seconds there will be a shutdown).

There will be a new image file generated. boot.img has not been touched by the script at all.

I wanted to say that after that, with the new image-new.img, my device does not load. Does this AIK exactly support Android 11? :)

I have used the linux version. I am not sure if they are the same, but I think so. May you please describe all the steps so we can guess what is wrong?

VWK8 commented 3 years ago

I downloaded archive "Android.Image .Kitchen.v3.7-Win32" and unpacked it. I put boot.img in the AIK folder and dragged it to unpackimg.bat. Then, without changing anything (for testing), I dragged the newly created "ramdisk" and "split_img" folders to repackimg.bat. After writing image-new.img in fastboot mode, my device stops loading. Maybe need a new Unsin for Android R?

thematrixdev commented 3 years ago

I downloaded archive "Android.Image .Kitchen.v3.7-Win32" and unpacked it. I put boot.img in the AIK folder and dragged it to unpackimg.bat. Then, without changing anything (for testing), I dragged the newly created "ramdisk" and "split_img" folders to repackimg.bat. After writing image-new.img in fastboot mode, my device stops loading. Maybe need a new Unsin for Android R?

May you try running the bat files instead of dragging anything onto it?

VWK8 commented 3 years ago

running the bat files

I tried it. Same. No warnings/errors are issued when unpacking/repacking and writing an image.

thematrixdev commented 3 years ago

running the bat files

I tried it. Same. No warnings/errors are issued when unpacking/repacking and writing an image.

Is the new boot image file same size with the original one? I don't use Windows. Let's wait someone else trying out for you.

VWK8 commented 3 years ago

Is the new boot image file same size with the original one?

Oh no.. The new image is half the size of the original.

thematrixdev commented 3 years ago

Is the new boot image file same size with the original one?

Oh no.. The new image is half the size of the original.

Then something is problematic. It should be the same size (I think).

VWK8 commented 3 years ago

Is the new boot image file same size with the original one?

Oh no.. The new image is half the size of the original.

Then something is problematic. It should be the same size (I think).

Thanks for even trying to help! I myself have not used AIK. But I got into this thread when I found out that the patched image via magisk no longer works.

tobise commented 3 years ago

half size is usual. AIK win version works with no problem at all. when you flash your magisk patched image (untouched by AIK), it goes into bootloop or shows "the software is damaged and after 5 seconds there will be a shutdown"?

VWK8 commented 3 years ago

when you flash your magisk patched image (untouched by AIK), it goes into bootloop or shows "the software is damaged and after 5 seconds there will be a shutdown"?

When I flash magisk patched image (untouched by AIK), it goes into bootloop. As it should be. This is well known. When I flash image repacked by AIK (no magisk), it shows "the software is damaged and after 5 seconds there will be a shutdown".

VWK8 commented 3 years ago

AIK win version works with no problem at all

I'm out of luck. )

thematrixdev commented 3 years ago

when you flash your magisk patched image (untouched by AIK), it goes into bootloop or shows "the software is damaged and after 5 seconds there will be a shutdown"?

When I flash magisk patched image (untouched by AIK), it goes into bootloop. As it should be. This is well known. When I flash image repacked by AIK (no magisk), it shows "the software is damaged and after 5 seconds there will be a shutdown".

I have had the exact problem before. I was dumb that I was flashing the original boot.img instead of the new one.

Maybe you can try installing a Ubuntu onto VM to confirm if that is the problem of AIK script.

tobise commented 3 years ago

Strange. I can download firmware and do the trick for you. Which specified version in xperiafirm do you want to flash?

VWK8 commented 3 years ago

Strange. I can download firmware and do the trick for you. Which specified version in xperiafirm do you want to flash?

Many thanks! :) Not worth it. I just would like to know what I am doing wrong. For the future. I will try virtual Linux.