summaryrefslogtreecommitdiff
path: root/tools
Commit message (Collapse)AuthorAgeFilesLines
* oss-fuzz: include generated corpora in the final zip fileFrantisek Sumsal2023-01-071-1/+4
| | | | | | | | | Since the files with generated directives are now automatically generated during build, they're now under the respective build directory which the current oss-fuzz CI script didn't account for. Follow-up to: #24958 Resolves: #25859
* tree-wide: BLS and DPS are now on uapi-group websiteZbigniew Jędrzejewski-Szmek2022-11-211-1/+2
|
* Merge pull request #24958 from Werkov/meson-generated-directivesLuca Boccassi2022-10-311-72/+0
|\ | | | | Generate dirrectives for fuzzer tests
| * meson: Generate fuzzer inputs with directivesMichal Koutný2022-10-201-72/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The lists of directives for fuzzer tests are maintained manually in the repo. There is a tools/check-directives.sh script that runs during test phase and reports stale directive lists. Let's rework the script into a generator so that these directive files are created on-the-flight and needn't be updated whenever a unit file directives change. The scripts is rewritten in Python to get rid of gawk dependency and each generated file is a separate meson target so that incremental builds refresh what is just necessary (and parallelize (negligible)). Note: test/fuzz/fuzz-unit-file/directives-all.slice is kept since there is not automated way to generate it (it is not covered by the check script neither).
* | Report version string as in the Boot Loader Spec, fix boot loader upgradesZbigniew Jędrzejewski-Szmek2022-10-251-1/+3
|/ | | | | | | | | | | | | | | | | | | | | | | We generate a "version string" that is reported by various tools. This patch changes this version string to use the characters specified for the version string in the Boot Loader Specification. We start using the special characters we have in the spec for this exact purpose and thus fix version comparisons. We also stop using '+' which is not part of the allowed charset and is used for boot attempt counting and should not be part of the version string. The version string is (among other places) used in sd-boot and the comparison result is used by 'bootctl update' to decide whether to install a new binary. Before, because 'nn-rc1' compares higher than 'nn', we would refuse to upgrade pre-release versions. The boot loader is the primary motivation. I'm not aware of programatic version comparisons in other places, but it makes sense to use the same versions string everywhere. (This patch effectively only matters for non-distro builds, because distro builds presumably use -Dversion-tag to set something meaningful. Ideally, those version strings are compatible with our version strings, but this is outside of our control.)
* docs/DPS: use the SD_GPT_* constants here tooZbigniew Jędrzejewski-Szmek2022-09-211-4/+5
|
* tools/list-discoverable-partitions: make the script work againZbigniew Jędrzejewski-Szmek2022-09-201-9/+9
|
* ci: simplify the Coverity script a bitFrantisek Sumsal2022-08-112-246/+40
| | | | | Also, address https://github.com/systemd/systemd/pull/24252#issuecomment-1208747320 by using a pre-defined e-mail address stored in the GH Action secrets.
* meson: Switch default-locale default to C.UTF-8Daan De Meyer2022-06-041-12/+0
| | | | | | | We're already using C.UTF-8 as the default locale for nspawn. Let's make the same change for the default-locale option instead of deciding what to use based on the locale used by the host system. Users can still override the locale using the default-locale option if needed.
* oss-fuzz: support i386Evgeny Vereshchagin2022-05-291-1/+21
| | | | Closes https://github.com/systemd/systemd/issues/23532
* Fix which(1) in meson-build.shнаб2022-05-231-1/+1
|
* Merge pull request #23246 from medhefgo/check-compilationEvgeny Vereshchagin2022-05-051-5/+0
|\ | | | | meson: Improve public header tests
| * meson: Remove check-compilation.shJan Janssen2022-05-041-5/+0
| | | | | | | | | | | | | | | | | | No need to involve a trivial shell script for this. We could call the compiler directly, but test() expects arguments to be passed separately and cc.cmd_array() can contain arguments itself. Using env is easier than manually slicing the array because meson has no builtins for that.
* | Merge pull request #23264 from keszybz/shorten-test-namesYu Watanabe2022-05-041-2/+2
|\ \ | |/ |/| Shorten test names
| * fuzz-network-parser: drop ".network" and shorten namesZbigniew Jędrzejewski-Szmek2022-05-041-2/+2
| | | | | | | | | | All fuzzer inputs as .network files. Some had the suffix, others didn't. So drop it everywhere, and also shorten some other names.
* | tree-wide: drop manually-crafted message for missing variablesZbigniew Jędrzejewski-Szmek2022-05-041-2/+2
|/ | | | | | | | Bash will generate a very nice message for us: /tmp/ff.sh: line 1: SOMEVAR: parameter null or not set Let's save some keystrokes by not replacing this with our own inferior messages.
* oss-fuzz: turn off fuzz-introspectorEvgeny Vereshchagin2022-04-221-0/+12
| | | | | | | | | | | fuzz-introspector passes -fuse-ld=gold and -flto using CFLAGS/LDFLAGS and due to https://github.com/mesonbuild/meson/issues/6377#issuecomment-575977919 and https://github.com/mesonbuild/meson/issues/6377 it doesn't mix well with meson. It's possible to build systemd with duct tape there using something like https://github.com/google/oss-fuzz/pull/7583#issuecomment-1104011067 but apparently even with gold and lto some parts of systemd are missing from reports (presumably due to https://github.com/google/oss-fuzz/issues/7598). Let's just fail here for now to make it clear that fuzz-introspector isn't supported.
* meson: also allow setting GIT_VERSION via templatesZbigniew Jędrzejewski-Szmek2022-04-051-4/+5
| | | | | | | | | GIT_VERSION is not available as a config.h variable, because it's rendered into version.h during builds. Let's rework jinja2 rendering to also parse version.h. No functional change, the new variable is so far unused. I guess this will make partial rebuilds a bit slower, but it's useful to be able to use the full version string.
* test/check-help: check that --help and -h are identicalZbigniew Jędrzejewski-Szmek2022-04-051-0/+6
|
* tests: add a smoke test for --version option in binariesZbigniew Jędrzejewski-Szmek2022-04-052-4/+40
| | | | | | | This is very similar to (and directly based on) the test for --help. I think it's nice to do this: the test is very quick, but it'll catch cases where we forgot to hook up the option, or forgot to exit after printing --version, and it'll also increase our test coverage a bit.
* tools/git-contrib: list contributions not only from WeblateZbigniew Jędrzejewski-Szmek2022-03-291-2/+3
| | | | | | It seems that --invert-grep used to affect --author, but now it doesn't (with git-2.35.1-1.fc36.x86_64), so effectively we would only show the one entry that was supposed to be filtered out.
* meson: replace sh+find with an internal glob in the python helperZbigniew Jędrzejewski-Szmek2022-03-231-6/+15
| | | | | | | | As suggested in https://github.com/systemd/systemd/pull/22810#discussion_r831708052 This makes the whole thing simpler. A glob is passed to helper which then resolves it on its own. This way it's trivial to call the helper with a different set of files for testing.
* tools/dbus_exporter: deblackify and shorten code a bitZbigniew Jędrzejewski-Szmek2022-03-221-33/+14
| | | | | | When we do mkdir, we should just use 0o777 and let the umask take care of the rest. Specifying an explicit mode is inappropriate. And when touching the code, let's replace black madness with normal python style.
* docs: swap Name and Partition Type UUID in headerMatthias Lisin2022-02-211-2/+2
|
* tools: adjust re.match to recent gpt.h additionsMatthias Lisin2022-02-211-1/+1
| | | | | with addition of SD_ID128_MAKE_UUID_STR entries to src/shared/gpt.h the tool failed halfway due to falsly matching the new entries
* ci: merge seed corpora with public OSS-Fuzz corpora on CFLiteEvgeny Vereshchagin2022-01-301-1/+13
| | | | | to let it cover as much code as possible. It should help to catch most regressions in a few minutes.
* ci: use CFLite to test forks (including systemd-stable)Evgeny Vereshchagin2022-01-291-1/+1
| | | | | | | It's like CIFuzz but unlike CIFuzz it's compatible with forks and it should make it possible to run the fuzzers to make sure that patches backported to them are backported correctly without introducing new bugs and regressions.
* meson: Use same name format for efi binary intermediatesJan Janssen2022-01-261-2/+2
|
* tests: fuzz etc_hosts_parseEvgeny Vereshchagin2022-01-201-0/+5
| | | | That's just a follow-up to https://github.com/systemd/systemd/pull/22179
* tree-wide: fix typoYu Watanabe2022-01-061-1/+1
|
* oss-fuzz: drop line-tables-onlyEvgeny Vereshchagin2022-01-051-1/+1
| | | | | | | | | | | | It was copy-pasted directly from OSS-Fuzz where it makes sense to kind of strip binaries to get nice backtraces but when the fuzzers are built and run locally with gdb it would be nice to have a little bit more than that. It was initially discovered in elfutils where I put the same flags and was surprised when I couldn't run the fuzzer comfortably step by step, which led to the same change there: https://github.com/google/oss-fuzz/pull/7092 :-)
* boot: Add gdb support and documentationJan Janssen2022-01-041-0/+85
| | | | | This will finally allow debugging issues in systemd without resorting to Print() calls all over the place.
* oss-fuzz: turn on the alignment checkEvgeny Vereshchagin2021-12-291-1/+2
|
* tests: add fuzz-bcdEvgeny Vereshchagin2021-12-291-0/+16
|
* meson: create new libsystemd-core.so private shared libraryZbigniew Jędrzejewski-Szmek2021-12-251-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The scheme is very similar to libsystemd-shared.so: instead of building a static library, we build a shared library from the same objects and link the two users to it. Both systemd and systemd-analyze consist mostly of the fairly big code in libcore, so we save a bit on the installation: (-0g, no strip) -rwxr-xr-x 5238864 Dec 14 12:52 /var/tmp/inst1/usr/lib/systemd/systemd -rwxr-xr-x 5399600 Dec 14 12:52 /var/tmp/inst1/usr/bin/systemd-analyze -rwxr-xr-x 244912 Dec 14 13:17 /var/tmp/inst2/usr/lib/systemd/systemd -rwxr-xr-x 461224 Dec 14 13:17 /var/tmp/inst2/usr/bin/systemd-analyze -rwxr-xr-x 5271568 Dec 14 13:17 /var/tmp/inst2/usr/lib/systemd/libsystemd-core-250.so (-0g, strip) -rwxr-xr-x 2522080 Dec 14 13:19 /var/tmp/inst1/usr/lib/systemd/systemd -rwxr-xr-x 2604160 Dec 14 13:19 /var/tmp/inst1/usr/bin/systemd-analyze -rwxr-xr-x 113304 Dec 14 13:19 /var/tmp/inst2/usr/lib/systemd/systemd -rwxr-xr-x 207656 Dec 14 13:19 /var/tmp/inst2/usr/bin/systemd-analyze -rwxr-xr-x 2648520 Dec 14 13:19 /var/tmp/inst2/usr/lib/systemd/libsystemd-core-250.so So for systemd itself we grow a bit (2522080 → 2648520+113304=2761824), but overall we save. The most is saved on all the test files that link to libcore, if they are installed, because there's 15 of them: $ du -s /var/tmp/inst? 220096 /var/tmp/inst1 122960 /var/tmp/inst2 I also considered making systemd-analyze a symlink to /usr/lib/systemd/systemd and turning systemd into a multicall binary. We did something like this with udevd and udevadm. But that solution doesn't fit well in this case. systemd-analyze has a bunch of functionality that is not used in systemd, so the systemd binary would need to grow quite a bit. And we're likely to add new types of verification or introspection features in analyze, and this baggage would only grow. In addition, there are the test binaries which also benefit from this.
* man: also add anotations for methodsYu Watanabe2021-12-241-0/+8
| | | | Fixes #21882.
* Change all fixed-path bash shebangs to /u/b/env bash outside test/наб2021-12-123-3/+3
|
* Export D-Bus interfaces to /usr/share/dbus-1/interfacesigo958622021-12-101-0/+61
| | | | | | | | | | | | | | | | | | Pass -Ddbus-interfaces-dir=no to meson to disable export Interfaces from: org.freedesktop.home1 org.freedesktop.hostname1 org.freedesktop.import1 org.freedesktop.locale1 org.freedesktop.LogControl1 org.freedesktop.login1 org.freedesktop.machine1 org.freedesktop.oom1 org.freedesktop.portable1 org.freedesktop.resolve1 org.freedesktop.systemd1 org.freedesktop.timedate1
* meson: add missing final newline in jinja2 outputsZbigniew Jędrzejewski-Szmek2021-12-091-0/+1
| | | | | I think this might be caused by trim_blocks=True. We were missing the final newline everywhere.
* bpf: refactor skeleton generationJames Hilliard2021-12-071-128/+0
| | | | This should hopefully fix cross compilation for the bpf programs.
* ci: pin python dependencies and let Dependabot keep track of themEvgeny Vereshchagin2021-12-071-2/+6
|
* docs: fix descriptions in discoverable partitionsAlyssa Ross2021-11-271-6/+6
| | | | | | | | | | | | | | | 00db9a114e ("docs: generate table from header using a script") got the descriptions for the partition types mixed up. After that change, the spec claimed, for example, that the /usr partition should contain "dm-verity integrity hash data for the matching root partition", and that the /usr verity partition should be of type "Any native, optionally in LUKS". This made the spec an extremely confusing read before I figured out what must have happened! I've gone through the table as it existed prior to 00db9a114e, and moved the descriptions around in the script that generates the table until they matched up with what they used to be. Then I regenerated the table from the fixed script.
* gpt: Rename PPC64LE TO PPC64_LEDaan De Meyer2021-11-241-2/+2
| | | | For consistency with ARCHITECTURE_PPC64_LE
* docs: remove comment that makes githubs renderer very angryZbigniew Jędrzejewski-Szmek2021-11-231-1/+0
| | | | It is fine on github.com, but not on github.io.
* Add a trivial guard against using the same uuid twiceZbigniew Jędrzejewski-Szmek2021-11-191-0/+6
|
* docs: document the partition UUID used by homedZbigniew Jędrzejewski-Szmek2021-11-191-0/+5
|
* docs: generate table from header using a scriptZbigniew Jędrzejewski-Szmek2021-11-191-0/+181
| | | | | | | | | | | | | | This adds a helper script: $ python3 tools/list-discoverable-partitions.py <src/shared/gpt.h <!-- generated with tools/list-discoverable-partitions.py --> | Partition Type UUID | Name | Allowed File Systems | Explanation | |---------------------|------|----------------------|-------------| | _Root Partition (Alpha)_ | `6523f8ae-3eb1-4e2a-a05a-18b695ae656f` | [Root Partition] | [Root Partition more] | | _Root Partition (ARC)_ | `d27f46ed-2919-4cb8-bd25-9531f3c16534` | ditto | ditto | ... The output can be pasted into the markdown file. I think this works better than trying to match the two lists by hand.
* oss-fuzz: move apt-gets and pips to the systemd repositoryEvgeny Vereshchagin2021-11-191-0/+7
| | | | | | | | | to be able to control our dependencies right here without sending PRs like https://github.com/google/oss-fuzz/pull/5199 and https://github.com/google/oss-fuzz/pull/5601. It should also allow us to pin meson to let Dependabot keep track of it and jump from one version to another without breaking anything
* build: preserve correct mode when generating files via jinja2Christian Brauner2021-11-081-1/+6
| | | | | | | | | When using "capture : true" in custom_target()s the mode of the source file is not preserved when the generated file is not installed and so needs to be tweaked manually. Switch from output capture to creating the target file and copy the permissions from the input file. Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
* meson-render-jinja2: use ast.literal_eval()Zbigniew Jędrzejewski-Szmek2021-11-051-2/+4
| | | | | | | | | | | Imports are sorted in the usual fashion: stdlib first. literal_eval() parses string/numbers/lists/sets/dicts, and nothing else, while eval will execute any python code. Using literal_eval() is generally more correct, because it avoids the risk of side effects from the parsed expression. In this case, we generate the parsed strings ourselves, so it's very unlikely to have anything unexpected in the expressions. But let's do the correct thing anyway.