Commit Graph

497 Commits

Author SHA1 Message Date
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
Daan De Meyer
fb514c2f8f mkosi: Rework how the pkgenv environment variables are set
Instead of including distribution specific files in the subimages,
let's have one common mkosi.pkgenv/ directory that handles all the
matching which is then included in the subimages.

This gives us more control on exactly how we do the matching.
2025-11-25 11:02:34 +01:00
Daan De Meyer
7336f2c748 meson: Still build libshared even if libmount is disabled
Currently, if the libmount feature is disabled, we don't build
libshared and as a result skip building every other executable as
well. Among other things, this makes our nodeps CI builds kind of
pointless since hardly any code will be compiled.

Let's improve on the situation by making libmount properly optional
in libshared. Then, we only skip building the executables that
actually need libmount.
2025-11-24 13:09:41 +01:00
Daan De Meyer
3f0fc93219 tools: Add script to detect unused symbols in libshared
Symbols exported by libshared can't get pruned by the linker, so
every unused exported symbol is effectively dead code we ship to users
for no good reason. Let's add a script to analyze how many such symbols
we have.

We also add a meson test to run the script on all of our binaries.
Since it detects unused symbols and still has a few false positives,
don't enable the test by default similar to the clang-tidy tests.

The script was 100% vibe coded by Github Copilot with Claude Sonnet 4.5
as the model.

Current results are (without the unused symbols list):

Analysis of libsystemd-shared-259.so
======================================================================
Total exported symbols: 4830
  (excluding public API symbols starting with 'sd_')
Used symbols: 4672
Unused symbols: 158
Usage rate: 96.7%
2025-11-19 13:14:15 +01:00
Zbigniew Jędrzejewski-Szmek
31d3b96293 musl: split out script to setup build
This makes it easier to set up a local build with musl:
$ tools/setup-musl-build.sh build-meson
$ ninja -C build-meson
2025-11-17 17:02:23 +01:00
Masanari Iida
036100d745 systemd-logind: Add signal section in man systemd-logind
This patch adds signal setion in man systemd-logind
2025-11-12 08:45:55 +09:00
Yu Watanabe
a736d4ec9c oss-fuzz: install libcrypt-dev in i386 image
This is preparation for bumping base image of oss-fuzz to Ubuntu 24.04.

Closes #39395.

Co-authored-by: Evgeny Vereshchagin <evvers@ya.ru>
2025-11-10 10:45:42 +09:00
Yu Watanabe
9b414a38fa tree-wide: drop unused libcap dependencies 2025-10-24 01:52:59 +09:00