Skip to content

Commit

Permalink
Fix Partition split_path calculation
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
DaanDeMeyer committed Nov 28, 2024
1 parent da6802b commit f54c73d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mkosi/partition.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ def from_dict(cls, dict: Mapping[str, Any]) -> "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"),
)

Expand Down

0 comments on commit f54c73d

Please sign in to comment.