bkerler / edl

Inofficial Qualcomm Firehose / Sahara / Streaming / Diag Tools :)
GNU General Public License v3.0
1.59k stars 372 forks source link

Fix `cmd_setactiveslot()` #515

Closed bongbui321 closed 6 months ago

bongbui321 commented 6 months ago

@bkerler, this should be the correct setactiveslot change of attributes and type for each partition.

Warning: This is qualcomm-specific, and is very slow ~20s - 30s~ -> ~5s-15s since it looks for corresponding partitions for each switch, so it will need to be improved in the future

This is how fastboot does it. it swaps the type of active partitions with their corresponding inactive partitions, and add + unset active bit corresponding to the new active slot. Moreover, boot partitions have additional attribute/flag settings derived from fastboot implementation such as retry_count, priority_val, bootability

qcomm abl doesn't set the success_val at the bit offset 54 until it boots successfully for "boot partition fall back" if there were error with booting process. Not sure if it is safe to set it in qdl mode prior to the successful boot?

bkerler commented 6 months ago

I assume it should be fine, but I also haven't tested that. Thanks !

bongbui321 commented 6 months ago

I didn't set the success_val at bit offset 54 and it still boots normally. I'm just not sure if it affects anything in the long run thats all. if you flash a device enough to get fastboot up, and then flash the device using fastboot would just reset the attributes/flags to correct values