Commit Graph

54455 Commits

Author SHA1 Message Date
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
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
Michal Koutný
7a0895c2eb Revert "CI: disable opensuse mkosi CI"
This reverts commit ab6df52083.

The image build failed during kernel RPM installation (bug in %post
scriptlet). This has been fixed in the package suse-module-tools 16.0.13
[1]. The fix is in openSUSE Tumbleweed repos so the tests can be enabled
again.

[1] https://github.com/openSUSE/suse-module-tools/pull/53

Fixes: #21019
2021-11-09 10:57:03 +00: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
Zbigniew Jędrzejewski-Szmek
8e93a614e7 makefs: also set uuid/label for ext2/ext3
We were only "supporting" ext4. Let's add "support", i.e. pass our optimization
options and uuid/label for the other two fses in the same family.

Nowadays there is separate code in the kernel, all three fs types are handled
by ext4 code. ext2 in particular is useful for in-memory devices: the journal
is just a waste of space there. ext3 is added for completeness mostly, since
ext4 should probably be used instead. But people might use it for testing or
for compatibility with older systems and I don't see much reason to not add
"support" here.
2021-11-09 09:12:01 +01:00
Zbigniew Jędrzejewski-Szmek
44cdeb6e33 makefs: reindent mkfs calls to follow the same style
I think this also makes it much easier to see what args are passed.
2021-11-09 09:12:01 +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