- We now automatically configure the qemu firmware, kernel cmdline and
initrd based on what type of kernel is passed by the user via
`-kernel` or `QemuKernel=`
+- We don't create subdirectories beneath the configured cache or build
+ directories anymore. To get back the previous behavior, configure the
+ cache and build directories as follows:
+
+ ```conf
+ CacheDirectory=mkosi.cache/%d~%r~%a
+ BuildDirectory=mkosi.builddir/%d~%r~%a
+ ```
## v18
from pathlib import Path
from typing import Optional, TextIO, Union
+from mkosi.architecture import Architecture
from mkosi.archive import extract_tar, make_cpio, make_tar
from mkosi.config import (
BiosBootloader,
"--cache-only", str(state.config.cache_only),
"--output-dir", str(state.workspace / "initrd"),
*(["--workspace-dir", str(state.config.workspace_dir)] if state.config.workspace_dir else []),
- "--cache-dir", str(state.cache_dir.parent),
+ "--cache-dir", str(state.cache_dir),
*(["--local-mirror", str(state.config.local_mirror)] if state.config.local_mirror else []),
"--incremental", str(state.config.incremental),
"--acl", str(state.config.acl),
release = p.tools_tree_release or distribution.default_release()
mirror = p.tools_tree_mirror or (p.mirror if p.mirror and p.distribution == distribution else None)
+ if p.cache_dir:
+ if p.distribution == distribution and p.release == release and p.architecture == Architecture.native():
+ cache = p.cache_dir
+ else:
+ cache = p.cache_dir / "tools"
+ else:
+ cache = None
+
cmdline = [
"--directory", "",
"--distribution", str(distribution),
"--cache-only", str(p.cache_only),
*(["--output-dir", str(p.output_dir)] if p.output_dir else []),
*(["--workspace-dir", str(p.workspace_dir)] if p.workspace_dir else []),
- *(["--cache-dir", str(p.cache_dir.parent)] if p.cache_dir else []),
+ *(["--cache-dir", str(cache)] if cache else []),
"--incremental", str(p.incremental),
"--acl", str(p.acl),
"--format", "directory",