aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scripts/signrom.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/signrom.py b/scripts/signrom.py
index 6c8b9bf406..5629bca222 100644
--- a/scripts/signrom.py
+++ b/scripts/signrom.py
@@ -17,7 +17,10 @@ if len(sys.argv) < 3:
fin = open(sys.argv[1], 'rb')
fout = open(sys.argv[2], 'wb')
-fin.seek(2)
+magic = fin.read(2)
+if magic != '\x55\xaa':
+ sys.exit("%s: option ROM does not begin with magic 55 aa" % sys.argv[1])
+
size_byte = ord(fin.read(1))
fin.seek(0)