diff options
| author | Jason Albert <albertj@us.ibm.com> | 2015-03-09 11:37:36 -0500 |
|---|---|---|
| committer | Jason Albert <albertj@us.ibm.com> | 2015-03-09 11:37:36 -0500 |
| commit | 63f5f863005c9b147c04132a3839d5ca880bcb70 (patch) | |
| tree | b9ab3ce14380170ad5285b11f5c5244369f84b46 | |
| parent | 56cb67de0aea477a28b98b769a07ebef9a0f264d (diff) | |
| download | vpdtools-63f5f863005c9b147c04132a3839d5ca880bcb70.tar.gz vpdtools-63f5f863005c9b147c04132a3839d5ca880bcb70.zip | |
Switch the TOC entrie value packing from big endian to little endian
| -rwxr-xr-x | createVpd.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/createVpd.py b/createVpd.py index 14e131b..42656f2 100755 --- a/createVpd.py +++ b/createVpd.py @@ -597,10 +597,10 @@ recordInfo[recordName].record[1:3] = struct.pack('<H', recordLength) tocName = recordInfo[recordName].tocName # Image size hasn't been updated since the end of the last record, so it points to the start of our new record tocRecordOffset = recordInfo[recordName].tocRecordOffset -recordInfo[tocName].record[tocRecordOffset:(tocRecordOffset + 2)] = struct.pack('>H', imageSize) +recordInfo[tocName].record[tocRecordOffset:(tocRecordOffset + 2)] = struct.pack('<H', imageSize) # The record is complete, so we can just use the length tocRecordLength = recordInfo[recordName].tocRecordLength -recordInfo[tocName].record[tocRecordLength:(tocRecordLength + 2)] = struct.pack('>H', len(recordInfo[recordName].record)) +recordInfo[tocName].record[tocRecordLength:(tocRecordLength + 2)] = struct.pack('<H', len(recordInfo[recordName].record)) # Update our total image size imageSize += len(recordInfo[recordName].record) @@ -642,10 +642,10 @@ for record in manifest.iter("record"): tocName = recordInfo[recordName].tocName # Image size hasn't been updated since the end of the last record, so it points to the start of our new record tocRecordOffset = recordInfo[recordName].tocRecordOffset - recordInfo[tocName].record[tocRecordOffset:(tocRecordOffset + 2)] = struct.pack('>H', imageSize) + recordInfo[tocName].record[tocRecordOffset:(tocRecordOffset + 2)] = struct.pack('<H', imageSize) # The record is complete, so we can just use the length tocRecordLength = recordInfo[recordName].tocRecordLength - recordInfo[tocName].record[tocRecordLength:(tocRecordLength + 2)] = struct.pack('>H', len(recordInfo[recordName].record)) + recordInfo[tocName].record[tocRecordLength:(tocRecordLength + 2)] = struct.pack('<H', len(recordInfo[recordName].record)) # Update our total image size imageSize += len(recordInfo[recordName].record) @@ -662,10 +662,10 @@ recordInfo[recordName].ecc = bytearray(("\0" * (int(len(recordInfo[recordName].r tocName = recordInfo[recordName].tocName # Image size hasn't been updated since the end of the last record, so it points to the start of our new record tocEccOffset = recordInfo[recordName].tocEccOffset -recordInfo[tocName].record[tocEccOffset:(tocEccOffset + 2)] = struct.pack('>H', imageSize) +recordInfo[tocName].record[tocEccOffset:(tocEccOffset + 2)] = struct.pack('<H', imageSize) # The record is complete, so we can just use the length tocEccLength = recordInfo[recordName].tocEccLength -recordInfo[tocName].record[tocEccLength:(tocEccLength + 2)] = struct.pack('>H', len(recordInfo[recordName].ecc)) +recordInfo[tocName].record[tocEccLength:(tocEccLength + 2)] = struct.pack('<H', len(recordInfo[recordName].ecc)) # Update our total image size imageSize += len(recordInfo[recordName].ecc) @@ -679,10 +679,10 @@ for record in manifest.iter("record"): tocName = recordInfo[recordName].tocName # Image size hasn't been updated since the end of the last record, so it points to the start of our new record tocEccOffset = recordInfo[recordName].tocEccOffset - recordInfo[tocName].record[tocEccOffset:(tocEccOffset + 2)] = struct.pack('>H', imageSize) + recordInfo[tocName].record[tocEccOffset:(tocEccOffset + 2)] = struct.pack('<H', imageSize) # The record is complete, so we can just use the length tocEccLength = recordInfo[recordName].tocEccLength - recordInfo[tocName].record[tocEccLength:(tocEccLength + 2)] = struct.pack('>H', len(recordInfo[recordName].ecc)) + recordInfo[tocName].record[tocEccLength:(tocEccLength + 2)] = struct.pack('<H', len(recordInfo[recordName].ecc)) # Update our total image size imageSize += len(recordInfo[recordName].ecc) |

