]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
mkosi: Switch to use mkosi presets with prebuilt initrds 27442/head
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 25 Apr 2023 14:04:49 +0000 (16:04 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 1 May 2023 13:39:50 +0000 (15:39 +0200)
Instead of building the initrds for the mkosi images with dracut,
let's switch to using mkosi presets to build the initrd with mkosi
as well.

This commit splits up our single image build into three separate
mkosi presets:

1. The "base" preset. This image contains systemd and all its runtime
dependencies. The sole purpose of this image is to serve as a base image
for the initrd and the final image. It's also responsible for building
systemd from source with the build script. The results are installed into
the base image. Note that we install the systemd and udev packages into this
image as well to prevent package managers from overriding the systemd we built
from source with the distro packaged systemd if it's pulled in as a dependency
by another package from the initrd or final profiles.
2. The "initrd" preset. This image provides the initrd. It's trivial and does
nothing more than packaging the base image up as a zstd compressed initramfs and
adds /init and /etc/initrd-release symlinks to the image.
3. The "final" preset. This image builds on top of the base image and adds
a kernel and extra packages that are useful for testing and debugging.

We also split out the optional kernel build into a separate set of config files
that are only included if a kernel to build is actually provided.

Note that this commit doesn't really change anything about how mkosi is used.
The commands remain the same, except that mkosi will now build all the presets
in order. "mkosi summary" will show the summary of all the presets. "mkosi qemu,
boot, shell" will always boot the final preset. With "-f", all presets will be
built and the final one is booted. "-i" makes a cache of each preset.

The only thing to keep in mind is that specifying config via the mkosi CLI will
apply to each of the presets. e.g. any extra packages added with "-p" will be
installed in both the initrd and the final image. To apply local configuration
to a single preset, create a file 00-local.conf in
mkosi.presets/<profile>/mkosi.conf.d and put all the preset specific configuration
in there.

53 files changed:
.github/workflows/mkosi.yml
mkosi.conf.d/05-qemu-mem.conf [new file with mode: 0644]
mkosi.conf.d/10-centos.conf [moved from mkosi.conf.d/20-centos.conf with 100% similarity]
mkosi.conf.d/10-debian.conf [new file with mode: 0644]
mkosi.conf.d/10-fedora.conf [new file with mode: 0644]
mkosi.conf.d/10-opensuse.conf [new file with mode: 0644]
mkosi.conf.d/10-systemd.conf
mkosi.conf.d/10-ubuntu.conf [new file with mode: 0644]
mkosi.conf.d/11-centos-8/mkosi.conf [new file with mode: 0644]
mkosi.conf.d/11-centos-8/mkosi.reposdir/powertools.repo [moved from mkosi.conf.d/21-centos-8/mkosi.reposdir/powertools.repo with 100% similarity]
mkosi.conf.d/20-arch.conf [deleted file]
mkosi.conf.d/20-debian-ubuntu/mkosi.extra/usr/lib/systemd/system-preset/99-ignore.preset [deleted file]
mkosi.extra/root/.gdbinit [deleted file]
mkosi.extra/usr/lib/systemd/system-preset/00-mkosi.preset [deleted file]
mkosi.prepare [deleted file]
mkosi.presets/00-base/mkosi.build [moved from mkosi.build with 81% similarity]
mkosi.presets/00-base/mkosi.conf [new file with mode: 0644]
mkosi.presets/00-base/mkosi.conf.d/10-arch.conf [new file with mode: 0644]
mkosi.presets/00-base/mkosi.conf.d/10-centos-fedora.conf [moved from mkosi.conf.d/20-centos-fedora.conf with 66% similarity]
mkosi.presets/00-base/mkosi.conf.d/10-debian-ubuntu.conf [moved from mkosi.conf.d/20-debian-ubuntu/mkosi.conf with 63% similarity]
mkosi.presets/00-base/mkosi.conf.d/10-debian.conf [moved from mkosi.conf.d/20-debian.conf with 69% similarity]
mkosi.presets/00-base/mkosi.conf.d/10-fedora.conf [moved from mkosi.conf.d/20-fedora.conf with 67% similarity]
mkosi.presets/00-base/mkosi.conf.d/10-opensuse.conf [moved from mkosi.conf.d/20-opensuse.conf with 61% similarity]
mkosi.presets/00-base/mkosi.conf.d/10-ubuntu.conf [moved from mkosi.conf.d/20-ubuntu.conf with 71% similarity]
mkosi.presets/00-base/mkosi.conf.d/11-centos-8.conf [moved from mkosi.conf.d/21-centos-8/mkosi.conf with 71% similarity]
mkosi.presets/00-base/mkosi.conf.d/11-centos-9.conf [new file with mode: 0644]
mkosi.presets/00-base/mkosi.extra/usr/lib/systemd/system-preset/00-mkosi.preset [new file with mode: 0644]
mkosi.presets/00-base/mkosi.extra/usr/lib/systemd/system-preset/99-mkosi.preset [new file with mode: 0644]
mkosi.presets/00-base/mkosi.extra/usr/lib/tmpfiles.d/locale.conf [moved from mkosi.conf.d/20-debian-ubuntu/mkosi.extra/usr/lib/tmpfiles.d/locale.conf with 100% similarity]
mkosi.presets/00-base/mkosi.prepare [new file with mode: 0755]
mkosi.presets/10-initrd.conf [new file with mode: 0644]
mkosi.presets/20-final/mkosi.build [new file with mode: 0755]
mkosi.presets/20-final/mkosi.conf [new file with mode: 0644]
mkosi.presets/20-final/mkosi.conf.d/10-arch.conf [new file with mode: 0644]
mkosi.presets/20-final/mkosi.conf.d/10-centos-fedora.conf [new file with mode: 0644]
mkosi.presets/20-final/mkosi.conf.d/10-debian-ubuntu.conf [new file with mode: 0644]
mkosi.presets/20-final/mkosi.conf.d/10-debian.conf [new file with mode: 0644]
mkosi.presets/20-final/mkosi.conf.d/10-fedora.conf [new file with mode: 0644]
mkosi.presets/20-final/mkosi.conf.d/10-opensuse.conf [new file with mode: 0644]
mkosi.presets/20-final/mkosi.conf.d/10-ubuntu.conf [new file with mode: 0644]
mkosi.presets/20-final/mkosi.conf.d/11-centos-8.conf [new file with mode: 0644]
mkosi.presets/20-final/mkosi.conf.d/11-centos-9.conf [moved from mkosi.conf.d/21-centos-9.conf with 69% similarity]
mkosi.presets/20-final/mkosi.conf.d/20-kernel-arch.conf [new file with mode: 0644]
mkosi.presets/20-final/mkosi.conf.d/20-kernel-centos-fedora.conf [new file with mode: 0644]
mkosi.presets/20-final/mkosi.conf.d/20-kernel-debian-ubuntu.conf [new file with mode: 0644]
mkosi.presets/20-final/mkosi.conf.d/20-kernel-fedora.conf [new file with mode: 0644]
mkosi.presets/20-final/mkosi.conf.d/20-kernel-opensuse.conf [new file with mode: 0644]
mkosi.presets/20-final/mkosi.conf.d/20-kernel.conf [new file with mode: 0644]
mkosi.presets/20-final/mkosi.extra/etc/issue [moved from mkosi.extra/etc/issue with 100% similarity]
mkosi.presets/20-final/mkosi.extra/usr/lib/systemd/mkosi-check-and-shutdown.sh [moved from mkosi.extra/usr/lib/systemd/mkosi-check-and-shutdown.sh with 100% similarity]
mkosi.presets/20-final/mkosi.extra/usr/lib/systemd/system/mkosi-check-and-shutdown.service [moved from mkosi.extra/usr/lib/systemd/system/mkosi-check-and-shutdown.service with 100% similarity]
mkosi.presets/20-final/mkosi.kernel.config [moved from mkosi.kernel.config with 100% similarity]
mkosi.presets/20-final/mkosi.postinst [moved from mkosi.postinst with 92% similarity]

index c38a6e75b0a1ff1c68763e585d2ae95adae9b697..173caea4898a77e13633a1e8474e672c81dc6ea3 100644 (file)
@@ -73,7 +73,7 @@ jobs:
 
     steps:
     - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
-    - uses: systemd/mkosi@54f80aa8f687ed4d1759f0a7329c64c3f0ff70ad
+    - uses: systemd/mkosi@3008c7e9383669b7fb6f6afe556c6fd28f28f8f4
 
     - name: Configure
       run: |
diff --git a/mkosi.conf.d/05-qemu-mem.conf b/mkosi.conf.d/05-qemu-mem.conf
new file mode 100644 (file)
index 0000000..58de5fc
--- /dev/null
@@ -0,0 +1,11 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+# Arch and CentOS 8 Stream initrds are rather big so we need to give QEMU more memory so the kernel can load
+# them without OOMing.
+
+[Match]
+Distribution=arch centos
+Release=rolling 8
+
+[Host]
+QemuMem=3G
diff --git a/mkosi.conf.d/10-debian.conf b/mkosi.conf.d/10-debian.conf
new file mode 100644 (file)
index 0000000..0eeaf07
--- /dev/null
@@ -0,0 +1,7 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+Distribution=debian
+
+[Distribution]
+Release=testing
diff --git a/mkosi.conf.d/10-fedora.conf b/mkosi.conf.d/10-fedora.conf
new file mode 100644 (file)
index 0000000..4511dcd
--- /dev/null
@@ -0,0 +1,7 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+Distribution=fedora
+
+[Distribution]
+Release=38
diff --git a/mkosi.conf.d/10-opensuse.conf b/mkosi.conf.d/10-opensuse.conf
new file mode 100644 (file)
index 0000000..98a7b4e
--- /dev/null
@@ -0,0 +1,7 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+Distribution=opensuse
+
+[Distribution]
+Release=tumbleweed
index 2b02eba0d63ca5b05b32f391c925f9450a79de60..ad709829ba427fcd16086347992dd95e1a96e6a7 100644 (file)
@@ -10,60 +10,6 @@ OutputDirectory=mkosi.output
 [Content]
 BuildDirectory=mkosi.builddir
 CacheDirectory=mkosi.cache
-ExtraTrees=src:/root/src
-Packages=
-        acl
-        bash-completion
-        coreutils
-        diffutils
-        dnsmasq
-        dosfstools
-        dracut
-        e2fsprogs
-        findutils
-        gcc # For sanitizer libraries
-        gdb
-        grep
-        kbd
-        kexec-tools
-        kmod
-        less
-        mtools
-        nano
-        nftables
-        openssl
-        python3
-        qrencode
-        sed
-        strace
-        systemd
-        tree
-        udev
-        util-linux
-        valgrind
-        wireguard-tools
-        xfsprogs
-        zsh
-
-BuildPackages=
-        bc
-        binutils
-        bison
-        clang
-        flex
-        gcc
-        gettext
-        git
-        gperf
-        lld
-        llvm
-        make
-        meson
-        pkgconf
-        rpm
-        rsync
-        tar
-        zstd
 
 [Host]
 Acl=yes
@@ -77,7 +23,7 @@ KernelCommandLineExtra=systemd.crash_shell
                        systemd.mask=auditd
                        # Tell the kernel to only log warning and up to the console.
                        loglevel=4
-
-[Validation]
-Password=
-Autologin=yes
+                       # Disable the kernel's ratelimiting on userspace logging to kmsg.
+                       printk.devkmsg=on
+                       # Tell networkd to manage the ethernet interface.
+                       ip=enp0s1:any
diff --git a/mkosi.conf.d/10-ubuntu.conf b/mkosi.conf.d/10-ubuntu.conf
new file mode 100644 (file)
index 0000000..d6ea6d1
--- /dev/null
@@ -0,0 +1,8 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+Distribution=ubuntu
+
+[Distribution]
+Release=jammy
+Repositories=universe
diff --git a/mkosi.conf.d/11-centos-8/mkosi.conf b/mkosi.conf.d/11-centos-8/mkosi.conf
new file mode 100644 (file)
index 0000000..cde54e9
--- /dev/null
@@ -0,0 +1,5 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+Distribution=centos
+Release=8
diff --git a/mkosi.conf.d/20-arch.conf b/mkosi.conf.d/20-arch.conf
deleted file mode 100644 (file)
index 6dcbb9f..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-# SPDX-License-Identifier: LGPL-2.1-or-later
-#
-# Copyright Â© 2016 Zeal Jagannatha
-
-[Match]
-Distribution=arch
-
-[Content]
-Packages=
-        alsa-lib
-        base
-        btrfs-progs
-        compsize
-        dhcp
-        f2fs-tools
-        fuse2
-        gnutls
-        iproute
-        libbpf
-        libcap-ng
-        libfido2
-        libmicrohttpd
-        libmnl
-        libpwquality
-        libxkbcommon
-        linux
-        man-db
-        numactl
-        openbsd-netcat
-        openssh
-        polkit
-        popt
-        python-pefile
-        python-psutil
-        python-pytest
-        quota-tools
-        shadow
-        tpm2-tss
-        vim
-
-BuildPackages=
-        bpf
-        docbook-xsl
-        libxslt
-        linux-api-headers
-        pahole
-        perl
-        python-docutils
-        python-jinja
-        python-lxml
-        python-pyelftools
diff --git a/mkosi.conf.d/20-debian-ubuntu/mkosi.extra/usr/lib/systemd/system-preset/99-ignore.preset b/mkosi.conf.d/20-debian-ubuntu/mkosi.extra/usr/lib/systemd/system-preset/99-ignore.preset
deleted file mode 100644 (file)
index 43f2553..0000000
+++ /dev/null
@@ -1 +0,0 @@
-ignore *
diff --git a/mkosi.extra/root/.gdbinit b/mkosi.extra/root/.gdbinit
deleted file mode 100644 (file)
index 1a2163e..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-set debuginfod enabled off
-set build-id-verbose 0
-set substitute-path ../src /root/src
diff --git a/mkosi.extra/usr/lib/systemd/system-preset/00-mkosi.preset b/mkosi.extra/usr/lib/systemd/system-preset/00-mkosi.preset
deleted file mode 100644 (file)
index e214931..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-# SPDX-License-Identifier: LGPL-2.1-or-later
-disable ssh.service
-disable sshd.service
-disable dnsmasq.service
-disable isc-dhcp-server.service
-disable isc-dhcp-server6.service
diff --git a/mkosi.prepare b/mkosi.prepare
deleted file mode 100755 (executable)
index 7e00df0..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh
-# SPDX-License-Identifier: LGPL-2.1-or-later
-set -e
-
-if [ "$(grep '^ID=' /etc/os-release)" = "ID=\"centos\"" ] && [ "$(grep '^VERSION=' /etc/os-release)" = "VERSION=\"8\"" ]; then
-    alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 1
-    alternatives --set python3 /usr/bin/python3.9
-fi
-
-# Make sure the necessary test users are available in the build image. We do this here because the build
-# script does not run as root.
-if [ "$1" = "build" ]; then
-    for id in 1 2 3; do
-        getent group $id >/dev/null || echo "g testgroup$id $id -" | systemd-sysusers -
-    done
-fi
similarity index 81%
rename from mkosi.build
rename to mkosi.presets/00-base/mkosi.build
index 7ad3371ee7887c2f7006ce486cb3206733362a65..e19251157dd753ec818de66221c43116f01d4b7e 100755 (executable)
@@ -162,31 +162,3 @@ if [ "$WITH_TESTS" = 1 ] ; then
 fi
 
 meson install -C "$BUILDDIR" --quiet --no-rebuild --only-changed
-
-if [ -d mkosi.kernel/ ]; then
-    SRCDIR="$SRCDIR/mkosi.kernel"
-    BUILDDIR="$BUILDDIR/mkosi.kernel"
-    cd "$SRCDIR"
-    mkdir -p "$BUILDDIR"
-
-    # Ensure fast incremental builds by fixating these values which usually change for each build.
-    export KBUILD_BUILD_TIMESTAMP="Fri Jun  5 15:58:00 CEST 2015"
-    export KBUILD_BUILD_HOST="mkosi"
-
-    scripts/kconfig/merge_config.sh -O "$BUILDDIR" \
-            ../mkosi.kernel.config \
-            tools/testing/selftests/bpf/config.x86_64 \
-            tools/testing/selftests/bpf/config
-
-    # Make sure systemd-boot boots this kernel and not the distro provided one by overriding the version.
-    make O="$BUILDDIR" VERSION=99 -j "$(nproc)"
-
-    KERNEL_RELEASE=$(make O="$BUILDDIR" VERSION=99 -s kernelrelease)
-    mkdir -p "$DESTDIR/usr/lib/modules/$KERNEL_RELEASE"
-    make O="$BUILDDIR" VERSION=99 INSTALL_MOD_PATH="$DESTDIR/usr" modules_install
-    make O="$BUILDDIR" VERSION=99 INSTALL_PATH="$DESTDIR/usr/lib/modules/$KERNEL_RELEASE" install
-    mkdir -p "$DESTDIR/usr/lib/kernel/selftests"
-    make -C tools/testing/selftests -j "$(nproc)" O="$BUILDDIR" VERSION=99 KSFT_INSTALL_PATH="$DESTDIR/usr/lib/kernel/selftests" SKIP_TARGETS="" install
-
-    ln -sf /usr/lib/kernel/selftests/bpf/bpftool "$DESTDIR/usr/bin/bpftool"
-fi
diff --git a/mkosi.presets/00-base/mkosi.conf b/mkosi.presets/00-base/mkosi.conf
new file mode 100644 (file)
index 0000000..a65d427
--- /dev/null
@@ -0,0 +1,34 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Output]
+Format=directory
+
+[Content]
+Bootable=no
+BuildSources=../..
+CleanPackageMetadata=no
+Packages=
+        kmod
+        less
+        systemd
+        udev
+
+BuildPackages=
+        acl
+        diffutils
+        gawk
+        binutils
+        clang
+        gettext
+        git
+        gperf
+        grep
+        lld
+        llvm
+        make
+        meson
+        pkgconf
+        rsync
+        sed
+        tar
+        zstd
diff --git a/mkosi.presets/00-base/mkosi.conf.d/10-arch.conf b/mkosi.presets/00-base/mkosi.conf.d/10-arch.conf
new file mode 100644 (file)
index 0000000..473d199
--- /dev/null
@@ -0,0 +1,31 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+Distribution=arch
+
+[Content]
+Packages=
+        gnutls
+        libbpf
+        libfido2
+        libmicrohttpd
+        libnftnl
+        libpwquality
+        libxkbcommon
+        openssl
+        qrencode
+        systemd-sysvcompat
+        tpm2-tss
+
+BuildPackages=
+        bpf
+        docbook-xsl
+        glib2
+        libxslt
+        linux-api-headers
+        perl
+        python
+        python-jinja
+        python-lxml
+        python-pefile
+        python-pyelftools
similarity index 66%
rename from mkosi.conf.d/20-centos-fedora.conf
rename to mkosi.presets/00-base/mkosi.conf.d/10-centos-fedora.conf
index d78b924304e5628bfe3dc6cc9292e5f50002a240..090daf60db5b62a522f6253d012f922baef8ec99 100644 (file)
@@ -5,67 +5,40 @@ Distribution=centos fedora
 
 [Content]
 Packages=
