Commit Graph
80082 Commits
Author SHA1 Message Date
Lennart Poettering 71a737d68d analyze: don't connect to bus from analyze test run
This thing should not be "live", hence don't try to connect to the bus,
or bind the private bus socket.

Fixes: #36540
2025-03-13 14:22:13 +01:00
Lennart Poettering e75fbee624 manager: explicitly create our private runtime directory
So far /run/systemd/ was created as side-effect of initializing the
D-Bus client/server. But in one of the next commits we'll suppress
connecting to D-Bus in test runs, hence let's move the logic our of the
D-Bus code and into manager_startup().

Then, also drop creating it again and again in PID 1 at various places,
and just rely on it to exist.
2025-03-13 14:22:13 +01:00
Lennart Poettering da65941c3e coredump,analyze: use read_full_file() for reading various top-level /proc/ files
Kernel API file systems typically use either "raw" or "seq_file" to
implement their various interface files. The former are really simple
(to point I'd call them broken), in that they have no understanding of
file offsets, and return their contents again and again on every read(),
and thus EOF is indicated by a short read, not by a zero read. The
latter otoh works like a typical file: you read until you get a
zero-sized read back.

We have read_virtual_file() to read the "raw" files, and can use regular
read_full_file() to read the "seq_file" ones.

Apparently all files in the top-level /proc/ directory use 'seq_file'.
but we accidentally used read_virtual_file() for them. Fix that.

Also clarify in a comment what the rules are.

Fixes: #36131
2025-03-13 14:18:46 +01:00
Lennart Poettering cca655dcbf bootctl: make sure bootctl --image= works on image with /usr/ but without / (#36727)
```
Let's make sure we can use the tool on ParticleOS images. They have no
root fs by default (until they are instantiated), but always have /usr/.
Hence add DISSECT_IMAGE_USR_NO_ROOT which has the desired effect.
```
2025-03-13 14:14:56 +01:00
Lennart Poettering a462280c9a bootctl: tweak status output when operating on --image= files
Let's not claim the system was not booted with UEFI if we use --image=.
The system wasn't booted at all, after all. Hence supress the whole
section altogether in this case.
2025-03-13 10:49:53 +01:00
Lennart Poettering 742e26ba20 bootctl: make sure bootctl --image= works on image with /usr/ but without /
Let's make sure we can use the tool on ParticleOS images. They have no
root fs by default (until they are instantiated), but always have /usr/.
Hence add DISSECT_IMAGE_USR_NO_ROOT which has the desired effect.
2025-03-13 10:49:33 +01:00
Lennart Poettering 76f1c94674 update TODO 2025-03-13 10:35:24 +01:00
Lennart Poettering ceaf0bda47 update TODO 2025-03-13 09:55:59 +01:00
Yu Watanabe e0b915f77a test-localed-util: use ASSERT_OK() and friends 2025-03-13 09:27:05 +01:00
Yu Watanabe d8a353552a TEST-73-LOCALE: do not unnecessarily restart systemd-localed
It is not necessary to clear previous keymap assignment, as
`localectl set-keymap` will anyway overwrite the previous assignment.

This drops the unnecessary restart of systemd-localed in the loop.
The mkosi test image contains about 500~700 keymaps. The test
performance is greatly improved by reducing the number of restarts,
especially when the test is running with sanitizers.

On Fedora 41 with sanitizers,
Before:
1/1 systemd:integration-tests / TEST-73-LOCALE OK             1157.50s
After:
1/1 systemd:integration-tests / TEST-73-LOCALE OK              104.43s
2025-03-13 09:24:49 +01:00
Yu Watanabe fdab24bf6a Fix several issues found by Coverity (#36726) 2025-03-13 07:54:06 +09:00
Daan De Meyer 3ed45e7fd3 copy: Bubble up ENOSPC immediately in fd_copy_directory()
It doesn't really make sense to continue once we start getting ENOSPC.
2025-03-13 07:53:06 +09:00
Lennart Poettering 520372b7ee man: document how Restart= reacts to oom kill
Fixes: #36529
2025-03-12 22:35:51 +00:00
Yu Watanabe e0111277e4 nsresource: fix GID check in io.systemd.UserDatabase.GetGroupRecord method
Fixes a bug in 8aee931e7a (v256).
2025-03-13 05:35:54 +09:00
Franck Bui dbe61d9ec7 getty-generator: don't use "3270!tty1" when instantiating serial-getty@.service on s390x
Path of the 3270 console in /sys is "/sys/class/tty/3270!tty1" but its device
node is "/dev/3270/tty1".
2025-03-13 05:34:37 +09:00
Yu Watanabe 36a9e47a0d nsresource: fix error handling 2025-03-13 05:27:50 +09:00
Yu Watanabe e66c71a786 boot: several follow-ups for reboot-on-error feature (#36721) 2025-03-13 05:26:47 +09:00
Yu Watanabe 86cbb13a4e udev/net: enable new [EnergyEfficientEthernet] section
Also fixes a typo in setting name.

Follow-up for cdc9be29b1.
Addresses post-merge comments for #36302.
2025-03-13 05:26:14 +09:00
Lennart Poettering 5dbf476b11 units: order oomd after swap.target
oomd only works well if we have swap, hence we should not start it
before swaps are up, in particular as we will print an annoying message
otherwise.

Fixes: #36704
2025-03-13 05:24:11 +09:00
Yu Watanabe 278e3adf50 test: wrap assignments in ASSERT_OK() and friends with parentheses
Hopefully fixes many CID reports.
2025-03-13 05:15:28 +09:00
Yu Watanabe 8df80dfbbf test-netlink: fix use of ASSERT_OK()
Follow-up for 3841288e5f.
2025-03-13 05:15:22 +09:00
Yu Watanabe 55b13141fc homed: fix OOM check
Follow-up for f1b6417fea.
Fixes CID#1593167.
2025-03-13 04:57:02 +09:00
Yu Watanabe 26835b3e98 homectl: insert missing 'else'
Follow-up for cc14c14782.
Fixes CID#1593168 and CID#1593166.
2025-03-13 04:56:49 +09:00
Lennart Poettering c5a5046792 boot: fallback to unrestricted allocation if initrd allocation doesn't fit below 4g (#36715)
Fixes: #36706
2025-03-13 04:14:40 +09:00
Yu Watanabe f9ddbc5b35 udev: use INTERFACE property rather than sysname when processing network interface (#36627)
sd-device replaces '!' in sysname with '/', hence sysname may be
different from ifname.
Let's use INTERFACE property when we need network interface name.

This fixes the following unexpected renaming of network interfaces
created with '!' in their name, e.g. 'hoge!foo' -> 'hoge_foo':
```
$ run0 ip link add 'hoge!foo' type dummy
$ ip link show 'hoge!foo'
Device "hoge!foo" does not exist.
$ ip link show 'hoge_foo'
410: hoge_foo: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether ee:54:4a:dd:c4:c7 brd ff:ff:ff:ff:ff:ff
```

Closes #26156.
2025-03-13 04:12:57 +09:00
Michael Catanzaro 780f320229 resolve: add warning comment to config file
There are way too many users configuring the DNS= setting by mistake,
because what it seems to do is different from what it actually does. We
do not have consensus to change its behavior, so let's at least add a
warning comment.

Fixes #33973
2025-03-13 04:12:18 +09:00
Yu Watanabe 1ae60b69fa boot: introduce string tables for RebootOnError and sucure_boot_enroll 2025-03-13 02:40:12 +09:00
Yu Watanabe c5710c00ff boot: fix use of uninitialized value on error
Follow-up for 0bdf94e588.
2025-03-13 02:40:12 +09:00
Yu Watanabe 2ee01dbc05 netlink-util: move several function prototypes 2025-03-13 01:48:50 +09:00
Yu Watanabe 472ad6af94 netlink-util: allow to call rtnl_set_link_name() and friends with NULL rtnl 2025-03-13 01:48:50 +09:00
Yu Watanabe 0e44a7c085 netlink-util: merge rtnl_get_link_info() and rtnl_get_ifname_full() into rtnl_get_link_info_full()
Then, this makes rtnl_get_ifname_full() and friends as inline wrappers of
rtnl_get_link_info_full().
2025-03-13 01:48:50 +09:00
Yu Watanabe 3841288e5f test-netlink: use ASSERT_OK() and friends 2025-03-13 01:48:50 +09:00
Yu Watanabe f0ebc0c5bf tests: introduce ASSERT_PTR_EQ() 2025-03-13 01:48:50 +09:00
Yu Watanabe 6e316e8104 udev/net: replace device_unsigned_attribute() with device_get_sysattr_unsigned()
They are completely equivalent, except for logging.
This also drops duplicated log messages on failure paths.
2025-03-13 01:48:50 +09:00
Yu Watanabe b15053de89 udev/net: fix assignment of ID_NET_NAME=
E.g. sd_device object of network interface 'hoge!foo' has sysname 'hoge/foo'.
So, previously udevd assigned 'hoge/foo' rather than 'hoge!foo' to ID_NET_NAME,
hence even when renaming is not requested, such interface was renamed to 'hoge_foo'
(note '/' cannot be used in network interface name, hence escaped to underbar).
2025-03-13 01:48:33 +09:00
Yu Watanabe b3157fc912 udev-event: fix filtering logic of renaming network interface
The device sysname may be different from the network interface name.
2025-03-13 01:08:57 +09:00
Yu Watanabe 4352457a96 udev-event: set INTERFACE/INTERFACE_OLD property on rename only when the device is a network interface
This does not change any behavior, as currently udevd only supports
renaming for network interfaces.

Closes #26156.
2025-03-13 01:08:57 +09:00
Yu Watanabe e3bc8d3449 udev-builtin-net_driver: use correct interface name
Previously, when the interface name contains '!', the builtin command
failed to get the driver of the interface.
2025-03-13 01:08:57 +09:00
Yu Watanabe bec2f4dc3e sd_device: introduce device_get_ifname()
sd-device replaces '!' in sysname with '/'. Hence, sysname and ifname
may be different. Let's get network interface name through INTERFACE
property.
2025-03-13 01:08:57 +09:00
Yu Watanabe 32b0e689d6 test: do not pass return value to log_error_errno() on success 2025-03-13 01:08:57 +09:00
Yu Watanabe 0f52a1107e test-sd-device: use ASSERT_OK() and friends 2025-03-13 01:08:57 +09:00
Yu Watanabe c7523292da sd-device: reorder elements in sd_device object
No functional change, just refactoring.
2025-03-13 01:08:57 +09:00
Yu Watanabe 1707b41e76 sd-device: protect more properties often set by kernel and internally used by udevd 2025-03-13 01:08:53 +09:00
Yu Watanabe a4cb6c41a1 hostname: several follow-ups for wildcard hostname support (#36707) 2025-03-13 00:46:00 +09:00
Lennart Poettering b330824e59 test-cgroup-util: Check return values (#36024)
Reported by Coverity and
Fixes CID#1587767
2025-03-12 15:50:33 +01:00
nkraetzschmar 0bdf94e588 boot: add reboot-on-error config option
Enabling this option will cause the system to reboot in case the selected
entry fails to load.
2025-03-12 15:47:38 +01:00
Lennart Poettering d54196a4cd Fixes several recent CI issues (#36691)
- Fixes a race in systemd-run caused by
b7ba8d55b8, which causes issue #36679.
- Skip verifying masked units in TEST-23.
- Avoid false-positive ASan warning by switching sanitizer run from
Fedora rawhide to Fedora 41, caused by recent update from
llvm-19.1.7-11.fc43 to llvm-20.1.0-1.fc43. Hopefully issue #36678 should
be fixed.

Closes #36678.
Closes #36679.
2025-03-12 15:32:58 +01:00
Yu Watanabe 11361e3293 meson: drop split-usr, rootlibdir, and rootprefix from meson_options.txt
These options were deprecated by b0d3095fd6 (v255).
Let's remove them completely.
2025-03-12 15:21:57 +01:00
Lennart Poettering d77bf27c80 update TODO 2025-03-12 13:35:20 +01:00
Lennart Poettering 36f529fd2d update TODO 2025-03-12 13:30:30 +01:00