Skip to content

Commit

Permalink
efi: skip check-alignment-* tests if pefile is not installed
Browse files Browse the repository at this point in the history
Otherwise, when building with ukify disabled, no one else requires pefile, and
if it is not installed, those tests fail:

```
================================== 12/1212 ===================================
test:         systemd:efi / check-alignment-systemd-bootx64.efi
start time:   14:21:54
duration:     0.08s
result:       exit status 1
command:      /mnt/work/systemd/upstream-fork/main/tools/check-efi-alignment.py /mnt/work/systemd/upstream-fork/main/build/src/boot/efi/systemd-bootx64.efi
----------------------------------- stderr -----------------------------------
Traceback (most recent call last):
  File "/mnt/work/systemd/upstream-fork/main/tools/check-efi-alignment.py", line 7, in <module>
    import pefile
ModuleNotFoundError: No module named 'pefile'
==============================================================================

================================== 13/1212 ===================================
test:         systemd:efi / check-alignment-linuxx64.efi.stub
start time:   14:21:54
duration:     0.08s
result:       exit status 1
command:      /mnt/work/systemd/upstream-fork/main/tools/check-efi-alignment.py /mnt/work/systemd/upstream-fork/main/build/src/boot/efi/linuxx64.efi.stub
----------------------------------- stderr -----------------------------------
Traceback (most recent call last):
  File "/mnt/work/systemd/upstream-fork/main/tools/check-efi-alignment.py", line 7, in <module>
    import pefile
ModuleNotFoundError: No module named 'pefile'
==============================================================================

================================== 14/1212 ===================================
test:         systemd:efi / check-alignment-addonx64.efi.stub
start time:   14:21:54
duration:     0.07s
result:       exit status 1
command:      /mnt/work/systemd/upstream-fork/main/tools/check-efi-alignment.py /mnt/work/systemd/upstream-fork/main/build/src/boot/efi/addonx64.efi.stub
----------------------------------- stderr -----------------------------------
Traceback (most recent call last):
  File "/mnt/work/systemd/upstream-fork/main/tools/check-efi-alignment.py", line 7, in <module>
    import pefile
ModuleNotFoundError: No module named 'pefile'
==============================================================================
```

Follow-up for 7ff3b88

(cherry picked from commit f0896ca)

Related: RHEL-30372
  • Loading branch information
aafeijoo-suse authored and jamacku committed Jun 11, 2024
1 parent bab9a56 commit 1abe8dc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tools/check-efi-alignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@

import sys

import pefile
try:
import pefile
except ImportError as e:
print(str(e), file=sys.stderr)
sys.exit(77)


def main():
Expand Down

0 comments on commit 1abe8dc

Please sign in to comment.