if args.force > 1 or not have_cache(initrd):
remove_cache_entries(initrd)
- for i, config in enumerate(images):
- if args.verb != Verb.build:
- check_tools(config, args.verb)
-
- images[i] = config = run_configure_scripts(config)
+ if not have_history(args):
+ for i, config in enumerate(images):
+ if args.verb != Verb.build:
+ check_tools(config, args.verb)
- # The images array has been modified so we need to reevaluate last again.
- # Also ensure that all other images are reordered in case their dependencies were modified.
- last = images[-1]
+ images[i] = config = run_configure_scripts(config)
- if not have_history(args):
+ # The images array has been modified so we need to reevaluate last again.
+ # Also ensure that all other images are reordered in case their dependencies were modified.
+ last = images[-1]
images = resolve_deps(images[:-1], last.dependencies) + [last]
if (
up in the generated XFS filesystem.
`History=`, `--history=`
-: Takes a boolean. If enabled, **mkosi** will write information about the
- latest build to the `.mkosi-private` subdirectory in the directory
- from which it was invoked. This information is then used to restore
- the config of the latest build when running any verb that needs a
- build without specifying `--force`.
+: Takes a boolean. If enabled, **mkosi** will write information about
+ the latest build to the `.mkosi-private` subdirectory in the
+ directory from which it was invoked. This information is then used
+ to restore the config of the latest build when running any verb that
+ needs a build without specifying `--force`.
+
+ Note that configure scripts will not be executed if we reuse the
+ history from a previous build.
To give an example of why this is useful, if you run
`mkosi -O my-custom-output-dir -f` followed by `mkosi vm`, **mkosi**