mirror of
https://github.com/systemd/systemd
synced 2025-10-06 00:13:24 +02:00
tree-wide: Use "mkosi box" instead of "mkosi sandbox"
The box verb was added as a synonym for sandbox. sandbox still works, but let's switch to box as it's shorter.
This commit is contained in:
14
.github/workflows/coverage.yml
vendored
14
.github/workflows/coverage.yml
vendored
@@ -83,22 +83,22 @@ jobs:
|
|||||||
run: mkosi summary
|
run: mkosi summary
|
||||||
|
|
||||||
- name: Build tools tree
|
- name: Build tools tree
|
||||||
run: sudo mkosi -f sandbox -- true
|
run: sudo mkosi -f box -- true
|
||||||
|
|
||||||
- name: Configure meson
|
- name: Configure meson
|
||||||
run: |
|
run: |
|
||||||
sudo mkosi sandbox -- \
|
sudo mkosi box -- \
|
||||||
meson setup \
|
meson setup \
|
||||||
--buildtype=debugoptimized \
|
--buildtype=debugoptimized \
|
||||||
build
|
build
|
||||||
|
|
||||||
- name: Build image
|
- 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
|
- name: Initial coverage report
|
||||||
run: |
|
run: |
|
||||||
sudo mkdir -p build/test/coverage
|
sudo mkdir -p build/test/coverage
|
||||||
sudo mkosi sandbox -- \
|
sudo mkosi box -- \
|
||||||
lcov \
|
lcov \
|
||||||
--directory build/mkosi.builddir/arch~rolling~x86-64 \
|
--directory build/mkosi.builddir/arch~rolling~x86-64 \
|
||||||
--capture \
|
--capture \
|
||||||
@@ -115,7 +115,7 @@ jobs:
|
|||||||
# --preserve-env makes sure all the github actions environment variables are propagated which are
|
# --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
|
# used in integration-test-wrapper.py to construct the `gh` command line to download the journals
|
||||||
# of failed tests.
|
# of failed tests.
|
||||||
sudo --preserve-env mkosi sandbox -- \
|
sudo --preserve-env mkosi box -- \
|
||||||
env \
|
env \
|
||||||
TEST_RUNNER=ubuntu-24.04 \
|
TEST_RUNNER=ubuntu-24.04 \
|
||||||
meson test \
|
meson test \
|
||||||
@@ -147,10 +147,10 @@ jobs:
|
|||||||
lcov_args+=(--add-tracefile "${file}")
|
lcov_args+=(--add-tracefile "${file}")
|
||||||
done < <(find build/test/coverage -name "TEST-*.coverage-info")
|
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
|
- 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
|
- name: Coveralls
|
||||||
uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b
|
uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b
|
||||||
|
20
.github/workflows/linter.yml
vendored
20
.github/workflows/linter.yml
vendored
@@ -51,29 +51,29 @@ jobs:
|
|||||||
ToolsTreeRelease=rawhide
|
ToolsTreeRelease=rawhide
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
mkosi -f sandbox -- true
|
mkosi -f box -- true
|
||||||
|
|
||||||
- name: Run mypy
|
- name: Run mypy
|
||||||
run: |
|
run: |
|
||||||
mkosi sandbox -- mypy --version
|
mkosi box -- 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 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
|
- name: Run ruff check
|
||||||
run: |
|
run: |
|
||||||
mkosi sandbox -- ruff --version
|
mkosi box -- 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 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
|
- name: Run ruff format
|
||||||
run: |
|
run: |
|
||||||
mkosi sandbox -- ruff --version
|
mkosi box -- 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
|
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
|
then
|
||||||
echo "Please run 'ruff format' on the above files or apply the diffs below manually"
|
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
|
fi
|
||||||
|
|
||||||
- name: Configure meson
|
- 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
|
- 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
|
||||||
|
10
.github/workflows/mkosi.yml
vendored
10
.github/workflows/mkosi.yml
vendored
@@ -214,21 +214,21 @@ jobs:
|
|||||||
run: mkosi summary
|
run: mkosi summary
|
||||||
|
|
||||||
- name: Build tools tree
|
- name: Build tools tree
|
||||||
run: sudo mkosi -f sandbox -- true
|
run: sudo mkosi -f box -- true
|
||||||
|
|
||||||
- name: Configure meson
|
- name: Configure meson
|
||||||
run: |
|
run: |
|
||||||
# /usr/sbin/bpftool is completely broken inside containers on Ubuntu which makes meson blow up so
|
# /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.
|
# 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.
|
# 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 \
|
meson setup \
|
||||||
--buildtype=debugoptimized \
|
--buildtype=debugoptimized \
|
||||||
-Dbpf-framework=disabled \
|
-Dbpf-framework=disabled \
|
||||||
build
|
build
|
||||||
|
|
||||||
- name: Build image
|
- 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
|
- name: Make sure sources weren't polluted by package build scripts
|
||||||
run: |
|
run: |
|
||||||
@@ -243,7 +243,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Run integration tests
|
- name: Run integration tests
|
||||||
run: |
|
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)
|
MAX_LINES=(--max-lines 300)
|
||||||
else
|
else
|
||||||
MAX_LINES=()
|
MAX_LINES=()
|
||||||
@@ -256,7 +256,7 @@ jobs:
|
|||||||
# --preserve-env makes sure all the github actions environment variables are propagated which are
|
# --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
|
# used in integration-test-wrapper.py to construct the `gh` command line to download the journals
|
||||||
# of failed tests.
|
# of failed tests.
|
||||||
sudo --preserve-env mkosi sandbox -- \
|
sudo --preserve-env mkosi box -- \
|
||||||
env \
|
env \
|
||||||
TEST_PREFER_QEMU=${{ matrix.vm }} \
|
TEST_PREFER_QEMU=${{ matrix.vm }} \
|
||||||
TEST_NO_QEMU=${{ matrix.no_qemu }} \
|
TEST_NO_QEMU=${{ matrix.no_qemu }} \
|
||||||
|
@@ -40,16 +40,16 @@ Then, you can build, run and test systemd executables as follows:
|
|||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ mkosi -f genkey # Generate signing keys once.
|
$ 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 box -- meson setup -Dbpf-framework=disabled build # bpftool detection inside mkosi box is broken on Ubuntu Noble and older
|
||||||
$ mkosi -f sandbox -- meson compile -C build
|
$ mkosi -f box -- meson compile -C build
|
||||||
$ mkosi -f sandbox -- build/systemctl --version
|
$ mkosi -f box -- build/systemctl --version
|
||||||
$ mkosi -f sandbox -- meson test -C build # Run the unit tests
|
$ mkosi -f box -- meson test -C build # Run the unit tests
|
||||||
```
|
```
|
||||||
|
|
||||||
To build and boot an OS image with the latest systemd installed:
|
To build and boot an OS image with the latest systemd installed:
|
||||||
|
|
||||||
```sh
|
```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 boot # Boot the image with systemd-nspawn.
|
||||||
$ mkosi vm # Boot the image with qemu.
|
$ mkosi vm # Boot the image with qemu.
|
||||||
```
|
```
|
||||||
@@ -65,8 +65,8 @@ $ cd systemd
|
|||||||
$ git checkout -b <BRANCH> # where BRANCH is the name of the branch
|
$ 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
|
$ $EDITOR src/core/main.c # or wherever you'd like to make your changes
|
||||||
$ mkosi -f genkey # Generate signing keys once.
|
$ mkosi -f genkey # Generate signing keys once.
|
||||||
$ mkosi -f sandbox -- meson setup build # Set up meson
|
$ mkosi -f box -- meson setup build # Set up meson
|
||||||
$ mkosi -f sandbox -- meson compile -C build mkosi # (re-)build the test image
|
$ mkosi -f box -- meson compile -C build mkosi # (re-)build the test image
|
||||||
$ mkosi vm # Boot the image in qemu
|
$ mkosi vm # Boot the image in qemu
|
||||||
$ git add -p # interactively put together your patch
|
$ git add -p # interactively put together your patch
|
||||||
$ git commit # commit it
|
$ git commit # commit it
|
||||||
@@ -85,7 +85,7 @@ not required to write basic patches.
|
|||||||
## Building the OS image without a tools tree
|
## Building the OS image without a tools tree
|
||||||
|
|
||||||
By default, `mkosi` will first build a tools tree and use it build the image and
|
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`:
|
binaries from your host instead, write the following to `mkosi/mkosi.local.conf`:
|
||||||
|
|
||||||
```conf
|
```conf
|
||||||
@@ -311,7 +311,7 @@ To debug systemd-boot in an IDE such as VSCode we can use a launch configuration
|
|||||||
right in your editor of choice (with the right plugin installed). When using mkosi, we can run clangd in the
|
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.
|
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.
|
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:
|
For example, for VScode, you'd have to add the following to the VSCode workspace settings of the systemd repository:
|
||||||
|
|
||||||
@@ -329,7 +329,7 @@ When using clangd, it's recommended to setup the build directory containing the
|
|||||||
compilation database used by clangd to use clang as the compiler as well:
|
compilation database used by clangd to use clang as the compiler as well:
|
||||||
|
|
||||||
```sh
|
```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
|
Additionally, the `gensources` target can be used to make sure all generated
|
||||||
@@ -337,5 +337,5 @@ sources are generated to avoid clangd complaining that these source files don't
|
|||||||
exist.
|
exist.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ mkosi sandbox -- ninja -C build gensources
|
$ mkosi box -- ninja -C build gensources
|
||||||
```
|
```
|
||||||
|
@@ -9,7 +9,7 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
exec "${SPAWN[@]}" \
|
exec "${SPAWN[@]}" \
|
||||||
mkosi sandbox -- \
|
mkosi box -- \
|
||||||
clangd \
|
clangd \
|
||||||
--compile-commands-dir=build \
|
--compile-commands-dir=build \
|
||||||
--path-mappings="\
|
--path-mappings="\
|
||||||
|
@@ -17,7 +17,7 @@ $ mkosi genkey
|
|||||||
Next, we can build the integration test image with meson:
|
Next, we can build the integration test image with meson:
|
||||||
|
|
||||||
```shell
|
```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
|
By default, the `mkosi` meson target which builds the integration test image depends on
|
||||||
@@ -38,24 +38,24 @@ directory (`OutputDirectory=`) to point to the other directory using `mkosi/mkos
|
|||||||
After the image has been built, the integration tests can be run with:
|
After the image has been built, the integration tests can be run with:
|
||||||
|
|
||||||
```shell
|
```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
|
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.
|
which is usually the name of the directory e.g.
|
||||||
|
|
||||||
```shell
|
```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
|
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
|
(`-i`) for `meson test` can be used. Note that this requires meson v1.5.0 or
|
||||||
newer:
|
newer:
|
||||||
|
|
||||||
```shell
|
```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
|
Due to limitations in meson, the integration tests do not yet depend on the
|
||||||
@@ -64,7 +64,7 @@ running the integration tests. To rebuild the image and rerun a test, the
|
|||||||
following command can be used:
|
following command can be used:
|
||||||
|
|
||||||
```shell
|
```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 integration tests use the same mkosi configuration that's used when you run
|
||||||
@@ -78,7 +78,7 @@ To iterate on an integration test, let's first get a shell in the integration te
|
|||||||
the following:
|
the following:
|
||||||
|
|
||||||
```shell
|
```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
|
This will get us a shell in the integration test environment after booting the machine without running the
|
||||||
@@ -173,9 +173,9 @@ Finally, we'll make use of the standalone mode of running the integration tests
|
|||||||
to avoid having to install any build dependencies.
|
to avoid having to install any build dependencies.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ mkosi -f sandbox -- meson setup testsuite test/integration-tests/standalone
|
$ mkosi -f box -- meson setup testsuite test/integration-tests/standalone
|
||||||
$ mkosi -f
|
$ mkosi -f
|
||||||
$ mkosi sandbox -- meson test -C testsuite --num-processes "$(($(nproc) / 4))"
|
$ mkosi box -- meson test -C testsuite --num-processes "$(($(nproc) / 4))"
|
||||||
```
|
```
|
||||||
|
|
||||||
### SELinux AVCs
|
### SELinux AVCs
|
||||||
|
@@ -4,9 +4,9 @@
|
|||||||
# as follows:
|
# as follows:
|
||||||
#
|
#
|
||||||
# mkosi genkey
|
# 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 -f
|
||||||
# mkosi sandbox -- meson test -C testsuite
|
# mkosi box -- meson test -C testsuite
|
||||||
#
|
#
|
||||||
project('systemd-testsuite',
|
project('systemd-testsuite',
|
||||||
license : 'LGPLv2+',
|
license : 'LGPLv2+',
|
||||||
|
Reference in New Issue
Block a user