aboutsummaryrefslogtreecommitdiff
path: root/scripts/signrom.py
AgeCommit message (Collapse)Author
2020-02-07drop "from __future__ import print_function"Paolo Bonzini
This is only needed for Python 2, which we do not support anymore. Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Acked-by: Alex Bennée <alex.bennee@linaro.org> Acked-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20200204160604.19883-1-pbonzini@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
2020-02-07make all Python scripts executablePaolo Bonzini
Scripts that have a Python shebang are meant to be executed directly from the shell; give them 755 permissions. Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20200204160237.16889-1-pbonzini@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
2020-02-07scripts/signrom: remove Python 2 support, add shebangPaolo Bonzini
Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20200204160028.16211-1-pbonzini@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
2018-06-08python: futurize -f libfuturize.fixes.fix_print_with_importEduardo Habkost
Change all Python code to use print as a function. This is necessary for Python 3 compatibility. Done using: $ py=$( (g grep -l -E '^#!.*python';find -name '*.py' -printf '%P\n';) | \ sort -u | grep -v README.sh4) $ futurize -w -f libfuturize.fixes.fix_print_with_import $py Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Acked-by: Fam Zheng <famz@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Message-Id: <20180608122952.2009-2-ehabkost@redhat.com> [ehabkost: fixup tests/docker/docker.py] Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2018-02-05scripts: ensure signrom treats data as bytesDaniel P. Berrange
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Message-Id: <20180116134217.8725-10-berrange@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2016-08-09linuxboot_dma: avoid guest ABI breakage on gcc vs. clang compilationPaolo Bonzini
Recent GCC compiles linuxboot_dma.c to 921 bytes, while CentOS 6 needs 1029 and clang needs 1527. Because the size of the ROM, rounded to the next 512 bytes, must match, this causes the API to break between a <1K ROM and one that is bigger. We want to make the ROM 1.5 KB in size, but it's better to make clang produce leaner ROMs, because currently it is worryingly close to the limit. To fix this prevent clang's happy inlining (which -Os cannot prevent). This only requires adding a noinline attribute. Second, the patch makes sure that the ROM has enough padding to prevent ABI breakage on different compilers. The size is now hardcoded in the file that is passed to signrom.py, as was the case before commit 6f71b77 ("scripts/signrom.py: Allow option ROM checksum script to write the size header.", 2016-05-23); signrom.py however will still pad the input to the requested size. This ensures that the padding goes beyond the next multiple of 512 if necessary, and also avoids the need for -fno-toplevel-reorder which clang doesn't support. signrom.py can then error out if the requested size is too small for the actual size of the compiled ROM. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2016-05-23scripts/signrom.py: Check for magic in option ROMs.Richard W.M. Jones
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>
2016-05-23scripts/signrom.py: Allow option ROM checksum script to write the size header.Richard W.M. Jones
Modify the signrom.py script so that if the size byte in the header is 0 (ie. not set) then the script will set the size. If the size byte is non-zero then we do the same as before, so this doesn't require changes to any existing ROM sourcecode. Signed-off-by: Richard W.M. Jones <rjones@redhat.com> Message-Id: <1463000807-18015-2-git-send-email-rjones@redhat.com>
2012-04-16signrom: Rewrite as python scriptJan Kiszka
Now that we have a hard dependency on python anyway, we can replace the slow shell script to calculate the option ROM checksum with a fast AND portable python version. Tested both with python 2.7 and 3.1. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>