summaryrefslogtreecommitdiffstats
path: root/meson.build (follow)
Commit message (Collapse)AuthorAgeFilesLines
* dissect: implement external helper plugin interface for /bin/mountLennart Poettering2023-03-061-0/+4
| | | | | | | | | | | With this change we'll install a symlink /sbin/mount.ddi → systemd-dissect. If invoked that way we'll do the equivalent of systemd-dissect --mount. This makes DDIs mountable directly via the "mount" command, by specifying the "-t ddi" pseudo file system type. Moreover you can now mount DDIs directly via /etc/fstab, by specifying "ddi" in the file system column (3rd column).
* Include <threads.h> if possible to get thread_local definitionCristian Rodríguez2023-03-061-0/+1
| | | | | | | | | | | | IN C23, thread_local is a reserved keyword and we shall therefore do nothing to redefine it. glibc has it defined for older standard version with the right conditions. v2 by Yu Watanabe: Move the definition to missing_threads.h like the way we define e.g. missing syscalls or missing definitions, and include it by the users. Co-authored-by: Yu Watanabe <watanabe.yu+github@gmail.com>
* meson: show options about tests in the summaryYu Watanabe2023-03-031-0/+2
|
* meson: Copy files with git only in true git repositoryMichal Koutný2023-03-021-1/+1
| | | | | | | | | | | | | When mkosi is run from git-worktree(1), the .git is not a repository directory but a textfile pointing to the real git dir (e.g. /home/user/systemd/.git/worktrees/systemd-worktree). This git dir is not bind mounted into build environment and it fails with: > fatal: not a git repository: /home/user/systemd/.git/worktrees/systemd-worktree > test/meson.build:190:16: ERROR: Command `/usr/bin/env -u GIT_WORK_TREE /usr/bin/git --git-dir=/root/src/.git ls-files ':/test/dmidecode-dumps/*.bin'` failed with status 128. There is already a fallback to use shell globbing instead of ls-files, use it with git worktrees as well.
* Merge pull request #26528 from keszybz/valgrind-simplificationYu Watanabe2023-02-221-3/+0
|\ | | | | Drop the -Dvalgrind configuration option
| * meson: merge our two valgrind configuration conditions into oneZbigniew Jędrzejewski-Szmek2023-02-221-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Most of the support for valgrind was under HAVE_VALGRIND_VALGRIND_H, i.e. we would enable if the valgrind headers were found. The operations then we be conditionalized on RUNNING_UNDER_VALGRIND. But in a few places we had code which was conditionalized on VALGRIND, i.e. the config option. I noticed because I compiled with -Dvalgrind=true on a machine that didn't have valgrind.h, and the build failed because RUNNING_UNDER_VALGRIND was not defined. My first idea was to add a check that the header is present if the option is set, but it seems better to just remove the option. The code to support valgrind is trivial, and if we're !RUNNING_UNDER_VALGRIND, it has negligible cost. And the case of running under valgrind is always some special testing/debugging mode, so we should just do those extra steps to make valgrind output cleaner. Removing the option makes things simpler and we don't have to think if something should be covered by the one or the other configuration bit. I had a vague recollection that in some places we used -Dvalgrind=true not for valgrind support, but to enable additional cleanup under other sanitizers. But that code would fail to build without the valgrind headers anyway, so I'm not sure if that was still used. If there are uses like that, we can extend the condition for cleanup_pools().
* | meson: Use dicts for fuzzer definitionsJan Janssen2023-02-211-13/+14
| |
* | meson: Add simple_fuzzers listJan Janssen2023-02-211-0/+5
| |
* | meson: Use dicts for test definitionsJan Janssen2023-02-211-43/+33
| | | | | | | | | | | | | | Although this slightly more verbose it makes it much easier to reason about. The code that produces the tests heavily benefits from this. Test lists are also now sorted by test name.
* | meson: Add simple_tests listJan Janssen2023-02-211-0/+5
|/ | | | | | A lot of tests can be defined by just their filename. Moving into their own list keeps things simpler, especially with the next commit. It also makes it easier to keep the lists sorted.
* vconsole: allow setting default keymap through build optionMike Yuan2023-02-151-0/+3
| | | | | | | Allow defining the default keymap to be used by vconsole-setup through a build option. A template vconsole.conf also gets populated by tmpfiles if it doesn't exist.
* meson: enable -Wzero-length-boundsZbigniew Jędrzejewski-Szmek2023-02-061-0/+1
| | | | | | This will warn if fake flexible arrays are re-introduced. I'm not using -Werror=… because we may still get warnings when compiling against old kernel headers. We can crank this up to error later.
* meson: enable -Warray-bounds and -fstrict-flex-arraysZbigniew Jędrzejewski-Szmek2023-02-061-0/+4
| | | | | | | | | | | | | | | | | -fstrict-flex-arrays means that the compiler doesn't have to assume that any trailing array is a flex array. I.e. unless the array is declared without a specified size, only indices in the declared range are valid. -Warray-bounds turns on the warnings about out-of-bounds array accesses. -Warray-bounds=2 does some more warnings, with higher false positive rate. But it doesn't seem to yield any false positives in our codebase, so enable it. clang supports -Warray-bounds, but not -Warray-bounds=2. gcc supports both. gcc-13 supports -fstrict-flex-arrays. See https://people.kernel.org/kees/bounded-flexible-arrays-in-c for a long discussion of use in the kernel.
* core: split system/user job timeouts and make them configurableZbigniew Jędrzejewski-Szmek2023-02-011-1/+4
| | | | | | | | | | | | | | | | Config options are -Ddefault-timeout-sec= and -Ddefault-user-timeout-sec=. Existing -Dupdate-helper-user-timeout= is renamed to -Dupdate-helper-user-timeout-sec= for consistency. All three options take an integer value in seconds. The renaming and type-change of the option is a small compat break, but it's just at compile time and result in a clear error message. I also doubt that anyone was actually using the option. This commit separates the user manager timeouts, but keeps them unchanged at 90 s. The timeout for the user manager is set to 4/3*user-timeout, which means that it is still 120 s. Fedora wants to experiment with lower timeouts, but doing this via a patch would be annoying and more work than necessary. Let's make this easy to configure.
* Merge pull request #26236 from medhefgo/meson-fixesZbigniew Jędrzejewski-Szmek2023-02-011-8/+3
|\ | | | | meson: Fixes
| * meson: Remove unused variablesJan Janssen2023-01-271-8/+3
| |
* | meson: fail build on implicit int warningsZbigniew Jędrzejewski-Szmek2023-02-011-0/+1
| |
* | ukify: don't install ukify man page if ukify is not enabledFrantisek Sumsal2023-02-011-14/+15
|/ | | | | | | Checking for gnu-efi is not enough, since ukify can be explicitly disabled. Resolves: #26274
* meson: bump numbers for v253-rc1Luca Boccassi2023-01-241-3/+3
|
* meson: Use python module for detectionJan Janssen2023-01-231-7/+3
|
* meson: Move bootctl sources defintion to its own fileJan Janssen2023-01-231-18/+2
| | | | The root meson.build file is already large enough.
* ukify: Downgrade required python version to 3.9Daan De Meyer2023-01-201-6/+6
|
* bootctl: unlink and cleanup functionsLudwig Nussel2023-01-191-0/+1
| | | | | | | | | | The unlink command removes an entry from the ESP including referenced files that are not referenced in other entries. That is useful eg to have multiple entries that use the same kernel with different options. The cleanup command removes all files that are not referenced by any entry.
* meson: ukify depends on GNU_EFILudwig Nussel2023-01-191-18/+18
| | | | | ukify is rather efi specific and the manpage is already conditional on HAVE_GNU_EFI so make the program also depend on HAVE_GNU_EFI
* Merge pull request #26082 from kraxel/ukiLennart Poettering2023-01-181-0/+2
|\ | | | | bootctl: add is-uki command
| * bootctl: add kernel-identity commandGerd Hoffmann2023-01-181-0/+2
| | | | | | | | | | The command takes a kernel as argument and checks what kind of kernel the image is. Returns one of uki, pe or unknown.
* | pcrphase: make tool more generic, reuse for measuring machine id/fs uuidsLennart Poettering2023-01-171-0/+1
| | | | | | | | See: #24503
* | cryptsetup: add tpm2-measure-pcr= and tpm2-measure-bank= crypttab optionsLennart Poettering2023-01-171-1/+2
|/ | | | | | | | | These options allow measuring the volume key used for unlocking the volume to a TPM2 PCR. This is ideally used for the volume key of the root file system and can then be used to bind other resources to the root file system volume in a secure way. See: #24503
* meson: use 0|1 for SD_BOOTZbigniew Jędrzejewski-Szmek2023-01-101-0/+3
| | | | | | | We converted to not using #ifdef for most of our defines because the syntax is nicer and we are protected against typos and can set -Werror=undef. Let's do the same for SD_BOOT. The define is nicely hidden in build.h for normal builds, and for EFI builds we were already setting SD_BOOT on the commandline.
* boot: Remove option TPM PCR compat optionJan Janssen2023-01-091-2/+0
| | | | It says remove in 2023; happy to oblige.
* p11kit: switch to dlopen()Luca Boccassi2022-12-191-0/+2
|
* bootctl: split out "install" verb tooLennart Poettering2022-12-191-0/+2
|
* bootctl: split out "status" verb tooLennart Poettering2022-12-191-0/+2
|
* bootctl: split out "set-efivar" verbs, tooLennart Poettering2022-12-191-0/+2
|
* bootctl: also split out 'systemd-efi-options' verbLennart Poettering2022-12-191-0/+2
|
* bootctl: split out random seed verb, tooLennart Poettering2022-12-191-1/+6
|
* bootctl: let's start splitting up bootctl like we did for systemctl and othersLennart Poettering2022-12-191-1/+3
|
* meson: fix cross-compilation of LONG_MAXasavah2022-12-181-1/+5
| | | | https://github.com/systemd/systemd/pull/25618#issuecomment-1355019553
* Merge pull request #25180 from keszybz/ukifyLennart Poettering2022-12-081-1/+33
|\ | | | | ukify: add helper to create UKIs
| * tests: add pytest tests for ukifyZbigniew Jędrzejewski-Szmek2022-12-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some gymnastics were needed to import ukify as a module. Before the file was templated, this was trivial: insert the directory in sys.path, call import. But it's a real pain to import the unsuffixed file after processing. Instead, the untemplated file is imported, which works well enough for tests and is very simple. The tests can be called via pytest: PATH=build/:$PATH pytest -v src/ukify/test/test_ukify.py or directly: PATH=build/:$PATH src/ukify/test/test_ukify.py or via the meson test machinery output: meson test -C build test-ukify -v or without verbose output: meson test -C build test-ukify Zekret files are obfuscated using base64.
| * meson,ukify: hook up ukify, add --version optionZbigniew Jędrzejewski-Szmek2022-12-071-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The option is added because we have a similar one for kernel-install. This program requires python, and some people might want to skip it because of this. The tool is installed in /usr/lib/systemd for now, since the interface might change. A template file is used, but there is no .in suffix. The problem is that we'll later want to import the file as a module for tests, but recent Python versions make it annoyingly hard to import a module from a file without a .py suffix. imp.load_sources() works, but it is deprecated and throws warnings. importlib.machinery.SourceFileLoader().load_module() works, but is also deprecated. And the documented replacements are a maze of twisted little callbacks that result in an empty module. So let's take the easy way out, and skip the suffix which makes it easy to import the template as a module after adding the directory to sys.path.
| * tests: add a simple test that bootctl output is valid jsonZbigniew Jędrzejewski-Szmek2022-12-011-1/+9
| | | | | | | | | | python's json.tool module is used because it does validation. jq is more forgiving. Also, json is in the stdlib, so it should be always available.
* | meson: build a standalone version of systemd-shutdownZbigniew Jędrzejewski-Szmek2022-12-061-0/+16
| | | | | | | | | | | | | | | | I'd like to use this as a basis for an exitrd: When compiled with -Dstandalone-binaries=true -Db_lto=true -Dbuildtype=release, the new file is 800k. It's more than I'd like, but still quite a bit less than libsystemd-shared.so, which is 3800k.
* | test: do the --help/--version checks for repart.standalone tooZbigniew Jędrzejewski-Szmek2022-12-061-0/+1
| |
* | manager: define a string constant for LONG_MAX and use that for sysctlZbigniew Jędrzejewski-Szmek2022-12-031-0/+4
| | | | | | | | | | This moves the formatting of the constant to compilation time and let's us avoid asprintf() in the very hot path of initial boot.
* | fdisk: introduce common fdisk_new_context_fd() helperLennart Poettering2022-11-261-4/+8
| | | | | | | | | | We do the same thing over and over again and it's a bit ugly, hence let's unify the code for it at one common place.
* | meson: resort importsZbigniew Jędrzejewski-Szmek2022-11-251-8/+8
|/
* Merge pull request #25389 from fbuihuu/update-test-for-opensuseYu Watanabe2022-11-181-1/+1
|\ | | | | Update test/ for openSUSE
| * meson: install test-kernel-install only when -Dkernel-install=trueFranck Bui2022-11-181-1/+1
| | | | | | | | | | | | | | | | This patch fixes the following build failure: meson.build:3853:8: ERROR: Unknown variable "test_kernel_install_sh". Fixes #25432.
* | shared/tpm2-util: Fix "Error: Esys invalid ESAPI handle (40000001)" warningVitaly Kuznetsov2022-11-161-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | systemd-cryptenroll complains (but succeeds!) upon binding to a signed PCR policy: $ systemd-cryptenroll --unlock-key-file=/tmp/passphrase --tpm2-device=auto --tpm2-public-key=... --tpm2-signature=..." /tmp/tmp.img ERROR:esys:src/tss2-esys/esys_iutil.c:394:iesys_handle_to_tpm_handle() Error: Esys invalid ESAPI handle (40000001). WARNING:esys:src/tss2-esys/esys_iutil.c:415:iesys_is_platform_handle() Convert handle from TPM2_RH to ESYS_TR, got: 0x40000001 ERROR:esys:src/tss2-esys/esys_iutil.c:394:iesys_handle_to_tpm_handle() Error: Esys invalid ESAPI handle (40000001). WARNING:esys:src/tss2-esys/esys_iutil.c:415:iesys_is_platform_handle() Convert handle from TPM2_RH to ESYS_TR, got: 0x4000000 New TPM2 token enrolled as key slot 1. The problem seems to be that Esys_LoadExternal() function from tpm2-tss expects a 'ESYS_TR_RH*' constant specifying the requested hierarchy and not a 'TPM2_RH_*' one (see Esys_LoadExternal() -> Esys_LoadExternal_Async() -> iesys_handle_to_tpm_handle() call chain). It all works because Esys_LoadExternal_Async() falls back to using the supplied values when iesys_handle_to_tpm_handle() fails: r = iesys_handle_to_tpm_handle(hierarchy, &tpm_hierarchy); if (r != TSS2_RC_SUCCESS) { ... tpm_hierarchy = hierarchy; } Note, TPM2_RH_OWNER was used on purpose to support older tpm2-tss versions (pre https://github.com/tpm2-software/tpm2-tss/pull/1531), use meson magic to preserve compatibility. Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>