mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-11-05 20:35:44 +00:00
scripts/signrom.py: Check for magic in option ROMs.
Because of the risk that compilers might not emit the asm() block at the beginning of the option ROM, check that the ROM contains the required magic signature. Signed-off-by: Richard W.M. Jones <rjones@redhat.com> Message-Id: <1463000807-18015-3-git-send-email-rjones@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
6f71b779c8
commit
fd28938b7a
1 changed files with 4 additions and 1 deletions
|
@ -17,7 +17,10 @@
|
|||
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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue