-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Brick on Xiaomi Redmi Note 13 Pro 5G (garnet) #405
Comments
Nice investigative work you did there--thanks for detailing all your findings! As far as I can tell, you did everything right. The If you want to be extra sure that everything flashed properly, you can try running adb push avbroot /tmp/
adb push avb_pkmd.bin /tmp/
# Run as root on the device
su
cd /tmp/
# Create the directory structure that `avbroot avb verify` expects
suffix=$(getprop ro.boot.slot_suffix)
mkdir /dev/avbroot
for f in {/dev/block/by-name,/dev/block/mapper}/*"${suffix}"; do ln "$(realpath "${f}")" "/dev/avbroot/$(basename "${f%${suffix}}.img")"; done
# Verify on-device partitions
./avbroot avb verify -i /dev/avbroot/vbmeta.img -p avb_pkmd.bin If that returns In that case, my only suggestion would be to try flashing the OTA from recovery twice so that both the A and B slots have something signed with your key. Some Pixel devices have bootloaders that check for this--not sure if Xiaomi's bootloader does something similar. If that also doesn't work, then I'm afraid you're probably out of luck and your device doesn't support |
As suggested I flashed the OTA twice from the recovery and made sure that both A and B slots boot into the same ROM.
On both slots (whether on the ROM itself or recovery) I did see the Also ran the commands you mentioned. I weren't aware you could actually run # ./avbroot avb verify -i /dev/avbroot/vbmeta.img -p avb_pkmd.bin
0.012s INFO vbmeta has a signed vbmeta header
0.019s INFO recovery has a signed vbmeta header
0.022s INFO vbmeta_system has a signed vbmeta header
0.023s INFO Verifying hash tree descriptor for: vendor
0.023s INFO Verifying hash descriptor for: vendor_boot
0.023s INFO Verifying hash tree descriptor for: odm
0.024s INFO Verifying hash descriptor for: recovery
0.024s INFO Verifying hash tree descriptor for: system_ext
0.024s INFO Verifying hash tree descriptor for: system
0.204s INFO Verifying hash tree descriptor for: product
0.310s INFO Verifying hash descriptor for: dtbo
1.969s INFO Verifying hash tree descriptor for: vendor_dlkm
2.657s INFO Verifying hash descriptor for: boot
28.271s INFO Successfully verified all vbmeta signatures and hashes I also encountered a weird behavior when trying to flash the partition $ fastboot erase avb_custom_keyshouldthisreallybehappening
Erasing 'avb_custom_keyshouldthisreallybehappening' OKAY [ 0.011s]
Finished. Total time: 0.024s
$ fastboot flash avb_custom_keyshouldthisreallybehappening avb_pkmd.bin
Warning: skip copying avb_custom_keyshouldthisreallybehappening image avb footer (avb_custom_keyshouldthisreallybehappening partition size: 0, avb_custom_keyshouldthisreallybehappening image size: 1032).
Sending 'avb_custom_keyshouldthisreallybehappening' (1 KB) OKAY [ 0.002s]
Writing 'avb_custom_keyshouldthisreallybehappening' OKAY [ 0.009s]
Finished. Total time: 0.047s That does not happen for other partitions like $ fastboot erase userdatablahblah
Erasing 'userdatablahblah' FAILED (remote: 'Check device console.')
fastboot: error: Command failed I also checked whether the erase command accepted any partition name regardless of whether it existed or not, but that doesn't seem to be the case here (I tested $ fastboot erase avb_custom
Erasing 'avb_custom' FAILED (remote: 'Check device console.')
fastboot: error: Command failed Just in case I also checked whether the above phenomenon is applicable to Pixel 8 but that doesn't seem to be the case: $ fastboot erase avb_custom_keyshouldthisreallybehappening
Erasing 'avb_custom_keyshouldthisreallybehappening' FAILED (remote: 'partition not found')
fastboot: error: Command failed I've got a feeling the |
Wow, yeah, the Xiaomi bootloader's |
Despite validating the signatures on device and flashing I believe from all the work above we can conclude that Xiaomi's implementation of |
There were some reports of
avb_custom_key
being supported on some Qualcomm-based Xiaomi models on #299 so I decided to take my chances and sign a custom ROM (crDroid) OTA for Xiaomi Redmi Note 13 Pro 5G which does use a Qualcomm SoC.The OTA zip file came without a recovery which resulted in me getting a
No compatible boot image found for OtaCertPatcher
error.So, I inserted a custom recovery using the instructions provided at #328 (comment) and then could proceed with the patch:
And verifying the patched OTA file:
Flashing the patched partitions using
fastboot flashall
did not work for me as I gotNot enough space to resize partition
errors when it tried to flashsystem.img
for whatever reason (perhaps the fastbootd implementation on the custom recovery was borked). So I flashed the custom recovery from the patched OTA first and then flashed the entire patched OTA zip viaadb sideload
After which crDroid was successfully installed and the phone did boot up and once again I put the device into fastboot mode and flashed the
avb_pkmd.bin
into theavb_custom_key
partition.As mentioned in the 8th step of the README I checked whether AVB was working properly or not
While I got the message
Returning avb_handle with status: Success
, theError verifying vbmeta image: OK_NOT_SIGNED
andReturning avb_handle for '/system' with status: VerificationError
were rather worrisome but according to #338 (comment) it should be fine?Considering I could see the root digest of my signed
system.img
at the line Built verity table line for/dev/block/dm-1
:But after locking the bootloader via
fastboot flashing lock
I got hit the infamousSystem has been destroyed
screen on my phone.I've got the means to fix my device but what I'd like to know is whether custom chain of trust is actually not supported on this model or perhaps I've done something wrong while trying to make things work?
The text was updated successfully, but these errors were encountered: