diff --git a/samples/base-qcow2.json b/samples/base-qcow2.json index a2931d6a..97b03177 100644 --- a/samples/base-qcow2.json +++ b/samples/base-qcow2.json @@ -23,6 +23,9 @@ "qemu-guest-agent", "xen-libs", "langpacks-en" + ], + "exclude-packages": [ + "dracut-config-rescue" ] } }, diff --git a/stages/org.osbuild.dnf b/stages/org.osbuild.dnf index 70e053b6..26283e9e 100755 --- a/stages/org.osbuild.dnf +++ b/stages/org.osbuild.dnf @@ -60,6 +60,7 @@ def main(tree, options): basearch = options["basearch"] operation = options.get("operation", "install") weak_deps = options.get("install_weak_deps", True) + exclude_packages = options.get("exclude-packages", []) with open("/tmp/dnf.conf", "w") as conf: for repoid, repo in enumerate(repos): @@ -101,6 +102,8 @@ def main(tree, options): ] cmd = base_cmd + [operation] + packages + for x in exclude_packages: + cmd += ["--exclude", x] print(" ".join(cmd), flush=True) subprocess.run(cmd, check=True)