From: Luca Boccassi Date: Sat, 6 Dec 2025 17:05:03 +0000 (+0000) Subject: portable: support split roothash X-Git-Tag: v26~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=97c81eef7228a1eec9c2b5b3be0bfdd33fe4085a;p=thirdparty%2Fmkosi.git portable: support split roothash Portable images are DDIs too, support writing a split roothash as with OS images --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index 3decb80b0..a7be4899a 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -3462,10 +3462,7 @@ def make_image( if p.split_path and p.type not in skip: maybe_compress(context, context.config.compress_output, p.split_path) - if ArtifactOutput.roothash in context.config.split_artifacts and ( - roothash := finalize_roothash(partitions) - ): - (context.staging / context.config.output_split_roothash).write_text(roothash.partition("=")[2]) + write_split_roothash(context, partitions) return partitions @@ -3725,6 +3722,13 @@ def make_esp( ) +def write_split_roothash(context: Context, partitions: Sequence[Partition]) -> None: + if ArtifactOutput.roothash in context.config.split_artifacts and ( + roothash := finalize_roothash(partitions) + ): + (context.staging / context.config.output_split_roothash).write_text(roothash.partition("=")[2]) + + def make_extension_or_portable_image(context: Context, output: Path) -> None: if context.config.verity == Verity.disabled or ( context.config.verity == Verity.auto @@ -3807,6 +3811,8 @@ def make_extension_or_portable_image(context: Context, output: Path) -> None: if p.split_path: maybe_compress(context, context.config.compress_output, p.split_path) + write_split_roothash(context, [Partition.from_dict(d) for d in j]) + def finalize_staging(context: Context) -> None: rmtree(