提交 fd28938b 编写于 作者: R Richard W.M. Jones 提交者: Paolo Bonzini

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: NRichard W.M. Jones <rjones@redhat.com>
Message-Id: <1463000807-18015-3-git-send-email-rjones@redhat.com>
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
上级 6f71b779
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册