Skip to content

Commit 86fe0f4

Browse files
committed
dnf: Give advanced users some control over plugins
Let's add some environment variables to control plugins for cases where users have some dnf plugin they can't touch on their host system which doesn't behave properly in mkosi-sandbox and which they can't remove themselves.
1 parent 50a1fee commit 86fe0f4

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

mkosi/installer/dnf.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,11 @@ def cmd(
169169
"--setopt=persistdir=/buildroot/var/lib/dnf",
170170
]
171171

172+
if plugins := context.config.environment.get("MKOSI_DNF_DISABLE_PLUGINS"):
173+
cmdline += [f"--disableplugin={plugins}"]
174+
if plugins := context.config.environment.get("MKOSI_DNF_ENABLE_PLUGINS"):
175+
cmdline += [f"--enableplugin={plugins}"]
176+
172177
if ARG_DEBUG.get():
173178
cmdline += ["--setopt=debuglevel=10"]
174179

mkosi/resources/man/mkosi.1.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3127,6 +3127,12 @@ repository.
31273127
* `$MKOSI_DNF` can be used to override the executable used as **dnf**.
31283128
This is particularly useful to select between **dnf** and **dnf5**.
31293129

3130+
* `$MKOSI_DNF_DISABLE_PLUGINS` can be used to disable dnf plugins. The value
3131+
is forwarded to dnf's `--disableplugin=` option.
3132+
3133+
* `$MKOSI_DNF_ENABLE_PLUGINS` can be used to enable dnf plugins. The value
3134+
is forwarded to dnf's `--enableplugin=` option.
3135+
31303136
* `$EPEL_MIRROR` can be used to override the default mirror location
31313137
used for the epel repositories when `Mirror=` is used. By default
31323138
**mkosi** looks for the epel repositories in the `fedora` subdirectory of

0 commit comments

Comments
 (0)