Commit Graph
39423 Commits
Author SHA1 Message Date
Yu Watanabe 829bb61fb8 udev: use sd_device_new_from_path() and _new_child()
Follow-up for 65c2ad985a.
2022-08-12 21:48:13 +09:00
Yu Watanabe 284ef480d0 test: add more tests for sd_device_new_from_path() 2022-08-12 21:42:00 +09:00
Yu Watanabe 95c250be0d sd-device: allow to create sd-device object through a symlink outside of /sys
For example, /proc/device-tree is a symlink to /sys/firmware/devicetree/base,
and the kernel documentation says the symlink should be used by userspace app.
See, https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-firmware-ofw.
Hence, it is useful to make `sd_device_new_from_path()` support such symlink.
2022-08-12 21:41:12 +09:00
Lennart Poettering c94887f10d Merge pull request #24273 from lnussel/refactor_sysuser_creds
Refactor sysuser creds
2022-08-12 14:32:06 +02:00
Yu Watanabe f714ecd450 udev: set description for device monitor 2022-08-12 21:27:14 +09:00
Yu Watanabe cbdf6a1fcf test: use sd_device_monitor_set_description() 2022-08-12 21:27:14 +09:00
Yu Watanabe f36b683f6c sd-device-monitor: logs description for device monitor 2022-08-12 21:27:14 +09:00
Yu Watanabe 39f11aa422 sd-device-monitor: introduce sd_device_monitor_{set,get}_description() 2022-08-12 21:27:14 +09:00
Yu Watanabe edf6cbc30f Merge pull request #24286 from yuwata/test-sd-device-monitor
test-sd-device-monitor: several fixlets
2022-08-12 21:24:40 +09:00
Yu Watanabe 0186571c9f sd-device-enumerator: drop noisy log messages
These are not for failed tasks, and provide almost no information.
2022-08-12 21:23:58 +09:00
Yu Watanabe df85ff9cad Merge pull request #24288 from yuwata/sd-device-monitor-fixlets
sd-device-monitor: two fixlets
2022-08-12 21:23:24 +09:00
Richard Phibel c412f4c603 repart: add test for drop-in files 2022-08-12 12:48:29 +02:00
Richard Phibel 39fc0174c3 repart: Add support for drop-in overrides 2022-08-12 12:48:29 +02:00
Richard Phibel ead3a3fc87 config-parser: Add list of drop-in files as return argument of config_parse_many
This will be used to save the list of drop-in files for each partition
2022-08-12 12:48:29 +02:00
Sean Anderson 65c2ad985a udev: net_id: Use devicetree aliases when available
Devicetree firmware contains an "aliases" node, containing various
aliases for devices described by the firmware. For ethernet devices,
these are named "ethernet0", "ethernet1", etc. They provide a convenient
means of numbering ethernet devices, especially on systems with no other
stable number other than the address. In particular, U-Boot already uses
these aliases to name its ethernet devices.

Previously, there have been attempts (such as [1]) to add support for
these aliases to Linux. However, these patches have been rejected
because it is the maintainers' view that naming policy be left to
userspace. Well, systemd is userspace, so here we are.

In terms of implementation, apparently there can be multiple device
trees at once. I have decided to dodge this problem for now, and just
use /proc/device-tree. If it is desired to support multiple device trees
later, then the scheme can be modified to include the device tree's
index. For example, /sys/firmware/devicetree/base2/aliases/ethernet3
might be named enb2d3.

For the moment we only support "ethernetX" aliases. Future patches might
want to also handle "canX" and "wifiX".

It is common on boards with only one ethernet device to use an alias of
just "ethernet". In this case, the index is an implicit 0. In case the
author of the firmware made a mistake, we check to ensure that aliases
of "ethernet" and "ethernet0" do not both exist.

[1] https://patchwork.kernel.org/project/linux-arm-kernel/patch/1399390594-1409-1-git-send-email-boris.brezillon@free-electrons.com/

Closes: #17625
2022-08-12 11:15:16 +02:00
Yu Watanabe 8bb4989906 sd-device-monitor: actually refuse to send invalid devices
Fixes an issue introduced by 9e79123884.
2022-08-12 04:34:19 +09:00
Yu Watanabe 133d78966f sd-device-monitor: fix inversed condition
Fixes an issue introduced by b3d06b9226.
2022-08-12 04:34:19 +09:00
Yu Watanabe 8164957461 test: do not fill up receiver buffer
If a system has many devices, then the receiver buffer may be filled up.

Hopefully fixes https://bugzilla.redhat.com/show_bug.cgi?id=2095750
2022-08-12 03:13:22 +09:00
Yu Watanabe 46c1223b24 test: add fake action and seqnum
Otherwise, the receiver refuses the devices. See device_verify().
2022-08-12 03:13:22 +09:00
wineway c8340822cf core/cgroup: CPUWeight/CPUShares support idle input
Signed-off-by: wineway <wangyuweihx@gmail.com>
2022-08-11 14:25:58 +02:00
Ludwig Nussel ff86850b30 creds: refactor reading user password
Share code between firstboot and sysusers
2022-08-11 13:32:55 +02:00
exploide e8d0eb3915 resolvctl: only remove protocol after last dot when mangling ifname for resolvconf
ifname_resolvconf_mangle is supposed to remove protocol suffixes like .dhcp
from interface names. But this removed also valid parts of the ifname like
VLAN IDs, e.g. enp2s0u4.72.dhcp -> enp2s0u4 instead of enp2s0u4.72

