kernel images is trivial and fast these days.
- Support for --qemu-boot was dropped
- Support for --use-host-repositories was dropped, use --repository-directory instead
-- `RepositoryDirectory` was renamed to `RepositoryDirectories` and now takes a comma-separated
- list of directories to look for extra repository files.
+- `RepositoryDirectory` was removed, use `PackageManagerTrees=` or `SkeletonTrees=` instead.
- `--repositories` is now only usable on Debian/RPM based distros and can only be used to enable additional
repositories. Specifically, it cannot be used on Arch Linux anymore to add new repositories.
- The `_epel` distributions were removed. Use `--repositories=epel` instead to enable
Linux, additional repositories must be passed in the form `<name>::<url>`
(e.g. `myrepo::https://myrepo.net`).
-`RepositoryDirectories`, `--repo-dir=`
-
-: This option can (for now) only be used with RPM-based distributions,
- Debian-based distributions and Arch Linux. It takes a comma separated list of
- directories containing extra repository definitions that will be used when
- installing packages. The files are passed directly to the corresponding
- package manager and should be written in the format expected by the package
- manager of the image's distro.
-
`Architecture=`, `--architecture=`
: The architecture to build the image for. A number of architectures can be specified, but which ones are
build result of a preceding run might be copied into a build image
as part of the source tree (see above).
-* The **`mkosi.reposdir/`** directory, if it exists, is automatically
- used as the repository directory for extra repository files. See
- the `RepositoryDirectories` option for more information.
-
* The **`mkosi.credentials/`** directory is used as a
source of extra credentials similar to the `Credentials=` option. For
each file in the directory, the filename will be used as the credential
*(["--mirror", state.config.mirror] if state.config.mirror else []),
"--repository-key-check", yes_no(state.config.repository_key_check),
"--repositories", ",".join(state.config.repositories),
- "--repo-dir", ",".join(str(p) for p in state.config.repo_dirs),
*(["--compress-output", str(state.config.compress_output)] if state.config.compress_output else []),
"--with-network", yes_no(state.config.with_network),
"--cache-only", yes_no(state.config.cache_only),
local_mirror: Optional[str]
repository_key_check: bool
repositories: list[str]
- repo_dirs: list[Path]
repart_dirs: list[Path]
overlay: bool
architecture: Architecture
section="Distribution",
parse=config_make_list_parser(delimiter=","),
),
- MkosiConfigSetting(
- dest="repo_dirs",
- name="RepositoryDirectories",
- section="Distribution",
- parse=config_make_list_parser(delimiter=",", parse=make_path_parser()),
- paths=("mkosi.reposdir",),
- ),
MkosiConfigSetting(
dest="output_format",
name="Format",
help="Repositories to use",
action=action,
)
- group.add_argument(
- "--repo-dir",
- metavar="PATH",
- help="Specify a directory containing extra distribution specific repository files",
- dest="repo_dirs",
- action=action,
- )
group = parser.add_argument_group("Output options")
group.add_argument(
die("UEFI SecureBoot enabled, but couldn't find certificate.",
hint="Consider placing it in mkosi.crt")
- if args.repo_dirs and not (
- is_dnf_distribution(args.distribution)
- or is_apt_distribution(args.distribution)
- or args.distribution == Distribution.arch
- ):
- die("--repo-dir is only supported on DNF/Debian based distributions and Arch")
-
if args.qemu_kvm == ConfigFeature.enabled and not qemu_check_kvm_support():
die("Sorry, the host machine does not support KVM acceleration.")
)
)
- for d in state.config.repo_dirs:
- f.write(f"Include = {d}/*\n")
return invoke_pacman(state, packages, apivfs=apivfs)
for repo in repos:
f.write(f"{repo}\n")
- for repo_dir in state.config.repo_dirs:
- for src in repo_dir.iterdir():
- if not src.is_file():
- continue
- if src.suffix in (".list", ".sources"):
- shutil.copyfile(src, state.workspace.joinpath("pkgmngr/etc/apt/sources.list.d", src.name))
-
def invoke_apt(
state: MkosiState,
with sources.open("w") as f:
for repo in repos:
f.write(f"{repo}\n")
-
- # Already contains a merged tree of repo_dirs after setup_apt
- for src in state.workspace.joinpath("pkgmngr/etc/apt/sources.list.d").iterdir():
- dst = state.root.joinpath("etc/apt/sources.list.d", src.name)
- if dst.exists():
- continue
- shutil.copyfile(src, dst)
"--setopt=keepcache=1",
"--setopt=install_weak_deps=0",
f"--setopt=cachedir={state.cache_dir}",
- f"--setopt=reposdir={' '.join(str(p) for p in state.config.repo_dirs)}",
f"--setopt=varsdir={state.pkgmngr / 'etc/dnf/vars'}",
f"--setopt=logdir={state.pkgmngr / 'var/log'}",
f"--setopt=persistdir={state.pkgmngr / 'var/lib/dnf'}",