Linux, additional repositories must be passed in the form `<name>::<url>`
(e.g. `myrepo::https://myrepo.net`).
-`RepositoryDirectories`, `--repository-directory`
+`RepositoryDirectories`, `--repo-dir=`
: This option can (for now) only be used with RPM-based distributions and Arch
Linux. It takes a comma separated list of directories containing extra repository
root or `/usr` partition along with its Verity partition and unified
kernel.
-`RepartDirectory=`, `--repart-directory`
+`RepartDirectory=`, `--repart-dir=`
: Path to a directory containing systemd-repart partition definition files that
are used when mkosi invokes systemd-repart when building a disk image. If not
normally run during the source build process. Note that this option
has no effect unless the `mkosi.build` build script honors it.
-`Cache=`, `--cache=`
+`CacheDirectory=`, `--cache-dir=`
: Takes a path to a directory to use as package cache for the
distribution package manager used. If this option is not used, but a
is automatically used for this purpose (also see the "Files" section
below).
-`InstallDirectory=`, `--install-directory=`
+`InstallDirectory=`, `--install-dir=`
: Takes a path of a directory to use as the install directory. The
directory used this way is shared between builds and allows the
re-building of images. Specifically:
1. The package cache of the distribution package manager may be cached
- between builds. This is configured with the `--cache=` option or
+ between builds. This is configured with the `--cache-dir=` option or
the `mkosi.cache/` directory. This form of caching relies on the
distribution's package manager, and caches distribution packages
(RPM, DEB, …) after they are downloaded, but before they are
"QCow2": "--qcow2",
"OutputDirectory": "--output-dir",
"WorkspaceDirectory": "--workspace-dir",
+ "CacheDirectory": "--cache-dir",
+ "RepartDirectory": "--repart-dir",
+ "BuildDirectory": "--build-dir",
"NSpawnSettings": "--settings",
"CheckSum": "--checksum",
"BMap": "--bmap",
"PostInstallationScript": "--postinst-script",
"TarStripSELinuxContext": "--tar-strip-selinux-context",
"SignExpectedPCR": "--sign-expected-pcr",
- "RepositoryDirectories": "--repository-directory",
+ "RepositoryDirectories": "--repo-dir",
"Credentials": "--credential",
}
help="Repositories to use",
)
group.add_argument(
- "--repository-directory",
+ "--repo-dir",
action=CommaDelimitedListAction,
default=[],
metavar="PATH",
help="Generate split partitions",
)
group.add_argument(
- "--repart-directory",
+ "--repart-dir",
metavar="PATH",
- dest="repart_dir",
help="Directory containing systemd-repart partition definitions",
)
group.add_argument(
help="Enable root autologin",
)
group.add_argument(
- "--cache",
- dest="cache_path",
+ "--cache-dir",
help="Package cache path",
type=Path,
metavar="PATH",
type=Path,
)
group.add_argument(
- "--build-dir", # Compatibility option
- help=argparse.SUPPRESS,
+ "--build-dir",
type=Path,
metavar="PATH",
- )
- group.add_argument(
- "--build-directory",
- dest="build_dir",
help="Path to use as persistent build directory",
- type=Path,
- metavar="PATH",
)
group.add_argument(
- "--install-directory",
- dest="install_dir",
+ "--install-dir",
help="Path to use as persistent install directory",
type=Path,
metavar="PATH",
empty_directory(config.install_dir)
if remove_package_cache:
- if config.cache_path is not None:
+ if config.cache_dir is not None:
with complete_step("Clearing out package cache…"):
- empty_directory(config.cache_path)
+ empty_directory(config.cache_dir)
def parse_boolean(s: str) -> bool:
def find_cache(args: argparse.Namespace) -> None:
subdir = f"{args.distribution}~{args.release}"
- if args.cache_path is not None:
- args.cache_path = Path(args.cache_path, subdir)
+ if args.cache_dir is not None:
+ args.cache_dir = Path(args.cache_dir, subdir)
elif os.path.exists("mkosi.cache/"):
- args.cache_path = Path("mkosi.cache", subdir)
+ args.cache_dir = Path("mkosi.cache", subdir)
else:
return
args.credentials = load_credentials(args)
args.kernel_command_line_extra = load_kernel_command_line_extra(args)
- if args.cache_path is not None:
- args.cache_path = args.cache_path.absolute()
+ if args.cache_dir is not None:
+ args.cache_dir = args.cache_dir.absolute()
if args.extra_trees:
for i in range(len(args.extra_trees)):
die("Images built without the --bootable option cannot be booted using qemu", MkosiNotSupportedException)
if args.repo_dirs and not (is_dnf_distribution(args.distribution) or args.distribution == Distribution.arch):
- die("--repository-directory is only supported on DNF based distributions and Arch")
+ die("--repo-dir is only supported on DNF based distributions and Arch")
if args.repo_dirs:
args.repo_dirs = [p.absolute() for p in args.repo_dirs]
):
print(" With Documentation:", yes_no(config.with_docs))
- print(" Package Cache:", none_to_none(config.cache_path))
+ print(" Package Cache:", none_to_none(config.cache_dir))
print(" Extra Trees:", line_join_source_target_list(config.extra_trees))
print(" Skeleton Trees:", line_join_source_target_list(config.skeleton_trees))
print(" CleanPackageMetadata:", yes_no_or(config.clean_package_metadata))
# If no cache directory is configured, it'll be located in the workspace which is owned by root in the
# userns so we have to run as the same user.
run(["mkdir", "-p", state.cache],
- user=state.uid if state.config.cache_path else 0,
- group=state.gid if state.config.cache_path else 0)
+ user=state.uid if state.config.cache_dir else 0,
+ group=state.gid if state.config.cache_dir else 0)
def make_install_dir(state: MkosiState) -> None:
def build_stuff(uid: int, gid: int, config: MkosiConfig) -> None:
workspace = tempfile.TemporaryDirectory(dir=config.workspace_dir or Path.cwd(), prefix=".mkosi.tmp")
workspace_dir = Path(workspace.name)
- cache = config.cache_path or workspace_dir / "cache"
+ cache = config.cache_dir or workspace_dir / "cache"
state = MkosiState(
uid=uid,
calculate_signature(state)
save_manifest(state, manifest)
- if state.config.cache_path:
- acl_toggle_remove(state.config, state.config.cache_path, state.uid, allow=True)
+ if state.config.cache_dir:
+ acl_toggle_remove(state.config, state.config.cache_dir, state.uid, allow=True)
for p in state.config.output_paths():
if state.staging.joinpath(p.name).exists():