-        alsa-lib
         audit-libs
-        cryptsetup
-        dhcp-server
-        dnf
-        fuse
-        glib2
-        glibc-minimal-langpack
-        glibc.i686
+        cryptsetup-libs
         gnutls
-        iproute
-        iproute-tc
-        kernel-core
         libasan
         libbpf
-        libcap-ng
-        libcap-ng-utils
         libfido2
         libgcrypt
         libmicrohttpd
-        libmnl
+        libnftnl
         libubsan
         libxcrypt
         libxkbcommon
-        netcat
-        numactl-libs
-        openssh-server
-        p11-kit
-        pam
-        passwd
-        polkit
-        popt
-        procps-ng
-        quota
+        openssl-libs
+        qrencode-libs
         tpm2-tss
         util-linux
-        vim-common
 
 BuildPackages=
         /usr/bin/pkg-config
         bpftool
         docbook-xsl
-        dwarves
-        glibc-devel.i686
-        glibc-static
-        glibc-static.i686
+        findutils
         libxslt
         pam-devel
         perl-interpreter
-        pkgconfig(alsa)
         pkgconfig(audit)
         pkgconfig(blkid)
         pkgconfig(bzip2)
         pkgconfig(dbus-1)
         pkgconfig(fdisk)
-        pkgconfig(fuse)
         pkgconfig(glib-2.0)
         pkgconfig(gnutls)
         pkgconfig(libacl)
         pkgconfig(libbpf)