After this change, everything behind the last dot is removed instead of the first.
2022-08-11 09:59:15 +02:00
Oleg Solovyov d784a8d474 oomd: notify via dbus what have been killed 2022-08-11 09:53:55 +02:00
gtwang01 7238fd51d4 core/scope: Add oom-kill status for scope units (#24269)
Closes #23557.
2022-08-11 12:19:43 +09:00
Anita Zhang 2ef59656b7 Merge pull request #24271 from yuwata/oom-log-message-m
oom: drop invalid %m in the log message
2022-08-10 11:02:28 -07:00
Jan B 03f36e9c01 cryptenroll: adding the option to use a keyfile to unlock the device 2022-08-10 17:13:57 +02:00
Yu Watanabe b6f6df4cb0 oom: drop invalid %m in the log message
Fixes https://github.com/systemd/systemd/issues/23785#issuecomment-1210030100.
2022-08-10 22:15:52 +09:00
Lennart Poettering 46cfc85f7e Merge pull request #23848 from yuwata/core-device-systemd-wants
core: fix SYSTEMD_WANTS and StopWhenUnneeded=
2022-08-10 14:43:25 +02:00
Yu Watanabe 5c19169fe9 tree-wide: fix typo 2022-08-10 19:43:38 +09:00
Jan Janssen 6a941db798 meson: Test correct efi linker for supported args
Fixes: #24241
2022-08-10 09:44:21 +02:00
Frantisek Sumsal ff71363c26 Merge pull request #24222 from yuwata/test-network-units
network: wait for teql netdev before setting qdisc
2022-08-09 17:08:50 +00:00
Sonali Srivastava 746cf8980b sleep: support multiple battery instead of only BAT0 2022-08-09 17:13:35 +01:00
Yu Watanabe 9b2a2e06c4 network/teql: wait for corresponding teql interface to be available 2022-08-09 19:37:49 +09:00
Yu Watanabe 21261ea231 network/qdisc: introduce is_ready() in qdisc vtable
Preparation for next commit.
2022-08-09 19:37:49 +09:00
josh-gordon-fb 78fa2f91d2 core/cgroup: use bus locator (#24251) 2022-08-09 16:20:07 +09:00
gtwang01 b607fd3f32 tree-wide: use bus locator (#24252)
This modifies some sd_bus calls to equivalent bus calls.
2022-08-09 16:19:09 +09:00
Yu Watanabe 85ff4150e1 backlight: accept embedded display port named e.g. card0-eDP-1 2022-08-09 14:30:05 +09:00
Luca BRUNO 5ed47c4d23 sysusers: properly process user entries with an explicit GID
This tweaks user creation logic to properly take into consideration
an explicitly requested GID.
It fixes a bug where the creation flow would mistakenly fall back
to use the username instead, resulting in wrong lookups in case of
users and groups using the same name.
2022-08-09 04:58:32 +09:00
Luca BRUNO 6b6e45eb73 sysusers: only check whether the requested GID is available
This relaxes the availability check when creating a group, if an
explicit GID has been requested.
It avoids mixing up users and groups entries with valid and unique
UIDs/GIDs, but each having the same ID number.
2022-08-09 04:58:15 +09:00
Yu Watanabe eff6bc9294 Merge pull request #24244 from yuwata/device-enumerator
sd-device-enumerator: fix sysattr match
2022-08-09 04:57:48 +09:00
Ludwig Nussel 8313a1a5cd kmod-setup: load dmi-sysfs if it's a module 2022-08-08 19:22:53 +01:00
Yu Watanabe 50f9c507b2 test: add tests for sd_device_enumerator_add_match_sysattr/property() 2022-08-09 02:21:25 +09:00
Yu Watanabe b07131facf sd-device-enumerator: FOREACH_DEVICE_PROPERTY() does not provide NULL value
Hence, when sd_device_enumerator_add_match_property() called with NULL
for value, then the filter always unmatches with the device.
2022-08-09 01:17:03 +09:00
Yu Watanabe 585f2035b3 sd-device-enumerator,monitor: fix sysattr match
Previously, if sd_device_enumerator_add_match_sysattr() is called for
the same sysattr with different values, then no device passed the filter.

Now, the accepted values (or patterns) are stored in strv, and if the
sysattr value of a device matches with the strv, then the device passes
the filter.
2022-08-09 01:17:00 +09:00
Chih-Hsuan Yen 7aa0b0121e cryptsetup: support keyfile-timeout for using a device as the key file
Closes https://github.com/systemd/systemd/issues/21993
2022-08-08 17:03:28 +01:00
Yu Watanabe 57a0e3f503 Merge pull request #24221 from yuwata/dhcp-client-cleanups
dhcp: use struct hw_addr_data
2022-08-08 23:59:58 +09:00
Yu Watanabe 52be2b43f5 hash-funcs: introduce string_hash_ops_free_strv_free 2022-08-08 23:41:28 +09:00
Lennart Poettering 65a667c49c Merge pull request #23511 from diabonas/tpm2-pin-systemd-gpt-auto-generator
cryptsetup: make systemd-gpt-auto-generator work with TPM2 and PIN
2022-08-08 15:40:03 +02:00
Lennart Poettering 2361820e7b Merge pull request #24220 from yuwata/on-ac-power
udev-util: assume running on AC power when no battery found
2022-08-08 15:35:55 +02:00
Jan Janssen 79a7ef89aa stub: Use EfiLoaderCode for kernel memory
Fixes: #24237
2022-08-08 15:33:35 +02:00