Commit Graph
35905 Commits
Author SHA1 Message Date
Yu Watanabe c990101f23 sd-netlink: fix type of NDA_LLADDR attribute 2021-11-11 12:49:42 +09:00
Luca Boccassi a704137c20 Merge pull request #21273 from yuwata/hostname-device-tree
hostnamed: use /proc/device-tree to get chassis type
2021-11-10 23:15:20 +00:00
Yu Watanabe 9133c1877f netif-util: fix stack-use-after-scope
Fixes a bug introduced by 0295b2fd1d.

Fixes #21292.
2021-11-10 22:11:18 +00:00
Yu Watanabe e2b777f821 sd-id128: use /proc/device-tree 2021-11-11 04:42:50 +09:00
Yu Watanabe c6dce5720c condition: use /proc/device-tree/ 2021-11-11 04:42:50 +09:00
Yu Watanabe e6cbe6970f hostnamed: use /proc/device-tree to get chassis type
From https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-firmware-ofw
---
Userspace must not use the /sys/firmware/devicetree/base
path directly, but instead should follow /proc/device-tree
symlink. It is possible that the absolute path will change
in the future, but the symlink is the stable ABI.
---

Addresses the comment https://github.com/systemd/systemd/pull/20731#discussion_r744095262.
2021-11-11 04:42:50 +09:00
Luca Boccassi 227e2fc1a7 Merge pull request #21290 from poettering/arch-me-harder
some docs/tweaks regarding porting to new archs
2021-11-10 18:37:01 +00:00
Jan Janssen 9cf75222f2 meson: Rework gnu-efi detection
Moving all of the gnu-efi detection into src/boot/efi/meson.build makes
more sense than having it partially split.

And thanks to subdir_done() we can simplify the code a lot.

Fixes: #21258
2021-11-10 18:25:19 +00:00
Lennart Poettering 04ba1bb038 shared: nudge people into sending us patches to make /lib64/ symlink generation work on all archs that need it
This is an attempt to nudge people into sending us patches that fix
bug #14311 for us, given that the original submitter lost interest.
2021-11-10 15:18:01 +01:00
Lennart Poettering d42e4fa258 shared: start pushing people gently to define GPT partition type UUIDs for missing archs
Let's generate a single gcc `#warning`  message asking people to define
partition type UUIDs for their architectures if they are missing.
2021-11-10 15:18:01 +01:00
Lennart Poettering 3299c293db architecture: drop __riscv__ checks, it's obsolete since 2018 2021-11-10 12:38:32 +01:00
Scott Lamb 4b499063ac fsck: no emergency.target on nofail mounts
Also describe failure behavior more precisely in the manpage.
Fixes #20237.
2021-11-10 11:58:12 +01:00
Anita Zhang 899acf5c2d core: replace slice dependencies as they get added
Defines a "UNIT_DEPENDENCY_SLICE_PROPERTY" UnitDependencyMask type that
is used when adding slices to the dependencies hashmap. This type is
used to remove slice dependencies when they get overridden by new ones.

Fixes #20182
2021-11-10 10:52:08 +01:00
Yu Watanabe 4883a5ec6c network: cake: fix copy-and-paste error
Follow-up for 35896db489.

Fixes CID#1465796.
2021-11-10 10:35:36 +01:00
Yu Watanabe 5ff3c71af8 Merge pull request #21276 from yuwata/ether-addr-util
ether-addr-util: introduce parse_hw_addr() and related conf parsers
2021-11-10 09:22:01 +09:00
Yu Watanabe 3f6a18633f Merge pull request #21281 from poettering/repart-align-fixes
repart: fixes when operating on unaligned partitions
2021-11-10 09:21:24 +09:00
Lennart Poettering 4a77b47ed8 Merge pull request #21283 from poettering/nspawn-idempotent-empty-settings
nspawn: make empty settings files true NOPs
2021-11-09 22:20:22 +01:00
Albert Brox 437346c96b analyze: basename -> path_extract_filename and other minor fixes 2021-11-09 22:19:34 +01:00
Lennart Poettering 9baa294c12 nspawn: don't muck with caps if no network setting is used in settings file
Our goal here (as in the previous commits) is to ensure that a settings
file loaded in --settings=override mode is truly a NOP. Previously this
was not the case as we'd drop CAP_NET_ADMIN from the caps if the
settings file didn't enable networking.

With this change we'll drop it only if explicitly turned off in the
settings file, and otherwise let the built-in defaults and cmdline
params reign supreme as documented.

Fixes: #20055
2021-11-09 18:32:30 +01:00
Lennart Poettering 2d09ea44fc nspawn: only copy syscall filters from settings if actually configured
As in the previous commit, let's not copy settings that aren#t
configured, so that --settings=override with an empty .nspawn file is
truly a NOP.
2021-11-09 18:32:25 +01:00
Lennart Poettering 0cc3c9f997 nspawn: copy BindUser= setting from settings only if set
Let's only pick this up from the settings if actually set.

As in the previous commit this makes sure that an empty settings file in
--settings=override mode is really a NOP.
2021-11-09 18:32:20 +01:00
Lennart Poettering d3689b9435 nspawn: use three boolean fields from settings file when actually set
Let's turn these three fields into tristates, so that we can distinguish
whether they are not configured at all from explicitly turned off.

Let#s then use this to ensure that we only copy the settings fields into
our execution environment if they are actually configured.

We already do this for some of the boolean settings, this adds it for
the missing ones.

The goal here is to ensure that an empty settings file used in
--settings=override mode (i.e. the default mode used in the
systemd-nspawn@.service unit) is truly a NOP.
2021-11-09 18:32:15 +01:00
Lennart Poettering a1dfd585c4 nspawn: add helper settings_network_configured()
The new helper returns whether the settings file had *any* networking
setting configured at all. We already have a similar helper
settings_private_network() which returns a similar result. The
difference is that the new helper will return true when the private
network was explicitly turned off, while the old one will only return
true if configured and enabled.

