diff options
-rw-r--r-- | docs/HACKING.md | 18 | ||||
-rw-r--r-- | meson.build | 1 | ||||
-rw-r--r-- | mkosi.conf.d/10-centos/mkosi.conf | 2 | ||||
-rw-r--r-- | mkosi.conf.d/10-extra-search-paths.conf | 7 | ||||
-rw-r--r-- | mkosi.conf.d/10-tools.conf | 8 | ||||
-rwxr-xr-x | mkosi.images/build/mkosi.sync | 2 | ||||
-rw-r--r-- | test/README.testsuite | 31 |
7 files changed, 51 insertions, 18 deletions
diff --git a/docs/HACKING.md b/docs/HACKING.md index 670cbb9dea..2e964f4178 100644 --- a/docs/HACKING.md +++ b/docs/HACKING.md @@ -44,6 +44,24 @@ or: $ mkosi qemu ``` +By default, the tools from your host system are used to build the image. To have +`mkosi` use the systemd tools from the `build/` directory, add the following to +`mkosi.local.conf`: + +```conf +[Host] +ExtraSearchPaths=build/ +``` + +And if you want `mkosi` to build a tools image and use the tools from there +instead of looking for tools on the host, add the following to +`mkosi.local.conf`: + +```conf +[Host] +ToolsTree=default +``` + Every time you rerun the `mkosi` command a fresh image is built, incorporating all current changes you made to the project tree. To avoid having to build a new image all the time when iterating on a patch, add the following to diff --git a/meson.build b/meson.build index 69dc53cde2..3893a9fabe 100644 --- a/meson.build +++ b/meson.build @@ -2673,6 +2673,7 @@ if mkosi.found() '--output-dir', meson.current_build_dir() / 'mkosi.output', '--cache-dir', meson.current_build_dir() / 'mkosi.cache', '--build-dir', meson.current_build_dir() / 'mkosi.builddir', + '--extra-search-path', meson.current_build_dir(), '--force', 'build', ], diff --git a/mkosi.conf.d/10-centos/mkosi.conf b/mkosi.conf.d/10-centos/mkosi.conf index 88b863c5a0..c9c570375d 100644 --- a/mkosi.conf.d/10-centos/mkosi.conf +++ b/mkosi.conf.d/10-centos/mkosi.conf @@ -4,7 +4,7 @@ Distribution=centos [Distribution] -Release=9 +Release=10 [Content] Environment= diff --git a/mkosi.conf.d/10-extra-search-paths.conf b/mkosi.conf.d/10-extra-search-paths.conf deleted file mode 100644 index bd3cdb1de4..0000000000 --- a/mkosi.conf.d/10-extra-search-paths.conf +++ /dev/null @@ -1,7 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later - -[Match] -PathExists=build/ - -[Host] -ExtraSearchPaths=build/ diff --git a/mkosi.conf.d/10-tools.conf b/mkosi.conf.d/10-tools.conf deleted file mode 100644 index 9d276d43c4..0000000000 --- a/mkosi.conf.d/10-tools.conf +++ /dev/null @@ -1,8 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later - -[Match] -PathExists=!build/ -SystemdVersion=<254 - -[Host] -@ToolsTree=default diff --git a/mkosi.images/build/mkosi.sync b/mkosi.images/build/mkosi.sync index 198e1bc147..a545d49867 100755 --- a/mkosi.images/build/mkosi.sync +++ b/mkosi.images/build/mkosi.sync @@ -3,7 +3,7 @@ set -e set -o nounset -if ((${NO_SYNC:-0})); then +if ((${NO_SYNC:-0})) || ((${NO_BUILD:-0})); then exit 0 fi diff --git a/test/README.testsuite b/test/README.testsuite index 0aa6cf576e..22da1cd1a1 100644 --- a/test/README.testsuite +++ b/test/README.testsuite @@ -14,12 +14,41 @@ We also need to make sure the required meson options are enabled: $ meson setup --reconfigure build -Dremote=enabled ``` -Next, we can build the integration test image: +To make sure `mkosi` doesn't try to build systemd from source during the image build +process, you can add the following to `mkosi.local.conf`: + +``` +[Content] +Environment=NO_BUILD=1 +``` + +You might also want to use the `PackageDirectories=` or `Repositories=` option to provide +mkosi with a directory or repository containing the systemd packages that should be installed +instead. If the repository containing the systemd packages is not a builtin repository known +by mkosi, you can use the `PackageManagerTrees=` option to write an extra repository definition +to /etc which is used when building the image instead. + +Next, we can build the integration test image with meson: ```shell $ meson compile -C build mkosi ``` +By default, the `mkosi` meson target which builds the integration test image depends on +other meson targets to build various systemd tools that are used to build the image to make +sure they are up-to-date. If you instead want the already installed systemd tools on the +host to be used, you can run `mkosi` manually to build the image. To build the integration test +image without meson, run the following: + +```shell +$ mkosi -f +``` + +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`. + After the image has been built, the integration tests can be run with: ```shell |