504 Commits

Author SHA1 Message Date
Luca Boccassi
8127d21ffc tools: add script to print blurb for SPI yearly report
Co-developed-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 20:45:36 +01:00
Zbigniew Jędrzejewski-Szmek
d8344fbf14 tools/test-crash-trace: do not use fixed signal numbers
The numbers of signals vary by arch. On the common arches the signals
listed here all use the same numbers, but people are likely to use
this on more fringe architectures too, so let's use symbolic names
instead.

Also the comment about gdb "hitting the same kill" didn't make sense.

The syntax is a bit baroque, but using a helper variable does not work.
Also shellcheck complains about $[ ] which would have made this more
legible.
2026-05-25 12:51:52 +01:00
Zbigniew Jędrzejewski-Szmek
997ce3a3c0 po: "detect" msgmerge-nofuzzy using file()
With find_program, meson verbosely reports the detection of the file,
which we don't need since it's part of the repo and always present.
2026-05-24 13:26:56 +01:00
Daan De Meyer
c7113f6b3c ci: run the musl build & test under mkosi with a postmarketOS tools tree
Drop the standalone Unit-tests (musl) workflow that ran on an Alpine sandbox
spun up by jirutka/setup-alpine, and merge it into unit-tests.yml as a new
build-musl job that provisions a postmarketOS tools tree via mkosi and runs
the meson build + test suite through 'mkosi box'. postmarketOS is musl-native,
so the musl-gcc / -idirafter /usr/include wrappers the Fedora tools tree
needed are gone; the linter.yml's own musl build step also goes away since
the unit-tests workflow now covers it (and tests it).

postmarketOS doesn't ship a downstream systemd packaging spec, so the new
tools tree config in mkosi.tools.conf/mkosi.conf.d/postmarketos.conf does not
set PrepareScripts and lists build deps manually. mkosi.sync now early-exits
when PKG_SUBDIR is unset so the missing pkgenv entry doesn't trip set -u.

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-20 17:22:35 +00:00
Luca Boccassi
d3f38e09ac po: skip automated fuzzy translations when generating new po files
The fuzzy translations are always wrong, but meson's integration does
not allow skipping them. Add a tiny wrapper for 'msgmerge' to
workaround the issue and skip them when running ninja systemd-update-po
2026-05-20 14:28:49 +02:00
Daan De Meyer
b8b2316b0a tools: add a test wrapper that replays crashing tests under gdb
meson test --wrapper hook to print a gdb backtrace inline in the test
log when a test exits with an actual crash signal (SIGSEGV, SIGABRT,
SIGBUS, SIGFPE, SIGILL). Wired into the default add_test_setup() so it
runs automatically on every `meson test`.