-        pkgconfig(libcap-ng)
         pkgconfig(libcap)
         pkgconfig(libcryptsetup)
         pkgconfig(libcurl)
@@ -74,7 +47,7 @@ BuildPackages=
         pkgconfig(libidn2)
         pkgconfig(libkmod)
         pkgconfig(libmicrohttpd)
-        pkgconfig(libmnl)
+        pkgconfig(libnftnl)
         pkgconfig(libpcre2-8)
         pkgconfig(libqrencode)
         pkgconfig(libseccomp)
@@ -83,12 +56,12 @@ BuildPackages=
         pkgconfig(mount)
         pkgconfig(numa)
         pkgconfig(openssl)
+        pkgconfig(openssl)
         pkgconfig(p11-kit-1)
-        pkgconfig(popt)
         pkgconfig(pwquality)
         pkgconfig(tss2-esys)
         pkgconfig(tss2-mu)
         pkgconfig(tss2-rc)
         pkgconfig(valgrind)
         pkgconfig(xkbcommon)
-        python3-docutils
+        rpm
similarity index 63%
rename from mkosi.conf.d/20-debian-ubuntu/mkosi.conf
rename to mkosi.presets/00-base/mkosi.conf.d/10-debian-ubuntu.conf
index 584536ef6b90f7108b4f00dc3c9b09ab0d7235fa..f5c3afbef459f1e47980ae42716801e334a97e36 100644 (file)
@@ -5,69 +5,39 @@ Distribution=debian ubuntu
 
 [Content]
 Packages=
