Commit Graph
61207 Commits
Author SHA1 Message Date
Yu Watanabe f334a8c8e9 Merge pull request #25536 from yuwata/sd-netlink-several-fixes
sd-netlink: several fixes
2022-11-29 10:35:07 +09:00
Yu Watanabe c167ed0fd1 Merge pull request #25552 from yuwata/network-ndisc-trivial-fixes
network: NDisc: trivial fixes
2022-11-29 10:33:33 +09:00
Luca Boccassi 8936a2a8f0 Merge pull request #25532 from Werkov/fix-cgtop-args
cgtop: Do not rewrite -P or -k options
2022-11-28 22:20:47 +01:00
Tonći Galić bcad98ee4d hwdb: Add support for Elgato Stream Pedal (#25550)
This adds the [Elgato Stream Pedal](https://www.elgato.com/en/stream-deck-pedal)
as part of the supported family
2022-11-29 05:15:25 +09:00
Yu Watanabe 6a4f43cd66 network: drop invalid and unused flag
Route.flags can only take RTNH_F_ONLINK, and other flags are silently
dropped.
2022-11-29 04:31:27 +09:00
Yu Watanabe d87c5cd8d9 network: fix indentation 2022-11-29 04:30:12 +09:00
Luca Boccassi 94d2caedee Merge pull request #25496 from DaanDeMeyer/repart-optimize
repart: Prefer using loop devices to populate filesystems when available
2022-11-28 15:51:32 +01:00
Luca Boccassi 6d3fcb6ccd Merge pull request #25222 from medhefgo/stub-cmdline
stub: Fix cmdline handling
2022-11-28 15:49:17 +01:00
Michal Koutný d4e32838e8 test: Add tests for systemd-cgtop args parsing 2022-11-28 14:29:49 +01:00
Michal Koutný 48600b3524 cgtop: Do not rewrite -P or -k options
--recursive=no will overwrite possible -P or -k option hence making the
recursive disabling impossible.

Check what counting types the system supports (encoded in the ordering
of our enum) of and pick whatever user requests but is also supported.

Fixes: #25248
2022-11-28 14:29:49 +01:00
Daan De Meyer d3201eb4f4 repart: Prefer using loop devices to populate filesystems when available
Let's make sure we use loop devices if we have access to them and
only fall back to regular files if we can't use loop devices. We
prefer loop devices because when using mkfs --root options, we have
to populate a temporary staging tree which means we're copying every
file twice instead of once when using loop devices.
2022-11-28 10:52:21 +01:00
Daan De Meyer d2ac7698cb repart: Make sure all files in the image are owned by root 2022-11-28 10:46:00 +01:00
Daan De Meyer 8a050905a3 repart: Move comment 2022-11-28 10:46:00 +01:00
Jan Janssen b17f3b3d80 stub: Detect empty LoadOptions when run from EFI shell
The EFI shell will pass the entire command line to the application it
starts, which includes the file path of the stub binary. This prevents
us from using the built-in cmdline if the command line is otherwise
empty.

Fortunately, the EFI shell registers a protocol on any images it starts
this way. The protocol even lets us access the args individually, making
it easy to strip the stub path off.

Fixes: #25201
2022-11-27 17:13:04 +01:00
Mike Yuan 3185360980 systemctl: deprecate passing positional argument to reboot completely
(follow-up of #15958)

In #15958 we deprecated passing positional argument to reboot by
generate a warning. It's been two years now and I believe it can
be dropped completely, as per requested in #15773.
2022-11-27 11:18:32 +01:00
Yu Watanabe 52ceba53d3 sd-netlink: append instead of prepend multipart message
Previously, e.g., networkd enumerated network interfaces with ifindex
in a decreasing order, as sd-netlink inverses the order of the received
multipart messages.
Let's keep the order of the multipart messages. Hopefully this changes
no behavior, as our code do not depend on the order of the received
multipart messages.

Before:
===
Nov 26 09:35:10 systemd[1]: Starting Network Configuration...
Nov 26 09:35:11 systemd-networkd[36185]: wlp59s0: Saved new link: ifindex=3, iftype=ETHER(1), kind=n/a
Nov 26 09:35:12 systemd-networkd[36185]: enp0s31f6: Saved new link: ifindex=2, iftype=ETHER(1), kind=n/a
Nov 26 09:35:12 systemd-networkd[36185]: lo: Saved new link: ifindex=1, iftype=LOOPBACK(772), kind=n/a

After:
===
Nov 26 09:45:18 systemd[1]: Starting Network Configuration...
Nov 26 09:45:19 systemd-networkd[38372]: lo: Saved new link: ifindex=1, iftype=LOOPBACK(772), kind=n/a
Nov 26 09:45:19 systemd-networkd[38372]: enp0s31f6: Saved new link: ifindex=2, iftype=ETHER(1), kind=n/a
Nov 26 09:45:19 systemd-networkd[38372]: wlp59s0: Saved new link: ifindex=3, iftype=ETHER(1), kind=n/a
2022-11-26 11:28:27 +09:00
Yu Watanabe a8ac052624 sd-netlink: do not link non-multipart messages
Previously, if a single packet contains multiple non-multipart messages,
then the messages were linked and saved as a single entry, especially
even if the messages has different serial numbers. Though, not sure if
the kernel sends such packet. But at least for safety, let's link only
multipart messages.
2022-11-26 11:28:27 +09:00
Yu Watanabe 9482429af9 sd-netlink: split out parse_message_one() from socket_read_message()
No functional change, just refactoring and preparation for later
commits.
2022-11-26 11:28:27 +09:00
Yu Watanabe 2b176edc74 sd-netlink: do not use serials currently queued 2022-11-26 11:28:27 +09:00
Yu Watanabe 7b34bae3b1 sd-netlink: also manage received messages by serial
Then, we can easily find the received message matching with requested
serial.
2022-11-26 11:28:27 +09:00
Yu Watanabe e417c4ac44 sd-netlink: reimplement received message queue
By using OrderedSet and Hashmap, we can drop all memmove() calls.
No functional changes, just refactoring.
2022-11-26 11:28:27 +09:00
Yu Watanabe 2ea465ef62 sd-netlink: introduce netlink_queue_received_message() and friend
No functional change, just refactoring.
2022-11-26 11:28:27 +09:00
Yu Watanabe 766417bd76 sd-netlink: fix segfault 2022-11-26 11:28:27 +09:00
Yu Watanabe bc1a8e2b6e sd-netlink: fix possible use-after-free
When we receive a multi-part message and fail to parse it, then
the prviously received message is freed with the _cleanup_ attribute,
but still referenced by sd_netlink.rqueue_partial. That causes
use-after-free when we receive another multi-part message.
2022-11-26 11:28:27 +09:00
Yu Watanabe b491454dfc sd-netlink: return earlier when received invalid message 2022-11-26 11:28:27 +09:00
Yu Watanabe fb298ef104 sd-netlink: allocate read buffer when necessary 2022-11-26 11:28:27 +09:00
Yu Watanabe 61d95dc02c sd-netlink: check received size in socket_recv_message()
No functional change, just refactoring and slightly shorten
socket_read_message().
2022-11-26 11:28:27 +09:00
Yu Watanabe b374397ec5 sd-netlink: drop redundant 'else' 2022-11-26 11:28:27 +09:00
Yu Watanabe 027193db48 sd-netlink: always initialize return variable on success 2022-11-26 11:28:27 +09:00
Lennart Poettering f8cf3d19d2 fdisk: introduce common fdisk_new_context_fd() helper
We do the same thing over and over again and it's a bit ugly, hence
let's unify the code for it at one common place.
2022-11-26 11:28:05 +09:00
Yu Watanabe f329a41be4 Merge pull request #25533 from keszybz/meson-fixups
Meson fixups
2022-11-26 11:27:34 +09:00
Lennart Poettering f52261a06d dissect: don't pre-open swap devices, we are not going to use them 2022-11-26 11:27:15 +09:00
Daan De Meyer 5fe8dbe728 repart: Remove bogus check
The --empty option applies to the partition table of the block
device, not the number of definition files we've read. Also, even
if we don't find any definition files, let's not shortcut execution
so we can run repart on a device/loopback file to get information
on the partition table.
2022-11-26 08:27:41 +09:00
Michal Koutný f38e89c23c logind: Properly unescape names of lingering users
Filenames to store user linger requests are created with C-escaping.
When we enumerate the files to acquire ligering users, we use the
filenames verbatim. In the case C-escaping is not an identity map (such
as "DOMAIN\User"), we won't be able to start user instances of
such mangled users.

Unescape filenames when we treat them as usernames again.

Fixes: #25448
2022-11-26 08:27:16 +09:00
Yu Watanabe 5bd346feb7 Merge pull request #25530 from poettering/resolved-stub-name
resolved: make _localdnsstub and _localdnsproxy resolve to 127.0.0.{53,54}
2022-11-26 08:26:28 +09:00
jcg 1751bdde94 Fix typo 2022-11-26 07:35:56 +09:00
Daan De Meyer da15f8406e units: Use BindsTo=systemd-networkd in systemd-networkd-wait-online.service
We don't want systemd-networkd-wait-online to start if systemd-networkd
is skipped due to condition failures. This is only guaranteed by BindsTo=
and not Requires=, so let's use BindsTo=
2022-11-26 07:35:05 +09:00
Luca Boccassi 6042b60def Merge pull request #25498 from medhefgo/stub-splash
stub: Fix splash alpha blending
2022-11-25 19:38:47 +01:00
Andika Triwidada 12a42034f6 po: Translated using Weblate (Indonesian)
Currently translated at 100.0% (193 of 193 strings)

Co-authored-by: Andika Triwidada <andika@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/id/
Translation: systemd/main
2022-11-25 17:58:16 +00:00
Zbigniew Jędrzejewski-Szmek 25d3a2816b meson: regenerate meson rules
Forgotten in 85bc6b0549.
2022-11-25 18:33:53 +01:00
Zbigniew Jędrzejewski-Szmek 10783aef2e meson: resort imports 2022-11-25 18:33:52 +01:00
Lennart Poettering 056c398bda resolved: introduce common macro for 127.0.0.2 IP address 2022-11-25 17:41:55 +01:00
Lennart Poettering 17f244e8f9 resolved: introduce the _localdnsstub and _localdnsproxy special hostnames for 127.0.0.54 + 127.0.0.53
Let's give these special IP addresses names. After all name resolution
is our job here.

Fixes: #23623
2022-11-25 17:37:30 +01:00
Lennart Poettering 68d449997f resolved: don't filter _gateway/_outbound twice
We already denied being responsible for these names further up, no need
to test for them again.
2022-11-25 17:37:13 +01:00
Lennart Poettering 84d194f1e8 resolved: in dns stub always report "lo" as interface for "localhost"
Previously, we'd return the ifindex the user asked on, and if none was
specified "lo". Let's always return "lo".

This should be a better choice usually, since localhost addresses are
typically not reachable over arbitrary interfaces once SO_BINDTODEVICE
or so is used. Hence, let's report the interface that is always right
for these addresses.
2022-11-25 17:37:13 +01:00
Lennart Poettering 4cb8a25b04 update TODO 2022-11-25 17:34:32 +01:00
Daan De Meyer cf9c27b18b mkfs-util: Drop batch (b) and n flags from mcopy
The batch flag is bugged on older versions of mcopy causing failures
such as:

```
Internal error, size too big
Streamcache allocation problem:: 5
```

It's also a little unclear what the batch flag actually does, so since
everything still works without it, it doesn't hurt to remove it.

The n flag only applies when copying from fat to unix which we don't do
so it doesn't make sense in this scenario.
2022-11-25 13:46:07 +01:00
Daan De Meyer 9044e5b3bf Merge pull request #25482 from DaanDeMeyer/repart-skip-partitions
repart: Add --skip-partitions=
2022-11-25 13:31:09 +01:00
Daan De Meyer 7d505753f1 repart: Add --skip-partitions=
--include-partitions and --exclude-partitions now fully exclude
partitions from repart. Whenever a partition type is excluded, we
don't take any partitions of that type into account at all when
running systemd-repart.

--skip-partitions= is introduced to do what --exclude-partitions did
previously. Any skipped partitions are taken into acount when doing
size calculations, but are not yet populated.

Why do we need both concepts? Exclusion is needed so that we can
use shared repart definitions to generate bootable and non-bootable
images. When generating a non-bootable image, we use --exclude-partitions
to exclude the ESP partition. Skipping is needed so that we can
populate the root partition while skipping the ESP partition, get
the roothash of the root partition, use that to generate a UKI, and
finally populate the ESP partition with the UKI included.
2022-11-25 12:07:38 +01:00
Lennart Poettering fb896517ae resolved: remove inappropriate assert()
A NULL Bitmap object is by all our code considered identical to an empty
bitmap. Hence let's remove the entirely unnecessary assert().

The assert() can be triggered if debug monitoring is used an an empty
NSEC or NSEC3 RR is included in an answer resolved returns.

it's not really a security issue since enabling debug monitoring is a
manual step requiring root privileges, that is off by default. Moreover,
it's a "clean" assert(), i.e. the worst that happens is tha a coredump
is generated and resolved restarted.

Fixes: #25449
2022-11-25 07:49:04 +09:00