From dbff64ddf06f64ab94bd314df27d6c089b75de52 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Tue, 27 Aug 2024 12:56:07 +0200 Subject: [PATCH 1/8] mkosi: Update to latest --- .github/workflows/mkosi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/mkosi.yml b/.github/workflows/mkosi.yml index 3b45e20f1e..39a439d8a4 100644 --- a/.github/workflows/mkosi.yml +++ b/.github/workflows/mkosi.yml @@ -105,7 +105,7 @@ jobs: steps: - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - - uses: systemd/mkosi@5ccee64874ecb9e457f71ec40876ddc3e232aaa6 + - uses: systemd/mkosi@8c2f828701a1bdb3dc9b80d6f2ab979f0430a6b8 # Freeing up disk space with rm -rf can take multiple minutes. Since we don't need the extra free space # immediately, we remove the files in the background. However, we first move them to a different location From 00a2a67d814651cd3d6e2dff6dab22a3f8e5f5f3 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Tue, 27 Aug 2024 13:17:38 +0200 Subject: [PATCH 2/8] mkosi: Don't apply distribution specific patches rpm upstream is going to imply --noprep when running with --build-in-place so let's do the same on older versions of rpm (https://github.com/rpm-software-management/rpm/commit/e0925ad6e3185030b004343f73a5917fdc562d6c) Also, to keep things consistent between distros, run with --noprepare on Arch Linux as well (we already skip patches on Debian/Ubuntu). To keep things working on Arch, we apply the one downstream patch manually ourselves. --- mkosi.images/build/mkosi.conf.d/arch/mkosi.build.chroot | 5 +++++ .../build/mkosi.conf.d/centos-fedora/mkosi.build.chroot | 7 +++++++ .../build/mkosi.conf.d/centos-fedora/mkosi.prepare | 1 + .../build/mkosi.conf.d/opensuse/mkosi.build.chroot | 1 + mkosi.images/build/mkosi.conf.d/opensuse/mkosi.prepare | 1 + 5 files changed, 15 insertions(+) diff --git a/mkosi.images/build/mkosi.conf.d/arch/mkosi.build.chroot b/mkosi.images/build/mkosi.conf.d/arch/mkosi.build.chroot index 176f0b8869..8d501ecb76 100755 --- a/mkosi.images/build/mkosi.conf.d/arch/mkosi.build.chroot +++ b/mkosi.images/build/mkosi.conf.d/arch/mkosi.build.chroot @@ -67,12 +67,17 @@ sed --in-place "pkg/$PKG_SUBDIR/PKGBUILD" \ --expression "s/^_tag=.*/_tag=$(cat meson.version)/" \ --expression "s/^pkgrel=.*/pkgrel=$(date "+%Y%m%d%H%M%S" --date "@$TS")/" +# Replace cdrom/dialout/tape groups with optical/uucp/storage. We apply this patch manually because we run +# with --noprepare. +patch -Np1 -i pkg/arch/0001-Use-Arch-Linux-device-access-groups.patch + # We get around makepkg's root check by setting EUID to something else. # shellcheck disable=SC2046 env --chdir="pkg/$PKG_SUBDIR" \ EUID=123 \ makepkg \ --noextract \ + --noprepare \ $( ((WITH_TESTS)) || echo --nocheck) \ --force \ _systemd_UPSTREAM=1 \ diff --git a/mkosi.images/build/mkosi.conf.d/centos-fedora/mkosi.build.chroot b/mkosi.images/build/mkosi.conf.d/centos-fedora/mkosi.build.chroot index ce69aa33b7..b372b2264b 100755 --- a/mkosi.images/build/mkosi.conf.d/centos-fedora/mkosi.build.chroot +++ b/mkosi.images/build/mkosi.conf.d/centos-fedora/mkosi.build.chroot @@ -53,6 +53,12 @@ if ((WIPE)) && [[ -d "$BUILDDIR/meson-private" ]]; then MKOSI_MESON_OPTIONS="$MKOSI_MESON_OPTIONS --wipe" fi +# Hack to work around https://github.com/rpm-software-management/rpm/issues/3216. +# TODO: Remove when rpm 4.20 gets into Rawhide. +mkdir -p "/var/tmp/BUILD/systemd-${VERSION/\~/_}-build" +mkdir -p "/var/tmp/BUILD/systemd-${VERSION/\~/_}-build/SPECPARTS" +ln -s /work/src "/var/tmp/BUILD/systemd-${VERSION/\~/_}-build/systemd-$VERSION" + IFS= # TODO: Replace meson_build and meson_install overrides with "--undefine __meson_verbose" once # https://github.com/mesonbuild/meson/pull/12835 is available. @@ -66,6 +72,7 @@ CC_LD="$( ((LLVM)) && echo lld)" \ CXX_LD="$( ((LLVM)) && echo lld)" \ rpmbuild \ -bb \ + --noprep \ --build-in-place \ --with upstream \ $( ((WITH_TESTS)) || echo "--nocheck") \ diff --git a/mkosi.images/build/mkosi.conf.d/centos-fedora/mkosi.prepare b/mkosi.images/build/mkosi.conf.d/centos-fedora/mkosi.prepare index 6028dc355b..a7e8353cf6 100755 --- a/mkosi.images/build/mkosi.conf.d/centos-fedora/mkosi.prepare +++ b/mkosi.images/build/mkosi.conf.d/centos-fedora/mkosi.prepare @@ -32,6 +32,7 @@ sed '/Source0/d' --in-place "pkg/$PKG_SUBDIR/systemd.spec" until mkosi-chroot \ rpmbuild \ -br \ + --noprep \ --build-in-place \ --with upstream \ --define "_topdir /var/tmp" \ diff --git a/mkosi.images/build/mkosi.conf.d/opensuse/mkosi.build.chroot b/mkosi.images/build/mkosi.conf.d/opensuse/mkosi.build.chroot index 173468f6c1..e44bf0e079 100755 --- a/mkosi.images/build/mkosi.conf.d/opensuse/mkosi.build.chroot +++ b/mkosi.images/build/mkosi.conf.d/opensuse/mkosi.build.chroot @@ -69,6 +69,7 @@ build() { CXX_LD="$( ((LLVM)) && echo lld)" \ rpmbuild \ -bb \ + --noprep \ --build-in-place \ --with upstream \ $( ((WITH_TESTS)) || echo "--nocheck") \ diff --git a/mkosi.images/build/mkosi.conf.d/opensuse/mkosi.prepare b/mkosi.images/build/mkosi.conf.d/opensuse/mkosi.prepare index 24f07fd459..b7dc231dda 100755 --- a/mkosi.images/build/mkosi.conf.d/opensuse/mkosi.prepare +++ b/mkosi.images/build/mkosi.conf.d/opensuse/mkosi.prepare @@ -30,6 +30,7 @@ mkosi-chroot \ until mkosi-chroot \ rpmbuild \ -bd \ + --noprep \ --build-in-place \ --with upstream \ --define "_topdir /var/tmp" \ From 71acb00c28a2d02fd582267a9bc263cd0ef9bd97 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Mon, 12 Aug 2024 12:19:37 +0200 Subject: [PATCH 3/8] mkosi: Always specify _sourcedir as an absolute path A relative path is not supported by rpm so let's make sure we specify it as an absolute path. --- .../build/mkosi.conf.d/centos-fedora/mkosi.build.chroot | 2 +- mkosi.images/build/mkosi.conf.d/centos-fedora/mkosi.prepare | 4 ++-- mkosi.images/build/mkosi.conf.d/opensuse/mkosi.build.chroot | 2 +- mkosi.images/build/mkosi.conf.d/opensuse/mkosi.prepare | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mkosi.images/build/mkosi.conf.d/centos-fedora/mkosi.build.chroot b/mkosi.images/build/mkosi.conf.d/centos-fedora/mkosi.build.chroot index b372b2264b..a790a8c083 100755 --- a/mkosi.images/build/mkosi.conf.d/centos-fedora/mkosi.build.chroot +++ b/mkosi.images/build/mkosi.conf.d/centos-fedora/mkosi.build.chroot @@ -78,7 +78,7 @@ CXX_LD="$( ((LLVM)) && echo lld)" \ $( ((WITH_TESTS)) || echo "--nocheck") \ $( ((WITH_DOCS)) || echo "--without=docs") \ --define "_topdir /var/tmp" \ - --define "_sourcedir pkg/$PKG_SUBDIR" \ + --define "_sourcedir $PWD/pkg/$PKG_SUBDIR" \ --define "_rpmdir $OUTPUTDIR" \ ${BUILDDIR:+"--define=_vpath_builddir $BUILDDIR"} \ --define "_build_name_fmt %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm" \ diff --git a/mkosi.images/build/mkosi.conf.d/centos-fedora/mkosi.prepare b/mkosi.images/build/mkosi.conf.d/centos-fedora/mkosi.prepare index a7e8353cf6..4fef26f881 100755 --- a/mkosi.images/build/mkosi.conf.d/centos-fedora/mkosi.prepare +++ b/mkosi.images/build/mkosi.conf.d/centos-fedora/mkosi.prepare @@ -17,7 +17,7 @@ mkosi-chroot \ --query \ --buildrequires \ --define "_topdir /var/tmp" \ - --define "_sourcedir pkg/$PKG_SUBDIR" \ + --define "_sourcedir $PWD/pkg/$PKG_SUBDIR" \ "pkg/$PKG_SUBDIR/systemd.spec" | grep --invert-match --regexp systemd --regexp /bin/sh --regexp "rpmlib(" --regexp udev --regexp grubby --regexp sdubby | sort --unique | @@ -36,7 +36,7 @@ until mkosi-chroot \ --build-in-place \ --with upstream \ --define "_topdir /var/tmp" \ - --define "_sourcedir pkg/$PKG_SUBDIR" \ + --define "_sourcedir $PWD/pkg/$PKG_SUBDIR" \ --define "_build_name_fmt %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm" \ "pkg/$PKG_SUBDIR/systemd.spec" do diff --git a/mkosi.images/build/mkosi.conf.d/opensuse/mkosi.build.chroot b/mkosi.images/build/mkosi.conf.d/opensuse/mkosi.build.chroot index e44bf0e079..b127e9d01a 100755 --- a/mkosi.images/build/mkosi.conf.d/opensuse/mkosi.build.chroot +++ b/mkosi.images/build/mkosi.conf.d/opensuse/mkosi.build.chroot @@ -74,7 +74,7 @@ build() { --with upstream \ $( ((WITH_TESTS)) || echo "--nocheck") \ --define "_topdir /var/tmp" \ - --define "_sourcedir pkg/$PKG_SUBDIR" \ + --define "_sourcedir $PWD/pkg/$PKG_SUBDIR" \ --define "_rpmdir $OUTPUTDIR" \ ${BUILDDIR:+"--define=_vpath_builddir $BUILDDIR"} \ --define "_build_name_fmt %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm" \ diff --git a/mkosi.images/build/mkosi.conf.d/opensuse/mkosi.prepare b/mkosi.images/build/mkosi.conf.d/opensuse/mkosi.prepare index b7dc231dda..c4a9580715 100755 --- a/mkosi.images/build/mkosi.conf.d/opensuse/mkosi.prepare +++ b/mkosi.images/build/mkosi.conf.d/opensuse/mkosi.prepare @@ -20,7 +20,7 @@ mkosi-chroot \ --query \ --buildrequires \ --define "_topdir /var/tmp" \ - --define "_sourcedir pkg/$PKG_SUBDIR" \ + --define "_sourcedir $PWD/pkg/$PKG_SUBDIR" \ "pkg/$PKG_SUBDIR/systemd.spec" | grep --invert-match --regexp systemd --regexp /bin/sh --regexp "rpmlib(" --regexp udev | sort --unique | @@ -34,7 +34,7 @@ until mkosi-chroot \ --build-in-place \ --with upstream \ --define "_topdir /var/tmp" \ - --define "_sourcedir pkg/$PKG_SUBDIR" \ + --define "_sourcedir $PWD/pkg/$PKG_SUBDIR" \ --define "_build_name_fmt %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm" \ "pkg/$PKG_SUBDIR/systemd.spec" do From 3e09a3eac20423cae5e596e72a4fc40b6ce454e6 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Wed, 28 Aug 2024 12:10:12 +0200 Subject: [PATCH 4/8] mkosi: Include noarch in dnf repoquery architectures ukify is noarch so we should include noarch to get all results. --- mkosi.conf.d/10-centos-fedora/mkosi.prepare | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkosi.conf.d/10-centos-fedora/mkosi.prepare b/mkosi.conf.d/10-centos-fedora/mkosi.prepare index 5729062953..9e74aabae2 100755 --- a/mkosi.conf.d/10-centos-fedora/mkosi.prepare +++ b/mkosi.conf.d/10-centos-fedora/mkosi.prepare @@ -12,7 +12,7 @@ for DEPS in --requires --recommends --suggests; do # We need --latest-limit=1 to only consider the newest version of the packages. # --latest-limit=1 is per . so we have to pass --arch= explicitly to make sure i686 packages # are not considered on x86-64. - dnf repoquery --arch="$DISTRIBUTION_ARCHITECTURE" --latest-limit=1 --quiet "$DEPS" "${PACKAGES[@]}" | + dnf repoquery --arch="$DISTRIBUTION_ARCHITECTURE,noarch" --latest-limit=1 --quiet "$DEPS" "${PACKAGES[@]}" | grep --invert-match --regexp systemd --regexp udev --regexp /bin/sh --regexp grubby --regexp sdubby --regexp libcurl-minimal | sort --unique | xargs --delimiter '\n' --no-run-if-empty mkosi-install From caf984def5fb74d4cc674493be561e4c6fea8294 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Wed, 28 Aug 2024 09:46:04 +0200 Subject: [PATCH 5/8] mkosi: update arch commit reference * ea5f086275 handle uncommon license * 43e43faab8 upgpkg: 256.5-1: new upstream release * 7f4443062f Provide /etc/cryptsetup-keys.d/ * 262a14b8e5 upgpkg: 256.4-1: new upstream release * 1aff4eb5f6 upgpkg: 256.3-1: new upstream release --- mkosi.images/build/mkosi.conf.d/arch/mkosi.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkosi.images/build/mkosi.conf.d/arch/mkosi.conf b/mkosi.images/build/mkosi.conf.d/arch/mkosi.conf index c071468963..91a4d1727a 100644 --- a/mkosi.images/build/mkosi.conf.d/arch/mkosi.conf +++ b/mkosi.images/build/mkosi.conf.d/arch/mkosi.conf @@ -7,7 +7,7 @@ Distribution=arch Environment= GIT_URL=https://gitlab.archlinux.org/archlinux/packaging/packages/systemd.git GIT_BRANCH=main - GIT_COMMIT=1d577a62688419ee4af01b847e55845cd9780301 + GIT_COMMIT=ea5f086275aeba40d878507fba8b22308c3fac01 PKG_SUBDIR=arch Packages= From 051fddfc4191dae851a40ee239707b7ab0061116 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Wed, 28 Aug 2024 09:46:05 +0200 Subject: [PATCH 6/8] mkosi: update opensuse commit reference * 2866762da8 Update systemd to version 256.4 / rev 429 via SR 1192932 --- mkosi.images/build/mkosi.conf.d/opensuse/mkosi.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkosi.images/build/mkosi.conf.d/opensuse/mkosi.conf b/mkosi.images/build/mkosi.conf.d/opensuse/mkosi.conf index a9414577c0..c8b3bd39dc 100644 --- a/mkosi.images/build/mkosi.conf.d/opensuse/mkosi.conf +++ b/mkosi.images/build/mkosi.conf.d/opensuse/mkosi.conf @@ -7,7 +7,7 @@ Distribution=opensuse Environment= GIT_URL=https://code.opensuse.org/package/systemd GIT_BRANCH=master - GIT_COMMIT=6812406e52a474568744c267e7bade1496bb26a5 + GIT_COMMIT=2866762da8394e98a85834f533b5ea3db6d3328f PKG_SUBDIR=opensuse Packages= From 92c22e02c1a591b4bc97ae4c6d0025851549f0fc Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Wed, 28 Aug 2024 09:46:07 +0200 Subject: [PATCH 7/8] mkosi: update fedora commit reference * 28076e6232 Only make python3-pillow Recommends on Fedora * a9807c4486 Do not require grubby on CentOS Stream 9 * d38cacfd3a Version 256.5 * 38291e13c1 Disable integration of userdb in sshd * 53118d2112 Backport patch to only read /proc/cmdline when not in container * 903e8e0f88 Backport upstream patch to try more initrd variants in 90-loaderentry.install * b29a66006c Version 256.4 * 1cdae03391 Update tmpfiles --destroy-data patch * 4fd4ef72a6 Upload sources * 3c3772150d Version 256.3 --- mkosi.images/build/mkosi.conf.d/centos-fedora/mkosi.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkosi.images/build/mkosi.conf.d/centos-fedora/mkosi.conf b/mkosi.images/build/mkosi.conf.d/centos-fedora/mkosi.conf index f3afd55a75..bce52d88a8 100644 --- a/mkosi.images/build/mkosi.conf.d/centos-fedora/mkosi.conf +++ b/mkosi.images/build/mkosi.conf.d/centos-fedora/mkosi.conf @@ -8,7 +8,7 @@ Distribution=|fedora Environment= GIT_URL=https://src.fedoraproject.org/rpms/systemd.git GIT_BRANCH=rawhide - GIT_COMMIT=00babccdea1576d96edfdb7ab12958564cc4f1b6 + GIT_COMMIT=28076e6232412aa7138e09aaec8c0a414faa3dce PKG_SUBDIR=fedora Packages= From e885e9defa5173f23f5755703f72314e382d83f5 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Wed, 28 Aug 2024 09:46:10 +0200 Subject: [PATCH 8/8] mkosi: update debian commit reference * aa17b7ddf9 Fix stage1 build * 2c13391e33 Update changelog for 256.5-1 release * 7d13196926 autopkgtest: skip TEST-64-UDEV-STORAGE due to qemu crash * 47769e8d7c Drop patch merged upstream * 4e8e9315b5 Update upstream source from tag 'upstream/256.5' |\ | * 71b885347d New upstream version 256.5 * 89a33e5408 d/e/checkout-upstream: undo quilt patches before switching debian branch * 3c942ecb0d d/e/checkout-upstream: do not rebase on main when building stable branches --- mkosi.images/build/mkosi.conf.d/debian-ubuntu/mkosi.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkosi.images/build/mkosi.conf.d/debian-ubuntu/mkosi.conf b/mkosi.images/build/mkosi.conf.d/debian-ubuntu/mkosi.conf index 17dd499f13..6c0b841639 100644 --- a/mkosi.images/build/mkosi.conf.d/debian-ubuntu/mkosi.conf +++ b/mkosi.images/build/mkosi.conf.d/debian-ubuntu/mkosi.conf @@ -9,7 +9,7 @@ Environment= GIT_URL=https://salsa.debian.org/systemd-team/systemd.git GIT_SUBDIR=debian GIT_BRANCH=debian/master - GIT_COMMIT=6e0f4f74bad23b54bfbca201cba4d3b8323fbbd6 + GIT_COMMIT=aa17b7ddf9633b4b0d06fdad3281137ba2851721 PKG_SUBDIR=debian Packages=