-        btrfs-progs
-        cryptsetup-bin
-        dbus-broker
-        default-dbus-session-bus
-        f2fs-tools
-        fdisk
-        fuse
-        gcc # Provides libasan/libubsan
-        iproute2
-        isc-dhcp-server
-        libasound2
-        libc6-i386
-        libcap-ng-utils
-        libcap-ng0
         libfdisk1
         libfido2-1
         libglib2.0-0
         libgnutls30
         libidn2-0
         libmicrohttpd12
-        libmnl0
-        libnuma1
+        libnftnl11
         libp11-kit0
         libpam0g
-        libpopt0
         libpwquality1
         libqrencode4
+        libssl3
         libtss2-dev # Use the -dev package to avoid churn in updating version numbers
-        netcat-openbsd
-        openssh-server
-        passwd
-        policykit-1
-        procps
-        python3-pefile
-        python3-psutil
-        python3-pytest
-        quota
+        systemd
         systemd-sysv
         tzdata
-        xxd
 
 BuildPackages=
         docbook-xsl
         dpkg-dev
         g++
-        gcc-multilib
         libacl1-dev
-        libasound-dev
         libaudit-dev
         libblkid-dev
         libbpf-dev
         libbz2-dev
-        libc6-dev
-        libc6-dev-i386
         libcap-dev
-        libcap-ng-dev
         libcryptsetup-dev
         libcurl4-openssl-dev
         libdbus-1-dev
         libdw-dev
         libfdisk-dev
         libfido2-dev
-        libfuse-dev
         libgcrypt20-dev
         libglib2.0-dev
         libgnutls28-dev
@@ -75,12 +45,10 @@ BuildPackages=
         libiptc-dev
         libkmod-dev
         libmicrohttpd-dev
-        libmnl-dev
         libmount-dev
