]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
2 years agocore: add serialization/deserialization for ExecContext
Luca Boccassi [Thu, 31 Aug 2023 23:31:26 +0000 (00:31 +0100)] 
core: add serialization/deserialization for ExecContext

2 years agotest: add simple test for two common kind of errors 29551/head
Lennart Poettering [Thu, 12 Oct 2023 13:28:06 +0000 (15:28 +0200)] 
test: add simple test for two common kind of errors

2 years agovarlink: don't generate %m error message if we are synthesizing the error
Lennart Poettering [Thu, 12 Oct 2023 13:23:42 +0000 (15:23 +0200)] 
varlink: don't generate %m error message if we are synthesizing the error

We are outputting a more useful log message anyway, the "Bad message"
error string is just confusing.

2 years agovarlink: refuse empty () structs/enums
Lennart Poettering [Thu, 12 Oct 2023 13:21:50 +0000 (15:21 +0200)] 
varlink: refuse empty () structs/enums

If we encounter an empty struct in the varlink IDL it could also be an
empty enum. Refuse this to avoid the ambiguity.

The spec doesn't cover this case clearly, hence let's better be on the
safe side and refuse it rather than making a decision what it means.

2 years agoMerge pull request #29544 from yuwata/network-dhcp-bus-command
Yu Watanabe [Thu, 12 Oct 2023 13:06:50 +0000 (22:06 +0900)] 
Merge pull request #29544 from yuwata/network-dhcp-bus-command

network: several fixlets for DBus methods for DHCP client and server

2 years agocore: add cgroup_add_or_update_device_allow()
Luca Boccassi [Tue, 3 Oct 2023 00:06:35 +0000 (01:06 +0100)] 
core: add cgroup_add_or_update_device_allow()

2 years agoserialize: add serialize_image_policy()
Luca Boccassi [Mon, 2 Oct 2023 22:35:26 +0000 (23:35 +0100)] 
serialize: add serialize_image_policy()

2 years agoserialize: add open_serialization_file()
Luca Boccassi [Tue, 19 Sep 2023 00:19:10 +0000 (01:19 +0100)] 
serialize: add open_serialization_file()

2 years agoserialize: add serialize_string_set()
Luca Boccassi [Mon, 18 Sep 2023 21:42:46 +0000 (22:42 +0100)] 
serialize: add serialize_string_set()

2 years agoserialize: add serialize_item_tristate()
Luca Boccassi [Mon, 18 Sep 2023 20:26:12 +0000 (21:26 +0100)] 
serialize: add serialize_item_tristate()

2 years agoserialize: add serialize_item_base64mem()
Luca Boccassi [Mon, 18 Sep 2023 20:15:25 +0000 (21:15 +0100)] 
serialize: add serialize_item_base64mem()

2 years agoserialize: add serialize_item_hexmem()
Luca Boccassi [Mon, 18 Sep 2023 20:05:15 +0000 (21:05 +0100)] 
serialize: add serialize_item_hexmem()

2 years agocore: ensure execute/spawn functions can work without Unit object
Luca Boccassi [Thu, 31 Aug 2023 19:58:22 +0000 (20:58 +0100)] 
core: ensure execute/spawn functions can work without Unit object

When switching to serialization later, the Unit object will not be
serialized, move parameters around instead

2 years agocore: ensure execute/spawn functions can work without manager object
Luca Boccassi [Thu, 31 Aug 2023 20:08:49 +0000 (21:08 +0100)] 
core: ensure execute/spawn functions can work without manager object

When switching to serialization later, the Manager object will not be
serialized, move parameters around instead

2 years agocore: add exec_params_dump helper
Luca Boccassi [Mon, 18 Sep 2023 18:16:02 +0000 (19:16 +0100)] 
core: add exec_params_dump helper

2 years agoprocess-util: add posix_spawn helper
Luca Boccassi [Fri, 2 Jun 2023 15:06:17 +0000 (16:06 +0100)] 
process-util: add posix_spawn helper

This provides CLONE_VM + CLONE_VFORK semantics, so it is useful to
avoid CoW traps and other issues around doing work between fork()
and exec().

2 years agoenv-util: add helper to replace env block
Luca Boccassi [Tue, 19 Sep 2023 23:06:21 +0000 (00:06 +0100)] 
env-util: add helper to replace env block

2 years agotest: add space-separated test for LogFilterPatterns
Luca Boccassi [Mon, 2 Oct 2023 22:30:19 +0000 (23:30 +0100)] 
test: add space-separated test for LogFilterPatterns

2 years agocore: fix checking for extension-releases for ExtensionImages/Directories
Luca Boccassi [Tue, 10 Oct 2023 17:50:36 +0000 (18:50 +0100)] 
core: fix checking for extension-releases for ExtensionImages/Directories

