Merge pull request #528 from bongbui321/faster_setactiveslot

faster setactiveslot
This commit is contained in:
Bjoern Kerler 2024-04-07 00:34:30 +02:00 committed by GitHub
commit f58350f784
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1356,10 +1356,11 @@ class firehose(metaclass=LogBase):
def cmd_patch_multiple(lun, start_sector, byte_offset, patch_data):
offset = 0
size_each_patch = 4
size_each_patch = 8 if len(patch_data) % 8 == 0 else 4
unpack_fmt = "<I" if size_each_patch == 4 else "<Q"
write_size = len(patch_data)
for i in range(0, write_size, size_each_patch):
pdata_subset = int(unpack("<I", patch_data[offset:offset+size_each_patch])[0])
pdata_subset = int(unpack(unpack_fmt, patch_data[offset:offset+size_each_patch])[0])
self.cmd_patch( lun, start_sector, byte_offset + offset, pdata_subset, size_each_patch, True)
offset += size_each_patch
return True
@ -1479,7 +1480,7 @@ class firehose(metaclass=LogBase):
_, lun_b, gpt_data_b, guid_gpt_b = resp
backup_gpt_data_b, backup_guid_gpt_b = self.get_gpt(lun_b, 0, 0 , 0, guid_gpt_b.header.backup_lba)
if not check_gpt_hdr:
if not check_gpt_hdr and partitionname_a[:3] != "xbl": # xbl partition don't need check consistency
sts, gpt_data_a, backup_gpt_data_a = ensure_gpt_hdr_consistency(guid_gpt_a, backup_guid_gpt_a, gpt_data_a, backup_gpt_data_a)
if not sts:
return False