-        libnuma-dev
+        libnftnl-dev
         libp11-kit-dev
         libpam0g-dev
-        libpopt-dev
         libpwquality-dev
         libqrencode-dev
         libseccomp-dev
@@ -89,9 +57,10 @@ BuildPackages=
         libxen-dev
         libxkbcommon-dev
         libzstd-dev
-        pahole
-        python3-docutils
+        python3
         python3-jinja2
         python3-lxml
+        python3-pefile
         python3-pyelftools
+        python3-pytest
         xsltproc
similarity index 69%
rename from mkosi.conf.d/20-debian.conf
rename to mkosi.presets/00-base/mkosi.conf.d/10-debian.conf
index c251ab6542b687c6569bf4b6b7902d4079f8ad3c..020b02b61c26931fb7dec70c77f8274e1dfbaef5 100644 (file)
@@ -3,13 +3,9 @@
 [Match]
 Distribution=debian
 
-[Distribution]
-Release=testing
-
 [Content]
 Packages=
         libbpf1
-        linux-image-cloud-amd64
 
 BuildPackages=
         bpftool
similarity index 67%
rename from mkosi.conf.d/20-fedora.conf
rename to mkosi.presets/00-base/mkosi.conf.d/10-fedora.conf
index 1574420487064a8ec7c7f5b69fc31a0d557ef684..035715979c77dcc850f097c551753139e502715e 100644 (file)
@@ -3,22 +3,13 @@
 [Match]
 Distribution=fedora
 
-[Distribution]
-Release=38
-
 [Content]
-Packages=
-        btrfs-progs
-        compsize
-        f2fs-tools
-        python3dist(pefile)
-        python3dist(psutil)
-        python3dist(pytest)
-
 BuildPackages=
-        libcap-static
         pkgconfig(libgcrypt)
         pkgconfig(xencontrol)
+        python3
         python3dist(jinja2)
         python3dist(lxml)
+        python3dist(pefile)
         python3dist(pyelftools)
+        python3dist(pytest)
similarity index 61%
rename from mkosi.conf.d/20-opensuse.conf
rename to mkosi.presets/00-base/mkosi.conf.d/10-opensuse.conf
index caf84ba0ab52599d60b427c4a9300fcfb57f7190..b8bce7148ea8e7c7a18afa0c2ed4ee609e2e95dc 100644 (file)
@@ -3,23 +3,13 @@
 [Match]
 Distribution=opensuse
 
-[Distribution]
-Release=tumbleweed
-
 [Content]
+# We install gawk, gzip, grep, xz here explicitly so that the busybox versions don't get installed instead.
 Packages=
-        btrfs-progs
-        dbus-1
-        f2fs-tools
-        fuse
-        gcc # Provides libasan/libubsan
-        glibc-32bit
-        glibc-locale-base
-        kernel-default
-        libasound2
+        gawk
+        grep
+        gzip
         libbpf1
-        libcap-ng-utils
-        libcap-ng0
         libcrypt1
         libcryptsetup12
         libdw1
@@ -28,48 +18,34 @@ Packages=
         libgcrypt20
         libglib-2_0-0
         libkmod2
-        liblz4-1
-        libmnl0
         libmount1
-        libnuma1
+        libnftnl11
+        libopenssl3
         libp11-kit0
-        libpopt0
         libqrencode4
         libseccomp2
         libxkbcommon0
-        openssh-server
+        libzstd1
         pam
-        python3-pefile
-        python3-psutil
-        python3-pytest
         shadow
         tpm2-0-tss
-        vim
+        xz
 
 BuildPackages=
-        alsa-devel
         audit-devel
         bpftool
         dbus-1-devel
         docbook-xsl-stylesheets
-        dwarves
         fdupes
-        fuse-devel
-        gcc-32bit
         gcc-c++
         glib2-devel
-        glibc-devel-32bit
-        glibc-devel-static-32bit
         glibc-locale
-        glibc-static
         intltool
         libacl-devel
         libapparmor-devel
         libblkid-devel
         libbpf-devel
-        libbz2-devel
         libcap-devel
-        libcap-ng-devel
         libcryptsetup-devel
         libcurl-devel
         libdw-devel
@@ -79,34 +55,27 @@ BuildPackages=
         libgcrypt-devel
         libgnutls-devel
         libkmod-devel
-        liblz4-devel
         libmicrohttpd-devel
-        libmnl-devel
         libmount-devel
-        libnuma-devel
+        libnftnl-devel
         libpwquality-devel
         libseccomp-devel
         libselinux-devel
         libxkbcommon-devel
         libxslt-tools
+        libzstd-devel
         openssl-devel
         pam-devel
         pciutils-devel
-        pcre-devel
-        popt-devel
-        python3-docutils
+        python3
         python3-Jinja2
         python3-lxml
+        python3-pefile
         python3-pyelftools
+        python3-pytest
         qrencode-devel
         shadow
-        system-group-obsolete
-        system-user-bin
-        system-user-daemon
-        system-user-nobody
-        system-user-root
         systemd-sysvinit
         timezone
         tpm2-0-tss-devel
         xen-devel
-        zlib-devel
similarity index 71%
rename from mkosi.conf.d/20-ubuntu.conf
rename to mkosi.presets/00-base/mkosi.conf.d/10-ubuntu.conf
index 036c1734b26135e8041f46ac5e909a7cb795cc4b..717809fd03c1d71562af4214871ae9355d78316b 100644 (file)
@@ -3,14 +3,9 @@
 [Match]
 Distribution=ubuntu
 
-[Distribution]
-Release=jammy
-Repositories=universe
-
 [Content]
 Packages=
         libbpf0
-        linux-virtual
 
 BuildPackages=
         linux-tools-common
similarity index 71%
rename from mkosi.conf.d/21-centos-8/mkosi.conf
rename to mkosi.presets/00-base/mkosi.conf.d/11-centos-8.conf
index d610212b611b4d1de10b833fccc0d9e2c04d6197..ef001c92c9a246742672a5191d794083d34f4ed0 100644 (file)
@@ -5,15 +5,12 @@ Distribution=centos
 Release=8
 
 [Content]
