phhusson / treble_experimentations

Notes about tinkering with Android Project Treble
3.4k stars 660 forks source link

[Redmi Note 8T] (willow) Boot failure on Quack #1087

Open milankragujevic opened 4 years ago

milankragujevic commented 4 years ago

As the title says, the device does not boot system-quack-arm64-ab-gapps.img.

It fails after the bootloader splash and reboots into recovery (shows splash twice).

Happens no matter the way it was flashed.

Other device-specific ROMs work fine.

Treble Info identified it as VNDK 28 arm64 A/B with no seamless upgrades.

last_kmsg is empty, probably because it fails to start at all...

phhusson commented 4 years ago

vbmeta flashed properly with disable-verity?

Le jeu. 30 janv. 2020 à 00:53, Milan Kragujević notifications@github.com a écrit :

As the title says, the device does not boot system-quack-arm64-ab-gapps.img.

It fails after the bootloader splash and reboots into recovery (shows splash twice).

Happens no matter the way it was flashed.

Other device-specific ROMs work fine.

Treble Info identified it as VNDK 28 arm64 A/B with no seamless upgrades.

last_kmsg is empty, probably because it fails to start at all...

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

milankragujevic commented 4 years ago

Yes.

fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img

Other ROMs (non-GSI) boot on the device.

I flashed it 3 times, once from recovery, two times from fastboot, it didn't change anything...

phhusson commented 4 years ago

Other ROM come with their own boot.img that disables dm-verity and probably many other things, so that doesn't count. Of course after flashing other ROMs, you flashed stock unmodified boot.img and vendor.img before testing GSI?

Le jeu. 30 janv. 2020 à 10:17, Milan Kragujević notifications@github.com a écrit :

Yes.

fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img

Other ROMs (non-GSI) boot on the device.

I flashed it 3 times, once from recovery, two times from fastboot, it didn't change anything...

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/phhusson/treble_experimentations/issues/1087?email_source=notifications&email_token=AAAA4ORC54TKNHT7S3OWGCTRAKLKLA5CNFSM4KNNOJX2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKKIIEY#issuecomment-580158483, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAA4OU3ZAJVVC7TXKZECFTRAKLKLANCNFSM4KNNOJXQ .

milankragujevic commented 4 years ago

Actually the other way around, I went from MIUI to GSI, 3 times, then flashed a custom ROM over it to test, then flashed back MIUI.

phhusson commented 4 years ago

ok. do the fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img on stock, boot stock, and dump the result of adb shell mount

Le jeu. 30 janv. 2020 à 10:32, Milan Kragujević notifications@github.com a écrit :

Actually the other way around, I went from MIUI to GSI, 3 times, then flashed a custom ROM over it to test, then flashed back MIUI.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

milankragujevic commented 4 years ago

Output of adb shell mount after flashing vbmeta with that command:

mount.log

milankragujevic commented 4 years ago

@phhusson Sorry to bother you, but can you take a look?

phhusson commented 4 years ago

K so disable-verity worked. Please try again getting /proc/last_kmsg and /sys/fs/pstore

If you can't get logs from those it is going to be an annoying brute force. Send your /vendor/etc/selinux

milankragujevic commented 4 years ago

selinux-2020-02-18.zip

Here you go, I will try logs a few more times, it literally doesn't try to boot, reboots straight into recovery from the bootloader splash screen, doesn't wait a second even. It, however, doesn't continue into recovery, it reboots and then goes into recovery (which can be and usually is, custom).

phhusson commented 4 years ago

K Selinux policy is "okay" it does need one of my workaround though. You don't have magisk running while testing this, correct?

milankragujevic commented 4 years ago

No Magisk, stock boot.img.

phhusson commented 4 years ago

Let's removing this from selinux policy anyway... Edit system/etc/selinux/plat_sepolicy.cil and remove the line: (genfscon sysfs /devices/virtual/block/ (u object_r sysfs_devices_block ((s0) (s0))))

milankragujevic commented 4 years ago

I did that, nothing. Reboots back into recovery, ls /sys/fs/pstore returns nothing, cat /proc/last_kmsg returns nothing.

I tried booting it with boot.img from another (source-built) ROM, same thing happens, goes into recovery mode. It seems to be crashing in the same way as if there is no OS installed.

I installed the latest system-quack-arm64-ab-gapps.img. You even mention fixes for audio on willow and ginkgo, I'm not sure how did those people get it to boot?

I flashed it via fastboot and via TWRP (to System Image target). I did flash vbmeta again as I've said before.

Wiped, formatted and erased data in all the ways possible, made no difference.

@phhusson

milankragujevic commented 4 years ago

Hi @phhusson, I tried the procedure described in issue https://github.com/phhusson/treble_experimentations/issues/881 (formatting data).

It didn't work.

Here is the full procedure:

  1. Flash stock ROM for the device and region with fastboot (includes everything)
  2. fastboot flash system system-quack-arm64-ab-gapps.img
  3. fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img
  4. fastboot format userdata
  5. fastboot reboot phone boots into Redmi Recovery
  6. Wipe Data from stock recovery
  7. Reboot to System phone still keeps rebooting into recovery

Here are logs (lack of them) right after the phone boots into recovery (steps: power off device, power on device, it shows Redmi bootloader logo, reboots, shows Redmi bootloader logo again, boots into custom recovery that I installed in the meantime):

C:\Users\Milan\Downloads\willow>adb shell
sh-5.0# ls /sys/fs/pstore
sh-5.0# cat /proc/last_kmsg
sh-5.0# exit
exit

Treble Info says it's arm64 SAR.

I have tried with stock boot.img, from MIUI 11.

edit: It works with a custom boot.img for Lineage OS 17.1. I am attaching stock boot.img and the LineageOS boot.img so you can maybe see the differences and enable the GSI to work with stock boot.img like on all other phones.

willow_stock_boot.zip willow_lineageos_boot.zip

Device Redmi Note 8T 4/64GB EEU SDM665 / MIUI V11.0.3.0-PCXEUXM

crazyrexz commented 4 years ago

did you manage to boot aosp? im trying quack with same problem to you, boot into recovery after flash. im on ginkgo redmi note 8 regular

milankragujevic commented 4 years ago

@crazyrexz Yes, use boot.img from any custom ROM, flash that boot, vbmeta and system.img, then format data.