Daan De Meyer [Thu, 27 Jun 2024 10:08:51 +0000 (12:08 +0200)]
mkosi: Switch back to btrfs
Now that we're running on Noble instead of Jammy btrfs has the temp_fsid
feature which means we can mount the same image multiple times so let's
switch back to btrfs instead of ext4 as the filesystem as btrfs properly
records timestamps when building filesystems from a root directory unlike
ext4.
Florian Schmaus [Wed, 26 Jun 2024 12:37:52 +0000 (14:37 +0200)]
core/exec-invoke: use sched_setattr instead of sched_setscheduler
The kernel's sched_setattr interface allows for more control over a processes
scheduling attributes as the previously used sched_setscheduler interface.
Using sched_setattr is also the prerequisite for support of utilization
clamping (UCLAMP [1], see #26705) and allows to set sched_runtime. The latter,
sched_runtime, will probably become a relevant scheduling parameter of the
EEVDF scheduler [2, 3], and therefore will not only apply to processes
scheduled via SCHED_DEADLINE, but also for processes scheduled via
SCHED_OTHER/SCHED_BATCH (i.e., most processes).
efi: share setting of generic efivars between sd-stub/sd-boot
We have very similar code for setting generic efi vars in sd-stub and
sd-boot. Let's share it.
This changes behaviour in a minor way: if you chainload multiple
versions of an sd-boot you'll see the efi vars of the first one now in
the OS, not of the last one.
But this should not matter, invocation like that should generally not
happen.
Instead of keeping three parallel arrays of dt base, dt size and dt
filename, just introduce a proper structure and use an array of that,
greatly simplifying DT handling.
iovec-util: make "struct iovec" and some helpers also available in EFI mode
The construct is a POSIX invention, but it's just so useful, let's also
define it in EFI mode, so that we can use similar constructs in EFI mode
and userspace.
polkit: allow non-local users to block sleep and shutdown
We already had 'auth_admin_keep' for org.freedesktop.login1.reboot and similar
actions. If a user is allowed to perform an action, I think they should be
allowed to _block_ the same action. Guarding this by auth_admin follows the
general principle of not allowing fully unprivileged users to have too much say
over the machine.
inhibit: add --no-ask-password option and allow interactive polkit auth
It seems entirely reasonable to make a policy which e.g. allows block operations
for interactive users after authentication. The tool should support this, so that
more complicated local policies can be used.
Related to https://github.com/systemd/systemd/pull/30307.
Matthias Lisin [Wed, 26 Jun 2024 02:12:42 +0000 (04:12 +0200)]
tmpfiles: use common macro for a set of specifiers
This adds %q, %A and %M specifiers to tmpfiles:
- %A and %M were previously added to tmpfiles.d man page, but not to specifier_table
- %q is added via COMMON_SYSTEM_SPECIFIERS
Daan De Meyer [Tue, 25 Jun 2024 14:34:28 +0000 (16:34 +0200)]
mkosi: update fedora commit reference
* 8153d9b0f9 Revert "Remove tmpfiles snippet for /home and /srv"
* a76669ee22 Remove tmpfiles snippet for /home and /srv
* b3e1d52cb4 Soft-disable tmpfiles --purge until a good use case comes up
* 4a29ab3f3b Version 256.1
* ebf352d292 disable auto-features when bootstrapping
* 1ae0516ae7 Version 256
* b32641170e Restore patch to drop varlink method call
* 421f0041b3 Version 256~rc4
* 65d9b49791 Fix typo
* c56891fb68 Drop sysusers.d/basic.conf
* 69472997b9 Renumber sources and make order more consistent
importd: allow activation in early boot, and make it socket activatable
Previously, importd was only accessible via D-Bus, which required it to
be a late boot service. Now that we have Varlink we can rearrange things
to become early-boot activated, just after the image directories are
mounted.
This will later allow us to have generator that auto-downloads images on
boot.
varlink: add varlink_many_*() helpers that send messages to a set of connections at once
If we have a Varlink interface that allows man subscribers to the same
source of events we typically want to notify all of them at once with
the same message.
Let's add some helpers for this purpose: varlink_many_*() can be used to
send messages, similar to the corresponding varlink_*() calls, but they
take a Set of Varlink objects and we issue the operation on every
connection once.
This ports over one existing case where this is beneficial, but the main
user for this is supposed to be importd later.
Let's properly return the measurement flag tristate, rather than a
boolean. Otherwise we'll mistake "nothing to measure" as "not measured",
which are two different things, and means we'll miscombine the flag
later, claiming to userspace that we measured no dtb data even if there
was.
Yu Watanabe [Mon, 24 Jun 2024 20:10:04 +0000 (05:10 +0900)]
core: do not filter out write() if required in the very late stage
Before 12001b1bf067339db089d52e08fd0b4c6a9945df, write() is required for
if Type=exec. However, with the previous commit, now write() is also used
for sending handoff timestamp. Let's allow write() if necessary.
Yu Watanabe [Sun, 23 Jun 2024 06:15:30 +0000 (15:15 +0900)]
core: use write() to send handoff timestamp
Before 12001b1bf067339db089d52e08fd0b4c6a9945df, the timestamp is sent
with write(), but the commit made the timestamp sent by send(), and
causes regressin #33299.
Note the invocation will still fail if write() is filtered by seccomp.
But, that is an old issue since Type=exec is introduced
(5686391b006ee82d8a4559067ad9818e3e631247).
oldherl [Mon, 24 Jun 2024 18:22:37 +0000 (04:22 +1000)]
hwdb: fix keyboard of RedmiBook Pro 15 2022 (#33465)
Fix two problems of the keyboard of RedmiBook Pro 15 2022.
- Enter key in the main area was mapped to KP_Enter.
- When Fn is locked (to use F1-F12 without pressing Fn),
Right Ctrl was mapped to Menu. Keeping it as Right Ctrl is more useful.
Yu Watanabe [Sun, 23 Jun 2024 05:36:08 +0000 (14:36 +0900)]
network/ndisc: do not override conflicting static routes
We have already ignored conflicting address configurations requested by
NDisc protocol. See ndisc_request_address().
Let's follow the same rule for routes. That is, if there are conflicting
static routes configured or requested, do not override them by NDisc.
Also, swap the order of checking existing route and existing request.
Mike Yuan [Sun, 23 Jun 2024 16:12:33 +0000 (18:12 +0200)]
core: verify WorkingDirectory= is outside of API VFS only under mount namespacing
The purpose of the check is to prevent leaking API VFS fds
from host into a mount namespace/container. When mountns
is not used at all, the check is pointless and causes
inconvenience. E.g. file managers might need to be spawned
under those directories, and they surely won't run in mountns.
Suggested in https://github.com/systemd/systemd/pull/33454#issuecomment-2186351467
Fixes #33361