]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Run systemd-hwdb when building an image
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 21 Jun 2023 11:12:46 +0000 (13:12 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 22 Jun 2023 00:10:37 +0000 (18:10 -0600)
mkosi/__init__.py

index 8335f7c58750c24c365582e2c5b205d76777acc0..b821d234181acafa0ad934609ef25f3fa35a54a5 100644 (file)
@@ -1478,6 +1478,11 @@ def run_preset(state: MkosiState) -> None:
         run(["systemctl", "--root", state.root, "preset-all"])
 
 
+def run_hwdb(state: MkosiState) -> None:
+    with complete_step("Generating hardware database"):
+        run(["systemd-hwdb", "--root", state.root, "--usr", "--strict", "update"])
+
+
 def run_firstboot(state: MkosiState) -> None:
     password, hashed = state.config.root_password or (None, False)
     pwopt = "--root-password-hashed" if hashed else "--root-password"
@@ -1741,6 +1746,7 @@ def build_image(args: MkosiArgs, config: MkosiConfig, uid: int, gid: int) -> Non
             run_preset(state)
             run_depmod(state)
             run_firstboot(state)
+            run_hwdb(state)
             remove_packages(state)
 
             if manifest: