Commit Graph
40864 Commits
Author SHA1 Message Date
Luca Boccassi c2fa46b6b9 Merge pull request #25134 from medhefgo/macro
macro: Small IN_SET improvements
2022-10-31 21:03:39 +01:00
Luca Boccassi 768b86b84a Merge pull request #25136 from yuwata/udev-id-renaming
udev: cleanup for ID_RENAMING property
2022-10-31 21:02:41 +01:00
Luca Boccassi 7319adcd1b Merge pull request #25142 from yuwata/network-fix-race-in-device-renaming-vs-dhcp
network,dhcp: fix theoretical race in device renaming
2022-10-31 21:01:57 +01:00
Luca Boccassi 4b9cfe08ba Merge pull request #25166 from yuwata/network-router-preference
network: adjust route metric based on router preference
2022-10-31 20:59:36 +01:00
Lennart Poettering 2e6a0579cc measure: honour phases when signing 2022-10-31 16:52:00 +01:00
Lennart Poettering 28acd1e6c3 measure: banks and phases list are always non-empty
When parsing parameters, we populate these lists with defaults when
empty, hence we can rely that there's at least one bank and one phase
defined.
2022-10-31 16:51:12 +01:00
Lennart Poettering 6032283b2f resolved: fix copypasta in resolved varlink API
As reported by @holtmann
2022-10-31 14:57:35 +01:00
Yu Watanabe 4069545727 network: try to reconfigure when some information is updated
When at least one of the name, MAC address, udev properties, and so on
for an interface is updated, try to find a matching .network file, and
reconfigure if a new .network file is assigned.

Fixes #24975.
2022-10-31 09:35:05 +09:00
Yu Watanabe 6625c39e70 network: simplify the logic of reading driver and permanent HW address
No functional changes, just refactoring and preparation for later
commits.

Note, `link->dev` should always exist when link state is initialized or
later.
2022-10-31 09:34:41 +09:00
Jan Janssen dcebf1d87e boot: Mark some functions as static 2022-10-30 14:17:11 +01:00
Yu Watanabe 479da1107a udev: always create device symlinks for USB disks
Previously, ata_id might not be able to retrieve attributes correctly,
and properties from usb_id were used as a fallback. See issue #24921
and PR #24923. To keep backward compatibility, still we need to create
symlinks based on USB serial.

Fixes #25179.
2022-10-30 12:02:02 +01:00
Yu Watanabe 269585dcc8 udev: fix for parsing MAC address
Fixes a bug introduced by 5bbcfbaa11.

Fixes #25181.
2022-10-30 11:55:00 +01:00
David Seifert 17dc285bd4 test: remove brittle iszero_safe() test
The test relies on finite -> infinite conversion happening
when increasing DBL_MAX.

Fixes #25044.
2022-10-29 11:18:44 +09:00
Luca Boccassi 9109009d24 tmpfiles: downgrade missing creds/source path log to debug
When installing systemd 252 in debian:

Setting up systemd (252~rc3-2) ...
Installing new version of config file /etc/systemd/logind.conf ...
Installing new version of config file /etc/systemd/system.conf ...
Installing new version of config file /etc/systemd/user.conf ...
/usr/lib/tmpfiles.d/provision.conf:13: Credential 'login.motd' not specified, skipping line.
/usr/lib/tmpfiles.d/provision.conf:14: Credential 'login.issue' not specified, skipping line.
/usr/lib/tmpfiles.d/provision.conf:17: Credential 'network.hosts' not specified, skipping line.
/usr/lib/tmpfiles.d/provision.conf:22: Credential 'ssh.authorized_keys.root' not specified, skipping line.
/usr/lib/tmpfiles.d/systemd.conf:43: Copy source path '/.extra/tpm2-pcr-signature.json' does not exist, skipping line.
/usr/lib/tmpfiles.d/systemd.conf:44: Copy source path '/.extra/tpm2-pcr-public-key.pem' does not exist, skipping line.

Downgrade to debug level
2022-10-29 05:29:47 +09:00
Yu Watanabe f5a0162d20 install: process all Wants= symlinks even if some of them fail
Follow-up for 94e7298d30.

