1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-07 04:58:29 +03:00

74514 Commits

Author SHA1 Message Date
Dan Nicholson
b5448c16f8 firstboot: fix root params with creds and prompting disabled
Remove an early return that prevents --prompt-root-password or
--prompt-root-shell and systemd.firstboot=off using credentials. In that case,
arg_prompt_root_password and arg_prompt_root_shell will be false, but the
prompt helpers still need to be called to read the credentials. Furthermore, if
only the root shell has been set, don't overwrite the root password.

(cherry picked from commit 35bc4c34240afdd55e117b909f26fa9a5dc54f3b)
2024-08-15 14:04:41 +01:00
Dan Nicholson
847dd914d0 firstboot: handle missing root password entries
If /etc/passwd and/or /etc/shadow exist but don't have an existing root entry,
one needs to be added. Previously this only worked if the files didn't exist.

(cherry picked from commit 2319154a6bec7b8c42e901dfacaefe95bf4e3750)
2024-08-15 14:04:41 +01:00
Yu Watanabe
cab78ad49f man: suggest to enable global IPv6Forwarding= setting to make IPv6 packets forwarded
Closes #33414.

(cherry picked from commit 175cdefd33788eced7fd6d76fb0b1676eb6ba799)
2024-08-15 14:04:41 +01:00
Dan Nicholson
21d270d38f firstboot: create locked and empty root passwords consistently
Although locked and empty passwords in /etc/passwd are treated the same, in all
other cases the entry is configured to read the password from /etc/shadow.

(cherry picked from commit 5088de9daa156a095e79684c658f9035db971538)
2024-08-15 14:04:41 +01:00
Dan Nicholson
fdf270a89e test: extend firstboot testing
Several features were not being tested or weren't being evaluated thoroughly.

(cherry picked from commit 38688bbc8ffb16a449a41cab344c27f6b1e74cd3)
2024-08-15 14:04:41 +01:00
Yu Watanabe
166b704a41 network: mention that IPv4 ACD is enabled by default for 169.254.0.0/16
Prompted by #33824.

(cherry picked from commit dd87ad8e193092f053ca702b303b25d2001bf96d)
2024-08-15 14:04:40 +01:00
Yu Watanabe
ad861b6ae6 network: request non-NULL SSID when a wlan interface is configured as station
To avoid conflicts with user .network file for the wlan interface with Bond=.
See https://github.com/systemd/systemd/issues/19832#issuecomment-857661200.

(cherry picked from commit e2becab08506d8a085f4c18231c7f354db16df9f)
2024-08-15 14:04:40 +01:00
Luca Boccassi
c12c122e2a efi: fix link to legacy EFI handover protocol
(cherry picked from commit 4d6ab7e8440845301c90211beb22015e7232faa1)
2024-08-15 14:04:40 +01:00
Luca Boccassi
84111f8916 stub: allocate and zero enough space in legacy x86 handover protocol
A PE image's memory footprint might be larger than its file size due
to uninitialized memory sections. Normally all PE headers should be
parsed to check the actual required size, but the legacy EFI handover
protocol is only used for x86 Linux bzImages, so we know only the last
section will require extra memory. Use SizeOfImage from the PE header
and if it is larger than the file size, allocate and zero extra memory
before using it.

Fixes https://github.com/systemd/systemd/issues/33816

(cherry picked from commit 19812661f1f65ebe777d1626b5abf6475faababc)
2024-08-15 14:04:40 +01:00
Yu Watanabe
0d98178abb network: call link_handle_bound_by_list() before trying to reconfigure interface
Otherwise, when an interface gained its carrier, the interface may not
have matching .network file yet, then link_reconfigure_impl() returns
zero, and link_handle_bound_by_list() is skipped.

Fixes #33837.

(cherry picked from commit 36b8ad085c6902631ad7054bffbda33d6d168823)
2024-08-15 14:04:40 +01:00
Ivan Shapovalov
1cdeda986a Revert "network/ndisc: ignore most fields of RA header when lifetime is zero"
This reverts commit ffef01acddcac27caaef02f7f28bff03d7799e5e.

