# XXX: drop after the HyperV bug that breaks secure boot KVM guests is solved
sed -i "s/'firmware'\s*:\s*'auto'/'firmware' : 'uefi'/g" test/*/meson.build
- tee mkosi.local.conf <<EOF
+ tee mkosi/mkosi.local.conf <<EOF
[Distribution]
Distribution=arch
- name: Configure
run: |
- tee mkosi.local.conf <<EOF
+ tee mkosi/mkosi.local.conf <<EOF
[Distribution]
Distribution=${{ matrix.distro }}
Release=${{ matrix.release }}
/ID
/build*
/install-tree
-/mkosi.builddir/
-/mkosi.output/
-/mkosi.installdir/
/mkosi.key
/mkosi.crt
/mkosi.tools/
/mkosi.tools.manifest
-/.mkosi-private/
-mkosi.local.conf
+/mkosi/mkosi.local.conf
/tags
.dir-locals-2.el
.vscode/
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.conf.d/centos-fedora/mkosi.conf.d/pkgenv.conf | cut -d= -f2)"'
+ - bash -c 'git -C .packit_rpm checkout "$(grep GIT_COMMIT= mkosi/mkosi.conf.d/centos-fedora/mkosi.conf.d/pkgenv.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'
By default, `mkosi` will first build a tools tree and use it build the image and
provide the environment for `mkosi sandbox`. To disable the tools tree and use
-binaries from your host instead, write the following to `mkosi.local.conf`:
+binaries from your host instead, write the following to `mkosi/mkosi.local.conf`:
```conf
[Build]
```json
{
- "clangd.path": "<path-to-systemd-repository>/mkosi.clangd",
+ "clangd.path": "<path-to-systemd-repository>/mkosi/mkosi.clangd",
}
```
## mkosi
-To build with sanitizers in mkosi, create a file `mkosi.local.conf` and add the following contents:
+To build with sanitizers in mkosi, create a file `mkosi/mkosi.local.conf` and add the following contents:
```
[Content]
$(pwd)=/work/src,\
$BUILDDIR/$BUILDSUBDIR=/work/build"\
"$@"
-
[Output]
RepartDirectories=mkosi.repart
-OutputDirectory=build/mkosi.output
+OutputDirectory=../build/mkosi.output
[Build]
History=yes
ToolsTree=default
-BuildDirectory=build/mkosi.builddir
-CacheDirectory=build/mkosi.cache
+BuildDirectory=../build/mkosi.builddir
+CacheDirectory=../build/mkosi.cache
Incremental=yes
WithTests=no
[Validation]
SignExpectedPcr=yes
+SignExpectedPcrKey=../mkosi.key
+SignExpectedPcrCertificate=../mkosi.crt
+VerityKey=../mkosi.key
+VerityCertificate=../mkosi.crt
[Content]
ExtraTrees=
mkosi.extra.common
- mkosi.crt:/usr/lib/verity.d/mkosi.crt # sysext verification key
+ ../mkosi.crt:/usr/lib/verity.d/mkosi.crt # sysext verification key
%O/minimal-0.root-%a.raw:/usr/share/minimal_0.raw
%O/minimal-0.root-%a-verity.raw:/usr/share/minimal_0.verity
%O/minimal-0.root-%a-verity-sig.raw:/usr/share/minimal_0.verity.sig
KVM=yes
[Include]
-Include=%D/mkosi.sanitizers
- %D/mkosi.coverage
+Include=%D/mkosi/mkosi.sanitizers
+ %D/mkosi/mkosi.coverage
Release=noble
[Build]
-SandboxTrees=%D/mkosi.conf.d/ubuntu/noble-backports-ports.sources:/etc/apt/sources.list.d/noble-backports-ports.sources
+SandboxTrees=%D/mkosi/mkosi.conf.d/ubuntu/noble-backports-ports.sources:/etc/apt/sources.list.d/noble-backports-ports.sources
Release=noble
[Build]
-SandboxTrees=%D/mkosi.conf.d/ubuntu/noble-backports.sources:/etc/apt/sources.list.d/noble-backports.sources
+SandboxTrees=%D/mkosi/mkosi.conf.d/ubuntu/noble-backports.sources:/etc/apt/sources.list.d/noble-backports.sources
\S (built from systemd tree)
Kernel \r on an \m (\l)
-
Distribution=arch
[Include]
-Include=%D/mkosi.conf.d/arch/mkosi.conf.d/pkgenv.conf
+Include=%D/mkosi/mkosi.conf.d/arch/mkosi.conf.d/pkgenv.conf
[Content]
Packages=
# SPDX-License-Identifier: LGPL-2.1-or-later
set -e
-. mkosi.functions
+. mkosi/mkosi.functions
if [[ "$1" == "clangd" ]]; then
exit 0
Distribution=|fedora
[Include]
-Include=%D/mkosi.conf.d/centos-fedora/mkosi.conf.d/pkgenv.conf
+Include=%D/mkosi/mkosi.conf.d/centos-fedora/mkosi.conf.d/pkgenv.conf
[Content]
Packages=
Distribution=|ubuntu
[Include]
-Include=%D/mkosi.conf.d/debian-ubuntu/mkosi.conf.d/pkgenv.conf
+Include=%D/mkosi/mkosi.conf.d/debian-ubuntu/mkosi.conf.d/pkgenv.conf
[Content]
Packages=
# SPDX-License-Identifier: LGPL-2.1-or-later
set -e
-. mkosi.functions
+. mkosi/mkosi.functions
if [[ "$1" == "clangd" ]]; then
exit 0
Distribution=opensuse
[Include]
-Include=%D/mkosi.conf.d/opensuse/mkosi.conf.d/pkgenv.conf
+Include=%D/mkosi/mkosi.conf.d/opensuse/mkosi.conf.d/pkgenv.conf
[Content]
Packages=
bash
[Include]
-Include=%D/mkosi.sanitizers
+Include=%D/mkosi/mkosi.sanitizers
[Include]
Include=
mkosi-initrd
- %D/mkosi.sanitizers
- %D/mkosi.coverage
+ %D/mkosi/mkosi.sanitizers
+ %D/mkosi/mkosi.coverage
[Content]
-ExtraTrees=%D/mkosi.extra.common
+ExtraTrees=%D/mkosi/mkosi.extra.common
Packages=
findutils
util-linux
[Include]
-Include=%D/mkosi.sanitizers
+Include=%D/mkosi/mkosi.sanitizers
# SPDX-License-Identifier: LGPL-2.1-or-later
[Content]
-SyncScripts=%D/mkosi.sync
+SyncScripts=%D/mkosi/mkosi.sync
Packages=
gdb
llvm
Distribution=arch
[Include]
-Include=%D/mkosi.conf.d/arch/mkosi.conf.d/pkgenv.conf
+Include=%D/mkosi/mkosi.conf.d/arch/mkosi.conf.d/pkgenv.conf
[Content]
-PrepareScripts=%D/mkosi.images/build/mkosi.conf.d/arch/mkosi.prepare
+PrepareScripts=%D/mkosi/mkosi.images/build/mkosi.conf.d/arch/mkosi.prepare
Packages=
base-devel
github-cli
Distribution=|centos
[Include]
-Include=%D/mkosi.conf.d/centos-fedora/mkosi.conf.d/pkgenv.conf
+Include=%D/mkosi/mkosi.conf.d/centos-fedora/mkosi.conf.d/pkgenv.conf
[Content]
-PrepareScripts=%D/mkosi.images/build/mkosi.conf.d/centos-fedora/mkosi.prepare
+PrepareScripts=%D/mkosi/mkosi.images/build/mkosi.conf.d/centos-fedora/mkosi.prepare
Packages=
python3-mypy
rpm-build
Distribution=|ubuntu
[Include]
-Include=%D/mkosi.conf.d/debian-ubuntu/mkosi.conf.d/pkgenv.conf
+Include=%D/mkosi/mkosi.conf.d/debian-ubuntu/mkosi.conf.d/pkgenv.conf
[Content]
-PrepareScripts=%D/mkosi.images/build/mkosi.conf.d/debian-ubuntu/mkosi.prepare
+PrepareScripts=%D/mkosi/mkosi.images/build/mkosi.conf.d/debian-ubuntu/mkosi.prepare
Packages=
gh
lcov
Distribution=opensuse
[Include]
-Include=%D/mkosi.conf.d/opensuse/mkosi.conf.d/pkgenv.conf
+Include=%D/mkosi/mkosi.conf.d/opensuse/mkosi.conf.d/pkgenv.conf
[Content]
-PrepareScripts=%D/mkosi.images/build/mkosi.conf.d/opensuse/mkosi.prepare
+PrepareScripts=%D/mkosi/mkosi.images/build/mkosi.conf.d/opensuse/mkosi.prepare
Packages=
gh
lcov
Release=noble
[Build]
-SandboxTrees=%D/mkosi.conf.d/ubuntu/noble-backports-ports.sources:/etc/apt/sources.list.d/noble-backports-ports.sources
+SandboxTrees=%D/mkosi/mkosi.conf.d/ubuntu/noble-backports-ports.sources:/etc/apt/sources.list.d/noble-backports-ports.sources
Release=noble
[Build]
-SandboxTrees=%D/mkosi.conf.d/ubuntu/noble-backports.sources:/etc/apt/sources.list.d/noble-backports.sources
+SandboxTrees=%D/mkosi/mkosi.conf.d/ubuntu/noble-backports.sources:/etc/apt/sources.list.d/noble-backports.sources
Note that by default we assume that `build/` is used as the meson build directory that will be used to run
the integration tests. If you want to use another directory as the meson build directory, you will have to
configure the mkosi build directory (`BuildDirectory=`), cache directory (`CacheDirectory=`) and output
-directory (`OutputDirectory=`) to point to the other directory using `mkosi.local.conf`.
+directory (`OutputDirectory=`) to point to the other directory using `mkosi/mkosi.local.conf`.
After the image has been built, the integration tests can be run with:
The integration tests use the same mkosi configuration that's used when you run
mkosi in the systemd reposistory, so any local modifications to the mkosi
-configuration (e.g. in `mkosi.local.conf`) are automatically picked up and used
+configuration (e.g. in `mkosi/mkosi.local.conf`) are automatically picked up and used
by the integration tests as well.
## Iterating on an integration test
## Running the integration tests without building systemd from source
If you want to run the integration tests against prebuilt systemd packages,
-first add the following to `mkosi.local.conf` to stop mkosi from building
+first add the following to `mkosi/mkosi.local.conf` to stop mkosi from building
systemd packages from source:
```conf
If the rpms are installed on the host system that the tests are running on,
you'll probably want to disable usage of the tools tree so that the tools from
the host system are used to build the image by adding the following to
-`mkosi.local.conf`:
+`mkosi/mkosi.local.conf`:
```conf
[Build]
system, you'll want to make sure they're installed into the mkosi tools tree so
that they're used to build the image by again using either
`PackageDirectories=` or `SandboxTrees=`, but this time in
-`mkosi.tools.conf/mkosi.local.conf` instead of `mkosi.local.conf`.
+`mkosi/mkosi.tools.conf/mkosi.local.conf` instead of `mkosi/mkosi.local.conf`.
Finally, we'll make use of the standalone mode of running the integration tests
to avoid having to install any build dependencies.
### SELinux AVCs
To have `TEST-06-SELINUX` check for SELinux denials, write the following to
-mkosi.local.conf:
+`mkosi/mkosi.local.conf`:
```conf
[Runtime]
print(f"+ {shlex.join(cmd)}")
changes = subprocess.check_output(cmd, text=True).strip()
- conf_dir = Path('mkosi.conf.d')
+ conf_dir = Path('mkosi/mkosi.conf.d')
files = conf_dir.glob('**/pkgenv.conf')
for file in files:
s = file.read_text()