Environmental terminations (SIGTERM/SIGKILL/SIGPIPE/SIGALRM) are passed
through without replay, and the original signal is re-raised so the
parent's wait() observes WIFSIGNALED rather than a plain exit code.
2026-05-19 23:14:32 +02:00
Luca Boccassi
3b3bec1abe Update hwdb autosuspend rules
ninja -C build update-hwdb-autosuspend
2026-05-18 12:17:23 +01:00
Yu Watanabe
9e15fad481 xml_helper: apply "ruff format" 2026-05-18 02:44:47 +09:00
Yu Watanabe
8fc2bde0db update-man-rules: apply "ruff format" 2026-05-18 02:44:47 +09:00
Yu Watanabe
c1e31e12b4 update-dbus-docs: apply "ruff format" and "ruff check --fix" 2026-05-18 02:44:47 +09:00
Yu Watanabe
09e34716fc sync-docs: apply "ruff format" and "ruff check --fix" 2026-05-18 02:44:47 +09:00
Yu Watanabe
3b690e2c7e meson-render-jinja2: apply "ruff format" 2026-05-18 02:44:47 +09:00
Yu Watanabe
1fbb5e0ff1 meson-extract-unit-files: apply "ruff format" 2026-05-18 02:44:47 +09:00
Yu Watanabe
3675924f5b make-man-index: apply "ruff format" 2026-05-18 02:44:47 +09:00
Yu Watanabe
8b24db05d4 make-directive-index: apply "ruff format" 2026-05-18 02:44:47 +09:00
Yu Watanabe
e0ac581a8b list-discoverable-partitions: apply "ruff format" 2026-05-18 02:44:47 +09:00
Yu Watanabe
cc1373700b generate-gperfs: apply "ruff format" 2026-05-18 02:44:47 +09:00
Yu Watanabe
86d3b07fba gdb-sd_dump_hashmaps: apply "ruff format" and "ruff check --fix" 2026-05-18 02:44:47 +09:00
Yu Watanabe
30c87278d4 find-unused-library-symbols: apply "ruff format" and "ruff check --fix" 2026-05-18 02:44:47 +09:00
Yu Watanabe
2ab056cb7e fetch-mkosi: apply "ruff format" and "ruff check --fix"
This also makes CONFIG is closed when not necessary.
2026-05-18 02:44:47 +09:00
Yu Watanabe
6c2bf5330b fetch-distro: apply "ruff format" 2026-05-18 02:44:47 +09:00
Yu Watanabe
0df17e665b elf2efi: apply "ruff format" and "ruff check --fix" 2026-05-18 02:44:47 +09:00
Yu Watanabe
7e62c9be6f dump-auxv: apply "ruff format" 2026-05-18 02:44:47 +09:00
Yu Watanabe
5aa172e263 dbus-exporter: apply "ruff format" and "ruff check --fix" 2026-05-18 02:44:47 +09:00
Yu Watanabe
a5d54f52d6 check-version-history: apply "ruff format" and "ruff check --fix" 2026-05-18 02:44:47 +09:00
Yu Watanabe
53172028c8 check-efi-alignment: apply "ruff format" 2026-05-18 02:44:46 +09:00
Yu Watanabe
0965c5d719 catalog-report: apply "ruff format" 2026-05-18 02:44:46 +09:00
Yu Watanabe
ce9b618e46 analyze-dump-sort: apply "ruff format" 2026-05-18 02:44:46 +09:00
Yu Watanabe
6cbf8222ca networkctl: add dhcp-lease verb to dump DHCP lease
This shows the DHCP message of an acquired DHCP lease.
Example:
```
$ networkctl dhcp-lease eth0
Header:
              KEY VALUE
   Hardware Type: ETHER
Hardware Address: 41:42:43:31:32:33
  Client Address: 192.0.2.123
  Server Address: 192.0.2.1

Options:
CODE NAME               DATA
   1 subnet mask        255.255.255.0
   3 router             192.0.2.1
   6 domain name server 192.0.2.1
  12 hostname           test-node
  15 domain name        lan
  28 broadcast address  192.0.2.255
  42 NTP server         192.0.2.11
                        192.0.2.12
  51 lease time         1d
  53 message type       5
  54 server identifier  192.0.2.1
  58 renewal time       11h 5min 38s
  59 rebinding time     20h 5min 38s
 119 domain search      hoge.example.com
                        foo.example.com
```
2026-05-17 21:02:20 +09:00
Michael Vogt
3c6a713836 tools: run check-coccinelle.sh with (updated) parsing_hacks.h
This commit runs the check-coccinelle checker scripts with the
parsing_hacks.h. Because this was missing before there were some
issues that did not get flagged.

While at it it also adds some missing cleanup attributes and
iterators to get better results. Its a bit sad that there is no
(easy/obvious) way to detect when new things are needed for
parsing_hacks.h
2026-04-11 21:15:12 +02:00
Michael Vogt
777d9c10ad coccinelle: add checks for pointer access without NULL check
The fix in 8f1751a111 made me wonder if we could automatically detect
when pointers are accessed but when this might not be safe. Systemd
is already using a lot of `assert(dst)` and this change now forces
us to use them.

So this commit (ab)uses coccinelle to flag any pointer parameter
dereference not preceded by assert(param), ASSERT_PTR(param), or an
explicit NULL check. It adds integration into meson as a new "coccinelle"
test suite (just like clang-tidy) and is run in CI. The check is not
perfect but seems a reasonable heuristic.

For this RFC commit it is scoped to a subset, it excludes 25 dirs right
now and includes around 100. About 300 warnings left. Busywork that I am
happy to do if there is agreement that it is worth it.

With this in place we would have caught the bug from 8f1751a111 in CI:
```
FAIL: check-pointer-deref.cocci found issues in systemd/src/boot:
diff -u -p systemd/src/boot/measure.c /tmp/nothing/measure.c
--- systemd/src/boot/measure.c
+++ /tmp/nothing/measure.c
@@ -312,7 +312,6 @@ EFI_STATUS tpm_log_tagged_event(
         if (err != EFI_SUCCESS)
                 return err;

-        *ret_measured = true;
         return EFI_SUCCESS;
 }
```

