]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Fix Partition split_path calculation
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 28 Nov 2024 21:43:03 +0000 (22:43 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 28 Nov 2024 21:43:55 +0000 (22:43 +0100)
Now that we use workdir() in make_image(), we have to change the
Partition initializer to remove the path added by workdir() again
to get the proper path on the host.

Fixes #3242.

mkosi/partition.py

index 49d3fcd81ba6dce635593837f248fa480376e860..282fae37e006f8e06cd81db37058ba432683ffdc 100644 (file)
@@ -23,7 +23,10 @@ class Partition:
             type=dict["type"],
             uuid=dict["uuid"],
             partno=int(partno) if (partno := dict.get("partno")) else None,
-            split_path=Path(p) if ((p := dict.get("split_path")) and p != "-") else None,
+            # We have to translate the sandbox path to the path on the host by removing the /work prefix.
+            split_path=(
+                Path(p.removeprefix("/work")) if ((p := dict.get("split_path")) and p != "-") else None
+            ),
             roothash=dict.get("roothash"),
         )