Commit Graph
54267 Commits
Author SHA1 Message Date
Yu Watanabe dfa4876c41 udev: drop colon from ID_NET_NAME_MAC
Fixes a bug introduced by eaba9bb3e6.
2021-11-11 18:29:55 +09:00
Yu Watanabe e44cd43788 ether-addr-util: introduce hw_addr_to_string_full() 2021-11-11 18:29:52 +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
Frantisek Sumsal 8b212f3596 ci: take CIFuzz's matrix into consideration
Otherwise the jobs will try to cancel each other out.

Follow-up to 3884837610.
2021-11-10 20:44:24 +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
Luca Boccassi fe63d890fd Merge pull request #21293 from mrc0mmand/ci-cancel-old-jobs
ci: cancel previous jobs on ref update
2021-11-10 18:15:21 +00:00
Frantisek Sumsal 3884837610 ci: cancel previous jobs on ref update
Let's save the environment (and reduce the number of jobs in GH Actions
queues) by cancelling old jobs on a ref update (force push).

See: https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#concurrency
2021-11-10 17:15:35 +01:00
Frantisek Sumsal 46573ee131 ci: fix indentation 2021-11-10 17:15:35 +01:00
Frantisek Sumsal b8c94ee372 Revert "CI: run GCC unit test job on push to main"
This reverts commit c1036042f5.

Follow-up to 0ad536c16a.
2021-11-10 17:15:35 +01:00
Lennart Poettering ec512b9b9d doc: add some docs with a checklist of what to do for new architectures 2021-11-10 15:18:01 +01: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 1fb2d8fcb6 docs: invite people to define GPT partition types for all archs now
The discovery partitions spec so far suggested we should define
arch-specific partition type uuids only for archs that have EFI. Let's
change that and invite people to define them for any arch. Why? Even if
GPT is defined as part of the UEFI spec it's quite useful independently
of it, too. Specifically, our image dissection logic makes use of it,
i.e. systemd-nspawn, systemd-gpt-auto-generator, systemd-repart,
RootImage=, portable services, and so on. None of these tools are
related to UEFI in any way.

Hence, let's open this up.
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
Zbigniew Jędrzejewski-Szmek 4d544a0c87 Merge pull request #21287 from yuwata/man-network-condition
man: cleanups for [Match] section
2021-11-10 10:36:54 +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 8c66ab20f6 man: use include directive for [Match] section 2021-11-10 10:59:21 +09:00
Yu Watanabe 33132db903 man: add missing Firmware= setting 2021-11-10 10:56:42 +09: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
Paulo Neves c809e38732 docs: Clarify systemctl show manual
The manual incorrectly asserted that the properties in systemctl show
matched the the options in systemd-system.conf, which is not always true.

Add clarification on the equivalence of the properties in systemctl show
and systemd-system.conf

Fixed #21230
2021-11-09 18:31:54 +01:00
Lennart Poettering 8c1e088ac9 nspawn: drop two entirely redundant lines 2021-11-09 18:31:24 +01:00
Lennart Poettering fb2fcad5d2 Merge pull request #21270 from poettering/event-mem-corruption
sd-event: fix memory corruption
2021-11-09 16:54:25 +01:00
Lennart Poettering 15c5977644 test: extend repart test suite to test for unaligned partitions 2021-11-09 16:53:11 +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