Similar to 2d393b1b6d8 ("network: IPv6 Compliance: Router Advertisement
Processing, Reachable Time [v6LC.2.2.15]"),

Extract from: https://www.ietf.org/rfc/rfc4861.html#section-4.2, p.21,
first paragraph:

    The Router Lifetime applies only to
    the router's usefulness as a default router; it
    does not apply to information contained in other
    message fields or options.

So it does not make sense to prevent DHCPv6 when Router Lifetime is 0.

Fixes #33357.

(cherry picked from commit 7767896d127264f660e1e8a714e5cd760840921f)
2024-08-15 14:04:40 +01:00
Daniel P. Berrangé
812fc38b91 Fix detection of TDX confidential VM on Azure platform
The original CVM detection logic for TDX assumes that the guest can see
the standard TDX CPUID leaf. This was true in Azure when this code was
originally written, however, current Azure now blocks that leaf in the
paravisor. Instead it is required to use the same Azure specific CPUID
leaf that is used for SEV-SNP detection, which reports the VM isolation
type.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
(cherry picked from commit 9d7be044cad1ae54e344daf8f2ec37da46faf0fd)
2024-08-15 14:04:40 +01:00
Yu Watanabe
9468a6ea47 network: do not bring down bound interfaces immediately
Even if a timespan specified to IgnoreCarrierLoss= for an interface,
when the carrier of the interface lost, bound interfaces might be bring
down immediately.

Let's also postpone bringing down bound interfaces with the specified
timespan.

(cherry picked from commit e8eaed0240d642e70c567b08f3593e4cf45a255a)
2024-08-15 13:08:37 +01:00
Arian van Putten
f23fe35c9f document how TimeoutStartSec= affects notify-reload (#33653)
* document how TimeoutStartSec=  affects notify-reload

(cherry picked from commit a55d1b29a4cc2edc8550c5f4e062f2194807dcd3)
2024-08-15 13:08:37 +01:00
Yu Watanabe
233ae5056f nspawn: remove macvlan interfaces before network namespace died
This is similar to what we do for veth interfaces in remove_veth_links().

When a container rebooted, macvlan interfaces created by the previous
boot may still exist in the kernel, and that causes -EADDRINUSE after
reboot.

Hopefully fixes #680.

(cherry picked from commit 1bfa47418e9df03c2562a4c82dc319cf7c3b228c)
2024-08-15 13:08:37 +01:00
Daan De Meyer
3d90344e94 cgroup-util: Ignore kernel threads in cg_kill_items()
Similar to the implementation of cgroup.kill in the kernel, let's
skip kernel threads in cg_kill_items() as trying to kill kernel
threads as an unprivileged process will fail with EPERM and doesn't
do anything when running privileged.

(cherry picked from commit 0fbb569de1dcc06118dba006cf7a40caf6cd94d0)
2024-08-15 13:08:37 +01:00
Daan De Meyer
1cb21b2cb1 kernel-install: Try some more initrd variants in 90-loaderentry.install
On CentOS/Fedora, dracut is configured to write the initrd to
/boot/initramfs-$KERNEL_VERSION...img so let's check for that as well
if no initrds were supplied.

(cherry picked from commit b56920e36c5692c0dde701bfb48330653a9c62c9)
2024-08-15 13:08:37 +01:00
Daan De Meyer
c386327fc8 kernel-install: Only read cmdline from /proc/cmdline when not in container
If we're running from within a container, we're very likely not going
to want to use the kernel command line from /proc/cmdline, so let's add
a check to see if we're running from a container to decide whether we'll
use the kernel command line from /proc/cmdline.

(cherry picked from commit 35c01ec59e0c2e6bd06cb18ca2ff612c6a7ea35d)
2024-08-15 13:08:37 +01:00
Daan De Meyer
852be5a77f test: Don't mount build sources into image when running non-interactively
(cherry picked from commit 578ee05155c0f6d8cc07f785fcc636037545c8da)
2024-08-15 13:08:37 +01:00
Nick Cao
31d806d4ed network: Fixup Table when L3MasterDevice is set on routing policy rule
(cherry picked from commit 615af2c77d996b2ba6e6d17d376f7a221c0e5822)
2024-08-15 13:08:37 +01:00
Nick Cao
fb44ee8908 man: network: move note about L3MasterDevice to the correct section
(cherry picked from commit 034b7dfc08062cde9f63847f34b4d1c604a19a46)
2024-08-15 13:08:37 +01:00
Vladimir Panteleev
ec3f2c8c8a man: clarify systemd-path variable source
(cherry picked from commit 3f24fa57df552accc2a6f9ab4d36724ba7227eff)
2024-08-15 13:08:37 +01:00
Vladimir Panteleev
5cf0c45f64 man: improve ManagerEnvironment documentation
- Improve wording for explanation when these variables are inherited

- Clarify that these variables are not placed in the process environment block,
  so /proc/PID/environ cannot be used as a debugging tool

(cherry picked from commit 6c1e0823b04525716d9ee0031a2b6735d3f7dfa4)
2024-08-15 13:08:37 +01:00
Jose Ignacio Tornos Martinez
0cdec6e1fe kernel-install: remove depmod generated file modules.weakdep
The new file, modules.weakdep, generated by depmod to get the weak
dpendencies information can be present
(05828b4a6e),
so remove it like the other similar files.

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
(cherry picked from commit eef4cd51f94d837bd0e71512c831634a2902522d)
2024-08-15 13:08:37 +01:00
Ronan Pigott
b2cfeed1d5 resolved: Don't retry queries that indicate net error
This probably rarely helped anyway, but it also in some cases interferes
with auxiliary dnssec queries where the authoritative nameserver does
not support EDNS0/DNSSEC.

Fixes: ac6844460ca1 ("resolved: support RFC 8914 EDE error codes")
(cherry picked from commit cd2ce31adbfa5fb4f08267a13ace3a72e7597a2f)
2024-08-15 13:08:37 +01:00
Michal Koutný
8ea1e6450c test: Fail cgroup delegation test when user cannot be created
It means: a) user cannot be created, something's wrong in the
test environment -> fail the test; b) user already exists, we shall not
continue and delete (foreign) user.

