]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
make_image: log systemd-repart *.conf files at the --debug level
authorMarc Herbert <marc.herbert@intel.com>
Tue, 11 Nov 2025 00:12:49 +0000 (16:12 -0800)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 16 Dec 2025 10:45:18 +0000 (11:45 +0100)
As discussed in #3948, systemd-repart *.conf files have default values
which is convenient until this fails with some dreaded "disk full" error
- then it becomes very mysterious. To considerably speed up the
investigation about what exactly is full, show the configuration files
in use when using --debug.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
(cherry picked from commit 7040a6add12c8f8c1c8393d5e35c747ee2876472)
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
mkosi/__init__.py

index 5c0b6fe99be5cfb2f8b6ecab9186ed226e876a52..b11eedb779154ec339d7423370dbe3381940136f 100644 (file)
@@ -3449,6 +3449,15 @@ def make_image(
     ):
         env["SYSTEMD_REPART_MKFS_EXT4_OPTIONS"] = "-O ^orphan_file"
 
+    if ARG_DEBUG.get():
+        for dir in definitions:
+            for c in dir.glob("*.conf"):
+                # Do not spam the logs in case something goes wrong
+                logging.debug(f"# {c} (truncated to 100 lines)")
+                with open(c) as f:
+                    for line in itertools.islice(f, 100):
+                        logging.debug(line.strip())
+
     with complete_step(msg):
         output = json.loads(
             run_systemd_sign_tool(