Skip to content

Commit 58b3eef

Browse files
committed
ptool: Dynamically erase backup partition table based on sector size
Erase backup GPT sectors dynamically based on sector size. Use 33 sectors for 512-byte and 5 for 4096-byte configurations. Ensure accurate and adaptable erase operations. Signed-off-by: Xiaoming Zhao <[email protected]>
1 parent c28472b commit 58b3eef

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ptool.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,7 @@ def CreateGPTPartitionTable(PhysicalPartitionNumber,UserProvided=False):
780780
PhysicalPartitionNumber,
781781
FileOffset[z],
782782
ConvertKBtoSectors(PhyPartition[k][j]['original_size_in_kb'])+LastLBA-FirstLBA+1-FilePartitionOffset[z],
783-
"zeros_33sectors.bin",
783+
"zeros_%dsectors.bin" % BackupGPTNumLBAs,
784784
"false",
785785
PartitionLabel,
786786
PhyPartition[k][j]['readbackverify'],
@@ -792,7 +792,7 @@ def CreateGPTPartitionTable(PhysicalPartitionNumber,UserProvided=False):
792792
PhysicalPartitionNumber,
793793
FileOffset[z],
794794
LastLBA-FirstLBA+1-FilePartitionOffset[z], # num_partition_sectors
795-
"zeros_33sectors.bin",
795+
"zeros_%dsectors.bin" % BackupGPTNumLBAs,
796796
"false",
797797
PartitionLabel,
798798
PhyPartition[k][j]['readbackverify'],

0 commit comments

Comments
 (0)