(cherry picked from commit 3e6e3e6d40db0a9e9741ef4942218193fca7b28e)
2024-08-15 13:08:37 +01:00
Daan De Meyer
161286e989 resize-fs: Put minimal ext4 size in the same ballpark as the other filesystems
TEST-46-HOMED fails on ext4 because the filesystem is deemed to small
for activation by cryptsetup. Let's bump the minimal filesystem size for
ext4 a bit to be in the same ballpark as ext4 and btrfs to avoid weird
errors due to impossibly small filesystems.

Also use U64_MB while we're touching this.

(cherry picked from commit ae07feb401ff70b122650ac01041021703d4b8ad)
2024-08-15 13:08:37 +01:00
Michal Koutný
64b63f6cd0 test: Reorganize testcase of cgroup delegation
There are multiple subtests, just move them around into functions
(leveraging the testcase_* convention) to make space for new related
subtests.

(cherry picked from commit 4f0541dc595277a62431c46d59dc258005160650)
2024-08-15 13:08:37 +01:00
Daan De Meyer
67ad9221b7 TEST-54-CREDS: Specify SMBIOS creds via corresponding mkosi option
This allows mkosi to combine fstab.extra with its own fstab.extra so
that it doesn't override the one we pass for the test.

(cherry picked from commit ebe17e3f9e6f6b7a85677fc10439936b41d196e3)
2024-08-15 13:08:37 +01:00
Yu Watanabe
84f0eda378 sd-event: change error code -EINVAL -> -EIO
EINVAL should be used when a function is called with an invalid
argument. Here, the signal is not a function argument.

Follow-up for 7a64c5f23efbb51fe4f1229c1a8aed6dd858a0a9.

