]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Cache skeleton trees
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 3 Jan 2024 13:44:09 +0000 (14:44 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 3 Jan 2024 15:24:38 +0000 (16:24 +0100)
These are only intended for files that affect package manager
operation so we should be able to cache this step without any issues
since if the skeleton tree is changed, users are likely going to want
to throw away their cache regardless.

mkosi/__init__.py
mkosi/resources/mkosi.md

index ed358efdc3479d46ce7dfc3b0178f9f998fbf571..4d1a69bfcb8e73a26693037c6072e8f273e31e36 100644 (file)
@@ -2619,13 +2619,13 @@ def build_image(args: Args, config: Config) -> None:
 
         with mount_base_trees(context):
             install_base_trees(context)
-            install_skeleton_trees(context)
             cached = reuse_cache(context)
 
             context.config.distribution.setup(context)
 
             if not cached:
                 with mount_cache_overlay(context):
+                    install_skeleton_trees(context)
                     install_distribution(context)
                     run_prepare_scripts(context, build=False)
                     install_build_packages(context)
index 0392d18cf683565b93ca7b1774cb2ff900a253da..c2944c77852f5e3ff32addc58905b117654d7663 100644 (file)
@@ -901,6 +901,11 @@ boolean argument: either `1`, `yes`, or `true` to enable, or `0`, `no`,
   purpose with the root directory as target (also see the **Files**
   section below).
 
+: Note that skeleton trees are cached and any changes to skeleton trees
+  after a cached image has been built (when using `Incremental=`) are
+  only applied when the cached image is rebuilt (by using `-ff` or
+  running `mkosi -f clean`).
+
 : As with the base tree logic above, instead of a directory, a tar
   file may be provided too. `mkosi.skeleton.tar` will be automatically
   used if found in the local directory.