]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Update to mkosi v19
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 28 Nov 2023 17:38:22 +0000 (18:38 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 28 Nov 2023 18:54:58 +0000 (19:54 +0100)
- Use mkosi.images/ instead of mkosi.presets/
- Use the .chroot suffix to run scripts in the image
- Use BuildSources= match for the kernel build
- Move 10-systemd.conf to mkosi.conf and rely on mkosi.local.conf
  for local configuration

63 files changed:
.github/workflows/mkosi.yml
.gitignore
docs/HACKING.md
docs/TESTING_WITH_SANITIZERS.md
mkosi.conf [moved from mkosi.conf.d/10-systemd.conf with 98% similarity]
mkosi.images/base/mkosi.build.chroot [moved from mkosi.presets/base/mkosi.build with 95% similarity]
mkosi.images/base/mkosi.conf [moved from mkosi.presets/base/mkosi.conf with 100% similarity]
mkosi.images/base/mkosi.conf.d/10-arch.conf [moved from mkosi.presets/base/mkosi.conf.d/10-arch.conf with 100% similarity]
mkosi.images/base/mkosi.conf.d/10-centos-fedora.conf [moved from mkosi.presets/base/mkosi.conf.d/10-centos-fedora.conf with 100% similarity]
mkosi.images/base/mkosi.conf.d/10-debian-ubuntu.conf [moved from mkosi.presets/base/mkosi.conf.d/10-debian-ubuntu.conf with 100% similarity]
mkosi.images/base/mkosi.conf.d/10-debian.conf [moved from mkosi.presets/base/mkosi.conf.d/10-debian.conf with 100% similarity]
mkosi.images/base/mkosi.conf.d/10-fedora.conf [moved from mkosi.presets/base/mkosi.conf.d/10-fedora.conf with 100% similarity]
mkosi.images/base/mkosi.conf.d/10-opensuse.conf [moved from mkosi.presets/base/mkosi.conf.d/10-opensuse.conf with 100% similarity]
mkosi.images/base/mkosi.conf.d/10-ubuntu.conf [moved from mkosi.presets/base/mkosi.conf.d/10-ubuntu.conf with 100% similarity]
mkosi.images/base/mkosi.extra/usr/lib/systemd/system-preset/00-mkosi.preset [moved from mkosi.presets/base/mkosi.extra/usr/lib/systemd/system-preset/00-mkosi.preset with 100% similarity]
mkosi.images/base/mkosi.extra/usr/lib/systemd/system-preset/99-mkosi.preset [moved from mkosi.presets/base/mkosi.extra/usr/lib/systemd/system-preset/99-mkosi.preset with 100% similarity]
mkosi.images/base/mkosi.extra/usr/lib/tmpfiles.d/locale.conf [moved from mkosi.presets/base/mkosi.extra/usr/lib/tmpfiles.d/locale.conf with 100% similarity]
mkosi.images/initrd/mkosi.conf [moved from mkosi.presets/initrd/mkosi.conf with 98% similarity]
mkosi.images/initrd/mkosi.conf.d/10-centos.conf [moved from mkosi.presets/initrd/mkosi.conf.d/10-centos.conf with 100% similarity]
mkosi.images/initrd/mkosi.conf.d/10-default.conf [moved from mkosi.presets/initrd/mkosi.conf.d/10-default.conf with 100% similarity]
mkosi.images/initrd/mkosi.conf.d/10-opensuse.conf [moved from mkosi.presets/initrd/mkosi.conf.d/10-opensuse.conf with 100% similarity]
mkosi.images/initrd/mkosi.postinst [moved from mkosi.presets/initrd/mkosi.postinst with 62% similarity]
mkosi.images/system/kernel/mkosi.build.chroot [new file with mode: 0755]
mkosi.images/system/kernel/mkosi.conf [new file with mode: 0644]
mkosi.images/system/kernel/mkosi.conf.d/10-arch.conf [new file with mode: 0644]
mkosi.images/system/kernel/mkosi.conf.d/10-centos-fedora.conf [new file with mode: 0644]
mkosi.images/system/kernel/mkosi.conf.d/10-debian-ubuntu.conf [new file with mode: 0644]
mkosi.images/system/kernel/mkosi.conf.d/10-fedora.conf [new file with mode: 0644]
mkosi.images/system/kernel/mkosi.conf.d/10-opensuse.conf [new file with mode: 0644]
mkosi.images/system/mkosi.conf [moved from mkosi.presets/system/mkosi.conf with 98% similarity]
mkosi.images/system/mkosi.conf.d/05-initrd.conf [moved from mkosi.presets/system/mkosi.conf.d/05-initrd.conf with 94% similarity]
mkosi.images/system/mkosi.conf.d/10-arch.conf [moved from mkosi.presets/system/mkosi.conf.d/10-arch.conf with 100% similarity]
mkosi.images/system/mkosi.conf.d/10-centos-fedora.conf [moved from mkosi.presets/system/mkosi.conf.d/10-centos-fedora.conf with 100% similarity]
mkosi.images/system/mkosi.conf.d/10-centos/mkosi.conf [moved from mkosi.presets/system/mkosi.conf.d/10-centos/mkosi.conf with 100% similarity]
mkosi.images/system/mkosi.conf.d/10-centos/mkosi.extra/usr/lib/repart.d/20-root.conf.d/xfs.conf [moved from mkosi.presets/system/mkosi.conf.d/10-centos/mkosi.extra/usr/lib/repart.d/20-root.conf.d/xfs.conf with 100% similarity]
mkosi.images/system/mkosi.conf.d/10-centos/mkosi.repart/10-usr.conf.d/squashfs.conf [moved from mkosi.presets/system/mkosi.conf.d/10-centos/mkosi.repart/10-usr.conf.d/squashfs.conf with 100% similarity]
mkosi.images/system/mkosi.conf.d/10-debian-amd64.conf [moved from mkosi.presets/system/mkosi.conf.d/10-debian-amd64.conf with 100% similarity]
mkosi.images/system/mkosi.conf.d/10-debian-arm64.conf [moved from mkosi.presets/system/mkosi.conf.d/10-debian-arm64.conf with 100% similarity]
mkosi.images/system/mkosi.conf.d/10-debian-ubuntu.conf [moved from mkosi.presets/system/mkosi.conf.d/10-debian-ubuntu.conf with 100% similarity]
mkosi.images/system/mkosi.conf.d/10-fedora.conf [moved from mkosi.presets/system/mkosi.conf.d/10-fedora.conf with 100% similarity]
mkosi.images/system/mkosi.conf.d/10-opensuse.conf [moved from mkosi.presets/system/mkosi.conf.d/10-opensuse.conf with 100% similarity]
mkosi.images/system/mkosi.conf.d/10-ubuntu.conf [moved from mkosi.presets/system/mkosi.conf.d/10-ubuntu.conf with 100% similarity]
mkosi.images/system/mkosi.conf.d/20-kernel-arch.conf [moved from mkosi.presets/system/mkosi.conf.d/20-kernel-arch.conf with 100% similarity]
mkosi.images/system/mkosi.conf.d/20-kernel-centos-fedora.conf [moved from mkosi.presets/system/mkosi.conf.d/20-kernel-centos-fedora.conf with 100% similarity]
mkosi.images/system/mkosi.conf.d/20-kernel-debian-ubuntu.conf [moved from mkosi.presets/system/mkosi.conf.d/20-kernel-debian-ubuntu.conf with 100% similarity]
mkosi.images/system/mkosi.conf.d/20-kernel-fedora.conf [moved from mkosi.presets/system/mkosi.conf.d/20-kernel-fedora.conf with 100% similarity]
mkosi.images/system/mkosi.conf.d/20-kernel-opensuse.conf [moved from mkosi.presets/system/mkosi.conf.d/20-kernel-opensuse.conf with 100% similarity]
mkosi.images/system/mkosi.conf.d/20-kernel.conf [moved from mkosi.presets/system/mkosi.conf.d/20-kernel.conf with 100% similarity]
mkosi.images/system/mkosi.extra/etc/issue [moved from mkosi.presets/system/mkosi.extra/etc/issue with 100% similarity]
mkosi.images/system/mkosi.extra/usr/lib/repart.d/15-swap.conf [moved from mkosi.presets/system/mkosi.extra/usr/lib/repart.d/15-swap.conf with 100% similarity]
mkosi.images/system/mkosi.extra/usr/lib/repart.d/20-root.conf [moved from mkosi.presets/system/mkosi.extra/usr/lib/repart.d/20-root.conf with 100% similarity]
mkosi.images/system/mkosi.extra/usr/lib/systemd/journald.conf.d/50-persistent.conf [moved from mkosi.presets/system/mkosi.extra/usr/lib/systemd/journald.conf.d/50-persistent.conf with 100% similarity]
mkosi.images/system/mkosi.extra/usr/lib/systemd/mkosi-check-and-shutdown.sh [moved from mkosi.presets/system/mkosi.extra/usr/lib/systemd/mkosi-check-and-shutdown.sh with 100% similarity]
mkosi.images/system/mkosi.extra/usr/lib/systemd/system/mkosi-check-and-shutdown.service [moved from mkosi.presets/system/mkosi.extra/usr/lib/systemd/system/mkosi-check-and-shutdown.service with 100% similarity]
mkosi.images/system/mkosi.extra/usr/lib/tmpfiles.d/99-mkosi.conf [moved from mkosi.presets/system/mkosi.extra/usr/lib/tmpfiles.d/99-mkosi.conf with 100% similarity]
mkosi.images/system/mkosi.extra/usr/share/factory/mkosi/gdbinit.d/systemd.gdb [moved from mkosi.presets/system/mkosi.extra/usr/share/factory/mkosi/gdbinit.d/systemd.gdb with 100% similarity]
mkosi.images/system/mkosi.finalize [moved from mkosi.presets/system/mkosi.finalize with 100% similarity]
mkosi.images/system/mkosi.postinst.chroot [moved from mkosi.presets/system/mkosi.postinst with 97% similarity]
mkosi.images/system/mkosi.repart/00-esp.conf [moved from mkosi.presets/system/mkosi.repart/00-esp.conf with 100% similarity]
mkosi.images/system/mkosi.repart/10-usr.conf [moved from mkosi.presets/system/mkosi.repart/10-usr.conf with 100% similarity]
mkosi.images/system/mkosi.repart/11-usr-verity.conf [moved from mkosi.presets/system/mkosi.repart/11-usr-verity.conf with 100% similarity]
mkosi.images/system/mkosi.repart/12-usr-verity-sig.conf [moved from mkosi.presets/system/mkosi.repart/12-usr-verity-sig.conf with 100% similarity]
mkosi.presets/system/mkosi.kernel.build [deleted file]

index 0d1d3a30b0889dcc6bef9947eb0e569baccee1d9..629a3101f819ffacd42461cb37fe6e0e1dbbddef 100644 (file)
@@ -81,11 +81,11 @@ jobs:
         echo 'deb http://azure.archive.ubuntu.com/ubuntu jammy-proposed restricted main universe' | sudo tee /etc/apt/sources.list.d/proposed.list
 
     - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
-    - uses: systemd/mkosi@16e63baaeadf7a5b100c5b5bf780c61c29878cfc
+    - uses: systemd/mkosi@bbe715f42911f9660712377a5b39335b9391ae22
 
     - name: Configure
       run: |
-        tee mkosi.conf <<- EOF
+        tee mkosi.local.conf <<- EOF
         [Distribution]
         Distribution=${{ matrix.distro }}
         Release=${{ matrix.release }}
@@ -112,17 +112,17 @@ jobs:
         # For erofs, we have to install linux-modules-extra-azure, but that doesn't match the running kernel
         # version, so we can't load the erofs module. squashfs is a builtin module so we use that instead.
 
-        mkdir -p mkosi.presets/system/mkosi.repart/10-usr.conf.d
-        tee mkosi.presets/system/mkosi.repart/10-usr.conf.d/squashfs.conf <<- EOF
+        mkdir -p mkosi.images/system/mkosi.repart/10-usr.conf.d
+        tee mkosi.images/system/mkosi.repart/10-usr.conf.d/squashfs.conf <<- EOF
         [Partition]
         Format=squashfs
         EOF
 
         # The emergency shell is not useful in the CI, as it just blocks for a long time before the job
         # eventually times out. Override it to just shutdown immediately.
-        mkdir -p mkosi.presets/initrd/mkosi.extra/usr/lib/systemd/system/emergency.service.d/
-        mkdir -p mkosi.presets/system/mkosi.extra/usr/lib/systemd/system/emergency.service.d/
-        tee mkosi.presets/initrd/mkosi.extra/usr/lib/systemd/system/emergency.service.d/poweroff.conf <<- EOF
+        mkdir -p mkosi.images/initrd/mkosi.extra/usr/lib/systemd/system/emergency.service.d/
+        mkdir -p mkosi.images/system/mkosi.extra/usr/lib/systemd/system/emergency.service.d/
+        tee mkosi.images/initrd/mkosi.extra/usr/lib/systemd/system/emergency.service.d/poweroff.conf <<- EOF
         [Unit]
         FailureAction=exit
         [Service]
@@ -130,7 +130,7 @@ jobs:
         ExecStart=
         ExecStart=false
         EOF
-        cp mkosi.presets/initrd/mkosi.extra/usr/lib/systemd/system/emergency.service.d/poweroff.conf mkosi.presets/system/mkosi.extra/usr/lib/systemd/system/emergency.service.d/poweroff.conf
+        cp mkosi.images/initrd/mkosi.extra/usr/lib/systemd/system/emergency.service.d/poweroff.conf mkosi.images/system/mkosi.extra/usr/lib/systemd/system/emergency.service.d/poweroff.conf
 
     - name: Generate secure boot key
       run: mkosi --debug genkey
index bb7223f51c4a52401a1f5fbef27b703ca3491a79..d666dc8ebda2b820fc92a1df131d808185afac19 100644 (file)
@@ -34,9 +34,7 @@ __pycache__/
 /mkosi.installdir/
 /mkosi.key
 /mkosi.crt
-# Ignore any mkosi config files with "local" in the name
-/mkosi.conf.d/**/*local*.conf
-mkosi.conf
+mkosi.local.conf
 /tags
 .dir-locals-2.el
 .vscode/
index 0178a43dba05a435e0c08173f1a8d5a2523f8c17..c0892169a95a06b175d65a09ecbbbd12ac1a4d0f 100644 (file)
@@ -35,7 +35,7 @@ possible, however. In order to simplify testing for cases like this we provide
 a set of `mkosi` build files directly in the source tree.
 [mkosi](https://github.com/systemd/mkosi) is a tool for building clean OS images
 from an upstream distribution in combination with a fresh build of the project
-in the local working directory. To make use of this, please install `mkosi` v18
+in the local working directory. To make use of this, please install `mkosi` v19
 or newer using your distribution's package manager or from the
 [GitHub repository](https://github.com/systemd/mkosi). `mkosi` will build an
 image for the host distro by default. First, run `mkosi genkey` to generate a key
@@ -60,8 +60,8 @@ Putting this all together, here's a series of commands for preparing a patch
 for systemd:
 
 ```sh
-$ git clone https://github.com/systemd/mkosi.git  # If mkosi v18 or newer is not packaged by your distribution
-$ ln -s $PWD/mkosi/bin/mkosi /usr/local/bin/mkosi # If mkosi v18 or newer is not packaged by your distribution
+$ git clone https://github.com/systemd/mkosi.git  # If mkosi v19 or newer is not packaged by your distribution
+$ ln -s $PWD/mkosi/bin/mkosi /usr/local/bin/mkosi # If mkosi v19 or newer is not packaged by your distribution
 $ git clone https://github.com/systemd/systemd.git
 $ cd systemd
 $ git checkout -b <BRANCH>        # where BRANCH is the name of the branch
@@ -234,7 +234,7 @@ QEMU.
 To allow VSCode's debugger to attach to systemd running in a mkosi image, we have to make sure it can access
 the virtual machine spawned by mkosi where systemd is running. mkosi makes this possible via a handy SSH
 option that makes the generated image accessible via SSH when booted. Thus you must build the image with
-`mkosi --ssh`. The easiest way to set the option is to create a file `mkosi.conf` in the root of the
+`mkosi --ssh`. The easiest way to set the option is to create a file `mkosi.local.conf` in the root of the
 repository and add the following contents:
 
 ```
@@ -343,7 +343,7 @@ To debug systemd-boot in an IDE such as VSCode we can use a launch configuration
 If you're hacking on the kernel in tandem with systemd, you can clone a kernel repository in mkosi.kernel/ in
 the systemd repository, and mkosi will automatically build that kernel and install it into the final image.
 To prevent the distribution's kernel from being installed (which isn't necessary since we're building our
-own kernel), you can add the following snippets to mkosi.conf.d/20-local.conf:
+own kernel), you can add the following snippets to `mkosi.local.conf`:
 
 (This snippet is for Fedora, the list of packages will need to be changed for other distributions)
 
index 67b6be46c284db10fd2e011a414b0cead037176d..39920c64d0803601ebc999c0d1f0d077fc014c6c 100644 (file)
@@ -15,8 +15,7 @@ compiler you want to use and which part of the test suite you want to run.
 
 ## mkosi
 
-To build with sanitizers in mkosi, create a file 20-local.conf in mkosi.conf.d/ and add the following
-contents:
+To build with sanitizers in mkosi, create a file `mkosi.local.conf` and add the following contents:
 
 ```
 [Content]
similarity index 98%
rename from mkosi.conf.d/10-systemd.conf
rename to mkosi.conf
index 883ffc9cf261129483eda7fa04aaf2d44e43e182..9961407a04319770c82ab0a7a8ba20025fcfccf6 100644 (file)
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: LGPL-2.1-or-later
 
-[Preset]
-Presets=system
+[Config]
+Images=system
 
 [Output]
 OutputDirectory=mkosi.output
similarity index 95%
rename from mkosi.presets/base/mkosi.build
rename to mkosi.images/base/mkosi.build.chroot
index 95402f6463fbadbb45ea09259feee4a4bbfe3841..f26098cedf5c7835c1329f842b9fbd7374235392 100755 (executable)
@@ -5,13 +5,6 @@ set -e
 # This is a build script for OS image generation using mkosi (https://github.com/systemd/mkosi).
 # Simply invoke "mkosi" in the project directory to build an OS image.
 
-if [ "${container:-}" != "mkosi" ]; then
-    exec mkosi-chroot "$SCRIPT" "$@"
-fi
-
-# Run commands as the user invoking mkosi.
-SU="setpriv --reuid=${MKOSI_UID:-0} --regid=${MKOSI_GID:-0} --clear-groups"
-
 # We don't want to install our build of systemd in the base image, but use it as an extra tree for the
 # initrd and system images, so override DESTDIR to store it in the output directory so we can reference it as
 # an extra tree in the initrd and system image builds.
@@ -206,10 +199,10 @@ if [ ! -f "$BUILDDIR"/build.ninja ]; then
         )
     fi
 
-    ( set -x; $SU meson setup "$BUILDDIR" "$SRCDIR" "${CONFIGURE_OPTS[@]}" )
+    ( set -x; meson setup "$BUILDDIR" "$SRCDIR" "${CONFIGURE_OPTS[@]}" )
 fi
 
-( set -x; $SU ninja -C "$BUILDDIR" "$@" )
+( set -x; ninja -C "$BUILDDIR" "$@" )
 if [ "$WITH_TESTS" = 1 ]; then
     if [ -n "$SANITIZERS" ]; then
         export ASAN_OPTIONS="$MKOSI_ASAN_OPTIONS"
similarity index 98%
rename from mkosi.presets/initrd/mkosi.conf
rename to mkosi.images/initrd/mkosi.conf
index 0ef3a7bd4adc301aab0691b5399b5399523a04f8..8e38dc1b782068155a09eadc50c31a9daa3ef17c 100644 (file)
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: LGPL-2.1-or-later
 
-[Preset]
+[Config]
 Dependencies=base
 
 [Output]
similarity index 62%
rename from mkosi.presets/initrd/mkosi.postinst
rename to mkosi.images/initrd/mkosi.postinst
index 6782ddd5faf9e3223983bf0a68f0451f43447c58..de610dfeb640f5e5395e37f9878354ca886003bf 100755 (executable)
@@ -2,10 +2,6 @@
 # SPDX-License-Identifier: LGPL-2.1-or-later
 set -e
 
-if [ "${container:-}" != "mkosi" ]; then
-    exec mkosi-chroot "$SCRIPT" "$@"
-fi
-
 # OpenSUSE insists on blacklisting erofs by default because its supposedly a legacy filesystem.
 # See https://github.com/openSUSE/suse-module-tools/pull/71
-rm -f /usr/lib/modprobe.d/60-blacklist_fs-erofs.conf
+rm -f "$BUILDROOT/usr/lib/modprobe.d/60-blacklist_fs-erofs.conf"
diff --git a/mkosi.images/system/kernel/mkosi.build.chroot b/mkosi.images/system/kernel/mkosi.build.chroot
new file mode 100755 (executable)
index 0000000..1b33ed9
--- /dev/null
@@ -0,0 +1,36 @@
+#!/bin/sh
+# SPDX-License-Identifier: LGPL-2.1-or-later
+set -e
+
+cd "$SRCDIR/kernel"
+
+BUILDDIR="$BUILDDIR/kernel"
+mkdir -p "$BUILDDIR"
+
+# Prevent a distro's custom installkernel script from being used.
+if [ -x /sbin/installkernel ]; then
+    mount --bind /dev/null /sbin/installkernel
+fi
+
+# 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)"
+make O="$BUILDDIR" VERSION=99 -j "$(nproc)" headers
+
+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="hid" install
+
+mkdir -p "$DESTDIR"/usr/bin
+ln -sf /usr/lib/kernel/selftests/bpf/bpftool "$DESTDIR/usr/bin/bpftool"
diff --git a/mkosi.images/system/kernel/mkosi.conf b/mkosi.images/system/kernel/mkosi.conf
new file mode 100644 (file)
index 0000000..5117d76
--- /dev/null
@@ -0,0 +1,19 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+BuildSources=kernel/
+
+[Content]
+BuildPackages=
+        bc
+        binutils
+        bison
+        clang
+        flex
+        gcc
+        lld
+        llvm
+        make
+        make
+        rsync
+        tar
diff --git a/mkosi.images/system/kernel/mkosi.conf.d/10-arch.conf b/mkosi.images/system/kernel/mkosi.conf.d/10-arch.conf
new file mode 100644 (file)
index 0000000..bf8ac9c
--- /dev/null
@@ -0,0 +1,19 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+Distribution=arch
+
+[Content]
+Packages=
+        alsa-lib
+        fuse3
+        libcap
+        libcap-ng
+        libelf
+        libmnl
+        numactl
+        popt
+
+BuildPackages=
+        pahole
+        python-docutils
diff --git a/mkosi.images/system/kernel/mkosi.conf.d/10-centos-fedora.conf b/mkosi.images/system/kernel/mkosi.conf.d/10-centos-fedora.conf
new file mode 100644 (file)
index 0000000..e4f2d5e
--- /dev/null
@@ -0,0 +1,34 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+Distribution=|centos
+Distribution=|fedora
+
+[Content]
+Packages=
+        alsa-lib
+        elfutils-libelf
+        fuse3
+        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(fuse3)
+        pkgconfig(libcap-ng)
+        pkgconfig(libcap)
+        pkgconfig(libelf)
+        pkgconfig(libmnl)
+        pkgconfig(numa)
+        pkgconfig(openssl)
+        pkgconfig(popt)
+        python3-docutils
diff --git a/mkosi.images/system/kernel/mkosi.conf.d/10-debian-ubuntu.conf b/mkosi.images/system/kernel/mkosi.conf.d/10-debian-ubuntu.conf
new file mode 100644 (file)
index 0000000..4542dba
--- /dev/null
@@ -0,0 +1,32 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+Distribution=|debian
+Distribution=|ubuntu
+
+[Content]
+Packages=
+        fuse3
+        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
+        libfuse3-dev
+        libmnl-dev
+        libnuma-dev
+        libpopt-dev
+        pahole
+        python3-docutils
diff --git a/mkosi.images/system/kernel/mkosi.conf.d/10-fedora.conf b/mkosi.images/system/kernel/mkosi.conf.d/10-fedora.conf
new file mode 100644 (file)
index 0000000..866c1ed
--- /dev/null
@@ -0,0 +1,8 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+Distribution=fedora
+
+[Content]
+BuildPackages=
+        libcap-static
diff --git a/mkosi.images/system/kernel/mkosi.conf.d/10-opensuse.conf b/mkosi.images/system/kernel/mkosi.conf.d/10-opensuse.conf
new file mode 100644 (file)
index 0000000..0647767
--- /dev/null
@@ -0,0 +1,34 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+Distribution=opensuse
+
+[Content]
+Packages=
+        fuse3
+        glibc-32bit
+        libasound2
+        libcap-ng0
+        libcap2
+        libelf1
+        libmnl0
+        libnuma1
+        libpopt0
+
+BuildPackages=
+        alsa-devel
+        dwarves
+        fuse3-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
similarity index 98%
rename from mkosi.presets/system/mkosi.conf
rename to mkosi.images/system/mkosi.conf
index 08f6fb7dc7629155e6a4843c81528f2347ba951a..7612f221cc50783ed205721905fc45565fd458c7 100644 (file)
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: LGPL-2.1-or-later
 
-[Preset]
+[Config]
 Dependencies=base
 
 [Content]
similarity index 94%
rename from mkosi.presets/system/mkosi.conf.d/05-initrd.conf
rename to mkosi.images/system/mkosi.conf.d/05-initrd.conf
index 47a730dc0eab05ddbb0c10c41120c6c560da8213..9f2175405816d16f364f330feba0487b473c9d27 100644 (file)
@@ -5,7 +5,7 @@ Bootable=!no
 Format=|disk
 Format=|directory
 
-[Preset]
+[Config]
 Dependencies=initrd
 
 [Content]
similarity index 97%
rename from mkosi.presets/system/mkosi.postinst
rename to mkosi.images/system/mkosi.postinst.chroot
index 663fa5c762e30b98c2e3104a2702d3b53cdf8223..e0728de27985e231b7983e0fe3b53cbc810ddd78 100755 (executable)
@@ -6,10 +6,6 @@ if [ "$1" = "build" ]; then
     exit 0
 fi
 
-if [ "${container:-}" != "mkosi" ]; then
-    exec mkosi-chroot "$SCRIPT" "$@"
-fi
-
 if [ -n "$SANITIZERS" ]; then
     LD_PRELOAD=$(ldd /usr/lib/systemd/systemd | grep libasan.so | awk '{print $3}')
 
diff --git a/mkosi.presets/system/mkosi.kernel.build b/mkosi.presets/system/mkosi.kernel.build
deleted file mode 100755 (executable)
index a21585c..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/bin/sh
-# SPDX-License-Identifier: LGPL-2.1-or-later
-set -e
-
-if [ "${container:-}" != "mkosi" ]; then
-    exec mkosi-chroot "$SCRIPT" "$@"
-fi
-
-if [ -d "$SRCDIR"/mkosi.kernel/ ]; then
-    SRCDIR="$SRCDIR/mkosi.kernel"
-    BUILDDIR="$BUILDDIR/mkosi.kernel"
-    cd "$SRCDIR"
-    mkdir -p "$BUILDDIR"
-
-    # Prevent a distro's custom installkernel script from being used.
-    if [ -x /sbin/installkernel ]; then
-        mount --bind /dev/null /sbin/installkernel
-    fi
-
-    # 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)"
-    make O="$BUILDDIR" VERSION=99 -j "$(nproc)" headers
-
-    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="hid" install
-
-    mkdir -p "$DESTDIR"/usr/bin
-    ln -sf /usr/lib/kernel/selftests/bpf/bpftool "$DESTDIR/usr/bin/bpftool"
-fi