(cherry picked from commit ab9af70edb23f2a66e93e2e16f87cd98873885b7)
2024-08-15 13:08:37 +01:00
David Tardon
7a48ea958b sd-event: do not assert on invalid signal
The signalfd_siginfo struct is received from outside via a FD, hence
assert() is not appropriate way to check it. Just do a normal runtime
check.

(cherry picked from commit 7a64c5f23efbb51fe4f1229c1a8aed6dd858a0a9)
2024-08-15 11:07:56 +01:00
David Tardon
b2df49a87b logind-dbus: check auth. for all inhibitor operations
Fixes #33834

(cherry picked from commit 639719e01065c3a2f557d70e4d8088c2ec71c7c6)
2024-08-15 11:07:49 +01:00
Jeffrey Bosboom
bd8ba1dcd8 docs/CONTROL_GROUP_INTERFACE.md: document accounting information available via D-Bus
(cherry picked from commit f7fa6326820bbb75a2a7112072a7771944ad8ce3)
2024-08-15 11:07:24 +01:00
Mike Yuan
4ad6b2631d basic/log: do not treat all negative errnos as synthetic
Currently, IS_SYNTHETIC_ERRNO() evaluates to true for all negative errnos,
because of the two's-complement negative value representation.
Subsequently, ERRNO= is not logged for most of our own code.
Let's fix this, by formatting all synthetic errnos as positive.
Then, treat all negative values as non-synthetic.

While at it, mark the evaluation order explicitly, and remove
unneeded comment.

Fixes #33800

(cherry picked from commit 268f58076f7e0258dce75f521d08199092279853)
2024-08-15 11:07:16 +01:00
Luca Boccassi
277204f1a3 test: fix D-Bus policy override for TEST-73-LOCALE
We don't need to allow non-root, and the policy needs to specify destination
and interface too, to narrow it down

Follow-up for 7b5c38a91def6cf236605010a0a93a1cd4c137e9

(cherry picked from commit a4c436c9d8ae20baf9d1d08d43e64e6355bcce83)
2024-08-15 11:06:58 +01:00
Daan De Meyer
2f47f979ec test-fs-util: Modernize openat_report_new() test
(cherry picked from commit b91ad562280ec4f37ba970f1f167d2d626da2692)
2024-08-15 11:06:45 +01:00
Daan De Meyer
e0b0a24a16 test-id128: Use new assertion macros
(cherry picked from commit 372e96a5a10630eb2e02111672221428e0be3fb8)
2024-08-15 11:06:36 +01:00
Daan De Meyer
04c1439ee6 test: Add ASSERT_EQ_ID128() and ASSERT_NE_ID128()
(cherry picked from commit 60a4505da4cfb57653fac79a79745e32ab0bc311)
2024-08-15 11:06:36 +01:00
Daan De Meyer
f40b0b101d test: Add ASSERT_FAIL()
(cherry picked from commit 8eb06fd162c8828739f8619437351d98d7105ec9)
2024-08-15 11:06:36 +01:00
Daan De Meyer
32ff025c36 mkosi: Update to latest
Includes the required fix to make mkosi copy NOCOW disk images properly.