Fixes CID#1499992.
2022-10-28 14:36:53 +02:00
Luca Boccassi 60e9a39ac7 Merge pull request #25164 from yuwata/network-route-table-0
network: fix handling of route table 0
2022-10-28 11:23:26 +02:00
Yu Watanabe 2ffb134e78 network: drop duplicated period in log message 2022-10-28 11:16:21 +02:00
Yu Watanabe 6f812d2899 network: adjust route priority based on preference
Even if different preference is specified, the kernel merges multiple
routes with the same preference. This is problematic when a network has
multiple routers.

Fixes #25138.
2022-10-28 15:48:28 +09:00
Yu Watanabe 7db98bc938 network: make RouteTable= also accept route table name 2022-10-28 11:35:17 +09:00
Yu Watanabe 513bed294e network: allow 0 for table number
Fixes #25089.
2022-10-28 11:33:22 +09:00
Yu Watanabe 29de4f7304 network: Table= also accepts table name 2022-10-28 11:03:52 +09:00
Yu Watanabe 4faca0a361 network: allow to (automatically) reconfigure failed interface
We have already allowed to reconfigure failed interface manually, but
not allowed to do automatically, e.g. on carrier gain.
This makes that failed interfaces also reconfigured automatically.

Note, the condition is inversed to shorten the condition.
2022-10-28 04:55:20 +09:00
Yu Watanabe 081466bd57 network: drop redundant condition
The function `link_reconfigure_impl()` has the same condition at the
beginning.
2022-10-28 04:55:20 +09:00
Yu Watanabe 6fadf01cf3 wait-online: ignore -ENODATA from sd_network_link_get_required_for_online()
Follow-up for 778e3da95e.

These settings are saved only when a .network file is assigned to the
interface. Let's silence noisy logs for unmanaged interfaces.
2022-10-27 11:08:38 +02:00
Zbigniew Jędrzejewski-Szmek 7155a51e64 Merge pull request #25146 from keszybz/relicese-to-mit-0
Change license of code examples in docs to MIT-0
2022-10-27 07:31:56 +02:00
Zbigniew Jędrzejewski-Szmek 69ce8a7e5a Merge pull request #25137 from yuwata/sd-device-drop-device-copy-properties
sd-device: drop unused device_copy_properties()
2022-10-27 07:28:22 +02:00
Yu Watanabe 14805b1468 dhcp: use the attached sd_device object when generating IAID
Note, previously `use_mac` set with `test_mode`. As `dev`, which is set with
`client->dev`, is not set when running test or fuzzer. Hence, the condition
```
if (udev_available() && !use_mac)
```
is effectively equivalent to
```
if (dev)
```
So, this commit mostly does not change behavior. Except for the following
corner case.

The sd_device object assigned from networkd (that is, Link.dev) never
has ID_RENAMING udev property, as sd_device objects which has the property
are filtered out at `link_check_initialized()` or `manager_udev_process_link()`
in networkd-link.c.

However, sd_device object created in `dhcp_identifier_set_iaid()` in the
previous code may have it. Such situation may (at least, theoretically)
happen when the network interface is renamed after initialized, e.g. by
creating the following spurious .link file:
```
[Match]
OriginalName=eno1
[Link]
Name=lan
```
and then trigger uevent for the network interface while systemd-networkd
calling `dhcp_identifier_set_iaid()`.
2022-10-27 09:12:47 +09:00
Yu Watanabe dec283e0a9 test: add test for IN_SET() with bitfield specifier 2022-10-27 06:37:01 +09:00
Yu Watanabe b6c86ae281 core/device: verify device syspath on switching root
Otherwise, if a device is removed while switching root, then the
corresponding .device unit will never go to inactive state.

This replaces the code dropped by cf1ac0cfe4.

Fixes #25106.
2022-10-27 06:11:10 +09:00
Zbigniew Jędrzejewski-Szmek 58b415ae61 systemd-sysv-install: change license to MIT-0
See parent commit for explanation.

git blame shows Martin Pitt is the author of the code.

