From 7228c96d7fe74b4bded3266c8bfe46e337ba2668 Mon Sep 17 00:00:00 2001 From: bongbui321 Date: Thu, 21 Mar 2024 00:43:00 -0400 Subject: [PATCH 1/2] follow fastboot standard --- edlclient/Library/firehose.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/edlclient/Library/firehose.py b/edlclient/Library/firehose.py index 8c45604..a66aa66 100755 --- a/edlclient/Library/firehose.py +++ b/edlclient/Library/firehose.py @@ -1326,18 +1326,21 @@ def cmd_patch_multiple(lun, start_sector, byte_offset, patch_data): offset += size_each_patch return True + # flags: 0x3a for inactive and 0x6f for inactive boot partition def set_flags(flags, active, is_boot): new_flags = flags if active: if is_boot: - new_flags |= (PART_ATT_PRIORITY_VAL | PART_ATT_ACTIVE_VAL | PART_ATT_MAX_RETRY_COUNT_VAL) - new_flags &= (~PART_ATT_SUCCESSFUL_VAL & ~PART_ATT_UNBOOTABLE_VAL) + #new_flags |= (PART_ATT_PRIORITY_VAL | PART_ATT_ACTIVE_VAL | PART_ATT_MAX_RETRY_COUNT_VAL) + #new_flags &= (~PART_ATT_SUCCESSFUL_VAL & ~PART_ATT_UNBOOTABLE_VAL) + new_flags = 0x6f << (AB_FLAG_OFFSET*8) else: new_flags |= AB_PARTITION_ATTR_SLOT_ACTIVE << (AB_FLAG_OFFSET*8) else: if is_boot: - new_flags &= (~PART_ATT_PRIORITY_VAL & ~PART_ATT_ACTIVE_VAL) - new_flags |= ((MAX_PRIORITY-1) << PART_ATT_PRIORITY_BIT) + #new_flags &= (~PART_ATT_PRIORITY_VAL & ~PART_ATT_ACTIVE_VAL) + #new_flags |= ((MAX_PRIORITY-1) << PART_ATT_PRIORITY_BIT) + new_flags = 0x3a << (AB_FLAG_OFFSET*8) else: new_flags &= ~(AB_PARTITION_ATTR_SLOT_ACTIVE << (AB_FLAG_OFFSET*8)) return new_flags From 3112252a9caaf5f94d489b5207f367223a00ff55 Mon Sep 17 00:00:00 2001 From: Hoang Bui <47828508+bongbui321@users.noreply.github.com> Date: Thu, 21 Mar 2024 01:04:49 -0400 Subject: [PATCH 2/2] fix --- edlclient/Library/firehose.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/edlclient/Library/firehose.py b/edlclient/Library/firehose.py index a66aa66..46da452 100755 --- a/edlclient/Library/firehose.py +++ b/edlclient/Library/firehose.py @@ -1326,7 +1326,7 @@ def cmd_patch_multiple(lun, start_sector, byte_offset, patch_data): offset += size_each_patch return True - # flags: 0x3a for inactive and 0x6f for inactive boot partition + # flags: 0x3a for inactive and 0x6f for active boot partition def set_flags(flags, active, is_boot): new_flags = flags if active: