]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
mkosi: create bmap before compression 994/head
authorGerard Salvatella <mail@gerardsalvatella.com>
Wed, 1 Jun 2022 15:44:45 +0000 (17:44 +0200)
committerGerard Salvatella <mail@gerardsalvatella.com>
Thu, 2 Jun 2022 16:01:56 +0000 (18:01 +0200)
Creation of bmap files needs to take place before any compression
happens, since bmaptool has to know where the "holes" of the image lie.
Compression removes the holes, preventing bmap from recreating the
original raw image. Move the bmap calculation step before the
compression.

mkosi/__init__.py

index 4381ea2251cd321ca6711f704fd86fd7ba0359ae..e24ba072081a9d57bed8c0289fa5153cc64a8ecb 100644 (file)
@@ -7448,6 +7448,7 @@ def build_stuff(args: MkosiArgs) -> Manifest:
             MkosiPrinter.print_step("Skipping (second) final image build phase.")
 
         raw = qcow2_output(args, image.raw)
+        bmap = calculate_bmap(args, raw)
         raw = compress_output(args, raw)
         split_root = compress_output(args, image.split_root, ".usr" if args.usr_only else ".root")
         split_verity = compress_output(args, image.split_verity, ".verity")
@@ -7469,7 +7470,6 @@ def build_stuff(args: MkosiArgs) -> Manifest:
             settings,
         )
         signature = calculate_signature(args, checksum)
-        bmap = calculate_bmap(args, raw)
 
         link_output(args, root, raw or image.archive)
         link_output_root_hash_file(args, root_hash_file)