diff --git a/.github/workflows/mkosi.yml b/.github/workflows/mkosi.yml index 0d1d3a30b0..629a3101f8 100644 --- a/.github/workflows/mkosi.yml +++ b/.github/workflows/mkosi.yml @@ -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 diff --git a/.gitignore b/.gitignore index bb7223f51c..d666dc8ebd 100644 --- a/.gitignore +++ b/.gitignore @@ -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/ diff --git a/docs/HACKING.md b/docs/HACKING.md index 0178a43dba..c0892169a9 100644 --- a/docs/HACKING.md +++ b/docs/HACKING.md @@ -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 # 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) diff --git a/docs/TESTING_WITH_SANITIZERS.md b/docs/TESTING_WITH_SANITIZERS.md index 67b6be46c2..39920c64d0 100644 --- a/docs/TESTING_WITH_SANITIZERS.md +++ b/docs/TESTING_WITH_SANITIZERS.md @@ -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] diff --git a/mkosi.conf.d/10-systemd.conf b/mkosi.conf similarity index 98% rename from mkosi.conf.d/10-systemd.conf rename to mkosi.conf index 883ffc9cf2..9961407a04 100644 --- a/mkosi.conf.d/10-systemd.conf +++ b/mkosi.conf @@ -1,7 +1,7 @@ # SPDX-License-Identifier: LGPL-2.1-or-later -[Preset] -Presets=system +[Config] +Images=system [Output] OutputDirectory=mkosi.output diff --git a/mkosi.presets/base/mkosi.build b/mkosi.images/base/mkosi.build.chroot similarity index 95% rename from mkosi.presets/base/mkosi.build rename to mkosi.images/base/mkosi.build.chroot index 95402f6463..f26098cedf 100755 --- a/mkosi.presets/base/mkosi.build +++ b/mkosi.images/base/mkosi.build.chroot @@ -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" diff --git a/mkosi.presets/base/mkosi.conf b/mkosi.images/base/mkosi.conf similarity index 100% rename from mkosi.presets/base/mkosi.conf rename to mkosi.images/base/mkosi.conf diff --git a/mkosi.presets/base/mkosi.conf.d/10-arch.conf b/mkosi.images/base/mkosi.conf.d/10-arch.conf similarity index 100% rename from mkosi.presets/base/mkosi.conf.d/10-arch.conf rename to mkosi.images/base/mkosi.conf.d/10-arch.conf diff --git a/mkosi.presets/base/mkosi.conf.d/10-centos-fedora.conf b/mkosi.images/base/mkosi.conf.d/10-centos-fedora.conf similarity index 100% rename from mkosi.presets/base/mkosi.conf.d/10-centos-fedora.conf rename to mkosi.images/base/mkosi.conf.d/10-centos-fedora.conf diff --git a/mkosi.presets/base/mkosi.conf.d/10-debian-ubuntu.conf b/mkosi.images/base/mkosi.conf.d/10-debian-ubuntu.conf similarity index 100% rename from mkosi.presets/base/mkosi.conf.d/10-debian-ubuntu.conf rename to mkosi.images/base/mkosi.conf.d/10-debian-ubuntu.conf diff --git a/mkosi.presets/base/mkosi.conf.d/10-debian.conf b/mkosi.images/base/mkosi.conf.d/10-debian.conf similarity index 100% rename from mkosi.presets/base/mkosi.conf.d/10-debian.conf rename to mkosi.images/base/mkosi.conf.d/10-debian.conf diff --git a/mkosi.presets/base/mkosi.conf.d/10-fedora.conf b/mkosi.images/base/mkosi.conf.d/10-fedora.conf similarity index 100% rename from mkosi.presets/base/mkosi.conf.d/10-fedora.conf rename to mkosi.images/base/mkosi.conf.d/10-fedora.conf diff --git a/mkosi.presets/base/mkosi.conf.d/10-opensuse.conf b/mkosi.images/base/mkosi.conf.d/10-opensuse.conf similarity index 100% rename from mkosi.presets/base/mkosi.conf.d/10-opensuse.conf rename to mkosi.images/base/mkosi.conf.d/10-opensuse.conf diff --git a/mkosi.presets/base/mkosi.conf.d/10-ubuntu.conf b/mkosi.images/base/mkosi.conf.d/10-ubuntu.conf similarity index 100% rename from mkosi.presets/base/mkosi.conf.d/10-ubuntu.conf rename to mkosi.images/base/mkosi.conf.d/10-ubuntu.conf diff --git a/mkosi.presets/base/mkosi.extra/usr/lib/systemd/system-preset/00-mkosi.preset b/mkosi.images/base/mkosi.extra/usr/lib/systemd/system-preset/00-mkosi.preset similarity index 100% rename from mkosi.presets/base/mkosi.extra/usr/lib/systemd/system-preset/00-mkosi.preset rename to mkosi.images/base/mkosi.extra/usr/lib/systemd/system-preset/00-mkosi.preset diff --git a/mkosi.presets/base/mkosi.extra/usr/lib/systemd/system-preset/99-mkosi.preset b/mkosi.images/base/mkosi.extra/usr/lib/systemd/system-preset/99-mkosi.preset similarity index 100% rename from mkosi.presets/base/mkosi.extra/usr/lib/systemd/system-preset/99-mkosi.preset rename to mkosi.images/base/mkosi.extra/usr/lib/systemd/system-preset/99-mkosi.preset diff --git a/mkosi.presets/base/mkosi.extra/usr/lib/tmpfiles.d/locale.conf b/mkosi.images/base/mkosi.extra/usr/lib/tmpfiles.d/locale.conf similarity index 100% rename from mkosi.presets/base/mkosi.extra/usr/lib/tmpfiles.d/locale.conf rename to mkosi.images/base/mkosi.extra/usr/lib/tmpfiles.d/locale.conf diff --git a/mkosi.presets/initrd/mkosi.conf b/mkosi.images/initrd/mkosi.conf similarity index 98% rename from mkosi.presets/initrd/mkosi.conf rename to mkosi.images/initrd/mkosi.conf index 0ef3a7bd4a..8e38dc1b78 100644 --- a/mkosi.presets/initrd/mkosi.conf +++ b/mkosi.images/initrd/mkosi.conf @@ -1,6 +1,6 @@ # SPDX-License-Identifier: LGPL-2.1-or-later -[Preset] +[Config] Dependencies=base [Output] diff --git a/mkosi.presets/initrd/mkosi.conf.d/10-centos.conf b/mkosi.images/initrd/mkosi.conf.d/10-centos.conf similarity index 100% rename from mkosi.presets/initrd/mkosi.conf.d/10-centos.conf rename to mkosi.images/initrd/mkosi.conf.d/10-centos.conf diff --git a/mkosi.presets/initrd/mkosi.conf.d/10-default.conf b/mkosi.images/initrd/mkosi.conf.d/10-default.conf similarity index 100% rename from mkosi.presets/initrd/mkosi.conf.d/10-default.conf rename to mkosi.images/initrd/mkosi.conf.d/10-default.conf diff --git a/mkosi.presets/initrd/mkosi.conf.d/10-opensuse.conf b/mkosi.images/initrd/mkosi.conf.d/10-opensuse.conf similarity index 100% rename from mkosi.presets/initrd/mkosi.conf.d/10-opensuse.conf rename to mkosi.images/initrd/mkosi.conf.d/10-opensuse.conf diff --git a/mkosi.presets/initrd/mkosi.postinst b/mkosi.images/initrd/mkosi.postinst similarity index 62% rename from mkosi.presets/initrd/mkosi.postinst rename to mkosi.images/initrd/mkosi.postinst index 6782ddd5fa..de610dfeb6 100755 --- a/mkosi.presets/initrd/mkosi.postinst +++ b/mkosi.images/initrd/mkosi.postinst @@ -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 index 0000000000..1b33ed9b06 --- /dev/null +++ b/mkosi.images/system/kernel/mkosi.build.chroot @@ -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 index 0000000000..5117d76243 --- /dev/null +++ b/mkosi.images/system/kernel/mkosi.conf @@ -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 index 0000000000..bf8ac9cdde --- /dev/null +++ b/mkosi.images/system/kernel/mkosi.conf.d/10-arch.conf @@ -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 index 0000000000..e4f2d5ee64 --- /dev/null +++ b/mkosi.images/system/kernel/mkosi.conf.d/10-centos-fedora.conf @@ -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 index 0000000000..4542dbacdc --- /dev/null +++ b/mkosi.images/system/kernel/mkosi.conf.d/10-debian-ubuntu.conf @@ -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 index 0000000000..866c1ed144 --- /dev/null +++ b/mkosi.images/system/kernel/mkosi.conf.d/10-fedora.conf @@ -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 index 0000000000..0647767aa4 --- /dev/null +++ b/mkosi.images/system/kernel/mkosi.conf.d/10-opensuse.conf @@ -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 diff --git a/mkosi.presets/system/mkosi.conf b/mkosi.images/system/mkosi.conf similarity index 98% rename from mkosi.presets/system/mkosi.conf rename to mkosi.images/system/mkosi.conf index 08f6fb7dc7..7612f221cc 100644 --- a/mkosi.presets/system/mkosi.conf +++ b/mkosi.images/system/mkosi.conf @@ -1,6 +1,6 @@ # SPDX-License-Identifier: LGPL-2.1-or-later -[Preset] +[Config] Dependencies=base [Content] diff --git a/mkosi.presets/system/mkosi.conf.d/05-initrd.conf b/mkosi.images/system/mkosi.conf.d/05-initrd.conf 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 47a730dc0e..9f21754058 100644 --- a/mkosi.presets/system/mkosi.conf.d/05-initrd.conf +++ b/mkosi.images/system/mkosi.conf.d/05-initrd.conf @@ -5,7 +5,7 @@ Bootable=!no Format=|disk Format=|directory -[Preset] +[Config] Dependencies=initrd [Content] diff --git a/mkosi.presets/system/mkosi.conf.d/10-arch.conf b/mkosi.images/system/mkosi.conf.d/10-arch.conf similarity index 100% rename from mkosi.presets/system/mkosi.conf.d/10-arch.conf rename to mkosi.images/system/mkosi.conf.d/10-arch.conf diff --git a/mkosi.presets/system/mkosi.conf.d/10-centos-fedora.conf b/mkosi.images/system/mkosi.conf.d/10-centos-fedora.conf similarity index 100% rename from mkosi.presets/system/mkosi.conf.d/10-centos-fedora.conf rename to mkosi.images/system/mkosi.conf.d/10-centos-fedora.conf diff --git a/mkosi.presets/system/mkosi.conf.d/10-centos/mkosi.conf b/mkosi.images/system/mkosi.conf.d/10-centos/mkosi.conf similarity index 100% rename from mkosi.presets/system/mkosi.conf.d/10-centos/mkosi.conf rename to mkosi.images/system/mkosi.conf.d/10-centos/mkosi.conf diff --git a/mkosi.presets/system/mkosi.conf.d/10-centos/mkosi.extra/usr/lib/repart.d/20-root.conf.d/xfs.conf b/mkosi.images/system/mkosi.conf.d/10-centos/mkosi.extra/usr/lib/repart.d/20-root.conf.d/xfs.conf similarity index 100% rename from mkosi.presets/system/mkosi.conf.d/10-centos/mkosi.extra/usr/lib/repart.d/20-root.conf.d/xfs.conf rename to mkosi.images/system/mkosi.conf.d/10-centos/mkosi.extra/usr/lib/repart.d/20-root.conf.d/xfs.conf diff --git a/mkosi.presets/system/mkosi.conf.d/10-centos/mkosi.repart/10-usr.conf.d/squashfs.conf b/mkosi.images/system/mkosi.conf.d/10-centos/mkosi.repart/10-usr.conf.d/squashfs.conf similarity index 100% rename from mkosi.presets/system/mkosi.conf.d/10-centos/mkosi.repart/10-usr.conf.d/squashfs.conf rename to mkosi.images/system/mkosi.conf.d/10-centos/mkosi.repart/10-usr.conf.d/squashfs.conf diff --git a/mkosi.presets/system/mkosi.conf.d/10-debian-amd64.conf b/mkosi.images/system/mkosi.conf.d/10-debian-amd64.conf similarity index 100% rename from mkosi.presets/system/mkosi.conf.d/10-debian-amd64.conf rename to mkosi.images/system/mkosi.conf.d/10-debian-amd64.conf diff --git a/mkosi.presets/system/mkosi.conf.d/10-debian-arm64.conf b/mkosi.images/system/mkosi.conf.d/10-debian-arm64.conf similarity index 100% rename from mkosi.presets/system/mkosi.conf.d/10-debian-arm64.conf rename to mkosi.images/system/mkosi.conf.d/10-debian-arm64.conf diff --git a/mkosi.presets/system/mkosi.conf.d/10-debian-ubuntu.conf b/mkosi.images/system/mkosi.conf.d/10-debian-ubuntu.conf similarity index 100% rename from mkosi.presets/system/mkosi.conf.d/10-debian-ubuntu.conf rename to mkosi.images/system/mkosi.conf.d/10-debian-ubuntu.conf diff --git a/mkosi.presets/system/mkosi.conf.d/10-fedora.conf b/mkosi.images/system/mkosi.conf.d/10-fedora.conf similarity index 100% rename from mkosi.presets/system/mkosi.conf.d/10-fedora.conf rename to mkosi.images/system/mkosi.conf.d/10-fedora.conf diff --git a/mkosi.presets/system/mkosi.conf.d/10-opensuse.conf b/mkosi.images/system/mkosi.conf.d/10-opensuse.conf similarity index 100% rename from mkosi.presets/system/mkosi.conf.d/10-opensuse.conf rename to mkosi.images/system/mkosi.conf.d/10-opensuse.conf diff --git a/mkosi.presets/system/mkosi.conf.d/10-ubuntu.conf b/mkosi.images/system/mkosi.conf.d/10-ubuntu.conf similarity index 100% rename from mkosi.presets/system/mkosi.conf.d/10-ubuntu.conf rename to mkosi.images/system/mkosi.conf.d/10-ubuntu.conf diff --git a/mkosi.presets/system/mkosi.conf.d/20-kernel-arch.conf b/mkosi.images/system/mkosi.conf.d/20-kernel-arch.conf similarity index 100% rename from mkosi.presets/system/mkosi.conf.d/20-kernel-arch.conf rename to mkosi.images/system/mkosi.conf.d/20-kernel-arch.conf diff --git a/mkosi.presets/system/mkosi.conf.d/20-kernel-centos-fedora.conf b/mkosi.images/system/mkosi.conf.d/20-kernel-centos-fedora.conf similarity index 100% rename from mkosi.presets/system/mkosi.conf.d/20-kernel-centos-fedora.conf rename to mkosi.images/system/mkosi.conf.d/20-kernel-centos-fedora.conf diff --git a/mkosi.presets/system/mkosi.conf.d/20-kernel-debian-ubuntu.conf b/mkosi.images/system/mkosi.conf.d/20-kernel-debian-ubuntu.conf similarity index 100% rename from mkosi.presets/system/mkosi.conf.d/20-kernel-debian-ubuntu.conf rename to mkosi.images/system/mkosi.conf.d/20-kernel-debian-ubuntu.conf diff --git a/mkosi.presets/system/mkosi.conf.d/20-kernel-fedora.conf b/mkosi.images/system/mkosi.conf.d/20-kernel-fedora.conf similarity index 100% rename from mkosi.presets/system/mkosi.conf.d/20-kernel-fedora.conf rename to mkosi.images/system/mkosi.conf.d/20-kernel-fedora.conf diff --git a/mkosi.presets/system/mkosi.conf.d/20-kernel-opensuse.conf b/mkosi.images/system/mkosi.conf.d/20-kernel-opensuse.conf similarity index 100% rename from mkosi.presets/system/mkosi.conf.d/20-kernel-opensuse.conf rename to mkosi.images/system/mkosi.conf.d/20-kernel-opensuse.conf diff --git a/mkosi.presets/system/mkosi.conf.d/20-kernel.conf b/mkosi.images/system/mkosi.conf.d/20-kernel.conf similarity index 100% rename from mkosi.presets/system/mkosi.conf.d/20-kernel.conf rename to mkosi.images/system/mkosi.conf.d/20-kernel.conf diff --git a/mkosi.presets/system/mkosi.extra/etc/issue b/mkosi.images/system/mkosi.extra/etc/issue similarity index 100% rename from mkosi.presets/system/mkosi.extra/etc/issue rename to mkosi.images/system/mkosi.extra/etc/issue diff --git a/mkosi.presets/system/mkosi.extra/usr/lib/repart.d/15-swap.conf b/mkosi.images/system/mkosi.extra/usr/lib/repart.d/15-swap.conf similarity index 100% rename from mkosi.presets/system/mkosi.extra/usr/lib/repart.d/15-swap.conf rename to mkosi.images/system/mkosi.extra/usr/lib/repart.d/15-swap.conf diff --git a/mkosi.presets/system/mkosi.extra/usr/lib/repart.d/20-root.conf b/mkosi.images/system/mkosi.extra/usr/lib/repart.d/20-root.conf similarity index 100% rename from mkosi.presets/system/mkosi.extra/usr/lib/repart.d/20-root.conf rename to mkosi.images/system/mkosi.extra/usr/lib/repart.d/20-root.conf diff --git a/mkosi.presets/system/mkosi.extra/usr/lib/systemd/journald.conf.d/50-persistent.conf b/mkosi.images/system/mkosi.extra/usr/lib/systemd/journald.conf.d/50-persistent.conf similarity index 100% rename from mkosi.presets/system/mkosi.extra/usr/lib/systemd/journald.conf.d/50-persistent.conf rename to mkosi.images/system/mkosi.extra/usr/lib/systemd/journald.conf.d/50-persistent.conf diff --git a/mkosi.presets/system/mkosi.extra/usr/lib/systemd/mkosi-check-and-shutdown.sh b/mkosi.images/system/mkosi.extra/usr/lib/systemd/mkosi-check-and-shutdown.sh similarity index 100% rename from mkosi.presets/system/mkosi.extra/usr/lib/systemd/mkosi-check-and-shutdown.sh rename to mkosi.images/system/mkosi.extra/usr/lib/systemd/mkosi-check-and-shutdown.sh diff --git a/mkosi.presets/system/mkosi.extra/usr/lib/systemd/system/mkosi-check-and-shutdown.service b/mkosi.images/system/mkosi.extra/usr/lib/systemd/system/mkosi-check-and-shutdown.service similarity index 100% rename from mkosi.presets/system/mkosi.extra/usr/lib/systemd/system/mkosi-check-and-shutdown.service rename to mkosi.images/system/mkosi.extra/usr/lib/systemd/system/mkosi-check-and-shutdown.service diff --git a/mkosi.presets/system/mkosi.extra/usr/lib/tmpfiles.d/99-mkosi.conf b/mkosi.images/system/mkosi.extra/usr/lib/tmpfiles.d/99-mkosi.conf similarity index 100% rename from mkosi.presets/system/mkosi.extra/usr/lib/tmpfiles.d/99-mkosi.conf rename to mkosi.images/system/mkosi.extra/usr/lib/tmpfiles.d/99-mkosi.conf diff --git a/mkosi.presets/system/mkosi.extra/usr/share/factory/mkosi/gdbinit.d/systemd.gdb b/mkosi.images/system/mkosi.extra/usr/share/factory/mkosi/gdbinit.d/systemd.gdb similarity index 100% rename from mkosi.presets/system/mkosi.extra/usr/share/factory/mkosi/gdbinit.d/systemd.gdb rename to mkosi.images/system/mkosi.extra/usr/share/factory/mkosi/gdbinit.d/systemd.gdb diff --git a/mkosi.presets/system/mkosi.finalize b/mkosi.images/system/mkosi.finalize similarity index 100% rename from mkosi.presets/system/mkosi.finalize rename to mkosi.images/system/mkosi.finalize diff --git a/mkosi.presets/system/mkosi.postinst b/mkosi.images/system/mkosi.postinst.chroot similarity index 97% rename from mkosi.presets/system/mkosi.postinst rename to mkosi.images/system/mkosi.postinst.chroot index 663fa5c762..e0728de279 100755 --- a/mkosi.presets/system/mkosi.postinst +++ b/mkosi.images/system/mkosi.postinst.chroot @@ -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.repart/00-esp.conf b/mkosi.images/system/mkosi.repart/00-esp.conf similarity index 100% rename from mkosi.presets/system/mkosi.repart/00-esp.conf rename to mkosi.images/system/mkosi.repart/00-esp.conf diff --git a/mkosi.presets/system/mkosi.repart/10-usr.conf b/mkosi.images/system/mkosi.repart/10-usr.conf similarity index 100% rename from mkosi.presets/system/mkosi.repart/10-usr.conf rename to mkosi.images/system/mkosi.repart/10-usr.conf diff --git a/mkosi.presets/system/mkosi.repart/11-usr-verity.conf b/mkosi.images/system/mkosi.repart/11-usr-verity.conf similarity index 100% rename from mkosi.presets/system/mkosi.repart/11-usr-verity.conf rename to mkosi.images/system/mkosi.repart/11-usr-verity.conf diff --git a/mkosi.presets/system/mkosi.repart/12-usr-verity-sig.conf b/mkosi.images/system/mkosi.repart/12-usr-verity-sig.conf similarity index 100% rename from mkosi.presets/system/mkosi.repart/12-usr-verity-sig.conf rename to mkosi.images/system/mkosi.repart/12-usr-verity-sig.conf diff --git a/mkosi.presets/system/mkosi.kernel.build b/mkosi.presets/system/mkosi.kernel.build deleted file mode 100755 index a21585c4ca..0000000000 --- a/mkosi.presets/system/mkosi.kernel.build +++ /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