run: mkosi summary
- name: Build tools tree
- run: sudo mkosi -f sandbox -- true
+ run: sudo mkosi -f box -- true
- name: Configure meson
run: |
- sudo mkosi sandbox -- \
+ sudo mkosi box -- \
meson setup \
--buildtype=debugoptimized \
build
- name: Build image
- run: sudo mkosi sandbox -- meson compile -C build mkosi
+ run: sudo mkosi box -- meson compile -C build mkosi
- name: Initial coverage report
run: |
sudo mkdir -p build/test/coverage
- sudo mkosi sandbox -- \
+ sudo mkosi box -- \
lcov \
--directory build/mkosi.builddir/arch~rolling~x86-64 \
--capture \
# --preserve-env makes sure all the github actions environment variables are propagated which are
# used in integration-test-wrapper.py to construct the `gh` command line to download the journals
# of failed tests.
- sudo --preserve-env mkosi sandbox -- \
+ sudo --preserve-env mkosi box -- \
env \
TEST_RUNNER=ubuntu-24.04 \
meson test \
lcov_args+=(--add-tracefile "${file}")
done < <(find build/test/coverage -name "TEST-*.coverage-info")
- sudo mkosi sandbox -- lcov --ignore-errors inconsistent,inconsistent "${lcov_args[@]}" --output-file build/test/coverage/everything.coverage-info
+ sudo mkosi box -- lcov --ignore-errors inconsistent,inconsistent "${lcov_args[@]}" --output-file build/test/coverage/everything.coverage-info
- name: List coverage report
- run: sudo mkosi sandbox -- lcov --ignore-errors inconsistent,inconsistent --list build/test/coverage/everything.coverage-info
+ run: sudo mkosi box -- lcov --ignore-errors inconsistent,inconsistent --list build/test/coverage/everything.coverage-info
- name: Coveralls
uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b
ToolsTreeRelease=rawhide
EOF
- mkosi -f sandbox -- true
+ mkosi -f box -- true
- name: Run mypy
run: |
- mkosi sandbox -- mypy --version
- mkosi sandbox -- mypy src/basic/generate-bpf-delegate-configs.py src/boot/generate-hwids-section.py src/test/generate-sym-test.py src/ukify/ukify.py test/integration-tests/integration-test-wrapper.py
+ mkosi box -- mypy --version
+ mkosi box -- mypy src/basic/generate-bpf-delegate-configs.py src/boot/generate-hwids-section.py src/test/generate-sym-test.py src/ukify/ukify.py test/integration-tests/integration-test-wrapper.py
- name: Run ruff check
run: |
- mkosi sandbox -- ruff --version
- mkosi sandbox -- ruff check src/basic/generate-bpf-delegate-configs.py src/boot/generate-hwids-section.py src/test/generate-sym-test.py src/ukify/ukify.py test/integration-tests/integration-test-wrapper.py
+ mkosi box -- ruff --version
+ mkosi box -- ruff check src/basic/generate-bpf-delegate-configs.py src/boot/generate-hwids-section.py src/test/generate-sym-test.py src/ukify/ukify.py test/integration-tests/integration-test-wrapper.py
- name: Run ruff format
run: |
- mkosi sandbox -- ruff --version
- if ! mkosi sandbox -- ruff format --check src/basic/generate-bpf-delegate-configs.py src/boot/generate-hwids-section.py src/test/generate-sym-test.py src/ukify/ukify.py test/integration-tests/integration-test-wrapper.py
+ mkosi box -- ruff --version
+ if ! mkosi box -- ruff format --check src/basic/generate-bpf-delegate-configs.py src/boot/generate-hwids-section.py src/test/generate-sym-test.py src/ukify/ukify.py test/integration-tests/integration-test-wrapper.py
then
echo "Please run 'ruff format' on the above files or apply the diffs below manually"
- mkosi sandbox -- ruff format --check --quiet --diff src/basic/generate-bpf-delegate-configs.py src/boot/generate-hwids-section.py src/test/generate-sym-test.py src/ukify/ukify.py test/integration-tests/integration-test-wrapper.py
+ mkosi box -- ruff format --check --quiet --diff src/basic/generate-bpf-delegate-configs.py src/boot/generate-hwids-section.py src/test/generate-sym-test.py src/ukify/ukify.py test/integration-tests/integration-test-wrapper.py
fi
- name: Configure meson
- run: mkosi sandbox -- env CC=clang CXX=clang++ meson setup -Dlocalegen-path=/usr/bin/locale-gen -Dcompat-mutable-uid-boundaries=true build
+ run: mkosi box -- env CC=clang CXX=clang++ meson setup -Dlocalegen-path=/usr/bin/locale-gen -Dcompat-mutable-uid-boundaries=true build
- name: Run clang-tidy
- run: mkosi sandbox -- meson test -C build --suite=clang-tidy --print-errorlogs --no-stdsplit
+ run: mkosi box -- meson test -C build --suite=clang-tidy --print-errorlogs --no-stdsplit
run: mkosi summary
- name: Build tools tree
- run: sudo mkosi -f sandbox -- true
+ run: sudo mkosi -f box -- true
- 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 -- \
+ sudo mkosi box -- \
meson setup \
--buildtype=debugoptimized \
-Dbpf-framework=disabled \
build
- name: Build image
- run: sudo mkosi sandbox -- meson compile -C build mkosi
+ run: sudo mkosi box -- meson compile -C build mkosi
- name: Make sure sources weren't polluted by package build scripts
run: |
- name: Run integration tests
run: |
- if [[ "$(sudo mkosi sandbox -- meson test --help)" == *"--max-lines"* ]]; then
+ if [[ "$(sudo mkosi box -- meson test --help)" == *"--max-lines"* ]]; then
MAX_LINES=(--max-lines 300)
else
MAX_LINES=()
# --preserve-env makes sure all the github actions environment variables are propagated which are
# used in integration-test-wrapper.py to construct the `gh` command line to download the journals
# of failed tests.
- sudo --preserve-env mkosi sandbox -- \
+ sudo --preserve-env mkosi box -- \
env \
TEST_PREFER_QEMU=${{ matrix.vm }} \
TEST_NO_QEMU=${{ matrix.no_qemu }} \
```sh
$ mkosi -f genkey # Generate signing keys once.
-$ 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
+$ mkosi -f box -- meson setup -Dbpf-framework=disabled build # bpftool detection inside mkosi box is broken on Ubuntu Noble and older
+$ mkosi -f box -- meson compile -C build
+$ mkosi -f box -- build/systemctl --version
+$ mkosi -f box -- meson test -C build # Run the unit tests
```
To build and boot an OS image with the latest systemd installed:
```sh
-$ mkosi -f sandbox -- meson compile -C build mkosi # (re-)build the OS image
+$ mkosi -f box -- meson compile -C build mkosi # (re-)build the OS image
$ mkosi boot # Boot the image with systemd-nspawn.
$ mkosi vm # Boot the image with qemu.
```
$ git checkout -b <BRANCH> # where BRANCH is the name of the branch
$ $EDITOR src/core/main.c # or wherever you'd like to make your changes
$ mkosi -f genkey # Generate signing keys once.
-$ mkosi -f sandbox -- meson setup build # Set up meson
-$ mkosi -f sandbox -- meson compile -C build mkosi # (re-)build the test image
+$ mkosi -f box -- meson setup build # Set up meson
+$ mkosi -f box -- meson compile -C build mkosi # (re-)build the test image
$ mkosi vm # Boot the image in qemu
$ git add -p # interactively put together your patch
$ git commit # commit it
## Building the OS image without a tools tree
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
+provide the environment for `mkosi box`. To disable the tools tree and use
binaries from your host instead, write the following to `mkosi/mkosi.local.conf`:
```conf
right in your editor of choice (with the right plugin installed). When using mkosi, we can run clangd in the
mkosi tools tree to avoid needing to install clangd on the host machine.
-All that is required is to run `mkosi -f sandbox true` once to make sure the tools tree is available and to modify
+All that is required is to run `mkosi -f box true` once to make sure the tools tree is available and to modify
the path of the clangd binary used by your editor to the `mkosi.clangd` script included in the systemd repository.
For example, for VScode, you'd have to add the following to the VSCode workspace settings of the systemd repository:
compilation database used by clangd to use clang as the compiler as well:
```sh
-$ mkosi sandbox -- env CC=clang CXX=clang++ meson setup build
+$ mkosi box -- env CC=clang CXX=clang++ meson setup build
```
Additionally, the `gensources` target can be used to make sure all generated
exist.
```sh
-$ mkosi sandbox -- ninja -C build gensources
+$ mkosi box -- ninja -C build gensources
```
fi
exec "${SPAWN[@]}" \
- mkosi sandbox -- \
+ mkosi box -- \
clangd \
--compile-commands-dir=build \
--path-mappings="\
Next, we can build the integration test image with meson:
```shell
-$ mkosi -f sandbox -- meson compile -C build mkosi
+$ mkosi -f box -- meson compile -C build mkosi
```
By default, the `mkosi` meson target which builds the integration test image depends on
After the image has been built, the integration tests can be run with:
```shell
-$ mkosi -f sandbox -- meson test -C build --setup=integration --suite integration-tests --num-processes "$(($(nproc) / 4))"
+$ mkosi -f box -- meson test -C build --setup=integration --suite integration-tests --num-processes "$(($(nproc) / 4))"
```
As usual, specific tests can be run in meson by appending the name of the test
which is usually the name of the directory e.g.
```shell
-$ mkosi -f sandbox -- meson test -C build --setup=integration -v TEST-01-BASIC
+$ mkosi -f box -- meson test -C build --setup=integration -v TEST-01-BASIC
```
-See `mkosi -f sandbox -- meson introspect build --tests` for a list of tests.
+See `mkosi -f box -- meson introspect build --tests` for a list of tests.
To interactively debug a failing integration test, the `--interactive` option
(`-i`) for `meson test` can be used. Note that this requires meson v1.5.0 or
newer:
```shell
-$ mkosi -f sandbox -- meson test -C build --setup=integration -i TEST-01-BASIC
+$ mkosi -f box -- meson test -C build --setup=integration -i TEST-01-BASIC
```
Due to limitations in meson, the integration tests do not yet depend on the
following command can be used:
```shell
-$ mkosi -f sandbox -- meson compile -C build mkosi && mkosi -f sandbox -- meson test -C build --setup=integration -v TEST-01-BASIC
+$ mkosi -f box -- meson compile -C build mkosi && mkosi -f box -- meson test -C build --setup=integration -v TEST-01-BASIC
```
The integration tests use the same mkosi configuration that's used when you run
the following:
```shell
-$ mkosi -f sandbox -- meson compile -C build mkosi && mkosi -f sandbox -- meson test -C build --setup=shell -i TEST-01-BASIC
+$ mkosi -f box -- meson compile -C build mkosi && mkosi -f box -- meson test -C build --setup=shell -i TEST-01-BASIC
```
This will get us a shell in the integration test environment after booting the machine without running the
to avoid having to install any build dependencies.
```sh
-$ mkosi -f sandbox -- meson setup testsuite test/integration-tests/standalone
+$ mkosi -f box -- meson setup testsuite test/integration-tests/standalone
$ mkosi -f
-$ mkosi sandbox -- meson test -C testsuite --num-processes "$(($(nproc) / 4))"
+$ mkosi box -- meson test -C testsuite --num-processes "$(($(nproc) / 4))"
```
### SELinux AVCs
# as follows:
#
# mkosi genkey
-# mkosi -f sandbox -- meson setup testsuite test/integration-tests/standalone
+# mkosi -f box -- meson setup testsuite test/integration-tests/standalone
# mkosi -f
-# mkosi sandbox -- meson test -C testsuite
+# mkosi box -- meson test -C testsuite
#
project('systemd-testsuite',
license : 'LGPLv2+',