Commit Graph
88931 Commits
Author SHA1 Message Date
Yu WatanabeandJörg Behrmann c5abf64d37 fuzz-bootspec: apply "ruff format"
This also replaces open().read() with Path().read_text().

Co-authored-by: Jörg Behrmann <behrmann@physik.fu-berlin.de>
2026-05-18 02:44:46 +09:00
Yu Watanabe a89c11b672 filesystem-sets: apply "ruff format" and "ruff check --fix" 2026-05-18 02:44:46 +09:00
Yu Watanabe 4758d1f71a man/notify-example: apply "ruff format" 2026-05-18 02:44:46 +09:00
Yu Watanabe 5481961700 man/check-os-release: apply "ruff format" 2026-05-18 02:44:46 +09:00
Yu Watanabe 14848f1f71 man/check-os-release-simple: apply "ruff format" 2026-05-18 02:44:46 +09:00
Yu Watanabe 522fdd7d96 man/90-rearrange-path: apply "ruff format" and "ruff check --fix" 2026-05-18 02:44:46 +09:00
Yu Watanabe 4fa9302fa4 hwdb/parse_hwdb: apply "ruff format" and "ruff check --fix" 2026-05-18 02:44:40 +09:00
Yu Watanabe 1c98dff834 hwdb/ids_parser: apply "ruff format" and "ruff check --fix" 2026-05-18 02:32:42 +09:00
Yu Watanabe a3dc3dc61b hwdb/acpi-update: apply "ruff format" 2026-05-18 02:32:42 +09:00
Yu Watanabe f74118be4f ycm: apply "ruff format" and "ruff check --fix" 2026-05-18 02:32:42 +09:00
Yu Watanabe 75f7304512 ruff: do not warn about too long line and lambda assignment 2026-05-18 02:32:42 +09:00
Yu Watanabe c54decc406 ruff: use single quotes for multiline strings 2026-05-18 02:32:39 +09:00
Yu Watanabe aa0f03eb03 networkctl: introduce 'dhcp-lease' command to dump acquired DHCP lease (#42137) 2026-05-18 01:28:11 +09:00
Yu Watanabe ba22984544 sd-dhcp-client: use dhcp_message_send_{udp,raw}() and update BPF code (#42138) 2026-05-18 01:26:55 +09:00
Yu Watanabe a72f23d2b8 sd-dhcp-client: drop unused data in sd_dhcp_client
With the previous commit, now sd_dhcp_client.link is not used anymore.
Let's drop it.
2026-05-17 22:44:17 +09:00
Yu Watanabe 0c69b24741 dhcp-client-send: move/update BPF code and socket initialization from dhcp-network.c
- BPF code now supports the case when IP header has IP packet options,
- also set socket priority to UDP socket.

Co-developed-by: Google Gemini Pro
2026-05-17 22:44:17 +09:00
Yu Watanabe 89cf6d81f7 dhcp-client-send: use dhcp_message_send_{udp,raw}() 2026-05-17 22:44:17 +09:00
Yu Watanabe ddd535a424 NEWS: mention new 'networkctl dhcp-lease' command 2026-05-17 21:03:55 +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
Yu Watanabe 9022ccc219 dhcp: cleanups for sd-dhcp-lease.c and rewrite test-dhcp-client (#42135) 2026-05-17 20:12:37 +09:00
Yu Watanabe 149adb2fdc dhcp-message-dump: introduce dump_dhcp_message()
It dumps DHCP messages in a human friendly format.
It will be used in networkctl in a later commit.
2026-05-17 20:09:47 +09:00
Yu Watanabe a192c67630 ci/alpine: do not install util-linux-login
For some reasons, after util-linux is bumped from 2.41.4-r0 to 2.42-r0,
the 'su' command from util-linux-login seems to not correctly run commands in
https://github.com/jirutka/setup-alpine/blob/v1.4.1/alpine.sh
and causes the following spurious failure:
```
2026-05-15T21:19:15.6539432Z ##[group]Set up user runner
2026-05-15T21:19:15.6981963Z /bin/sh: line 0: ��: not found
2026-05-15T21:19:15.6982503Z /bin/sh: line 1: ␡ELF␂␁␁␃: not found
2026-05-15T21:19:15.6985788Z /bin/sh: line 10: ␒␐␆␒B␈␒�␄␒y␄␒�␁␒␞␇␒:␁␒�␃␒�␄␒@␁␒9␈␒?␆␒␚␈␒x: not found
2026-05-15T21:19:15.7010731Z /bin/sh: line 33: can't open ␂␒-␂␒�: no such file
2026-05-15T21:19:15.7016026Z /bin/sh: line 33: syntax error: unexpected word (expecting ")")
2026-05-15T21:19:15.7049583Z
2026-05-15T21:19:15.7050199Z ␛[1;31mError occurred at line 338:␛[0m
2026-05-15T21:19:15.7050830Z   335 | 		echo 'permit nopass keepenv $SUDO_USER' | tee /etc/doas.d/root.conf
2026-05-15T21:19:15.7051287Z   336 | 	fi
2026-05-15T21:19:15.7051549Z   337 | SHELL
2026-05-15T21:19:15.7052039Z ␛[1;31m> 338 | abin/"$INPUT_SHELL_NAME" --root /.setup.sh␛[0m
2026-05-15T21:19:15.7052506Z   339 |
2026-05-15T21:19:15.7052796Z   340 | rm .setup.sh
2026-05-15T21:19:15.7053172Z   341 | endgroup
2026-05-15T21:19:15.7096322Z ##[error]Error occurred at line 338: abin/"$INPUT_SHELL_NAME" --root /.setup.sh (see the job log for more information)
2026-05-15T21:19:15.7101400Z ##[error]Process completed with exit code 1.
```
Let's not install the package. It seems no command provided by the
package is used.
2026-05-17 10:56:34 +01:00
Yu Watanabe 335ac4a71d fuzz-dhcp-client: externally set socket fd, rather than override functions 2026-05-17 15:20:29 +09:00
Yu Watanabe acdaee339f test-dhcp-client: add test cases for discover attempt counter 2026-05-17 15:20:29 +09:00
Yu Watanabe 115c354b57 test-dhcp-client: add test cases for IPv6-only mode 2026-05-17 15:20:29 +09:00
Yu Watanabe 7df9210283 test-dhcp-client: add test case for BOOTP client mode 2026-05-17 15:20:29 +09:00
Yu Watanabe 9bd6b949d3 test-dhcp-client: add test case for INIT-REBOOT sequence 2026-05-17 15:20:29 +09:00
Yu Watanabe f7c144b9c7 test-dhcp-client: add test case for rapid commit mode 2026-05-17 15:20:24 +09:00
Yu Watanabe 3eba8d6265 test-dhcp-client: add test case for anonymized mode 2026-05-17 15:18:41 +09:00
Lennart Poettering ab9d673c6b update TODO 2026-05-17 08:17:31 +02:00
Yu Watanabe cec4d5e673 sd-dhcp-client: two tiny cleanups (#42129) 2026-05-17 04:16:32 +09:00
Yu Watanabe 385cd74fca test-dhcp-client: rewrite the test by using sd_dhcp_message
More test cases will be added later.
2026-05-17 04:13:47 +09:00
Yu Watanabe 33c6d10749 sd-dhcp-client: allow to set socket fd externally
It will be used by the unit test and fuzzer for the DHCP client.
Preparation for later changes.
2026-05-17 04:13:47 +09:00
Yu Watanabe f2169cfe8e sd-dhcp-lease: coding style cleanups
Rename function arguments for storing results, and accept NULL for
them. Also, adjust the position of asterisk.
2026-05-17 04:13:47 +09:00
Yu Watanabe 5768f1dd6f Final batch of conversions to option and verb macros (#42127) 2026-05-17 03:50:48 +09:00
Yu Watanabe bd3bbacd24 sd-dhcp-client: drop unused legacy code (#42128) 2026-05-17 03:42:29 +09:00
Zbigniew Jędrzejewski-Szmek d512d3c6d3 treewide: get rid of remaing getopt/getopt_long stuff 2026-05-16 18:37:12 +02:00
Zbigniew Jędrzejewski-Szmek 39a3647539 tree-wide: get rid of old dispatch_verb
Also rename dispatch_verb_with_args to dispatch_verb.
2026-05-16 18:37:10 +02:00
Zbigniew Jędrzejewski-Szmek 40fed88f8e test-verbs: dispatch via _dispatch_verb_with_args() directly
Drops the global-optind dependency from the test helper. Verb fixtures
stay inline as static const Verb[] — the section-based VERB() macro
would force unique verb names across the three test cases, which they
deliberately share to exercise overlap.

Co-developed-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 18:36:08 +02:00
Zbigniew Jędrzejewski-Szmek e934c6209a veritysetup: convert verbs to VERB macros
Place VERB() declarations above each dispatch function and use
verbs_get_help_table() in help(). run() switches to
dispatch_verb_with_args(); the argv_looks_like_help() shortcut is
preserved since this is an internal tool with no proper option parsing.

Co-developed-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 18:36:08 +02:00
Zbigniew Jędrzejewski-Szmek 65f83b0352 update-utmp: convert verbs to VERB macros
There is no --help implemented, so both verbs don't get help strings.
We should probably add --help + --version, and a proper description
of the program, but I'm leaving that for later.

Co-developed-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 18:36:08 +02:00
Zbigniew Jędrzejewski-Szmek 062f6892b3 integritysetup: convert verbs to VERB macros
Place VERB() declarations above each dispatch function and use
verbs_get_help_table() in help() so the command listing stays in sync.
run() switches to dispatch_verb_with_args(); the argv_looks_like_help()
shortcut is preserved since this is an internal tool with no proper
option parsing.

Co-developed-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 18:36:08 +02:00
Zbigniew Jędrzejewski-Szmek 1bf6be01c0 backlight: convert verbs to VERB macros
Place VERB() declarations directly above each dispatch function and use
verbs_get_help_table() in help() so the command listing stays in sync.
run() switches to dispatch_verb_with_args(); the argv_looks_like_help()
shortcut is preserved since this is an internal tool with no proper
option parsing.

Co-developed-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 18:36:08 +02:00
Zbigniew Jędrzejewski-Szmek 59db1f482a dissect: convert the other parser to option macros 2026-05-16 18:36:08 +02:00
Zbigniew Jędrzejewski-Szmek 59ce15c406 storagectl: convert run_as_mount_helper to OPTION macros
This is the util-linux mount-helper interface (mount.storage), so all
options stay hidden via help=NULL — they are not user-facing. The
namespace "mount.storage" is distinct from the storagectl namespace
used for the user-facing CLI.

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-16 18:36:08 +02:00
Zbigniew Jędrzejewski-Szmek 8bc7cf64d1 udev: drop leftover includes of getopt.h
Not sure why those were left and why clang-tidy didn't complain.
2026-05-16 18:36:08 +02:00
Yu Watanabe ff32569f2a sd-dhcp-client: set TOS and socket priority by default
Also this renames sd_dhcp_client_set_service_type() to _set_ip_service_type().
2026-05-17 01:34:44 +09:00
Yu Watanabe e7c550895a sd-dhcp-client: split out setting anonymize parameter
No effective functional change. Just refactoring.
2026-05-17 01:33:43 +09:00
Zbigniew Jędrzejewski-Szmek cf88903637 tree-wide: get rid of most uses of ALIGN_PTR
This bothered me for a while, but I didn't think too much about it and just
copied the existing usage pattern. But it really doesn't make sense. We expect
the compiler to align the section properly. But if it didn't align it, applying
alignment after the fact would just cause our pointer to point to the middle
of the structure. That'd be even worse than a misaligned pointer.

Similarly, when doing pointer arithmetic, p++ should really result in a value
with the appropriate alignment. This is the basic principle of C pointer
addition. So we really shouldn't try to adjust the pointer ourselves. At most,
we can assert that it is indeed aligned in tests.
2026-05-16 18:32:14 +02:00
Yu Watanabe 4095391bd6 dhcp-packet: drop unused dhcp_packet_verify_headers() 2026-05-17 01:31:43 +09:00