]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
ukify: fix hwids section reproducibility
authorLuca Boccassi <luca.boccassi@gmail.com>
Wed, 30 Jul 2025 23:04:33 +0000 (00:04 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Thu, 31 Jul 2025 10:47:54 +0000 (11:47 +0100)
When there are multiple json files the glob list output is
not stable. Sort it before use.

Follow-up for 0333b9d5892983efc690d444fb8783624a1ef476

src/ukify/ukify.py

index 5bbe9b1ea68b3d21346c520c6f690a812df13dda..8a8d72429fe2f8a8dcf16b42aefdbf2340c18174 100755 (executable)
@@ -1184,7 +1184,7 @@ def pack_strings(strings: set[str], base: int) -> tuple[bytes, dict[str, int]]:
 
 
 def parse_hwid_dir(path: Path) -> bytes:
-    hwid_files = path.rglob('*.json')
+    hwid_files = sorted(path.rglob('*.json'))
     devstr_to_type: dict[str, int] = {
         'devicetree': DEVICE_TYPE_DEVICETREE,
         'uefi-fw': DEVICE_TYPE_UEFI_FW,