]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
mkosi: Use globs instead of prepare script to install extra packages
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 10 Feb 2023 14:33:31 +0000 (15:33 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 10 Feb 2023 15:05:32 +0000 (16:05 +0100)
This allows us to install everything in the same dnf command instead
of having to use a prepare script to run dnf from within the image.

This is a hack until mkosi supports release specific dropin files.

mkosi.conf.d/centos/10-centos.conf
mkosi.prepare

index ce6eafe31b103ab4f87444248b3a8943a4a3aeb2..94aeaed9c9cc3b85626f3e3f7bf3d5d75eaab232 100644 (file)
@@ -3,6 +3,10 @@
 # This is a settings file for OS image generation using mkosi (https://github.com/systemd/mkosi).
 # Symlink this file to mkosi.default in the project root directory and invoke "mkosi" to build an OS image.
 
+# We use python3*dist() throughout this file because we need to make sure the python3.9dis() packages are
+# installed on CentOS Stream 8. mkosi doesn't support release specific configuration yet so we use the globs
+# to get the necessary packages on both CentOS Stream 8 and CentOS Stream 9.
+
 [Distribution]
 Distribution=centos
 Repositories=epel
@@ -37,7 +41,10 @@ Packages=
         polkit
         popt
         procps-ng
-        python3dist(pefile)
+        python3*dist(pefile)
+        python3*dist(pluggy) # python39-pluggy is a pytest dependency that's not installed for some reason.
+        python3*dist(pytest)
+        python39
         quota
         tpm2-tss
         vim-common
@@ -91,7 +98,6 @@ BuildPackages=
         pkgconfig(tss2-rc)
         pkgconfig(valgrind)
         pkgconfig(xkbcommon)
-        python3dist(docutils)
-        python3dist(jinja2)
-        python3dist(lxml)
-        python3dist(pytest)
+        python3*dist(docutils)
+        python3*dist(jinja2)
+        python3*dist(lxml)
index 3fcfe26c15b64eceb321547c20d31d68fd1df62f..7e00df015259649c533c9ccbea3c7bf89e0ff6e4 100755 (executable)
@@ -3,17 +3,6 @@
 set -e
 
 if [ "$(grep '^ID=' /etc/os-release)" = "ID=\"centos\"" ] && [ "$(grep '^VERSION=' /etc/os-release)" = "VERSION=\"8\"" ]; then
-    # python39-pluggy is a pytest dependency that's not installed for some reason.
-    dnf \
-        -y \
-        --enablerepo=powertools \
-         --setopt=powertools.module_hotfixes=true \
-         install \
-         python39 \
-         python39-pefile \
-         python39-jinja2 \
-         python39-pytest \
-         python39-pluggy
     alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 1
     alternatives --set python3 /usr/bin/python3.9
 fi