The parsing is done after the image has been opened, not before, as it
cannot be done on an block device. Also fix returning on any error for
ExtensionDirectories, not just ENOENT.

Follow-up for 55ea4ef096543d2bceea9315868d5aca945d7a57

2 years agoupdate TODO
Lennart Poettering [Wed, 11 Oct 2023 21:28:55 +0000 (23:28 +0200)] 
update TODO

2 years agoman/systemd.exec: Update service result table
Reto Schneider [Tue, 10 Oct 2023 12:49:22 +0000 (14:49 +0200)] 
man/systemd.exec: Update service result table

exec-condition and oom-kill were added without updating this table.

2 years agohibernate-resume: remove kernel/image version comparison when resuming
Zbigniew Jędrzejewski-Szmek [Fri, 8 Sep 2023 16:19:36 +0000 (18:19 +0200)] 
hibernate-resume: remove kernel/image version comparison when resuming

We already had a similar check that was removed, see
8340b762e4f597e98a72de1385e74b9be04e521d (*). The kernel supports loading of a
resume image from a different kernel version. This makes sense, because the
goal of "resume" is to replace the running system by a saved memory image, so
it doesn't really matter that the short-lived kernel is different.

By removing the check, we make the process more reliable: for example, the user
may select a different kernel from a list, or not have the previously running
kernel in /boot at all, etc. Requiring the exact same kernel version makes the
process more fragile for no benefit.

Similar reasoning holds for the image version: the image may be updated, and
for example an older kernel+initrd might be used, with an embedded VERSION_ID
that is not the latest. This is fine, and the check is not useful.

I left the check for ID/IMAGE_ID: we probably don't want to use the resume
image if the hibernation was done from a different installation.

(Note: why not check VERSION_ID/IMAGE_VERSION? Because of the following
scenario: a user has an installation of Fedora 35, and they upgrade to Fedora
36, which means that the os-release file on disk gets replaced and now
specifies VERSION_ID=36. But the running kernel is not replaced, and its
package is not removed because the running kernel version is never removed, so
we still have a boot entry that in initrd-release says VERSION_ID=35. Without
rebooting, the user does hibernation. When resuming, we want to resume, no
matter if one of the new entries with VERSION_ID=36 or one of the old entries
with VERSION_ID=35 is picked in the boot loader menu.

If the installation is image-based, i.e. it has IMAGE_ID+IMAGE_VERSION, the
situation is similar: after an upgrade, we may still have an boot entry from
before the upgrade. Using an older kernel+initrd to boot and switch-root into a
newer installation is supported and is rather common.

In fact, it is a rather common situation that the version reported by the boot
entry (or stored internally in the initrd-release in the initrd) does not match
the actual system on disk. Generally, this metadata is saved when the boot menu
entry is written and does not reflect subsequent upgrades. Various
distributions generally keep at least 3 kernels after a upgrade, and during an
upgrade only install one new, which means that after a major upgrade, generally
there will be at least two kernels which have mismatched version information.)

OTOH, I think it is useful to *write* all the details to the EFI var. As
discussed in https://github.com/systemd/systemd/issues/29037, we may want to
show this information in the boot loader. It is also useful for debugging.

(*) Also again discussed and verified in
https://github.com/systemd/systemd/pull/27330#discussion_r1234332080.

", ignored" is dropped, since this failure is likely to cause the following
check to fail. Better not to say anything then to say the misleading thing.