-Packages=
-        python39
-        python3.9dist(pefile)
-        python3.9dist(pluggy) # python39-pluggy is a pytest dependency that's not installed for some reason.
-        python3.9dist(psutil)
-        python3.9dist(pytest)
-
 BuildPackages=
         libgcrypt-devel # CentOS Stream 8 libgcrypt-devel doesn't ship a pkg-config file.
+        platform-python
         python3.9dist(jinja2)
         python3.9dist(lxml)
+        python3.9dist(pefile)
         python3.9dist(pyelftools)
+        python3.9dist(pytest)
+        python39
diff --git a/mkosi.presets/00-base/mkosi.conf.d/11-centos-9.conf b/mkosi.presets/00-base/mkosi.conf.d/11-centos-9.conf
new file mode 100644 (file)
index 0000000..61c1d27
--- /dev/null
@@ -0,0 +1,15 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+Distribution=centos
+Release=9
+
+[Content]
+BuildPackages=
+        pkgconfig(libgcrypt)
+        platform-python
+        python3dist(jinja2)
+        python3dist(lxml)
+        python3dist(pefile)
+        python3dist(pyelftools)
+        python3dist(pytest)
diff --git a/mkosi.presets/00-base/mkosi.extra/usr/lib/systemd/system-preset/00-mkosi.preset b/mkosi.presets/00-base/mkosi.extra/usr/lib/systemd/system-preset/00-mkosi.preset
new file mode 100644 (file)
index 0000000..64baf3b
--- /dev/null
@@ -0,0 +1,19 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+# mkosi adds its own ssh units via the --ssh switch so disable the default ones.
+disable ssh.service
+disable sshd.service
+
+# These are started manually in integration tests so don't start them by default.
+disable dnsmasq.service
+disable isc-dhcp-server.service
+disable isc-dhcp-server6.service
+
+# Pulled in via dracut-network by kexec-tools on Fedora.
+disable NetworkManager.service
+
+# Make sure dbus-broker is started by default on Debian/Ubuntu.
+enable dbus-broker.service
+
+# systemd-networkd is disabled by default on Fedora so make sure it is enabled.
+enable systemd-networkd.service
diff --git a/mkosi.presets/00-base/mkosi.extra/usr/lib/systemd/system-preset/99-mkosi.preset b/mkosi.presets/00-base/mkosi.extra/usr/lib/systemd/system-preset/99-mkosi.preset
new file mode 100644 (file)
index 0000000..710ee7c
--- /dev/null
@@ -0,0 +1,4 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+# Make sure that services are disabled by default (primarily for Debian/Ubuntu).
+disable *
diff --git a/mkosi.presets/00-base/mkosi.prepare b/mkosi.presets/00-base/mkosi.prepare
new file mode 100755 (executable)
index 0000000..269ba3e
--- /dev/null
@@ -0,0 +1,18 @@
+#!/bin/sh
+# SPDX-License-Identifier: LGPL-2.1-or-later
+set -e
+
+if [ "$1" = "build" ]; then
+    . /etc/os-release
+
+    if [ "$ID" = "centos" ] && [ "$VERSION" = "8" ]; then
+        alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 1
+        alternatives --set python3 /usr/bin/python3.9
+    fi
+
+    # Make sure the necessary test users are available in the build image. We do this here because the build
+    # script does not run as root.
+    for id in 1 2 3; do
+        getent group $id >/dev/null || echo "g testgroup$id $id -" | systemd-sysusers -
+    done
+fi
diff --git a/mkosi.presets/10-initrd.conf b/mkosi.presets/10-initrd.conf
new file mode 100644 (file)
index 0000000..4201770
--- /dev/null
@@ -0,0 +1,20 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Output]
+Format=cpio
+# TODO: Switch to zstd once we stop building CentOS Stream 8.
+CompressOutput=xz
+
+[Content]
+BaseTrees=mkosi.output/base
+MakeInitrd=yes
+
+# Arch Linux doesn't split their gcc-libs package so we manually remove unneeded stuff here to make sure it
+# doesn't end up in the initrd.
+RemoveFiles=
+        /usr/lib/libgfortran.so*
+        /usr/lib/libgo.so*
+        /usr/lib/libgomp.so*
+        /usr/lib/libgphobos.so*
+        /usr/lib/libobjc.so*
+        /usr/lib/libstdc++.so*
diff --git a/mkosi.presets/20-final/mkosi.build b/mkosi.presets/20-final/mkosi.build
new file mode 100755 (executable)
index 0000000..ed355ab
--- /dev/null
@@ -0,0 +1,32 @@
+#!/bin/sh
+# SPDX-License-Identifier: LGPL-2.1-or-later
+set -e
+
+if [ -d "$SRCDIR"/mkosi.kernel/ ]; then
+    SRCDIR="$SRCDIR/mkosi.kernel"
+    BUILDDIR="$BUILDDIR/mkosi.kernel"
+    cd "$SRCDIR"
+    mkdir -p "$BUILDDIR"
+
+    # Ensure fast incremental builds by fixating these values which usually change for each build.
+    export KBUILD_BUILD_TIMESTAMP="Fri Jun  5 15:58:00 CEST 2015"
+    export KBUILD_BUILD_HOST="mkosi"
+
+    scripts/kconfig/merge_config.sh -O "$BUILDDIR" \
+            ../mkosi.kernel.config \
+            tools/testing/selftests/bpf/config.x86_64 \
+            tools/testing/selftests/bpf/config
+
+    # Make sure systemd-boot boots this kernel and not the distro provided one by overriding the version.
+    make O="$BUILDDIR" VERSION=99 -j "$(nproc)"
+
+    KERNEL_RELEASE=$(make O="$BUILDDIR" VERSION=99 -s kernelrelease)
+    mkdir -p "$DESTDIR/usr/lib/modules/$KERNEL_RELEASE"
+    make O="$BUILDDIR" VERSION=99 INSTALL_MOD_PATH="$DESTDIR/usr" modules_install
+    make O="$BUILDDIR" VERSION=99 INSTALL_PATH="$DESTDIR/usr/lib/modules/$KERNEL_RELEASE" install
+    mkdir -p "$DESTDIR/usr/lib/kernel/selftests"
+    make -C tools/testing/selftests -j "$(nproc)" O="$BUILDDIR" VERSION=99 KSFT_INSTALL_PATH="$DESTDIR/usr/lib/kernel/selftests" SKIP_TARGETS="" install
+
+    mkdir -p "$DESTDIR"/usr/bin
+    ln -sf /usr/lib/kernel/selftests/bpf/bpftool "$DESTDIR/usr/bin/bpftool"
+fi
diff --git a/mkosi.presets/20-final/mkosi.conf b/mkosi.presets/20-final/mkosi.conf
new file mode 100644 (file)
index 0000000..d15a17a
--- /dev/null
@@ -0,0 +1,38 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Content]
+BaseTrees=../../mkosi.output/base
+ExtraTrees=../../src:/root/src
+Initrds=../../mkosi.output/initrd.cpio.xz
+Packages=
+        acl
+        bash-completion
+        coreutils
+        diffutils
+        dnsmasq
+        dosfstools
+        e2fsprogs
+        findutils
+        gcc # Sanitizer libraries
+        gdb
+        grep
+        kbd
+        kexec-tools
+        less
+        mtools
+        nano
+        nftables
+        openssl
+        qrencode
+        sed
+        strace
+        tree
+        util-linux
+        valgrind
+        wireguard-tools
+        xfsprogs
+        zsh
+
+[Validation]
+Password=
+Autologin=yes
diff --git a/mkosi.presets/20-final/mkosi.conf.d/10-arch.conf b/mkosi.presets/20-final/mkosi.conf.d/10-arch.conf
new file mode 100644 (file)
index 0000000..b0bbcf0
--- /dev/null
@@ -0,0 +1,25 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+Distribution=arch
+
+[Content]
+Packages=
+        btrfs-progs
+        compsize
+        dhcp
+        f2fs-tools
+        glib2
+        iproute
+        linux
+        man-db
+        openbsd-netcat
+        openssh
+        polkit
+        python-pefile
+        python-psutil
+        python-pytest
+        python3
+        quota-tools
+        shadow
+        vim
diff --git a/mkosi.presets/20-final/mkosi.conf.d/10-centos-fedora.conf b/mkosi.presets/20-final/mkosi.conf.d/10-centos-fedora.conf
new file mode 100644 (file)
index 0000000..d89f827
--- /dev/null
@@ -0,0 +1,24 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+Distribution=centos fedora
+
+[Content]
+Packages=
+        cryptsetup
+        dhcp-server
+        dnf
+        glib2
+        iproute
+        iproute-tc
+        kernel-core
+        libcap-ng-utils
+        netcat
+        openssh-server
+        p11-kit
+        pam
+        passwd
+        polkit
+        procps-ng
+        quota
+        vim-common
diff --git a/mkosi.presets/20-final/mkosi.conf.d/10-debian-ubuntu.conf b/mkosi.presets/20-final/mkosi.conf.d/10-debian-ubuntu.conf
new file mode 100644 (file)
index 0000000..804aa67
--- /dev/null
@@ -0,0 +1,27 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+Distribution=debian ubuntu
+
+[Content]
+Packages=
+        btrfs-progs
+        cryptsetup-bin
+        dbus-broker
+        default-dbus-session-bus
+        f2fs-tools
+        fdisk
+        iproute2
+        isc-dhcp-server
+        libcap-ng-utils
+        netcat-openbsd
+        openssh-server
+        passwd
+        policykit-1
+        procps
+        python3
+        python3-pefile
+        python3-psutil
+        python3-pytest
+        quota
+        xxd
diff --git a/mkosi.presets/20-final/mkosi.conf.d/10-debian.conf b/mkosi.presets/20-final/mkosi.conf.d/10-debian.conf
new file mode 100644 (file)
index 0000000..3eb7a54
--- /dev/null
@@ -0,0 +1,8 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+Distribution=debian
+
+[Content]
+Packages=
+        linux-image-cloud-amd64
diff --git a/mkosi.presets/20-final/mkosi.conf.d/10-fedora.conf b/mkosi.presets/20-final/mkosi.conf.d/10-fedora.conf
new file mode 100644 (file)
index 0000000..5ae623e
--- /dev/null
@@ -0,0 +1,14 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+Distribution=fedora
+
+[Content]
+Packages=
+        btrfs-progs
+        compsize
+        f2fs-tools
+        python3
+        python3dist(pefile)
+        python3dist(psutil)
+        python3dist(pytest)
diff --git a/mkosi.presets/20-final/mkosi.conf.d/10-opensuse.conf b/mkosi.presets/20-final/mkosi.conf.d/10-opensuse.conf
new file mode 100644 (file)
index 0000000..f948dd6
--- /dev/null
@@ -0,0 +1,22 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+Distribution=opensuse
+
+[Content]
+Packages=
+        btrfs-progs
+        cryptsetup
+        dbus-broker
+        f2fs-tools
+        glibc-locale-base
+        kernel-default
+        libcap-ng-utils
+        openssh-server
+        python3
+        python3-pefile
+        python3-psutil
+        python3-pytest
+        quota
+        shadow
+        vim
diff --git a/mkosi.presets/20-final/mkosi.conf.d/10-ubuntu.conf b/mkosi.presets/20-final/mkosi.conf.d/10-ubuntu.conf
new file mode 100644 (file)
index 0000000..eb88ca7
--- /dev/null
@@ -0,0 +1,8 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+Distribution=ubuntu
+
+[Content]
+Packages=
+        linux-virtual
diff --git a/mkosi.presets/20-final/mkosi.conf.d/11-centos-8.conf b/mkosi.presets/20-final/mkosi.conf.d/11-centos-8.conf
new file mode 100644 (file)
index 0000000..2fa4764
--- /dev/null
@@ -0,0 +1,14 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+Distribution=centos
+Release=8
+
+[Content]
+Packages=
+        platform-python
+        python3.9dist(pefile)
+        python3.9dist(pluggy) # python39-pluggy is a pytest dependency that's not installed for some reason.
+        python3.9dist(psutil)
+        python3.9dist(pytest)
+        python39
similarity index 69%
rename from mkosi.conf.d/21-centos-9.conf
rename to mkosi.presets/20-final/mkosi.conf.d/11-centos-9.conf
index 0febf2c2eeb6ed092c348ad8da9e04c389df1fdd..d6ab3ee1c304d1f40a8041fbbb0befac76035b0d 100644 (file)
@@ -6,13 +6,8 @@ Release=9
 
 [Content]
 Packages=