We'll reuse the helper a 2nd time later on, but even without it it makes
things a bit more readable.
2021-11-09 18:32:10 +01:00
Lennart Poettering 8c1e088ac9 nspawn: drop two entirely redundant lines 2021-11-09 18:31:24 +01:00
Lennart Poettering 1052a1142d repart: fix free area calculations for unaligned partitions
To properly detect how much space we have to distribute we need to take
into account that both the partition offset and the partition size
aren't aligned.
2021-11-09 16:31:48 +01:00
Lennart Poettering 0b7f574f72 repart: don't distribute space after unaligned partitions
If we operate on a disk that has a pre-existing unaligned partition
(i.e. one that doesn't start on multiple of 4K, or doesn't have a size
of multiple 4K), then the amount of space after it to distribute among
partitions isn't a multiple of 4K either.  So far we might end up
passing the remaining fraction to any partition that wanted it, which
was usually the first one after it that is newly defined. This then
confused the later placement algorithm, since it assumed all partitions
we newly allocate were properly aligned but by being extended by the
fractional space they wouldn't be anymore.

Let's hence fix that by ensuring we never pass space to later partitions
so that things wouldn't be aligned anymore.

Anything that is left-over then at the very end (i.e. typically exactly
the remaining fraction) is added as padding to the existing, unaligned
partition, so that it can't confuse anyone.

Fixes: #20622
2021-11-09 16:25:24 +01:00
Lennart Poettering ae0613c6c4 repart: simplify stat machine we mostly go through linearly 2021-11-09 16:25:00 +01:00
Lennart Poettering 184cf99a35 repart: use LESS_BY() more 2021-11-09 16:24:22 +01:00
Yu Watanabe 99628f363b conf-parser: introduce config_parse_hw_addr() and config_parse_hw_addrs() 2021-11-09 21:39:09 +09:00
Yu Watanabe c6df73ca72 ether-addr-util: introduce {hw,ether}_addr_hash_ops_free 2021-11-09 21:39:09 +09:00
Yu Watanabe aa4f765326 conf-parser: rename config_parse_hwaddr() -> config_parse_ether_addr() 2021-11-09 21:39:09 +09:00
Yu Watanabe 227e9ce255 ether-addr-util: replace ether_addr_from_string() with parse_ether_addr() 2021-11-09 21:39:09 +09:00
Yu Watanabe 02160bc909 ether-addr-util: introduce parse_ether_addr() 2021-11-09 21:39:09 +09:00
Yu Watanabe fb4e524180 test: add tests for parse_hw_addr() 2021-11-09 21:39:09 +09:00
Yu Watanabe 76a5d3dee2 ether-addr-util: introduce parse_hw_addr() 2021-11-09 21:39:05 +09:00
Lennart Poettering 035daf73fb test: add test case for self-destroy inotify handler 2021-11-09 13:13:25 +01:00
Lennart Poettering e67d738a87 sd-event: add sd_event_add_inotify_fd() call
sd_event_add_inotify_fd() is like sd_event_add_inotify(), but takes an
fd to an inode instead of a path, and is hence a ton nicer.
2021-11-09 13:02:13 +01:00
Lennart Poettering 53baf2efa4 sd-event: don't destroy inotify data structures from inotify event handler
This fixes a bad memory access when we destroy an inotify source handler
from the handler itself, and thus destroy the associated inotify_data
structures.

Fixes: #20177
2021-11-09 12:53:04 +01:00
Lennart Poettering 9830d71614 logind: downgrade message about /run/utmp missing to LOG_DEBUG
This isn't really anything to really complain about, let's debug log
about this, and continue quietly as if utmp was empty.
2021-11-09 12:52:59 +01:00
Lennart Poettering 4f538d7b22 tree-wide: use sd_event_source_disable_unref() where we can 2021-11-09 12:52:53 +01:00
Lennart Poettering 3777940ab2 inotify-util: improve reported error codes when inotify_add_watch() fails 2021-11-09 12:52:07 +01:00
Yu Watanabe 777c17b9d1 Merge pull request #21269 from yuwata/network-netdev-cleanups
network/netdev: several trivial cleanups
2021-11-09 19:08:11 +09:00
Zbigniew Jędrzejewski-Szmek 7368e69bc7 Merge pull request #21271 from yuwata/ether-addr-util-helper-functions
ether-addr-util: introduce several helper functions
2021-11-09 10:02:55 +01:00
Zbigniew Jędrzejewski-Szmek ed8ba68f3b Merge pull request #21272 from yuwata/netif-util-split
netif-util: move several functions from network-util.c to netif-util.c
2021-11-09 10:01:07 +01:00
Yu Watanabe b01895bf70 arp-util: drop redundant line
The client's IP address is already loaded to X.
(The comment of the dropped line is wrong, X instead of A.)
2021-11-09 09:32:09 +01:00
Yu Watanabe bc945c2b42 network/netdev: sort netdev kinds 2021-11-09 16:00:49 +09:00
Yu Watanabe ad851caebd network/bridge: drop if_bridge.h from bridge.h
To avoid future header conflicts.
2021-11-09 16:00:49 +09:00
Yu Watanabe fddb337cc8 network/netdev: fix typo 2021-11-09 16:00:49 +09:00
Yu Watanabe e331889a5e network: bareudp: use fill_message_create 2021-11-09 16:00:49 +09:00
Yu Watanabe 8e30e5fcd4 network: geneve: use fill_message_create 2021-11-09 16:00:49 +09:00