- 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
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'
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
PassEnvironment=
NO_BUILD
- NO_SYNC
WIPE
SANITIZERS
CFLAGS
ASAN_OPTIONS
COVERAGE
VCS_TAG
+ GIT_URL
+ GIT_SUBDIR
+ GIT_BRANCH
+ GIT_COMMIT
+ PKG_SUBDIR
[Output]
RepartDirectories=mkosi.repart
# 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.
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
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
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
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
--- /dev/null
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+ToolsTreeDistribution=ubuntu
--- /dev/null
+# 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
--- /dev/null
+# 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
[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
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
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
[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=
[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
# SPDX-License-Identifier: LGPL-2.1-or-later
set -e
-if [[ "$1" == "build" ]]; then
+if [[ "$1" == "build" ]] || ((NO_BUILD)); then
exit 0
fi
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
# SPDX-License-Identifier: LGPL-2.1-or-later
set -e
-if [[ "$1" == "build" ]]; then
+if [[ "$1" == "build" ]] || ((NO_BUILD)); then
exit 0
fi
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
# SPDX-License-Identifier: LGPL-2.1-or-later
set -e
-if [[ "$1" == "build" ]]; then
+if [[ "$1" == "build" ]] || ((NO_BUILD)); then
exit 0
fi
[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
# SPDX-License-Identifier: LGPL-2.1-or-later
set -e
-if [[ "$1" == "build" ]]; then
+if [[ "$1" == "build" ]] || ((NO_BUILD)); then
exit 0
fi
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()