]> Git Repo - qemu.git/blobdiff - scripts/signrom.py
hw/ide/atapi: Use the ldst API
[qemu.git] / scripts / signrom.py
index d1dabe0240fc29e7e209fc7415dcd5c895fa64c3..313ee28a17753171d9e34b19479199b9fba4adf4 100644 (file)
@@ -1,3 +1,4 @@
+from __future__ import print_function
 #
 # Option ROM signing utility
 #
@@ -18,7 +19,7 @@ fin = open(sys.argv[1], 'rb')
 fout = open(sys.argv[2], 'wb')
 
 magic = fin.read(2)
-if magic != '\x55\xaa':
+if magic != b'\x55\xaa':
     sys.exit("%s: option ROM does not begin with magic 55 aa" % sys.argv[1])
 
 size_byte = ord(fin.read(1))
@@ -33,7 +34,7 @@ elif len(data) < size:
     # Add padding if necessary, rounding the whole input to a multiple of
     # 512 bytes according to the third byte of the input.
     # size-1 because a final byte is added below to store the checksum.
-    data = data.ljust(size-1, '\0')
+    data = data.ljust(size-1, b'\0')
 else:
     if ord(data[-1:]) != 0:
         sys.stderr.write('WARNING: ROM includes nonzero checksum\n')
This page took 0.021976 seconds and 4 git commands to generate.