(cherry picked from commit 3d6c6f9b9e957735a801b8d1587508dea9599795)
2024-08-15 11:06:08 +01:00
Daniel P. Berrangé
b077417713 man/systemd-detect-virt: fix row spanning for VM header
This fixes

  commit 9b0688f491674b53ef7a52bdf561a430c53673d6
  Author: Yu Watanabe <watanabe.yu+github@gmail.com>
  Date:   Tue Jan 9 10:52:49 2024 +0900

    virt: add Google Compute Engine support

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
(cherry picked from commit 9ffdfc67c6aedcb66c2b18c2c61bc32e585e6d6e)
2024-08-05 16:02:36 +02:00
Luca Boccassi
566210c272 meson: Bump version to 256.4 v256.4 2024-07-24 13:49:39 +01:00
Luca Boccassi
16de138427 mkosi: update debian commit reference
* c004a150e7 Configure default DNS servers for upstream CI builds
* a27b1516c9 autopkgtest: set Release= in mkosi.local.conf to distinguish testing vs unstable
* dddce818b2 autopkgtest: add allow-stderr to timedated test
* 2a7b111506 Install valrinkctl zsh completion file
* 862497a139 d/t/control: add Depends: lib{systemd,udev}-dev for upstream
* cb78791b85 d/t/upstream: ensure correct ubuntu codename is used
* fe7445b94d d/t/boot-and-services: fix a couple python sytax warnings
* 2a875917cc d/t/boot-and-services: skip test_tmp_cleanup if tmp.mount is overridden
* 6fe81acbc9 Install zsh completion for run0
2024-07-24 14:26:49 +02:00
Luca Boccassi
b731debea9 hwdb: update to main@{2024-07-24}
git restore -s origin/main hwdb.d/ test/hwdb.d
2024-07-24 14:26:49 +02:00
vdovhanych
a78a524652 add udev rules for trezor hw wallet devices
(cherry picked from commit 2cf425ec573b8f67025c5e74cd267015129e7349)
2024-07-24 14:26:49 +02:00
Mike Yuan
b825a8be0b core: reliably check if varlink socket has been deserialized
Follow-up for 6906c028e83b77b35eaaf87b27d0fe5c6e1984b7

The mentioned commit uses access() to check if varlink socket
already exists in the filesystem, but that isn't sufficient.

> Varlink sockets are not serialized until v252, so upgrading from
> v251 or older means we will not listen anymore on the varlink sockets.
>
> See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1074789
> for more details as this was found when updating from Debian Bullseye to a new version.

After this commit, the set up of varlink_server is effectively
split into two steps. manager_varlink_init_system(), which is
called after deserialization, would no longer skip listening
even if Manager.varlink_server is in place, but actually
check if we're listening on desired sockets.
Then, manager_deserialize() can be switched back to using
manager_setup_varlink_server().

Alternative to #33817

Co-authored-by: Luca Boccassi <bluca@debian.org>
(cherry picked from commit d4e5c66ed469c822ca5346c7a445ec1446b1d17f)
2024-07-24 14:26:49 +02:00
Daan De Meyer
83c9043727 mkosi: Bump device timeout even more
I still manage to hit it in some cases so let's bump again.

(cherry picked from commit fffbfb4ed1b949a853773e0445197c2aba4e5f91)
2024-07-24 14:26:49 +02:00
Zbigniew Jędrzejewski-Szmek
e60d01bdbf man/systemd-repart: extend description and reword some sentences
The page was written when systemd-repart was primarily intended to be used on a
running system. But nowadays it's more often used to create images, so extend
that part of the description.

While at it, fix some whitespace issues and trim some overly complicated sentences.

(cherry picked from commit d202ea57549248c4246c8f453a2ff88a4c2a7e1e)
2024-07-24 14:26:49 +02:00
Steve Traylen
766af3f782 Document that MemorySwapMax supports % configuration
Certainly on systemd 252 at least a configuration of
```
MemorySwapMax=40%
```
is supported but this was missing from the man page.
Only MemoryMax was documented as supporting a %.

(cherry picked from commit 8af38e5b0475f514141d314088dcf9fffd7edc37)
2024-07-24 14:26:49 +02:00
Daan De Meyer
1922d49fd6 Make vcs-tag do something useful for non-developer mode as well
When building packages of arbitrary commits of systemd-stable,
distributors might want to include a git sha of the exact commit
they're on. Let's extend vcs-tag a little to make this possible.

If we're on a commit matching a tag, don't generate a git sha at all.
If we're not on a commit matching a tag, generate a vcs tag as usually.
However, if we're not in developer mode, don't append a '^' if the tree
is dirty to accomodate package builds applying various patches to the
tree which shouldn't be considered as "dirty" edits.

(cherry picked from commit 944faf65986f36d7ed3a4ba5cb4cc763011f0f77)
2024-07-24 14:26:49 +02:00