fix mkmacboot truncating the output file

Use open(imgfile, 'r+b'), not 'wb'. Duh.
This commit is contained in:
Will Woods 2011-11-01 13:35:24 -04:00
parent 417fdf93cc
commit 7ea8baeae3

View File

@ -52,7 +52,7 @@ def macbless(imgfile):
nodedata = struct.pack(">i", blessnode)
dirdata = struct.pack(">i", dirnode)
# Write it to the volume header
with open(imgfile, "wb") as img:
with open(imgfile, "r+b") as img:
img.seek(0x450) # HFSPlusVolumeHeader->finderInfo
img.write(dirdata) # finderInfo[0]
img.write(nodedata) # finderInfo[1]