This also adds a new POINTER_MAY_BE_NULL() for the cases when the
called function will do the NULL check (like `iovec_is_set()`).
2026-03-26 18:13:17 +01:00
Daan De Meyer
59a83c37bf ci: Simplify musl build setup
No need to setup symlink farms, we can just use the host's /usr/include
now.
2026-02-19 20:04:06 +01:00
Zbigniew Jędrzejewski-Szmek
a6b328fd95 elf2efi: modernize typing annotations
We still need Union and Optional as long as compat with Python 3.9
is needed.
2026-02-19 15:34:10 +01:00
Zbigniew Jędrzejewski-Szmek
3c7bb0c37b elf2efi: make mypy-clean 2026-02-19 15:34:10 +01:00
Zbigniew Jędrzejewski-Szmek
528a939c89 elf2efi: import whole module, not individual symbols
When reading the code, it was hard to figure out if the given name was
imported or a local class. And the renaming of imports also made it
harder to look things up online. Arguably, the deeply nested import
structure and inconsistent naming in elftools is partially to blame:
there is just no good way to make this look nice. But anyway, let's use
the usual style of importing the module and using names prefixed with
the module path so that the origin of imported names is clear.

elfutils.elf.elffile is importered separately, because a) it needs to be
imported separately anyway bxecause the module does lazy imports
internally, a) the name already indicates the origin, c) is used in
quite a few places so the shorter name is nice.
2026-02-19 15:34:10 +01:00
Yu Watanabe
08719d0e78 Revert "tools: make update-dbus-docs compatible with Python 3.7"
This reverts commit 668b3a42fe.

Now we require Python 3.9 or newer.
2026-02-18 18:47:15 +09:00
Oleksandr Andrushchenko
f8a4c3d375 network: add ModemManager support
[Match]
Name=wwan*

[Network]
LLDP=no
LinkLocalAddressing=no
IPv6AcceptRA=no

[ModemManager]
SimpleConnectPropertie]s=apn=internet ip-type=ipv4 allow-roaming=no pin=1111 operator-id=25503
RouteMetric=200
UseGateway=yes

Co-authored-by: Yu Watanabe <watanabe.yu+github@gmail.com>
2026-02-16 13:22:21 +09:00
Daan De Meyer
5ae7db99bf tools: Fix changelog generation (again)
Using --first-parent --no-merges seems to exclude not just the merge
commits but all the commits from the merge as well. Let's use only
--no-merges to get just the commits without merges.
2026-02-14 16:04:55 +01:00
Lennart Poettering
e2f23b6deb man: document new varlinkctl feature 2026-02-09 10:54:18 +01:00
Daan De Meyer
7bb0bd400f fetch-mkosi: Shorten commit message title
Currently github truncates the message so let's make it a little shorter
so it's not truncated.
2026-02-05 10:53:09 +01:00
Yu Watanabe
966c29ae59 tools: add script that checks external links in docs
Generated by GitHub Copilot, and manually adjusted.
2026-01-31 01:11:05 +09:00
Yu Watanabe
2553c53730 tools: drop unnecessary sys/capability.h header
After 9b414a38fa (#39425), the header is
not required. And after b295c166f9, the
header is not installed in CI environments.
2026-01-02 08:46:05 +01:00
Yu Watanabe
6d2c9c2203 tools: show each command to make it easier to debug 2026-01-02 08:46:05 +01:00
Yu Watanabe
fe3c790f71 tools: allow to run setup-musl-build.sh for already set up directory 2026-01-02 08:46:05 +01:00
Luca Boccassi
9463b3b51c man: document version for BindNetworkInterface instead of using ignore list
The ignore list is for older stuff, all new interfaces must be documented
with a version.

Follow-up for c1c787651b
2025-12-24 19:25:21 +01:00
Luiz Amaral
c1c787651b Add support for binding a unit to a network iface 2025-12-24 07:37:58 +01:00
Luca Boccassi
2791af18e4 tools: use -f in mkosi summary in fetch-distro.py
$ ./tools/fetch-distro.py -u fedora
+ mkosi --json -d fedora summary
‣ Ignoring --distribution from the CLI. Run with -f to rebuild the image with this setting

Follow-up for 35f6e5c327
2025-12-19 11:35:21 +00:00
q66
3d64cb9a54 vcs-tag.sh: use portable sed argument order 2025-12-08 21:35:28 +01:00
Yu Watanabe
929ce35f8d meson: rework include_directories() and finding of tools (#39956)
This is a cleanup in preparation for later additions.
2025-12-02 20:07:37 +09:00
Zbigniew Jędrzejewski-Szmek
322f6adbcd meson: add tools/meson.build
Previously, we looked for scripts in the tools/ directory ad hoc,
wherever they were needed. Let's do those checks in one place.
The main meson.build file is shrunk somewhat, which is always nice.
2025-12-01 16:18:11 +01:00