]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
check-efi-alignment: apply "ruff format"
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 19 Feb 2026 17:04:20 +0000 (02:04 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 17 May 2026 17:44:46 +0000 (02:44 +0900)
tools/check-efi-alignment.py

index abdeb22fdbdb38a9207040248565e62ee2ab3582..b442a16f556219cdc68bd5ec6731e66fcfe4e801 100755 (executable)
@@ -15,22 +15,23 @@ def main():
     pe = pefile.PE(sys.argv[1], fast_load=True)
 
     for section in pe.sections:
-        name = section.Name.rstrip(b"\x00").decode()
+        name = section.Name.rstrip(b'\x00').decode()
         file_addr = section.PointerToRawData
         virt_addr = section.VirtualAddress
-        print(f"{name:10s} file=0x{file_addr:08x} virt=0x{virt_addr:08x}")
+        print(f'{name:10s} file=0x{file_addr:08x} virt=0x{virt_addr:08x}')
 
         if file_addr % 512 != 0:
-            print(f"File address of {name} section is not aligned to 512 bytes", file=sys.stderr)
+            print(f'File address of {name} section is not aligned to 512 bytes', file=sys.stderr)
             return 1
 
         if virt_addr % 512 != 0:
-            print(f"Virt address of {name} section is not aligned to 512 bytes", file=sys.stderr)
+            print(f'Virt address of {name} section is not aligned to 512 bytes', file=sys.stderr)
             return 1
 
+
 if __name__ == '__main__':
     if len(sys.argv) != 2:
-        print(f"Usage: {sys.argv[0]} pe-image")
+        print(f'Usage: {sys.argv[0]} pe-image')
         sys.exit(1)
 
     sys.exit(main())