+        platform-python
         python3dist(pefile)
         python3dist(pluggy) # python39-pluggy is a pytest dependency that's not installed for some reason.
         python3dist(psutil)
         python3dist(pytest)
-
-BuildPackages=
-        pkgconfig(libgcrypt)
-        python3dist(jinja2)
-        python3dist(lxml)
-        python3dist(pyelftools)
diff --git a/mkosi.presets/20-final/mkosi.conf.d/20-kernel-arch.conf b/mkosi.presets/20-final/mkosi.conf.d/20-kernel-arch.conf
new file mode 100644 (file)
index 0000000..6ac0b58
--- /dev/null
@@ -0,0 +1,20 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+PathExists=mkosi.kernel/
+Distribution=arch
+
+[Content]
+Packages=
+        alsa-lib
+        fuse2
+        libcap
+        libcap-ng
+        libelf
+        libmnl
+        numactl
+        popt
+
+BuildPackages=
+        pahole
+        python-docutils
diff --git a/mkosi.presets/20-final/mkosi.conf.d/20-kernel-centos-fedora.conf b/mkosi.presets/20-final/mkosi.conf.d/20-kernel-centos-fedora.conf
new file mode 100644 (file)
index 0000000..c42f991
--- /dev/null
@@ -0,0 +1,34 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+PathExists=mkosi.kernel/
+Distribution=centos fedora
+
+[Content]
+Packages=
+        alsa-lib
+        elfutils-libelf
+        fuse
+        glibc.i686
+        libcap
+        libcap-ng
+        libcap-ng-utils
+        libmnl
+        numactl-libs
+        popt
+
+BuildPackages=
+        dwarves
+        glibc-devel.i686
+        glibc-static
+        glibc-static.i686
+        pkgconfig(alsa)
+        pkgconfig(fuse)
+        pkgconfig(libcap-ng)
+        pkgconfig(libcap)
+        pkgconfig(libelf)
+        pkgconfig(libmnl)
+        pkgconfig(numa)
+        pkgconfig(openssl)
+        pkgconfig(popt)
+        python3-docutils
diff --git a/mkosi.presets/20-final/mkosi.conf.d/20-kernel-debian-ubuntu.conf b/mkosi.presets/20-final/mkosi.conf.d/20-kernel-debian-ubuntu.conf
new file mode 100644 (file)
index 0000000..00338fa
--- /dev/null
@@ -0,0 +1,32 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+PathExists=mkosi.kernel/
+Distribution=debian ubuntu
+
+[Content]
+Packages=
+        fuse
+        libasound2
+        libc6-i386
+        libcap-ng0
+        libcap2
+        libelf1
+        libmnl0
+        libnuma1
+        libpopt0
+
+BuildPackages=
+        gcc-multilib
+        libasound-dev
+        libc6-dev
+        libc6-dev-i686
+        libcap-ng-dev
+        libcap-dev
+        libelf-dev
+        libfuse-dev
+        libmnl-dev
+        libnuma-dev
+        libpopt-dev
+        pahole
+        python3-docutils
diff --git a/mkosi.presets/20-final/mkosi.conf.d/20-kernel-fedora.conf b/mkosi.presets/20-final/mkosi.conf.d/20-kernel-fedora.conf
new file mode 100644 (file)
index 0000000..ea94c14
--- /dev/null
@@ -0,0 +1,9 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+PathExists=mkosi.kernel/
+Distribution=fedora
+
+[Content]
+BuildPackages=
+        libcap-static
diff --git a/mkosi.presets/20-final/mkosi.conf.d/20-kernel-opensuse.conf b/mkosi.presets/20-final/mkosi.conf.d/20-kernel-opensuse.conf
new file mode 100644 (file)
index 0000000..aec631f
--- /dev/null
@@ -0,0 +1,35 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+PathExists=mkosi.kernel/
+Distribution=opensuse
+
+[Content]
+Packages=
+        fuse
+        glibc-32bit
+        libasound2
+        libcap-ng0
+        libcap2
+        libelf1
+        libmnl0
+        libnuma1
+        libpopt0
+
+BuildPackages=
+        alsa-devel
+        dwarves
+        fuse-devel
+        gcc-32bit
+        glibc-devel-32bit
+        glibc-devel-static-32bit
+        glibc-static
+        libcap-devel
+        libcap-ng-dev
+        libelf-devel
+        liblz4-dev
+        libmnl-dev
+        libnuma-devel
+        pcre-devel
+        popt-devel
+        python3-docutils
diff --git a/mkosi.presets/20-final/mkosi.conf.d/20-kernel.conf b/mkosi.presets/20-final/mkosi.conf.d/20-kernel.conf
new file mode 100644 (file)
index 0000000..5505b41
--- /dev/null
@@ -0,0 +1,20 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+PathExists=mkosi.kernel/
+
+[Content]
+BuildSources=./
+BuildPackages=
+        bc
+        binutils
+        bison
+        clang
+        flex
+        gcc
+        lld
+        llvm
+        make
+        make
+        rsync
+        tar
similarity index 92%
rename from mkosi.postinst
rename to mkosi.presets/20-final/mkosi.postinst
index 82c23cf87a64b4a13b9e311a6557d807747e0b6c..4339d7fd220289ea3b3bd931073479ebe1e253a3 100755 (executable)
@@ -73,3 +73,10 @@ fi
 
 # Let tmpfiles.d/systemd-resolve.conf handle the symlink
 rm -f /etc/resolv.conf
+
+. /etc/os-release
+
+if [ "$ID" = "centos" ] && [ "$VERSION" = "8" ]; then
+    alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 1
+    alternatives --set python3 /usr/bin/python3.9
+fi