Daan De Meyer [Fri, 3 Jan 2025 15:45:50 +0000 (16:45 +0100)]
core: do not disconnect from bus when failed to install signal match (#35779)
If bus_add_match_full() is called without install callback and we failed
to install the signal match e.g. by timeout, then add_match_callback()
will disconnect from the bus. Let's use a custom install handler and
handle failures gracefully.
This does not *solve* the root cause of issue
https://github.com/systemd/systemd/issues/30573, but should improve the
situation when the issue is triggered.
The new json_dispatch_const_path() is to json_dispatch_path() what
sd_json_dispatch_const_string() is to sd_json_dispatch_ string(), i.e.
doesn't implicitly strdup() the string, but gives you the pointer into
the JSON structure, and thus requires you to keep it pinned.
Daan De Meyer [Fri, 3 Jan 2025 12:54:09 +0000 (13:54 +0100)]
vmspawn: Switch to virtconsole for headless console (#35836)
virtconsole is the modern way to set up a headless serial connection
to a virtual machine so let's make use of it instead of -serial. This
also allows us to get rid of the per architecture serial console device
names and makes vmspawn more consistent with mkosi qemu which already
uses
virtconsole.
Otherwise the code was measuring the content of hwdids into dtbauto
section and vice-versa.
Found this while adding the new `dtbauto` and `.hwdids` fields in the go
implementation of `sd-measure` at
https://github.com/siderolabs/talos/blob/main/internal/pkg/secureboot/measure/measure.go.
Daan De Meyer [Fri, 3 Jan 2025 10:14:44 +0000 (11:14 +0100)]
vmspawn: Switch to virtconsole for headless console
virtconsole is the modern way to set up a headless serial connection
to a virtual machine so let's make use of it instead of -serial. This
also allows us to get rid of the per architecture serial console device
names and makes vmspawn more consistent with mkosi qemu which already uses
virtconsole.
Daan De Meyer [Fri, 3 Jan 2025 08:19:55 +0000 (09:19 +0100)]
network/dhcp: introduce global setting for DHCPv4 client identifier (#35783)
Typically, the same client identifier setting is used for all
interfaces. Hence, better to provide the system-wide setting to specify
the client identifier.
- Set `RefuseManualStart=yes`.
- Order before shutdown.target and emergency.target.
- Remove wrong `Wants=remote-fs.target` dependency from
breakpoint-pre-switch-root.service.
- Remove unneeded `After=sysroot.mount` from breakpoint-pre-switch-root.service
(implied by initrd.target).
Mike Yuan [Thu, 2 Jan 2025 19:03:33 +0000 (20:03 +0100)]
random-util: our baseline includes getrandom() (v3.17) now
Plus, linux/random.h never defined getrandom(), hence remove
the custom machinery for sys/random.h vs linux/random.h
in favor of single HAVE_GETRANDOM.
Mike Yuan [Thu, 2 Jan 2025 18:59:56 +0000 (19:59 +0100)]
random-util: drop needless conditionalization of sys/auxv.h
We assume its existence in basic/build-path.c, shared/userdb.c,
and coredump/coredump.c already, for which nothing has been reported
so far. So this seems safe to drop.
ask-password: add Varlink API for querying passwords from the user
This turns systemd-ask-password into a small Varlink service, so that
there's an standard IPC way to ask for a password. It mostly directly
exposes the functionality of the Varlink service.
Mike Yuan [Thu, 2 Jan 2025 03:32:00 +0000 (04:32 +0100)]
shared/hibernate-util: drop support for kernels lacking /sys/power/resume_offset
The current fallback path is actually unreliable, given
the kernel *supports* setting the resume offset through
cmdline after all, but just not exposed under /sys/.
For v258 let's drop it hence.
I didn't bump the baseline to 4.17, but merely documented
new requirement in README, because there's certainly more
compat stuff to drop between 4.3 and 4.17, and README is
a useful list for things to kill. We'll get to 5.4 eventually.
Mike Yuan [Thu, 2 Jan 2025 03:17:47 +0000 (04:17 +0100)]
shared/hibernate-util: handle the case where no swap has available backing dev
This also makes find_suitable_hibernation_device() report
more accurate error (ENOSPC -> ESTALE) if there's
no swap space on the system at all but resume= is set.
Mike Yuan [Mon, 16 Dec 2024 00:54:11 +0000 (01:54 +0100)]
core/socket: introduce intermediate SOCKET_START_OPEN state
Prior to this commit, if no Exec*= is defined for socket,
and the unit was in SOCKET_FAILED state, failure of socket_open_fds()
would induce state transition SOCKET_FAILED -> SOCKET_FAILED,
and OnFailure= deps get unexpectedly skipped. Let's introduce
an intermediate state, so that during unit start we enter
UNIT_ACTIVATING at least once.
Mike Yuan [Mon, 16 Dec 2024 18:59:17 +0000 (19:59 +0100)]
core/socket: clean up usbffs handling
- Log about errors in socket_open_fds()
- Open parent dir fd and operate under it, instead of constructing paths
everywhere
- Replace scandir() with readdir_all()
Luca Boccassi [Mon, 30 Dec 2024 18:42:29 +0000 (18:42 +0000)]
mkosi: switch to github mirror of openSUSE sources from build.opensuse.org (#35789)
The commit history of
[src.opensuse.org](https://src.opensuse.org/pool/systemd/src/branch/devel)
has been reset again to 2015 (both branches, factory and devel)... this
is unusable for now. I'd suggest switching to the github mirror of
code.opensuse.org, maintained since 2019 (at least github is not down
that often and the commit history does not change).
mkosi: switch to github mirror of openSUSE sources from build.opensuse.org
The current src.opensuse.org is very unstable and commit hashes are reset (or
even removed) every now and then. While the official repo is not fixed, let's
move to a more stable source, the github mirror of code.opensuse.org, maintained
since 2019.
Yu Watanabe [Mon, 30 Dec 2024 01:16:37 +0000 (10:16 +0900)]
network: introduce system wide default setting for DHCPv4 client ID
Typically, the same client identifier setting is used for all
interfaces. Hence, better to provide the system-wide setting to specify
the client identifier.
Yu Watanabe [Sun, 29 Dec 2024 06:50:43 +0000 (15:50 +0900)]
core: do not disconnect from bus when failed to install signal match
If bus_add_match_full() is called without install callback and we failed
to install the signal match e.g. by timeout, then add_match_callback()
will disconnect from the bus.
Let's use a custom install handler and handle failures gracefully.
This does not *solve* the root cause of issue #30573, but should improve
the situation when the issue is triggered.