From a49b16e3ffa14418dee305efbceb79f7424d1a90 Mon Sep 17 00:00:00 2001 From: Jonathan Lebon Date: Mon, 21 Jul 2025 15:45:36 -0400 Subject: [PATCH] bootc-base-imagectl: add --repo This is analogous to the dnf option of the same name, available in both dnf4 and dnf5. It has the same semantics as rpm-ostree's `repos` key, so we can map it directly. This will make it easier in CoreOS-land to inject our own repos and control enablement declaratively rather than have to fiddle with repo files directly. Note also that the `config-manager` dnf plugin is not installed by default in the base bootc image, and I would rather not have to install that for each compose. --- bootc-base-imagectl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bootc-base-imagectl b/bootc-base-imagectl index b20077b..f5315ee 100755 --- a/bootc-base-imagectl +++ b/bootc-base-imagectl @@ -52,6 +52,8 @@ def run_build_rootfs(args): override_manifest['sysusers'] = 'compose-forced' passwd_mode = 'nobody' if args.nobody_99 else 'none' override_manifest['variables'] = {'passwd_mode': passwd_mode} + if args.repo: + override_manifest['repos'] = args.repo tmp_manifest = None if override_manifest: @@ -154,6 +156,7 @@ if __name__ == "__main__": build_rootfs.add_argument("--no-docs", help="Don't install documentation", action='store_true') build_rootfs.add_argument("--sysusers", help="Run systemd-sysusers instead of injecting hardcoded passwd/group entries", action='store_true') build_rootfs.add_argument("--nobody-99", help=argparse.SUPPRESS, action='store_true') + build_rootfs.add_argument("--repo", help="Enable specific repositories only", action='append', default=[], metavar='REPO') build_rootfs.add_argument("source_root", help="Path to the source root directory used for dnf configuration (default=/)", nargs='?', default='/') build_rootfs.add_argument("target", help="Path to the target root directory that will be generated.") build_rootfs.set_defaults(func=run_build_rootfs)