2 years agoRevert "Revert "meson: use c_args in generator scripts (#10289)""
Jordan Williams [Wed, 11 Oct 2023 18:32:49 +0000 (13:32 -0500)] 
Revert "Revert "meson: use c_args in generator scripts (#10289)""

This reverts commit 0e3cc902faec4f18d5fa606396f602b08bc94e27.

Fixes #10288.
I have confirmed that this does now fix cross-compilation.
It appears that changes upstream in Meson, probably mesonbuild/meson#5263, have made the original MR, #10289, work now.

This needs to be tested to ensure that it doesn't break Travis CI like when it was reverted in #10361.

2 years agoefi/boot: rename ConfigEntry to BootEntry 29502/head
Zbigniew Jędrzejewski-Szmek [Tue, 10 Oct 2023 07:52:14 +0000 (09:52 +0200)] 
efi/boot: rename ConfigEntry to BootEntry

Some of the entries are really configured, but we also have a bunch
of automatic entries. Calling them "config entries" is misleading, let's
use the more natural "boot entry".

While at it, rename:
  config_load_entries() → config_load_type1_entries()
  config_entry_add_unified() → config_load_type2_entries()
  config_title_generate() → generate_boot_entry_titles()
  config_entry_add_<type>() → config_add_entry_<type>()

No functional change.

2 years agoefi/boot: adjust grammar and punctuation in comments
Zbigniew Jędrzejewski-Szmek [Mon, 9 Oct 2023 09:14:11 +0000 (11:14 +0200)] 
efi/boot: adjust grammar and punctuation in comments

2 years agoefi/boot: use "else if" instead of explicit "continue"
Zbigniew Jędrzejewski-Szmek [Sun, 8 Oct 2023 11:10:47 +0000 (13:10 +0200)] 
efi/boot: use "else if" instead of explicit "continue"

No functional change.

2 years agoefi/boot: make timeout changes relative to current value
Zbigniew Jędrzejewski-Szmek [Sun, 8 Oct 2023 10:33:43 +0000 (12:33 +0200)] 
efi/boot: make timeout changes relative to current value

When the user pressed + or -, we would set the efivar override, starting
from the default of 0. Instead, set an override that starts at the current
value. This means that when user has e.g. a configured override of 5 s, and
they press +, they get an override of 6 s. I think this is leads to a much
smoother experience for a user, who does not necessarilly need to know that
we have three levels of overrides, they just want to easily configure the
timeout with keys. If they press +, the timeout should increase, and not
jump to some low value.

Also, once an override has been set via the boot menu, i.e. the efivar is set,
do not allow unsetting the efivar from the boot menu. This way we also avoid
an unexpected "jump" to whatever the other sources of configuration specify.
The user can configure any value with the keys that they want, so we don't
need to allow unsetting.

2 years agoefi/boot: split out helper to reduce duplicate formatting code
Zbigniew Jędrzejewski-Szmek [Sun, 8 Oct 2023 10:24:29 +0000 (12:24 +0200)] 
efi/boot: split out helper to reduce duplicate formatting code

No functional change.

2 years agosd-boot: when rebooting or powering off, save config state
Zbigniew Jędrzejewski-Szmek [Sat, 7 Oct 2023 12:00:42 +0000 (14:00 +0200)] 
sd-boot: when rebooting or powering off, save config state

The menu_run() function allows the user to set/unset default entry, or to
increase/decrease menu timeout. After a keypress, status like
  "Menu timeout set to 5 s"
is printed, but there actually isn't any immediate effect. The value is only
written right right before booting a menu entry to avoid unnecessary wear&tear
on the nvram storage. This delayed write is supposed to be invisible to the
user.

Nevertheless, operations like reboot into firmware, reboot, or shutdown were
done immediately. We need to exit the loop first, save the state, and only do
the op afterwards.

Fixup for f6531b11d21931b3952d566ceded672ba21681cc and
e6cab77eca8f6556f381c348b0452b526a752ab7.
Also reverts 498d0cc426afc13fdadb0a385fd16c005645e0cf.

2 years agoman: use consistent label for "Reboot Into Firmware Interface"
Zbigniew Jędrzejewski-Szmek [Fri, 6 Oct 2023 16:46:28 +0000 (18:46 +0200)] 
man: use consistent label for "Reboot Into Firmware Interface"

That is what sd-boot actually displays.

2 years agoefi/boot: use DEFINE_TRIVIAL_CLEANUP_FUNC() in one more place
Zbigniew Jędrzejewski-Szmek [Fri, 6 Oct 2023 16:11:03 +0000 (18:11 +0200)] 
efi/boot: use DEFINE_TRIVIAL_CLEANUP_FUNC() in one more place

No functional change.

2 years agonetwork: do not trigger assertion by forcerenew command 29544/head
Yu Watanabe [Thu, 12 Oct 2023 09:38:01 +0000 (18:38 +0900)] 
network: do not trigger assertion by forcerenew command

When DHCP server is not running, sending force-renew command triggers
assertion.

2 years agosd-dhcp-server: make sd_dhcp_server_is_running() silently work with NULL
Yu Watanabe [Thu, 12 Oct 2023 09:35:55 +0000 (18:35 +0900)] 
sd-dhcp-server: make sd_dhcp_server_is_running() silently work with NULL

We already do in the same way for sd-dhcp-client and friends.

2 years agotest-network: drop unnecessary explicit stop of dnsmasq
Yu Watanabe [Thu, 12 Oct 2023 09:34:20 +0000 (18:34 +0900)] 
test-network: drop unnecessary explicit stop of dnsmasq

2 years agotest-network: add test case for renewing DHCP lease
Yu Watanabe [Thu, 12 Oct 2023 09:33:52 +0000 (18:33 +0900)] 
test-network: add test case for renewing DHCP lease

2 years agonetwork: restart dhcp4 client when renewing lease is requested but the client is...
Yu Watanabe [Thu, 12 Oct 2023 09:13:55 +0000 (18:13 +0900)] 
network: restart dhcp4 client when renewing lease is requested but the client is stopped

Follow-up for fc35a9f8d1632c4e7a279228f869bfc77d8f5b9c.

Fixes the issue https://github.com/systemd/systemd/pull/29472#issuecomment-1759092138.

2 years agoMerge pull request #29523 from keszybz/kernel-install-dtb-files
Lennart Poettering [Thu, 12 Oct 2023 08:43:24 +0000 (10:43 +0200)] 
Merge pull request #29523 from keszybz/kernel-install-dtb-files

Do not look for dtb files in /boot, add support in 60-ukify.install

2 years agoMerge pull request #29472 from yuwata/network-dhcp-ipv6-only-mode
Yu Watanabe [Thu, 12 Oct 2023 04:06:54 +0000 (13:06 +0900)] 
Merge pull request #29472 from yuwata/network-dhcp-ipv6-only-mode

network/dhcp: add IPv6 only mode support

2 years agotest: use kill-whom instead of kill-who (the latter is deprecated)
Michael Biebl [Wed, 11 Oct 2023 20:01:39 +0000 (22:01 +0200)] 
test: use kill-whom instead of kill-who (the latter is deprecated)

2 years agoMerge pull request #29537 from poettering/varlink-tweaks
Mike Yuan [Wed, 11 Oct 2023 18:36:37 +0000 (02:36 +0800)] 
Merge pull request #29537 from poettering/varlink-tweaks

varlink: some smaller usability tweaks + bugfixes

2 years agocore/exec-credential: use rmdir_and_freep at one more place
Mike Yuan [Wed, 11 Oct 2023 15:16:19 +0000 (23:16 +0800)] 
core/exec-credential: use rmdir_and_freep at one more place

2 years agocore/execute: suppress logs if LogLevelMax= is specified
Yu Watanabe [Wed, 11 Oct 2023 13:58:49 +0000 (22:58 +0900)] 
core/execute: suppress logs if LogLevelMax= is specified

Fixes #29532.

2 years agosd-device: Support matching all properties
Daan De Meyer [Mon, 9 Oct 2023 14:06:50 +0000 (16:06 +0200)] 
sd-device: Support matching all properties

Let's support enumerating over devices that match all of the given
properties instead of any of the given properties by adding a new
function sd_device_enumerator_add_match_property_required() which
specifies properties that should all be matched instead of just one.

Fixes #28372

2 years agoupdate TODO
Lennart Poettering [Wed, 11 Oct 2023 14:51:08 +0000 (16:51 +0200)] 
update TODO

2 years agovarlink: use the right validator for error replies 29537/head
Lennart Poettering [Wed, 11 Oct 2023 15:01:46 +0000 (17:01 +0200)] 
varlink: use the right validator for error replies

2 years agovarlink: didn't generate a varlink error reply if a failed method call handler alread...
Lennart Poettering [Wed, 11 Oct 2023 14:59:59 +0000 (16:59 +0200)] 
varlink: didn't generate a varlink error reply if a failed method call handler already did

It might happen that a method call handler already generated an error
reply and then still propagated the error back to the varlink logic.
Let's not try to generate a 2nd reply from that error code then, but
simply proceed without. This simplifies handling of errors in method
call handlers, because they can uniformly return errno-style error
codes, and only if they want return a full Varlink errror.

2 years agovarlink: don't bother replying about validation errors on method calls with 'oneway...
Lennart Poettering [Wed, 11 Oct 2023 14:59:24 +0000 (16:59 +0200)] 
varlink: don't bother replying about validation errors on method calls with 'oneway' set

2 years agovarlink: automatically send ExpectedMore error message back when we were called witho...
Lennart Poettering [Wed, 11 Oct 2023 14:51:30 +0000 (16:51 +0200)] 
varlink: automatically send ExpectedMore error message back when we were called without more=true set, but need it

Various Varlink calls only make sense if they are called with more=true
(i.e. in a mode where multiple replies are expected to be sent). If a
method call assumes it is called with more (manifested in the fact it
calls varlink_notify(), the call to reply to such messages) let's return
a recognizable error code for the violated expectation.

This adds a new error for this, org.varlink.service.ExpectedMore. Note
we are squatting the official org.varlink.service namespace, but for
such a basic thing it makes sense to add it there.

2 years agokernel-install/60-ukify: also support the convention with 'devicetree' file 29523/head
Zbigniew Jędrzejewski-Szmek [Tue, 10 Oct 2023 17:41:35 +0000 (19:41 +0200)] 
kernel-install/60-ukify: also support the convention with 'devicetree' file

Requested in https://github.com/systemd/systemd/pull/28582#issuecomment-1673300596.
The is the last requested changed, so fixes #28771.

90-loaderentry.install is modified to also check $KERNEL_INSTALL_CONF_ROOT
when looking for the devicetree file. For normal use this is probably not
needed, but it's nice to be consistent and it also makes it much easier to
write the tests.

In tests, also do 'ukify inspect' now that we have it.

2 years agoukify: fix .dtb section name in 'inspect'
Zbigniew Jędrzejewski-Szmek [Tue, 10 Oct 2023 17:39:59 +0000 (19:39 +0200)] 
ukify: fix .dtb section name in 'inspect'

Fixup for df4a46733a609f1673de0bebb38e89fffd70c16c.

2 years agokernel-install/60-ukify: add helper function for locating input files
Zbigniew Jędrzejewski-Szmek [Tue, 10 Oct 2023 16:53:55 +0000 (18:53 +0200)] 
kernel-install/60-ukify: add helper function for locating input files

Also rename config_file_location() to uki_conf_location() to make
it obvious which config file was meant.

2 years agoman/kernel-install: fix formatting and document /etc/kernel/devicetree
Zbigniew Jędrzejewski-Szmek [Wed, 11 Oct 2023 15:34:43 +0000 (17:34 +0200)] 
man/kernel-install: fix formatting and document /etc/kernel/devicetree

Each filename should be a separate <term>, so that they separated in the
formatted text. Also, we list files in documentation in priority order, but
here they were in reverse order. Also, rework the description of
$KERNEL_INSTALL_CONF_ROOT to say that it makes kernel-install not look at the
other files. This requires some more words, so make this a separate paragraph
and refer from individual items to it. Also, drop some sentences with "Read by
...", they were already outdated.

Partial fix for #28771.

Co-authored-by: Emil Renner Berthing <systemd@esmil.dk>
2 years agokernel-install/90-loaderentry: do not read dtbs from /boot
Zbigniew Jędrzejewski-Szmek [Tue, 10 Oct 2023 14:32:16 +0000 (16:32 +0200)] 
kernel-install/90-loaderentry: do not read dtbs from /boot

/boot is not trusted, so we shouldn't use load files from there. Also, space in
/boot is limited, so it doesn't make sense to install the files under one
location there and then copy them to a different location. We should only copy
the files from /usr somewhere and then install it in the appropriate place under
/boot.

Also use "/usr/lib" instead of the "/lib" prefix. We don't support unmerged-user
anymore.

Addresses some of the feedback in
https://github.com/systemd/systemd/pull/28582#discussion_r1285820556.

2 years agotimedate: Extend timeout for setting NTP
PhylLu [Wed, 11 Oct 2023 01:41:29 +0000 (09:41 +0800)] 
timedate: Extend timeout for setting NTP

One of the steps in setting up NTP is to enable/disable the
'systemd-timesyncd.service' and then perform a daemon reload.
we use an extra-long timeout for reload in timedated as same as used in
systemd daemon reload to avoiding certain situation have longer reload
times (which exceed the 25 second default timeout used for
dbus-communication), potentially leading to setting NTP failure.

2 years agodns-domain: fix the RFC reference
Michal Sekletar [Wed, 11 Oct 2023 13:28:19 +0000 (15:28 +0200)] 
dns-domain: fix the RFC reference

2 years agodissect: move helpers for categorizing DDIs into generic code 29525/head
Lennart Poettering [Tue, 10 Oct 2023 21:09:45 +0000 (23:09 +0200)] 
dissect: move helpers for categorizing DDIs into generic code

These tests are already done at two places, let's unify them in one
place, and tweak them slightly (specifically: require for considering a
DDI bootable in UEFI we also need need an init system inside).

2 years agodissect: allow confext/sysext to be in the same image
Lennart Poettering [Tue, 10 Oct 2023 14:04:51 +0000 (16:04 +0200)] 
dissect: allow confext/sysext to be in the same image

This reworks the image discovery logic, and conceptually allows DDIs
that are both confext and sysext to exist. Previously we'd only extract
one type of exension data from a DDI, with this we allow to extract both
if both exist.

This doesn't add support for true "multi-modal" DDIs, that qualify as
various things at once, it just lays some ground work that ensures we at
least can dissect such images.

This reworks 484d26dac1e8e543fc9e300e3c1fa36be0769f7d quite a bit.

This changes systemd-dissect's JSON output, but given the
version with the fields it changes/dops has never been released (as the
above patch was merged post-v254) this shouldn't be an issue.

2 years agodissect: image size can be unset, suppres in JSON output then
Lennart Poettering [Tue, 10 Oct 2023 16:27:33 +0000 (18:27 +0200)] 
dissect: image size can be unset, suppres in JSON output then

The ioctl() failure we handle gracefully, hence also reflect that in the
JSON output.

(While we are at it, bring JSON output into same order as textual
output, i.e. move uuid down a bit.)

2 years agodissect: show architecture in JSON output too
Lennart Poettering [Tue, 10 Oct 2023 16:25:32 +0000 (18:25 +0200)] 
dissect: show architecture in JSON output too

We show it in the human readable output, and we should include the same
data in the JSON output too.

2 years agodissect: port to new JSON_BUILD_STRV_ENV_PAIR()
Lennart Poettering [Tue, 10 Oct 2023 16:18:27 +0000 (18:18 +0200)] 
dissect: port to new JSON_BUILD_STRV_ENV_PAIR()

2 years agojson: add json_build() support for env block serialization
Lennart Poettering [Tue, 10 Oct 2023 14:01:41 +0000 (16:01 +0200)] 
json: add json_build() support for env block serialization

2 years agotest-network: add tests for DHCP IPv6 only mode 29472/head
Yu Watanabe [Fri, 6 Oct 2023 05:11:07 +0000 (14:11 +0900)] 
test-network: add tests for DHCP IPv6 only mode

For [DHCPv4] IPv6OnlyMode= and [DHCPServer] IPv6OnlyPreferredSec=.

2 years agonetwork/dhcp4: support IPv6 only mode (RFC 8925)
Yu Watanabe [Wed, 20 Sep 2023 05:29:06 +0000 (14:29 +0900)] 
network/dhcp4: support IPv6 only mode (RFC 8925)

Co-authored-by: Susant Sahani <ssahani@gmail.com>
2 years agosd-dhcp-client: support IPv6 only mode
Yu Watanabe [Wed, 20 Sep 2023 05:02:51 +0000 (14:02 +0900)] 
sd-dhcp-client: support IPv6 only mode

This makes sd-dhcp-client optionally request IPv6 only preferred
option (RFC 8925).

2 years agonetwork/dhcp-server: allow to configure IPv6 only preferred option
Susant Sahani [Wed, 20 Sep 2023 01:14:07 +0000 (10:14 +0900)] 
network/dhcp-server: allow to configure IPv6 only preferred option

Co-authored-by: Yu Watanabe <watanabe.yu+github@gmail.com>
2 years agosd-dhcp-server: support IPv6 only mode
Susant Sahani [Wed, 20 Sep 2023 00:50:02 +0000 (09:50 +0900)] 
sd-dhcp-server: support IPv6 only mode

This makes sd-dhcp-server send IPv6 only preferred option (RFC 8925).

Co-authored-by: Yu Watanabe <watanabe.yu+github@gmail.com>
2 years agoMerge pull request #29530 from poettering/debug-log-tweaks
Mike Yuan [Wed, 11 Oct 2023 12:29:00 +0000 (20:29 +0800)] 
Merge pull request #29530 from poettering/debug-log-tweaks

pid1: various debug logging tweaks

2 years agodoc: readd vanished ```
Lennart Poettering [Wed, 11 Oct 2023 08:41:49 +0000 (10:41 +0200)] 
doc: readd vanished ```

This disappeared in 1e8f5f79e1b6ae2b4115df280c626b71c54a5bb6, let's
restore it.

2 years agokillall: suppress debug log if some cgroup doesn't have survive_final_kill_signal... 29530/head
Lennart Poettering [Wed, 11 Oct 2023 09:26:25 +0000 (11:26 +0200)] 
killall: suppress debug log if some cgroup doesn't have survive_final_kill_signal xattr set

This is the default case, hence really no reason to be noisy about that.

2 years agobpf-lsm: suppress noisy debug log message if we remove a unit from the bpf-lsm table...
Lennart Poettering [Wed, 11 Oct 2023 09:22:49 +0000 (11:22 +0200)] 
bpf-lsm: suppress noisy debug log message if we remove a unit from the bpf-lsm table where it was never added

There's really no point in logging about one of the most common cases we
have: that no BPF-LSM policy was installed for a specific unit.

2 years agofdset: improve debug logging for left-over fds
Lennart Poettering [Wed, 11 Oct 2023 09:11:12 +0000 (11:11 +0200)] 
fdset: improve debug logging for left-over fds

Let's show which fds are closed as part of the left-over fd set logic on
daemon reload/reexec cycles.

This is useful to debug accidentally unclaimed fds.

2 years agodocs: clarify difference between kernel stub and sd-stub in UEFI doc
Luca Boccassi [Tue, 10 Oct 2023 22:08:23 +0000 (23:08 +0100)] 
docs: clarify difference between kernel stub and sd-stub in UEFI doc

2 years agolimits-util: suppress noisy debug message when reading tasks in top-level cgroup
Lennart Poettering [Wed, 11 Oct 2023 09:09:09 +0000 (11:09 +0200)] 
limits-util: suppress noisy debug message when reading tasks in top-level cgroup

We have the "tasks.max" cgroup attribute only if we run in a cgroup
namespace, but not on the host. Hence let's handle ENODATA silently
simply to reduce the debug noise generated.

2 years agoMerge pull request #29427 from ddstreet/cryptenroll_specify_handle_index
Lennart Poettering [Wed, 11 Oct 2023 08:47:01 +0000 (10:47 +0200)] 
Merge pull request #29427 from ddstreet/cryptenroll_specify_handle_index

Cryptenroll specify handle index

2 years agosd-gpt: add defines for big-endian MIPS/MIPS64
Roland Hieber [Tue, 10 Oct 2023 09:34:20 +0000 (11:34 +0200)] 
sd-gpt: add defines for big-endian MIPS/MIPS64

According to the respective change in the DPS:
<https://github.com/uapi-group/specifications/pull/86>

Signed-off-by: Roland Hieber <rhi@pengutronix.de>
2 years agonamespace: make setup_namespace() less crazy
Lennart Poettering [Tue, 10 Oct 2023 19:36:50 +0000 (21:36 +0200)] 
namespace: make setup_namespace() less crazy

Let's replace the ridiculous number of arguments with a structure, to
make this function less weird.

No change in behaviour, just some refactoring.

2 years agodocs: document that in future we'll do EV_EVENT_TAG only, no EV_IPL
Lennart Poettering [Tue, 10 Oct 2023 13:51:38 +0000 (15:51 +0200)] 
docs: document that in future we'll do EV_EVENT_TAG only, no EV_IPL

2 years agologinctl: *-status: set minimum table column width if extra info will be printed
Mike Yuan [Tue, 10 Oct 2023 14:08:36 +0000 (22:08 +0800)] 
loginctl: *-status: set minimum table column width if extra info will be printed

Follow-up for bf366954fa09070f6c3e1e630f57d20463fc5739

Before this commit, we hardcode "prefix" to the widest field
possible in the table. However, there's no guarantee that the
field would actually be used/added, so it could potentially
result in misalignment. Therefore, let's set the minimum width
of the cell to the hardcoded width too.

2 years agonetworkctl: use proper vertical table for status
Mike Yuan [Mon, 9 Oct 2023 11:02:25 +0000 (19:02 +0800)] 
networkctl: use proper vertical table for status

Also modernize macro definition and error handling.

2 years agotpm2: don't use GetCapability() to check transient handles 29427/head
Dan Streetman [Tue, 10 Oct 2023 20:55:39 +0000 (16:55 -0400)] 
tpm2: don't use GetCapability() to check transient handles

The kernel tpm "resource manager" interface doesn't report that any transient
handles exist, even if they do, so don't bother asking if the handle is
transient.

2 years agoman: fix example for systemd.swap-extra
Laszlo Gombos [Tue, 10 Oct 2023 13:45:20 +0000 (09:45 -0400)] 
man: fix example for systemd.swap-extra

2 years agodissect: don't show non-JSON arch + sector size in JSON mode
Lennart Poettering [Tue, 10 Oct 2023 14:05:28 +0000 (16:05 +0200)] 
dissect: don't show non-JSON arch + sector size in JSON mode

2 years agodoc-sync: add support for uploading the documentation for main
Abderrahim Kitouni [Mon, 9 Oct 2023 19:28:27 +0000 (20:28 +0100)] 
doc-sync: add support for uploading the documentation for main

It will refuse running on any other branch than main or stable branches.

Also update the release instructions to run it on the stable branch.

2 years agoman/systemd.exec: document behavior of SetLoginEnvironment= when unset
Mike Yuan [Tue, 10 Oct 2023 10:08:08 +0000 (18:08 +0800)] 
man/systemd.exec: document behavior of SetLoginEnvironment= when unset

Follow-up for 854eca4a95993bb1bd77a18de39efe1ed1a44bbd

Addresses https://github.com/systemd/systemd/pull/29493#discussion_r1351980046

2 years agoukify: override default option value with config file 29332/head
Emanuele Giuseppe Esposito [Wed, 27 Sep 2023 08:28:45 +0000 (04:28 -0400)] 
ukify: override default option value with config file

If an option like SecureBootCertificateDir is given, it should override
the default '/etc/pki/pesign'. Until now the config file option were
always ignored if they had a default.

So from now on, every ConfigItem with a config_key and default field
should also give config_push = ConfigItem.config_set.

2 years agoukify: automatically infer --signtool from the parameters given
Emanuele Giuseppe Esposito [Tue, 26 Sep 2023 16:04:01 +0000 (12:04 -0400)] 
ukify: automatically infer --signtool from the parameters given

--signtool is actually useless: it can be inferred depending on if
--secureboot-certificate-name (pesign) is given, or
--secureboot-private-key and --secureboot-certificate (sbsign) is given.

Leave the option just for backwards compatibility.

2 years agotpm2: do not call Esys_TR_Close()
Dan Streetman [Mon, 9 Oct 2023 16:27:10 +0000 (12:27 -0400)] 
tpm2: do not call Esys_TR_Close()

Unfortunately, the tpm2-tss library doesn't reference count handles, and a call
to Esys_TR_Close() will remove the handle that could be in use by other
code. So stop calling Esys_TR_Close(), and leave the handle around until we
cleanup the entire ESYS_CONTEXT.

2 years agotest: add tests for systemd-cryptenroll --tpm2-seal-key-handle
Dan Streetman [Fri, 6 Oct 2023 15:14:25 +0000 (11:14 -0400)] 
test: add tests for systemd-cryptenroll --tpm2-seal-key-handle

In TEST-70-TPM2, test systemd-cryptenroll --tpm2-seal-key-handle using the
default (0) as well as the SRK handle (0x81000001), and test using a non-SRK
handle index after creating and persisting a primary key.

In test/test-tpm2, test tpm2_seal() and tpm2_unseal() using default (0), the SRK
handle, and a transient handle.

2 years agocryptenroll: allow specifying handle index of key to use for sealing
Dan Streetman [Fri, 21 Jul 2023 19:49:16 +0000 (15:49 -0400)] 
cryptenroll: allow specifying handle index of key to use for sealing

This defaults to the SRK index.

2 years agoMerge pull request #29493 from YHNdnzj/unit-always-set-user-home
Lennart Poettering [Tue, 10 Oct 2023 08:16:07 +0000 (10:16 +0200)] 
Merge pull request #29493 from YHNdnzj/unit-always-set-user-home

core/execute: always set $USER and introduce SetLoginEnvironment=

2 years agoMerge pull request #29507 from abderrahim/doc-sync-improvement
Luca Boccassi [Tue, 10 Oct 2023 07:59:33 +0000 (08:59 +0100)] 
Merge pull request #29507 from abderrahim/doc-sync-improvement

Improvements to the doc-sync target

2 years agoMerge pull request #28699 from bluca/dtb_addon
Luca Boccassi [Tue, 10 Oct 2023 07:58:54 +0000 (08:58 +0100)] 
Merge pull request #28699 from bluca/dtb_addon

stub: add support for dtb addons

2 years agoUpdate TODO 28699/head
Luca Boccassi [Fri, 6 Oct 2023 22:42:27 +0000 (23:42 +0100)] 
Update TODO

2 years agoboot: measure loader.conf in PCR5
Luca Boccassi [Fri, 6 Oct 2023 22:41:10 +0000 (23:41 +0100)] 
boot: measure loader.conf in PCR5

Results in:

- EventNum: 26
  PCRIndex: 5
  EventType: EV_EVENT_TAG
  DigestCount: 4
  Digests:
  - AlgorithmId: sha1
    Digest: 155fb999ca61ba8c7b1f1d87cee821f772ef084a
  - AlgorithmId: sha256
    Digest: 4c26adf231603613afc00bb3d5cad046aec6a525ca01262417c7085caab452b5
  - AlgorithmId: sha384
    Digest: 3e0758cb6605ac274e55d747bf29ee3474fc4413cd5e7a451d1375219cd7f08a30fc915a8df7131657ca78b82b9ccec8
  - AlgorithmId: sha512
    Digest: e32d905b9092c543802f386db9a397d9b6593bdb8360fb747a6d23e491a09595fec8699184cc790d0873a3d52ed16d045538f0c73ece48278fae0fb6ed9b4ed6
  EventSize: 32
  Event: 2a58bcf5180000006c006f0061006400650072002e0063006f006e0066000000

2 years agostub: measure all cmdline addons together
Luca Boccassi [Sat, 23 Sep 2023 23:34:58 +0000 (00:34 +0100)] 
stub: measure all cmdline addons together

2 years agostub: add support for dtb addons
Luca Boccassi [Mon, 7 Aug 2023 00:05:18 +0000 (01:05 +0100)] 
stub: add support for dtb addons

Same as kernel command line addons.

2 years agoMove CLEANUP_ARRAY to src/fundamental
Luca Boccassi [Sat, 23 Sep 2023 17:29:32 +0000 (18:29 +0100)] 
Move CLEANUP_ARRAY to src/fundamental

2 years agoefi: add xmemdup
Luca Boccassi [Sat, 12 Aug 2023 22:14:13 +0000 (23:14 +0100)] 
efi: add xmemdup

2 years agoefi: add EFI_TCG2_TAGGED_EVENT and helpers
Luca Boccassi [Mon, 2 Oct 2023 00:17:58 +0000 (01:17 +0100)] 
efi: add EFI_TCG2_TAGGED_EVENT and helpers

2 years agomkosi: use different configs for Debian kernel package list
Luca Boccassi [Thu, 28 Sep 2023 10:56:27 +0000 (11:56 +0100)] 
mkosi: use different configs for Debian kernel package list

The kernel package is named after the architecture, so builds will
fail if mkosi --architecture arm64 is used