From ddc2234f4a1a632c96a3558e0c8c5762606ed807 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Tue, 25 Mar 2025 21:28:06 +0100 Subject: [PATCH 01/10] mkosi: Update to latest --- .github/workflows/coverage.yml | 2 +- .github/workflows/mkosi.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index c93156be31..c51e4da109 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -25,7 +25,7 @@ jobs: steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - uses: systemd/mkosi@6e64559161c1a5ed88ad1eacdd77f9a45cbbf6a6 + - uses: systemd/mkosi@03d1a1b4cdc474c55166a2f48be244748011206d # 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 diff --git a/.github/workflows/mkosi.yml b/.github/workflows/mkosi.yml index 30ef13e0c5..2614ee84d9 100644 --- a/.github/workflows/mkosi.yml +++ b/.github/workflows/mkosi.yml @@ -120,7 +120,7 @@ jobs: steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - uses: systemd/mkosi@6e64559161c1a5ed88ad1eacdd77f9a45cbbf6a6 + - uses: systemd/mkosi@03d1a1b4cdc474c55166a2f48be244748011206d # 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 eeb43426de20c97449bbec6c84783709415ffb45 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Tue, 25 Mar 2025 20:41:24 +0100 Subject: [PATCH 02/10] mkosi: Remove debian/ubuntu pinning mkosi does this natively now. --- mkosi.conf.d/10-debian-ubuntu/mkosi-pinning.pref | 3 --- mkosi.conf.d/10-debian-ubuntu/mkosi.conf | 3 --- 2 files changed, 6 deletions(-) delete mode 100644 mkosi.conf.d/10-debian-ubuntu/mkosi-pinning.pref diff --git a/mkosi.conf.d/10-debian-ubuntu/mkosi-pinning.pref b/mkosi.conf.d/10-debian-ubuntu/mkosi-pinning.pref deleted file mode 100644 index 5649b70a85..0000000000 --- a/mkosi.conf.d/10-debian-ubuntu/mkosi-pinning.pref +++ /dev/null @@ -1,3 +0,0 @@ -Package: * -Pin: release l=mkosi -Pin-Priority: 1100 diff --git a/mkosi.conf.d/10-debian-ubuntu/mkosi.conf b/mkosi.conf.d/10-debian-ubuntu/mkosi.conf index b34b8c6e19..30138c00fb 100644 --- a/mkosi.conf.d/10-debian-ubuntu/mkosi.conf +++ b/mkosi.conf.d/10-debian-ubuntu/mkosi.conf @@ -4,9 +4,6 @@ Distribution=|debian Distribution=|ubuntu -[Build] -SandboxTrees=mkosi-pinning.pref:/etc/apt/preferences.d/mkosi-pinning.pref - [Content] VolatilePackages= libnss-myhostname From d3ae14bd2feb8ee07b72bef0bd397c8cdd43a4ea Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Thu, 27 Mar 2025 13:18:45 +0100 Subject: [PATCH 03/10] mkosi: Disable various extra things in the default preset --- .../usr/lib/systemd/system-preset/00-mkosi.preset | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mkosi.extra.common/usr/lib/systemd/system-preset/00-mkosi.preset b/mkosi.extra.common/usr/lib/systemd/system-preset/00-mkosi.preset index 42db0c9b98..5076886f50 100644 --- a/mkosi.extra.common/usr/lib/systemd/system-preset/00-mkosi.preset +++ b/mkosi.extra.common/usr/lib/systemd/system-preset/00-mkosi.preset @@ -40,6 +40,15 @@ disable iscsi.service disable iscsid.socket disable iscsiuio.socket +# Enabled by default on Fedora, but don't make sense for our use case. +disable lvm2-lvmpolld.socket +disable lvm2-monitor.service +disable dracut-shutdown.service +disable dm-event.socket +disable fstrim.timer +disable raid-check.timer +disable systemd-tmpfiles-clean.timer + # mkosi relabels the image itself so no need to do it on boot. disable selinux-autorelabel-mark.service From 858e59c82c2246d34d84bd495f46c971d9303dba Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Thu, 27 Mar 2025 14:31:55 +0100 Subject: [PATCH 04/10] mkosi: Mark /etc /var as updated in a finalize script Let's make sure we don't run ldconfig.service and other services again on first boot. --- mkosi.finalize | 5 +++++ 1 file changed, 5 insertions(+) create mode 100755 mkosi.finalize diff --git a/mkosi.finalize b/mkosi.finalize new file mode 100755 index 0000000000..e6aededc60 --- /dev/null +++ b/mkosi.finalize @@ -0,0 +1,5 @@ +#!/bin/bash +# SPDX-License-Identifier: CC-0 +set -e + +touch -r "$BUILDROOT/usr" "$BUILDROOT/etc/.updated" "$BUILDROOT/var/.updated" From c4fcd6ea78e21dd0cf718f2c83fab9268fcaa72a Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Fri, 28 Mar 2025 11:40:20 +0100 Subject: [PATCH 05/10] mkosi: Bump minimum version to 25~devel --- mkosi.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkosi.conf b/mkosi.conf index a9d096815a..fc2b12bda2 100644 --- a/mkosi.conf +++ b/mkosi.conf @@ -1,7 +1,7 @@ # SPDX-License-Identifier: LGPL-2.1-or-later [Config] -MinimumVersion=25 +MinimumVersion=25~devel Dependencies= exitrd initrd From 51b492074674d020de1d556dc2c3fa224b41e508 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Thu, 27 Mar 2025 14:24:28 +0100 Subject: [PATCH 06/10] test: Boot integration test VMs without an initrd if possible If we don't need an initrd, let's not waste time in one. We have to gate this by distributions that have the necessary kernel modules to make this work as builtin modules, hopefully we can expand the list in the future. --- .../TEST-08-INITRD/meson.build | 1 + .../TEST-24-CRYPTSETUP/meson.build | 1 + .../integration-test-wrapper.py | 22 ++++++++++++++----- test/integration-tests/meson.build | 2 +- 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/test/integration-tests/TEST-08-INITRD/meson.build b/test/integration-tests/TEST-08-INITRD/meson.build index dcbfe20134..5425096a56 100644 --- a/test/integration-tests/TEST-08-INITRD/meson.build +++ b/test/integration-tests/TEST-08-INITRD/meson.build @@ -8,5 +8,6 @@ integration_tests += [ ], 'exit-code' : 124, 'vm' : true, + 'firmware' : 'linux', }, ] diff --git a/test/integration-tests/TEST-24-CRYPTSETUP/meson.build b/test/integration-tests/TEST-24-CRYPTSETUP/meson.build index 4d65e1d9ab..c9e0271e96 100644 --- a/test/integration-tests/TEST-24-CRYPTSETUP/meson.build +++ b/test/integration-tests/TEST-24-CRYPTSETUP/meson.build @@ -22,5 +22,6 @@ integration_tests += [ '--runtime-size=11G', ], 'vm' : true, + 'firmware' : 'linux', }, ] diff --git a/test/integration-tests/integration-test-wrapper.py b/test/integration-tests/integration-test-wrapper.py index 90f40abfe2..d098910685 100755 --- a/test/integration-tests/integration-test-wrapper.py +++ b/test/integration-tests/integration-test-wrapper.py @@ -489,6 +489,22 @@ def main() -> None: else: rtc = None + # mkosi will use the UEFI secure boot firmware by default on UEFI platforms. However, this breaks on + # Github Actions in combination with KVM because of a HyperV bug so make sure we use the non secure + # boot firmware on Github Actions. + # TODO: Drop after the HyperV bug that breaks secure boot KVM guests is solved + if args.firmware == 'auto' and os.getenv('GITHUB_ACTIONS'): + firmware = 'uefi' + # Whenever possible, boot without an initrd. This requires the target distribution kernel to have the + # necessary modules (virtio-blk, ext4) builtin. + elif args.firmware == 'linux-noinitrd' and (summary.distribution, summary.release) not in ( + ('fedora', 'rawhide'), + ('arch', 'rolling'), + ): + firmware = 'linux' + else: + firmware = args.firmware + cmd = [ args.mkosi, '--directory', os.fspath(args.meson_source_dir), @@ -508,11 +524,7 @@ def main() -> None: '--runtime-scratch=no', *([f'--qemu-args=-rtc base={rtc}'] if rtc else []), *args.mkosi_args, - # mkosi will use the UEFI secure boot firmware by default on UEFI platforms. However, this breaks on - # Github Actions in combination with KVM because of a HyperV bug so make sure we use the non secure - # boot firmware on Github Actions. - # TODO: Drop after the HyperV bug that breaks secure boot KVM guests is solved - '--firmware', 'uefi' if args.firmware == 'auto' and os.getenv("GITHUB_ACTIONS") else args.firmware, + '--firmware', firmware, *(['--kvm', 'no'] if int(os.getenv('TEST_NO_KVM', '0')) else []), '--kernel-command-line-extra', ' '.join( diff --git a/test/integration-tests/meson.build b/test/integration-tests/meson.build index ecf3df7f09..cdcc1d8dba 100644 --- a/test/integration-tests/meson.build +++ b/test/integration-tests/meson.build @@ -7,7 +7,7 @@ integration_test_template = { 'timeout' : 1800, 'storage' : 'volatile', 'priority' : 0, - 'firmware' : 'linux', + 'firmware' : 'linux-noinitrd', 'enabled' : true, 'configuration' : { 'memory-accounting' : 'no', From c2d2b382b6440dbb3795a3982260cf9534bbf2de Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Thu, 27 Mar 2025 15:49:06 +0100 Subject: [PATCH 07/10] TEST-06-SELINUX: Only enable if meson was invoked as root This test only works if the image was built as root. Since that's impossible to check as meson generally runs before we build the image, let's use whether meson is run as root as a proxy. --- test/integration-tests/TEST-06-SELINUX/meson.build | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/integration-tests/TEST-06-SELINUX/meson.build b/test/integration-tests/TEST-06-SELINUX/meson.build index e2f329d17c..22f306260d 100644 --- a/test/integration-tests/TEST-06-SELINUX/meson.build +++ b/test/integration-tests/TEST-06-SELINUX/meson.build @@ -1,5 +1,8 @@ # SPDX-License-Identifier: LGPL-2.1-or-later +id = find_program('id', required : true) +uid = run_command(id, '-u', check : true).stdout().strip().to_int() + integration_tests += [ integration_test_template + { 'name' : fs.name(meson.current_source_dir()), @@ -11,5 +14,6 @@ integration_tests += [ # Make sure we don't mount anything with virtiofs as otherwise fixfiles will try to relabel # it. 'mkosi-args' : integration_test_template['mkosi-args'] + ['--runtime-build-sources=no'], + 'enabled' : uid == 0, }, ] From 29a1e7df64818192be719f1309ae449054b0d7c4 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Thu, 27 Mar 2025 15:53:28 +0100 Subject: [PATCH 08/10] test: Mark tests as skipped if requirements were not satisfied Instead of not creating the test at all, let's always create test but simply mark them as skipped as this is more observable than simply not creating the test at all. --- test/integration-tests/integration-test-wrapper.py | 5 +++++ test/integration-tests/meson.build | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/test/integration-tests/integration-test-wrapper.py b/test/integration-tests/integration-test-wrapper.py index d098910685..7335611eb7 100755 --- a/test/integration-tests/integration-test-wrapper.py +++ b/test/integration-tests/integration-test-wrapper.py @@ -365,6 +365,7 @@ def main() -> None: parser.add_argument('--coredump-exclude-regex', required=True) parser.add_argument('--sanitizer-exclude-regex', required=True) parser.add_argument('--rtc', action=argparse.BooleanOptionalAction) + parser.add_argument('--skip', action=argparse.BooleanOptionalAction) parser.add_argument('mkosi_args', nargs='*') args = parser.parse_args() @@ -386,6 +387,10 @@ def main() -> None: print(f'TEST_NO_QEMU=1, skipping {args.name}', file=sys.stderr) exit(77) + if args.skip: + print(f'meson requirements for test {args.name} were not fulfilled, skipping', file=sys.stderr) + exit(77) + for s in os.getenv('TEST_SKIP', '').split(): if s in args.name: print(f'Skipping {args.name} due to TEST_SKIP', file=sys.stderr) diff --git a/test/integration-tests/meson.build b/test/integration-tests/meson.build index cdcc1d8dba..3afbeac1e4 100644 --- a/test/integration-tests/meson.build +++ b/test/integration-tests/meson.build @@ -125,6 +125,10 @@ foreach integration_test : integration_tests integration_test_args += ['--rtc'] endif + if not integration_test['enabled'] + integration_test_args += ['--skip'] + endif + if not mkosi.found() continue endif @@ -153,10 +157,6 @@ foreach integration_test : integration_tests integration_test_env += {'SYSTEMD_INTEGRATION_TESTS': '1'} endif - if not integration_test['enabled'] - continue - endif - # We don't explicitly depend on the "mkosi" target because that means the image is rebuilt on every # "ninja -C build". Instead, the mkosi target has to be rebuilt manually before running the # integration tests with mkosi. From e7df838a073dd6a1de41636dfa55f0ef33151dd6 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Thu, 27 Mar 2025 16:10:03 +0100 Subject: [PATCH 09/10] test: Use /dev/shm for TEST_JOURNAL_USE_TMP if /tmp isn't tmpfs If /dev/shm is a tmpfs and /tmp isn't, use /dev/shm instead. --- .../integration-test-wrapper.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/test/integration-tests/integration-test-wrapper.py b/test/integration-tests/integration-test-wrapper.py index 7335611eb7..18b35eec7c 100755 --- a/test/integration-tests/integration-test-wrapper.py +++ b/test/integration-tests/integration-test-wrapper.py @@ -350,6 +350,15 @@ def process_coverage(args: argparse.Namespace, summary: Summary, name: str, jour print(f'Wrote coverage report for {name} to {output}', file=sys.stderr) +def statfs(path: Path) -> str: + return subprocess.run( + ['stat', '--file-system', os.fspath(path), '--format=%T'], + stdout=subprocess.PIPE, + text=True, + check=True, + ).stdout.strip() + + def main() -> None: parser = argparse.ArgumentParser(description=__doc__) parser.add_argument('--mkosi', required=True) @@ -442,7 +451,12 @@ def main() -> None: ) if os.getenv('TEST_JOURNAL_USE_TMP', '0') == '1': - journal_file = Path(f'/tmp/systemd-integration-tests/journal/{name}.journal') + if statfs(Path('/tmp')) != 'tmpfs' and statfs(Path('/dev/shm')) == 'tmpfs': + tmp = Path('/dev/shm') + else: + tmp = Path('/tmp') + + journal_file = tmp / f'systemd-integration-tests/journal/{name}.journal' else: journal_file = (args.meson_build_dir / f'test/journal/{name}.journal').absolute() From 1b49fb9aaa7d5d6dc84d4a1ca56acda2385ef10e Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Tue, 25 Mar 2025 21:02:24 +0100 Subject: [PATCH 10/10] mkosi: Use build image prepare scripts for tools tree as well Instead of listing dependencies manually for the default tools tree, let's reuse the prepare scripts from the build image. To make this work, the sync script has to be configured for the tools tree as well so that it's invoked both when building the tools tree and for the regular image, otherwise, when doing the first build in a fresh checkout, the sync script won't have executed yet as sync scripts for the regular images are executed after building the default tools tree. --- .github/workflows/mkosi.yml | 4 ++++ .packit.yml | 2 +- docs/HACKING.md | 2 +- mkosi.conf | 6 +++++- mkosi.conf.d/05-tools/mkosi.conf | 7 ++----- mkosi.conf.d/05-tools/mkosi.conf.d/arch.conf | 12 ++---------- .../05-tools/mkosi.conf.d/centos-fedora.conf | 15 ++------------- .../05-tools/mkosi.conf.d/debian-ubuntu.conf | 13 +------------ .../05-tools/mkosi.conf.d/opensuse.conf | 18 +++--------------- .../05-tools/mkosi.conf.d/ubuntu/mkosi.conf | 4 ++++ .../ubuntu/mkosi.conf.d/non-x86.conf | 10 ++++++++++ .../mkosi.conf.d/ubuntu/mkosi.conf.d/x86.conf | 10 ++++++++++ mkosi.conf.d/10-arch/mkosi.conf | 7 +++++++ mkosi.conf.d/10-centos-fedora/mkosi.conf | 7 +++++++ mkosi.conf.d/10-debian-ubuntu/mkosi.conf | 8 ++++++++ mkosi.conf.d/10-opensuse/mkosi.conf | 6 ++++++ .../build/mkosi.conf.d/arch/mkosi.conf | 7 ------- .../build/mkosi.conf.d/arch/mkosi.prepare | 2 +- .../mkosi.conf.d/centos-fedora/mkosi.conf | 7 ------- .../mkosi.conf.d/centos-fedora/mkosi.prepare | 2 +- .../mkosi.conf.d/debian-ubuntu/mkosi.conf | 8 -------- .../mkosi.conf.d/debian-ubuntu/mkosi.prepare | 2 +- .../build/mkosi.conf.d/opensuse/mkosi.conf | 8 -------- .../build/mkosi.conf.d/opensuse/mkosi.prepare | 2 +- mkosi.images/build/mkosi.sync => mkosi.sync | 0 tools/fetch-distro.py | 2 +- 26 files changed, 78 insertions(+), 93 deletions(-) create mode 100644 mkosi.conf.d/05-tools/mkosi.conf.d/ubuntu/mkosi.conf create mode 100644 mkosi.conf.d/05-tools/mkosi.conf.d/ubuntu/mkosi.conf.d/non-x86.conf create mode 100644 mkosi.conf.d/05-tools/mkosi.conf.d/ubuntu/mkosi.conf.d/x86.conf rename mkosi.images/build/mkosi.sync => mkosi.sync (100%) diff --git a/.github/workflows/mkosi.yml b/.github/workflows/mkosi.yml index 2614ee84d9..2f13079252 100644 --- a/.github/workflows/mkosi.yml +++ b/.github/workflows/mkosi.yml @@ -191,10 +191,14 @@ jobs: - name: Configure meson run: | + # /usr/sbin/bpftool is completely broken inside containers on Ubuntu which makes meson blow up so + # disable the bpf-framework stuff to avoid the issue. + # TODO: Drop when we move off Ubuntu Noble as this will be fixed in the next Ubuntu LTS release. sudo mkosi sandbox -- \ meson setup \ --buildtype=debugoptimized \ -Dintegration-tests=true \ + -Dbpf-framework=disabled \ build - name: Build image diff --git a/.packit.yml b/.packit.yml index d5d2ef3636..75d5f6557a 100644 --- a/.packit.yml +++ b/.packit.yml @@ -19,7 +19,7 @@ actions: post-upstream-clone: # Use the Fedora Rawhide specfile - git clone https://src.fedoraproject.org/rpms/systemd .packit_rpm - - bash -c 'git -C .packit_rpm checkout "$(grep GIT_COMMIT= mkosi.images/build/mkosi.conf.d/centos-fedora/mkosi.conf | cut -d= -f2)"' + - bash -c 'git -C .packit_rpm checkout "$(grep GIT_COMMIT= mkosi.conf.d/10-centos-fedora/mkosi.conf | cut -d= -f2)"' - bash -c 'echo "%bcond upstream 1" > .packit_rpm/systemd.spec.new' - bash -c 'echo "%define meson_extra_configure_options --werror" >> .packit_rpm/systemd.spec.new' - bash -c 'cat .packit_rpm/systemd.spec >> .packit_rpm/systemd.spec.new' diff --git a/docs/HACKING.md b/docs/HACKING.md index 5a6e57da53..6baa3ae393 100644 --- a/docs/HACKING.md +++ b/docs/HACKING.md @@ -39,7 +39,7 @@ chance that your distribution's packaged version of mkosi will be too old. Then, you can build, run and test systemd executables as follows: ```sh -$ mkosi -f sandbox -- meson setup build +$ mkosi -f sandbox -- meson setup -Dbpf-framework=disabled build # bpftool detection inside mkosi sandbox is broken on Ubuntu Noble and older $ mkosi -f sandbox -- meson compile -C build $ mkosi -f sandbox -- build/systemctl --version $ mkosi -f sandbox -- meson test -C build # Run the unit tests diff --git a/mkosi.conf b/mkosi.conf index fc2b12bda2..033b92d591 100644 --- a/mkosi.conf +++ b/mkosi.conf @@ -11,7 +11,6 @@ Dependencies= PassEnvironment= NO_BUILD - NO_SYNC WIPE SANITIZERS CFLAGS @@ -24,6 +23,11 @@ PassEnvironment= ASAN_OPTIONS COVERAGE VCS_TAG + GIT_URL + GIT_SUBDIR + GIT_BRANCH + GIT_COMMIT + PKG_SUBDIR [Output] RepartDirectories=mkosi.repart diff --git a/mkosi.conf.d/05-tools/mkosi.conf b/mkosi.conf.d/05-tools/mkosi.conf index 6656cee287..adbbf98ebf 100644 --- a/mkosi.conf.d/05-tools/mkosi.conf +++ b/mkosi.conf.d/05-tools/mkosi.conf @@ -1,11 +1,8 @@ # SPDX-License-Identifier: LGPL-2.1-or-later [Build] +ToolsTreeSyncScripts=%D/mkosi.sync ToolsTreePackages= - gcc gdb - gperf llvm - meson - pkgconf - rsync + meson # Also needed in the NO_BUILD case so we list it explicitly. diff --git a/mkosi.conf.d/05-tools/mkosi.conf.d/arch.conf b/mkosi.conf.d/05-tools/mkosi.conf.d/arch.conf index fdb147a1c7..4de8b2bd58 100644 --- a/mkosi.conf.d/05-tools/mkosi.conf.d/arch.conf +++ b/mkosi.conf.d/05-tools/mkosi.conf.d/arch.conf @@ -4,19 +4,11 @@ ToolsTreeDistribution=arch [Build] +ToolsTreePrepareScripts=%D/mkosi.images/build/mkosi.conf.d/arch/mkosi.prepare ToolsTreePackages= - cryptsetup + base-devel github-cli lcov - libcap - libmicrohttpd - libxslt mypy - perl-json-xs - python-jinja - python-lxml - python-pytest ruff shellcheck - tpm2-tss - util-linux-libs diff --git a/mkosi.conf.d/05-tools/mkosi.conf.d/centos-fedora.conf b/mkosi.conf.d/05-tools/mkosi.conf.d/centos-fedora.conf index 5dc5662115..2645e6df5d 100644 --- a/mkosi.conf.d/05-tools/mkosi.conf.d/centos-fedora.conf +++ b/mkosi.conf.d/05-tools/mkosi.conf.d/centos-fedora.conf @@ -5,18 +5,7 @@ ToolsTreeDistribution=|fedora ToolsTreeDistribution=|centos [Build] +ToolsTreePrepareScripts=%D/mkosi.images/build/mkosi.conf.d/centos-fedora/mkosi.prepare ToolsTreePackages= - pkgconfig(blkid) - pkgconfig(libcap) - pkgconfig(libcryptsetup) - pkgconfig(libcurl) - pkgconfig(fdisk) - pkgconfig(libmicrohttpd) - pkgconfig(mount) - tpm2-tss-devel - python3-jinja2 - python3-lxml python3-mypy - python3-pytest - libxslt - docbook-style-xsl + rpm-build diff --git a/mkosi.conf.d/05-tools/mkosi.conf.d/debian-ubuntu.conf b/mkosi.conf.d/05-tools/mkosi.conf.d/debian-ubuntu.conf index c060e57e82..b6715b5c50 100644 --- a/mkosi.conf.d/05-tools/mkosi.conf.d/debian-ubuntu.conf +++ b/mkosi.conf.d/05-tools/mkosi.conf.d/debian-ubuntu.conf @@ -5,20 +5,9 @@ ToolsTreeDistribution=|debian ToolsTreeDistribution=|ubuntu [Build] +ToolsTreePrepareScripts=%D/mkosi.images/build/mkosi.conf.d/debian-ubuntu/mkosi.prepare ToolsTreePackages= gh lcov - libblkid-dev - libcap-dev - libcryptsetup-dev - libcurl4-openssl-dev - libfdisk-dev - libmicrohttpd-dev - libmount-dev - libtss2-dev mypy - python3-jinja2 - python3-lxml - python3-pytest shellcheck - xsltproc diff --git a/mkosi.conf.d/05-tools/mkosi.conf.d/opensuse.conf b/mkosi.conf.d/05-tools/mkosi.conf.d/opensuse.conf index aeaa325d06..b7af141964 100644 --- a/mkosi.conf.d/05-tools/mkosi.conf.d/opensuse.conf +++ b/mkosi.conf.d/05-tools/mkosi.conf.d/opensuse.conf @@ -4,23 +4,11 @@ ToolsTreeDistribution=opensuse [Build] +ToolsTreePrepareScripts=%D/mkosi.images/build/mkosi.conf.d/opensuse/mkosi.prepare ToolsTreePackages= - lcov - libz1 gh + lcov mypy - pkgconfig(blkid) - pkgconfig(libcap) - pkgconfig(libcryptsetup) - pkgconfig(libcurl) - pkgconfig(fdisk) - pkgconfig(libmicrohttpd) - pkgconfig(mount) - pkgconfig(libopenssl) python3-ruff - tpm2-0-tss-devel - python3-jinja2 - python3-lxml - python3-pytest - xsltproc + rpm-build ShellCheck diff --git a/mkosi.conf.d/05-tools/mkosi.conf.d/ubuntu/mkosi.conf b/mkosi.conf.d/05-tools/mkosi.conf.d/ubuntu/mkosi.conf new file mode 100644 index 0000000000..3078782ae3 --- /dev/null +++ b/mkosi.conf.d/05-tools/mkosi.conf.d/ubuntu/mkosi.conf @@ -0,0 +1,4 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +[Match] +ToolsTreeDistribution=ubuntu diff --git a/mkosi.conf.d/05-tools/mkosi.conf.d/ubuntu/mkosi.conf.d/non-x86.conf b/mkosi.conf.d/05-tools/mkosi.conf.d/ubuntu/mkosi.conf.d/non-x86.conf new file mode 100644 index 0000000000..bbddf8e25f --- /dev/null +++ b/mkosi.conf.d/05-tools/mkosi.conf.d/ubuntu/mkosi.conf.d/non-x86.conf @@ -0,0 +1,10 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +# The ports Ubuntu archive is for non i386/amd64 repositories + +[Match] +Architecture=!x86-64 +Architecture=!x86 +ToolsTreeRelease=noble + +[Build] +ToolsTreeSandboxTrees=%D/mkosi.conf.d/10-ubuntu/noble-backports-ports.sources:/etc/apt/sources.list.d/noble-backports-ports.sources diff --git a/mkosi.conf.d/05-tools/mkosi.conf.d/ubuntu/mkosi.conf.d/x86.conf b/mkosi.conf.d/05-tools/mkosi.conf.d/ubuntu/mkosi.conf.d/x86.conf new file mode 100644 index 0000000000..9a6aa05cfb --- /dev/null +++ b/mkosi.conf.d/05-tools/mkosi.conf.d/ubuntu/mkosi.conf.d/x86.conf @@ -0,0 +1,10 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +# The main Ubuntu archive is only for i386/amd64 repositories + +[Match] +Architecture=|x86-64 +Architecture=|x86 +ToolsTreeRelease=noble + +[Build] +ToolsTreeSandboxTrees=%D/mkosi.conf.d/10-ubuntu/noble-backports.sources:/etc/apt/sources.list.d/noble-backports.sources diff --git a/mkosi.conf.d/10-arch/mkosi.conf b/mkosi.conf.d/10-arch/mkosi.conf index f897d7d31c..79c189bf03 100644 --- a/mkosi.conf.d/10-arch/mkosi.conf +++ b/mkosi.conf.d/10-arch/mkosi.conf @@ -3,6 +3,13 @@ [Match] Distribution=arch +[Build] +Environment= + GIT_URL=https://gitlab.archlinux.org/archlinux/packaging/packages/systemd.git + GIT_BRANCH=main + GIT_COMMIT=1b4994657df1c7495607f0c2f20db73550b94f34 + PKG_SUBDIR=arch + [Content] VolatilePackages= systemd diff --git a/mkosi.conf.d/10-centos-fedora/mkosi.conf b/mkosi.conf.d/10-centos-fedora/mkosi.conf index 7c941046f7..6f996fd578 100644 --- a/mkosi.conf.d/10-centos-fedora/mkosi.conf +++ b/mkosi.conf.d/10-centos-fedora/mkosi.conf @@ -4,6 +4,13 @@ Distribution=|centos Distribution=|fedora +[Build] +Environment= + GIT_URL=https://src.fedoraproject.org/rpms/systemd.git + GIT_BRANCH=rawhide + GIT_COMMIT=617952132de4ed882b9b00ceeed077f843130f91 + PKG_SUBDIR=fedora + [Content] VolatilePackages= systemd diff --git a/mkosi.conf.d/10-debian-ubuntu/mkosi.conf b/mkosi.conf.d/10-debian-ubuntu/mkosi.conf index 30138c00fb..3b85be300b 100644 --- a/mkosi.conf.d/10-debian-ubuntu/mkosi.conf +++ b/mkosi.conf.d/10-debian-ubuntu/mkosi.conf @@ -4,6 +4,14 @@ Distribution=|debian Distribution=|ubuntu +[Build] +Environment= + GIT_URL=https://salsa.debian.org/systemd-team/systemd.git + GIT_SUBDIR=debian + GIT_BRANCH=debian/master + GIT_COMMIT=d8c7f8f7f461b1edc3bf5040509e697ea574c990 + PKG_SUBDIR=debian + [Content] VolatilePackages= libnss-myhostname diff --git a/mkosi.conf.d/10-opensuse/mkosi.conf b/mkosi.conf.d/10-opensuse/mkosi.conf index 32ff446fec..6509ea4f16 100644 --- a/mkosi.conf.d/10-opensuse/mkosi.conf +++ b/mkosi.conf.d/10-opensuse/mkosi.conf @@ -9,6 +9,12 @@ Repositories=non-oss [Build] SandboxTrees=macros.db_backend:/etc/rpm/macros.db_backend +Environment= + GIT_URL=https://github.com/bmwiedemann/openSUSE + GIT_SUBDIR=packages/s/systemd + GIT_BRANCH=master + GIT_COMMIT=9002a773f0ab185908dc8fb6c831c1cd9fdf11f0 + PKG_SUBDIR=opensuse [Content] VolatilePackages= diff --git a/mkosi.images/build/mkosi.conf.d/arch/mkosi.conf b/mkosi.images/build/mkosi.conf.d/arch/mkosi.conf index e239f71294..d7a79d11c1 100644 --- a/mkosi.images/build/mkosi.conf.d/arch/mkosi.conf +++ b/mkosi.images/build/mkosi.conf.d/arch/mkosi.conf @@ -3,13 +3,6 @@ [Match] Distribution=arch -[Build] -Environment= - GIT_URL=https://gitlab.archlinux.org/archlinux/packaging/packages/systemd.git - GIT_BRANCH=main - GIT_COMMIT=1b4994657df1c7495607f0c2f20db73550b94f34 - PKG_SUBDIR=arch - [Content] Packages= base diff --git a/mkosi.images/build/mkosi.conf.d/arch/mkosi.prepare b/mkosi.images/build/mkosi.conf.d/arch/mkosi.prepare index d9e3221d31..500928279a 100755 --- a/mkosi.images/build/mkosi.conf.d/arch/mkosi.prepare +++ b/mkosi.images/build/mkosi.conf.d/arch/mkosi.prepare @@ -2,7 +2,7 @@ # SPDX-License-Identifier: LGPL-2.1-or-later set -e -if [[ "$1" == "build" ]]; then +if [[ "$1" == "build" ]] || ((NO_BUILD)); then exit 0 fi 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 5a846ae085..4d0ca8917d 100644 --- a/mkosi.images/build/mkosi.conf.d/centos-fedora/mkosi.conf +++ b/mkosi.images/build/mkosi.conf.d/centos-fedora/mkosi.conf @@ -4,13 +4,6 @@ Distribution=|centos Distribution=|fedora -[Build] -Environment= - GIT_URL=https://src.fedoraproject.org/rpms/systemd.git - GIT_BRANCH=rawhide - GIT_COMMIT=617952132de4ed882b9b00ceeed077f843130f91 - PKG_SUBDIR=fedora - [Content] Packages= clang-devel 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 3b7a470733..4118e2e59f 100755 --- a/mkosi.images/build/mkosi.conf.d/centos-fedora/mkosi.prepare +++ b/mkosi.images/build/mkosi.conf.d/centos-fedora/mkosi.prepare @@ -2,7 +2,7 @@ # SPDX-License-Identifier: LGPL-2.1-or-later set -e -if [[ "$1" == "build" ]]; then +if [[ "$1" == "build" ]] || ((NO_BUILD)); then exit 0 fi 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 e83cb6e73e..81c79a2c21 100644 --- a/mkosi.images/build/mkosi.conf.d/debian-ubuntu/mkosi.conf +++ b/mkosi.images/build/mkosi.conf.d/debian-ubuntu/mkosi.conf @@ -4,14 +4,6 @@ Distribution=|debian Distribution=|ubuntu -[Build] -Environment= - GIT_URL=https://salsa.debian.org/systemd-team/systemd.git - GIT_SUBDIR=debian - GIT_BRANCH=debian/master - GIT_COMMIT=d8c7f8f7f461b1edc3bf5040509e697ea574c990 - PKG_SUBDIR=debian - [Content] Packages= apt diff --git a/mkosi.images/build/mkosi.conf.d/debian-ubuntu/mkosi.prepare b/mkosi.images/build/mkosi.conf.d/debian-ubuntu/mkosi.prepare index cec81ec1d5..86852a588a 100755 --- a/mkosi.images/build/mkosi.conf.d/debian-ubuntu/mkosi.prepare +++ b/mkosi.images/build/mkosi.conf.d/debian-ubuntu/mkosi.prepare @@ -2,7 +2,7 @@ # SPDX-License-Identifier: LGPL-2.1-or-later set -e -if [[ "$1" == "build" ]]; then +if [[ "$1" == "build" ]] || ((NO_BUILD)); then exit 0 fi diff --git a/mkosi.images/build/mkosi.conf.d/opensuse/mkosi.conf b/mkosi.images/build/mkosi.conf.d/opensuse/mkosi.conf index cd852ed883..70a1b31b64 100644 --- a/mkosi.images/build/mkosi.conf.d/opensuse/mkosi.conf +++ b/mkosi.images/build/mkosi.conf.d/opensuse/mkosi.conf @@ -3,14 +3,6 @@ [Match] Distribution=opensuse -[Build] -Environment= - GIT_URL=https://github.com/bmwiedemann/openSUSE - GIT_SUBDIR=packages/s/systemd - GIT_BRANCH=master - GIT_COMMIT=9002a773f0ab185908dc8fb6c831c1cd9fdf11f0 - PKG_SUBDIR=opensuse - [Content] Packages= clang diff --git a/mkosi.images/build/mkosi.conf.d/opensuse/mkosi.prepare b/mkosi.images/build/mkosi.conf.d/opensuse/mkosi.prepare index ab2a42d8b4..1090f4818f 100755 --- a/mkosi.images/build/mkosi.conf.d/opensuse/mkosi.prepare +++ b/mkosi.images/build/mkosi.conf.d/opensuse/mkosi.prepare @@ -2,7 +2,7 @@ # SPDX-License-Identifier: LGPL-2.1-or-later set -e -if [[ "$1" == "build" ]]; then +if [[ "$1" == "build" ]] || ((NO_BUILD)); then exit 0 fi diff --git a/mkosi.images/build/mkosi.sync b/mkosi.sync similarity index 100% rename from mkosi.images/build/mkosi.sync rename to mkosi.sync diff --git a/tools/fetch-distro.py b/tools/fetch-distro.py index b91833a68f..77c46d45a2 100755 --- a/tools/fetch-distro.py +++ b/tools/fetch-distro.py @@ -126,7 +126,7 @@ def update_distro(args, distro: str, config: dict): print(f"+ {shlex.join(cmd)}") changes = subprocess.check_output(cmd, text=True).strip() - conf_dir = Path('mkosi.images/build/mkosi.conf.d') + conf_dir = Path('mkosi.conf.d') files = conf_dir.glob('*/*.conf') for file in files: s = file.read_text()