main: ParseContext,
finalized: dict[str, Any],
*,
+ configdir: Path | None,
resources: Path,
) -> Config:
context = ParseContext(resources)
for name in finalized.get("environment", {}).keys() & finalized.get("pass_environment", [])
}
+ if configdir and (p := configdir / "mkosi.initrd.conf").exists():
+ with chdir(p if p.is_dir() else Path.cwd()):
+ context.parse_config_one(p, parse_profiles=p.is_dir(), parse_local=p.is_dir())
+
with chdir(resources / "mkosi-initrd"):
context.parse_config_one(resources / "mkosi-initrd", parse_profiles=True)
subimages = [Config.from_dict(ns) for ns in images]
if any(want_default_initrd(image) for image in subimages + [main]):
- initrd = finalize_default_initrd(maincontext, config, resources=resources)
+ initrd = finalize_default_initrd(maincontext, config, configdir=configdir, resources=resources)
if want_default_initrd(main):
main = dataclasses.replace(
* `mkosi.conf.d/` is parsed in the same directory as `mkosi.conf` if it
exists. Each directory and each file with the `.conf` extension in
`mkosi.conf.d/` is parsed. Any directory in `mkosi.conf.d` is parsed
- as if it were a regular top level directory, except for `mkosi.images/`
- and `mkosi.tools.conf`, which are only picked up in the top level
- directory.
+ as if it were a regular top level directory, except for `mkosi.images/`,
+ `mkosi.tools.conf` and `mkosi.initrd.conf`, which are only picked up in
+ the top level directory.
* If any profiles are configured, their configuration is parsed from the
`mkosi.profiles/` directory.
* Subimages are parsed from the `mkosi.images/` directory if it exists.
specifying this setting, the special value `default` can be assigned alongside the other
values.
+ When the default initrd is used, it can be further configured using the settings below and
+ with `mkosi.initrd.conf` which can either be a file or directory containing extra configuration
+ for the default initrd.
+
**mkosi** will also look for initrds in a subdirectory `io.mkosi.initrd` of
the artifact directory (see `$ARTIFACTDIR` in the section **ENVIRONMENT
VARIABLES**). Any initrds found there are appended to the user-provided
If set to `yes`, **mkosi** will automatically add an extra tools tree
image and use it as the tools tree. This image can be further configured
- using the settings below or with `mkosi.tools.conf` which can either be a
+ using the settings below and with `mkosi.tools.conf` which can either be a
file or directory containing extra configuration for the default tools tree.
See the **TOOLS TREE** section for further details.