(I was considering whether we should instead drop this file, but it's still
useful for *distributions*. Eveen if we discourage people from using sysv
scripts, distributions will have to deal with them for a while yet.)
2022-10-26 08:39:34 +02:00
Zbigniew Jędrzejewski-Szmek bdc84a6fc9 Merge pull request #25120 from bluca/test_machineid
unit tests: do not fail when machine-id is missing
2022-10-26 07:43:48 +02:00
Yu Watanabe 3b1dbdf0c2 network: attach device to DHCP clients
The attached sd_device object will be used later.
2022-10-26 08:08:35 +09:00
Yu Watanabe 793178b987 sd-dhcp6-client: introduce sd_dhcp6_client_attach_device()
It will be used later.
2022-10-26 08:08:35 +09:00
Yu Watanabe be615f7c14 sd-dhcp-client: introduce sd_dhcp_client_attach_device()
It will be used later.
2022-10-26 08:08:35 +09:00
Yu Watanabe 389954987a sd-device: make device_shallow_clone() static 2022-10-26 05:12:54 +09:00
Yu Watanabe 53354d370e sd-device: drop unused device_copy_properties() 2022-10-26 05:05:30 +09:00
Yu Watanabe 28235d1062 udev: use ASSERT_PTR() at one more place 2022-10-26 04:52:06 +09:00
Yu Watanabe 7137f2f3a7 udev: drop ID_RENAMING from UdevEvent.dev_db_clone instead of UdevEvent.dev
As the properties loaded from the database are stored to UdevEvent.dev_db_clone,
instead of UdevEvent.dev.

This also makes the removal done unconditionally, for safety.
2022-10-26 04:44:00 +09:00
Yu Watanabe a505d7e7f8 Merge pull request #25133 from poettering/ddi-dissect
mention "DDIs" in systemd-dissect tool --help text/man page
2022-10-26 03:37:44 +09:00
Yu Watanabe e967926b09 macro: fix indentation 2022-10-26 03:28:08 +09:00
Jan Janssen 790f4dda74 macro: Simply case macros for IN_SET
The CASE param would normally provide the operation for the compiler to
do in this macro magic. But in this case CASE_F_1 was hardcoding the
operation, making the parameter moot.
This just removes the somewhat pointless parameter instead of fixing
the one case. These macros are used for IN_SET case labels only and
not named generically anyways.
2022-10-26 03:27:09 +09:00
Jan Janssen 0bc4ac526d macro: Use more correct type in IN_SET
This will now catch mistakes like this:
    struct s {
            int i:2;
    } s = { 1 };
    assert_se(IN_SET(s.i, ULLONG_MAX));

> warning: implicit conversion from 'unsigned long long' to
> 'typeof (+s.i)' (aka 'int') changes value from 18446744073709551615
> to -1 [-Wconstant-conversion]
2022-10-26 03:27:09 +09:00
Yu Watanabe bcf04e9b27 tree-wide: fix typo 2022-10-26 03:24:45 +09:00
Yu Watanabe d0f69be793 Merge pull request #25131 from poettering/image-root-help-text-fix
analyze/coredumpctl: add --image=/--root= to --help texts
2022-10-26 03:17:17 +09:00
Lennart Poettering a94a199cff dissect: mention DDI moniker in --help text 2022-10-25 18:57:59 +02:00
Yu Watanabe 1ea74fca3a core/device: also serialize/deserialize device syspath
The field will be used in later commits.
2022-10-26 01:50:23 +09:00
Yu Watanabe 54a4d71509 core/device: update comment 2022-10-26 01:50:23 +09:00
xiaoyang 02c0d656b4 Revert "core: drop non-default value for DefaultLimitMEMLOCK=" (#25058)
This reverts commit 606104bcdb.
2022-10-26 01:49:07 +09:00
Jacek Migacz c89d0c3b05 core: give a nicer error message on invalid aliases 2022-10-25 18:18:57 +02:00
Lennart Poettering 2d15dc86ca coredumpctl: add --root= + --image= to --help text 2022-10-25 17:47:52 +02:00