systemd/.git
20 months agondisc-option: add HomeAgent option support
Yu Watanabe [Sat, 16 Mar 2024 06:52:18 +0000 (15:52 +0900)]
ndisc-option: add HomeAgent option support

Currently, these are not used, but will be used later in sd-radv.

20 months agoMerge pull request #31965 from yuwata/logs-show-cleanups
Luca Boccassi [Wed, 27 Mar 2024 13:09:56 +0000 (13:09 +0000)]
Merge pull request #31965 from yuwata/logs-show-cleanups

logs-show: several cleanups

20 months agoMerge pull request #31964 from yuwata/journalctl-filter-cleanups
Luca Boccassi [Wed, 27 Mar 2024 13:07:43 +0000 (13:07 +0000)]
Merge pull request #31964 from yuwata/journalctl-filter-cleanups

journalctl-filter: several cleanups

20 months agoMerge pull request #31954 from DaanDeMeyer/mkosi
Daan De Meyer [Wed, 27 Mar 2024 12:27:44 +0000 (13:27 +0100)]
Merge pull request #31954 from DaanDeMeyer/mkosi

mkosi: Re-enable OpenSUSE build

20 months agomkosi: Specify --without docs if needed for fedora/centos
Daan De Meyer [Wed, 27 Mar 2024 12:00:11 +0000 (13:00 +0100)]
mkosi: Specify --without docs if needed for fedora/centos

20 months agoUpdate pkg/fedora to latest
Daan De Meyer [Wed, 27 Mar 2024 11:58:17 +0000 (12:58 +0100)]
Update pkg/fedora to latest

20 months agomkosi: Merge base and system images
Daan De Meyer [Wed, 27 Mar 2024 10:07:52 +0000 (11:07 +0100)]
mkosi: Merge base and system images

The only reason to have these split up is to be able to build extension
images that use the base image as a base tree and install extra packages.
Until we have such a use case, let's merge the base and system images to
simplify things a bit.

We keep the mkosi.images/ directory to not cause too many conflicts with
the integration tests PR.

20 months agomkosi: Re-enable OpenSUSE build
Daan De Meyer [Tue, 26 Mar 2024 09:42:00 +0000 (10:42 +0100)]
mkosi: Re-enable OpenSUSE build

20 months agomkosi: Update to latest
Daan De Meyer [Tue, 26 Mar 2024 10:16:55 +0000 (11:16 +0100)]
mkosi: Update to latest

20 months agoMerge pull request #31980 from bluca/soft_reboot_timestamps
Luca Boccassi [Wed, 27 Mar 2024 10:30:12 +0000 (10:30 +0000)]
Merge pull request #31980 from bluca/soft_reboot_timestamps

soft-reboot: fix timestamps accounting for sd-analyze, add new timestamp, add new counter

20 months agobuild(deps): bump pkg/debian from `1932e19` to `44fe1d4`
dependabot[bot] [Wed, 27 Mar 2024 09:12:48 +0000 (09:12 +0000)]
build(deps): bump pkg/debian from `1932e19` to `44fe1d4`

Bumps pkg/debian from `1932e19` to `44fe1d4`.

---
updated-dependencies:
- dependency-name: pkg/debian
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
20 months agocore: add counter for soft-reboot iterations
Luca Boccassi [Wed, 27 Mar 2024 00:30:45 +0000 (00:30 +0000)]
core: add counter for soft-reboot iterations

Allow to query via D-Bus how many times the current booted system has
been soft rebooted

20 months agoanalyze: show only current times after soft-reboot
Luca Boccassi [Tue, 26 Mar 2024 22:32:04 +0000 (22:32 +0000)]
analyze: show only current times after soft-reboot

The firmware/loader/kernel times are no longer relevant for the startup
sequence on soft-reboot, so use only the userspace timestamps

20 months agocore: add SoftRebootStartTimestamp
Luca Boccassi [Tue, 26 Mar 2024 22:30:43 +0000 (22:30 +0000)]
core: add SoftRebootStartTimestamp

Will be useful to calculate how long it took to shut down the system before starting
in the new root

20 months agocore: do not serialize timestamps that are re-measured on soft-reboot
Luca Boccassi [Tue, 26 Mar 2024 22:28:58 +0000 (22:28 +0000)]
core: do not serialize timestamps that are re-measured on soft-reboot

Otherwise the de-serialization overwrites the timestamps taken after
soft-reboot (e.g.: userspace start/finish) and sd-analyze shows bogus
data

20 months agoMerge pull request #31789 from jsitnicki/socket-pass-fds-to-exec
Yu Watanabe [Wed, 27 Mar 2024 01:18:13 +0000 (10:18 +0900)]
Merge pull request #31789 from jsitnicki/socket-pass-fds-to-exec

Pass socket FDs to all ExecXYZ= commands in socket unit but ExecStartPre=

20 months agoresolved: always return the validated answers when validating
Ronan Pigott [Tue, 26 Mar 2024 07:33:19 +0000 (00:33 -0700)]
resolved: always return the validated answers when validating

We normally expect sd-resolved only to return the validated subset of a
validated response. In some cases we give up on validating, because we
have enough information already to conclude the answer is bogus.

Let's be sure to always reply with only the validated subset in these
cases too, so that we don't return bogus answers and confuse primitive
clients that won't see the SERVFAIL rcode.

20 months agoresolved: minor dnssec fixups
Ronan Pigott [Tue, 26 Mar 2024 18:00:44 +0000 (11:00 -0700)]
resolved: minor dnssec fixups

Fixes: ce5b9d5b3c24 ("resolved: request DS with DNSKEY")

20 months agoshared/logs-show: restore infinite loop avoidance for corrupted journals
Zbigniew Jędrzejewski-Szmek [Tue, 26 Mar 2024 17:46:23 +0000 (18:46 +0100)]
shared/logs-show: restore infinite loop avoidance for corrupted journals

Fixes a bug introduced in e44f06065bf20e8d0e4adacff61350ebd36f299e: it was
supposed to be a refactoring, but unfortunately FOREACH_ARRAY is implemented
using a for loop, so when the 'goto finish' was replaced by 'break', it only
broke the inner loop, leading to a infinite loop.

20 months agohome: fix typo
Yu Watanabe [Tue, 26 Mar 2024 19:07:49 +0000 (04:07 +0900)]
home: fix typo

Follow-up for 5ec87d577f92effe27a62e965e02a6f9a40f81cc.

20 months agotest: integration test for PassFileDescriptorsToExec= option
Jakub Sitnicki [Thu, 14 Mar 2024 10:20:50 +0000 (11:20 +0100)]
test: integration test for PassFileDescriptorsToExec= option

Check if socket file descriptors are passed to ExecXYZ= commands from the
socket unit depending on whether PassFileDescriptorsToExec= option is set.

20 months agosocket: pass socket FDs to all ExecXYZ= commands but ExecStartPre=
Jakub Sitnicki [Thu, 15 Feb 2024 17:02:50 +0000 (18:02 +0100)]
socket: pass socket FDs to all ExecXYZ= commands but ExecStartPre=

Today listen file descriptors created by socket unit don't get passed to
commands in Exec{Start,Stop}{Pre,Post}= socket options.

This prevents ExecXYZ= commands from accessing the created socket FDs to do
any kind of system setup which involves the socket but is not covered by
existing socket unit options.

One concrete example is to insert a socket FD into a BPF map capable of
holding socket references, such as BPF sockmap/sockhash [1] or
reuseport_sockarray [2]. Or, similarly, send the file descriptor with
SCM_RIGHTS to another process, which has access to a BPF map for storing
sockets.

To unblock this use case, pass ListenXYZ= file descriptors to ExecXYZ=
commands as listen FDs [4]. As an exception, ExecStartPre= command does not
inherit any file descriptors because it gets invoked before the listen FDs
are created.

This new behavior can potentially break existing configurations. Commands
invoked from ExecXYZ= might not expect to inherit file descriptors through
sd_listen_fds protocol.

To prevent breakage, add a new socket unit parameter,
PassFileDescriptorsToExec=, to control whether ExecXYZ= programs inherit
listen FDs.

[1] https://docs.kernel.org/bpf/map_sockmap.html
[2] https://lore.kernel.org/r/20180808075917.3009181-1-kafai@fb.com
[3] https://man.archlinux.org/man/socket.7#SO_INCOMING_CPU
[4] https://www.freedesktop.org/software/systemd/man/latest/sd_listen_fds.html

20 months agoMerge pull request #31951 from bluca/resolve_reload
Yu Watanabe [Tue, 26 Mar 2024 17:37:52 +0000 (02:37 +0900)]
Merge pull request #31951 from bluca/resolve_reload

resolved: support reloading configuration at runtime

20 months agoMerge pull request #31959 from YHNdnzj/execute-pass-fds
Yu Watanabe [Tue, 26 Mar 2024 17:37:23 +0000 (02:37 +0900)]
Merge pull request #31959 from YHNdnzj/execute-pass-fds

core/execute: check if EXEC_PASS_FDS is set if got exec_params.fds

20 months agoMerge pull request #31960 from YHNdnzj/capsule-followup
Yu Watanabe [Tue, 26 Mar 2024 17:34:43 +0000 (02:34 +0900)]
Merge pull request #31960 from YHNdnzj/capsule-followup

Some follow-ups for capsule

20 months agodissect: fix memory leak
Antonio Alvarez Feijoo [Tue, 26 Mar 2024 13:53:44 +0000 (14:53 +0100)]
dissect: fix memory leak

20 months agoefi: skip check-alignment-* tests if pefile is not installed
Antonio Alvarez Feijoo [Tue, 26 Mar 2024 15:08:57 +0000 (16:08 +0100)]
efi: skip check-alignment-* tests if pefile is not installed

Otherwise, when building with ukify disabled, no one else requires pefile, and
if it is not installed, those tests fail:

```
================================== 12/1212 ===================================
test:         systemd:efi / check-alignment-systemd-bootx64.efi
start time:   14:21:54
duration:     0.08s
result:       exit status 1
command:      /mnt/work/systemd/upstream-fork/main/tools/check-efi-alignment.py /mnt/work/systemd/upstream-fork/main/build/src/boot/efi/systemd-bootx64.efi
----------------------------------- stderr -----------------------------------
Traceback (most recent call last):
  File "/mnt/work/systemd/upstream-fork/main/tools/check-efi-alignment.py", line 7, in <module>
    import pefile
ModuleNotFoundError: No module named 'pefile'
==============================================================================

================================== 13/1212 ===================================
test:         systemd:efi / check-alignment-linuxx64.efi.stub
start time:   14:21:54
duration:     0.08s
result:       exit status 1
command:      /mnt/work/systemd/upstream-fork/main/tools/check-efi-alignment.py /mnt/work/systemd/upstream-fork/main/build/src/boot/efi/linuxx64.efi.stub
----------------------------------- stderr -----------------------------------
Traceback (most recent call last):
  File "/mnt/work/systemd/upstream-fork/main/tools/check-efi-alignment.py", line 7, in <module>
    import pefile
ModuleNotFoundError: No module named 'pefile'
==============================================================================

================================== 14/1212 ===================================
test:         systemd:efi / check-alignment-addonx64.efi.stub
start time:   14:21:54
duration:     0.07s
result:       exit status 1
command:      /mnt/work/systemd/upstream-fork/main/tools/check-efi-alignment.py /mnt/work/systemd/upstream-fork/main/build/src/boot/efi/addonx64.efi.stub
----------------------------------- stderr -----------------------------------
Traceback (most recent call last):
  File "/mnt/work/systemd/upstream-fork/main/tools/check-efi-alignment.py", line 7, in <module>
    import pefile
ModuleNotFoundError: No module named 'pefile'
==============================================================================
```

Follow-up for 7ff3b88396f440bff60328b4bff7627a34d45e4a

20 months agohwdb: fix Asus T300FA rotation matrix (#31973)
Luxiter [Tue, 26 Mar 2024 17:32:03 +0000 (18:32 +0100)]
hwdb: fix Asus T300FA rotation matrix (#31973)

Closes #31972.

20 months agologs-show: read the current boot ID if nothing specified for add_match_boot_id()
Yu Watanabe [Fri, 22 Mar 2024 08:40:37 +0000 (17:40 +0900)]
logs-show: read the current boot ID if nothing specified for add_match_boot_id()

No functional change, just refactoring.

20 months agosd-id128: move get_boot_id_for_machine() to id128-util.c
Yu Watanabe [Fri, 22 Mar 2024 08:21:01 +0000 (17:21 +0900)]
sd-id128: move get_boot_id_for_machine() to id128-util.c

And rename it to id128_get_boot_for_machine().

This also splits out id128_get_boot() from sd_id128_get_boot(), and
make id128_get_boot_for_machine() use it.

20 months agojournalctl-filter: several cleanups for add_matches()
Yu Watanabe [Thu, 21 Mar 2024 19:19:42 +0000 (04:19 +0900)]
journalctl-filter: several cleanups for add_matches()

- split it into small pieces to reduce indentation,
- return earlier if no filter specified,
- use journal_add_matchf() and journal_add_match_pair(),
  chase_and_stat(), is_symlink(), and sd_device_new_from_devname(),
- replace sd_device_get_devname() + stat() with sd_device_get_devnum(),
- refuse to install filter by path with --root, --image, or --machine
  at least now, as previously it has not worked anyway.

20 months agojournalctl-filter: add missing sd_journal_add_conjunction()
Yu Watanabe [Thu, 21 Mar 2024 18:09:35 +0000 (03:09 +0900)]
journalctl-filter: add missing sd_journal_add_conjunction()

Otherwise, if --facility= is specified with extra matches with '+',
the facility filter will not be applied to the specified filter after '+'.

20 months agojournalctl-filter: several trivial cleanups
Yu Watanabe [Thu, 21 Mar 2024 18:08:54 +0000 (03:08 +0900)]
journalctl-filter: several trivial cleanups

- declare iterator in loop,
- use journal_add_match_pair() and journal_add_matchf(),
- log failures in the caller.

20 months agojournalctl-filter: modernize add_units()
Yu Watanabe [Thu, 21 Mar 2024 17:47:21 +0000 (02:47 +0900)]
journalctl-filter: modernize add_units()

- add missing assertions,
- use set_ensure_consume() and strv_consume(),
- use string_hash_ops_free and _cleanup_set_free_,
- use strv_fnmatch_full(),
- replace unused counter with a boolean flag,
- return earlier if no unit filtering is requested.

20 months agoMerge pull request #31879 from yuwata/journalctl-split
Yu Watanabe [Tue, 26 Mar 2024 14:45:20 +0000 (23:45 +0900)]
Merge pull request #31879 from yuwata/journalctl-split

journalctl: split journalctl.c into small pieces

20 months agondisc-option: sort options in sent message
Yu Watanabe [Sun, 17 Mar 2024 06:33:32 +0000 (15:33 +0900)]
ndisc-option: sort options in sent message

To make the sent message reproducible.

20 months agoMerge pull request #31943 from yuwata/sd-ndisc-option-getter-remover
Luca Boccassi [Tue, 26 Mar 2024 13:55:46 +0000 (13:55 +0000)]
Merge pull request #31943 from yuwata/sd-ndisc-option-getter-remover

sd-ndisc: introduce option getter and remover

20 months agosd-ndisc-protocol: list up all known options
Yu Watanabe [Sat, 16 Mar 2024 06:25:47 +0000 (15:25 +0900)]
sd-ndisc-protocol: list up all known options

See below for more details:
https://www.iana.org/assignments/icmpv6-parameters/icmpv6-parameters.xhtml#icmpv6-parameters-5

20 months agobus-util: dedup bus_set_address_capsule
Mike Yuan [Tue, 26 Mar 2024 12:59:32 +0000 (20:59 +0800)]
bus-util: dedup bus_set_address_capsule

Follow-up for ad963c3f5680796ccd094b81f35ff7aa20b57247

20 months agoresolved: support reloading configuration at runtime
Luca Boccassi [Fri, 8 Mar 2024 23:02:19 +0000 (23:02 +0000)]
resolved: support reloading configuration at runtime

Drop connections and caches and reload config from files, to allow
for low-interruptions updates, and hook up to the usual SIGHUP and
ExecReload=. Mark servers and services configured directly via D-Bus
so that they can be kept around, and only the configuration file
settings are dropped and reloaded.

Fixes https://github.com/systemd/systemd/issues/17503
Fixes https://github.com/systemd/systemd/issues/20604

20 months agojournalctl-show: split out seek_journal()
Yu Watanabe [Thu, 21 Mar 2024 10:18:02 +0000 (19:18 +0900)]
journalctl-show: split out seek_journal()

No functional change, just refactoring.

20 months agojournalctl: split journalctl.c into small pieces
Yu Watanabe [Wed, 20 Mar 2024 18:50:09 +0000 (03:50 +0900)]
journalctl: split journalctl.c into small pieces

And introduces per-action functions.
No functional change, just refactoring.

20 months agojournalctl: use correct type for flags
Yu Watanabe [Tue, 19 Mar 2024 10:04:10 +0000 (19:04 +0900)]
journalctl: use correct type for flags

This also moves its declaration, as it is not changed in the loop.

20 months agojournalctl: merge three if blocks for seeking to the initial position
Yu Watanabe [Tue, 19 Mar 2024 09:54:24 +0000 (18:54 +0900)]
journalctl: merge three if blocks for seeking to the initial position

No functional change, just refactoring.

20 months agosystemctl,busctl: sort includes
Mike Yuan [Tue, 26 Mar 2024 12:48:46 +0000 (20:48 +0800)]
systemctl,busctl: sort includes

Follow-up for 56cb74c3cd1358d7d0b3f613feaf2eeab601a6bd
and 00431b2b66cb59540deda4ea018170a289673585

20 months agounits: sort lists in meson.build
Mike Yuan [Tue, 26 Mar 2024 12:36:28 +0000 (20:36 +0800)]
units: sort lists in meson.build

20 months agotest: use /run/ instead of /etc/ in TEST-75-RESOLVE
Luca Boccassi [Sat, 23 Mar 2024 01:32:44 +0000 (01:32 +0000)]
test: use /run/ instead of /etc/ in TEST-75-RESOLVE

20 months agodaemon-util: introduce notify_reloading helper
Mike Yuan [Tue, 26 Mar 2024 09:40:01 +0000 (17:40 +0800)]
daemon-util: introduce notify_reloading helper

Prompted by #31951

20 months agoMerge pull request #29721 from poettering/systemd-project
Zbigniew Jędrzejewski-Szmek [Tue, 26 Mar 2024 12:19:33 +0000 (13:19 +0100)]
Merge pull request #29721 from poettering/systemd-project

New capsule@.service feature

20 months agocore/execute: check if EXEC_PASS_FDS is set if got exec_params.fds
Mike Yuan [Tue, 26 Mar 2024 10:57:08 +0000 (18:57 +0800)]
core/execute: check if EXEC_PASS_FDS is set if got exec_params.fds

Prompted by #31789 (specifically
https://github.com/systemd/systemd/pull/31789#discussion_r1525267612)

20 months agocore/service: remove redundant Unit.type check
Mike Yuan [Tue, 26 Mar 2024 10:55:19 +0000 (18:55 +0800)]
core/service: remove redundant Unit.type check

SOCKET(u) returns NULL if the type doesn't match.

20 months agobuild(deps): bump pkg/opensuse from `af49127` to `acdb1cd`
dependabot[bot] [Tue, 26 Mar 2024 09:21:52 +0000 (09:21 +0000)]
build(deps): bump pkg/opensuse from `af49127` to `acdb1cd`

Bumps pkg/opensuse from `af49127` to `acdb1cd`.

---
updated-dependencies:
- dependency-name: pkg/opensuse
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
20 months agoefi: Measure into both CC and TPM if available. (#31939)
Dionna Amalie Glaze [Tue, 26 Mar 2024 09:26:59 +0000 (02:26 -0700)]
efi: Measure into both CC and TPM if available. (#31939)

* efi: Measure into both CC and TPM if available.

It's possible that both measurement protocols are made available, so
instead of assuming only one or the other are available, measure into
both to avoid a problem like CVE-2021-42299.

Signed-off-by: Dionna Glaze <dionnaglaze@google.com>
20 months agoMerge pull request #31801 from flatcar-hub/krnowak/sysext-config
Luca Boccassi [Tue, 26 Mar 2024 09:23:19 +0000 (09:23 +0000)]
Merge pull request #31801 from flatcar-hub/krnowak/sysext-config

systemd-sysext: Add support for env vars, ephemeral layers and some fixes

20 months agoMerge pull request #31947 from yuwata/test-recently-fixed-issues
Yu Watanabe [Tue, 26 Mar 2024 05:56:58 +0000 (14:56 +0900)]
Merge pull request #31947 from yuwata/test-recently-fixed-issues

Tests for recently fixed issues

20 months agotest: add test cases for journalctl --facility=/--output=help
Yu Watanabe [Mon, 25 Mar 2024 19:18:16 +0000 (04:18 +0900)]
test: add test cases for journalctl --facility=/--output=help

Follow-up for d44233503f29ad6f79914c8e6137fc2d260d9f89.

20 months agotest: add test cases for systemd-analyze --global
Yu Watanabe [Mon, 25 Mar 2024 19:10:01 +0000 (04:10 +0900)]
test: add test cases for systemd-analyze --global

Follow-up for ac97053618387ca1fa0d378cde7957aab8f0476c.

20 months agondisc-option: introduce ndisc_option_remove()
Yu Watanabe [Sun, 17 Mar 2024 04:27:08 +0000 (13:27 +0900)]
ndisc-option: introduce ndisc_option_remove()

20 months agondisc-option: rename ndisc_option_get() -> ndisc_option_get_by_type()
Yu Watanabe [Sat, 16 Mar 2024 07:44:49 +0000 (16:44 +0900)]
ndisc-option: rename ndisc_option_get() -> ndisc_option_get_by_type()

Then, introduce more generic ndisc_option_get().

20 months agoci: build with clang-18
Frantisek Sumsal [Tue, 5 Mar 2024 11:24:19 +0000 (12:24 +0100)]
ci: build with clang-18

20 months agoDocument SYSTEMD_REPART_MKFS_* in repart.d manual
Gaël Donval [Thu, 14 Mar 2024 13:00:01 +0000 (13:00 +0000)]
Document SYSTEMD_REPART_MKFS_* in repart.d manual

20 months agohome/homework: use FOREACH_ARRAY more
Mike Yuan [Mon, 25 Mar 2024 12:33:18 +0000 (20:33 +0800)]
home/homework: use FOREACH_ARRAY more

Prompted by #31932

20 months agoMerge pull request #31932 from bluca/coverity
Yu Watanabe [Mon, 25 Mar 2024 18:04:51 +0000 (03:04 +0900)]
Merge pull request #31932 from bluca/coverity

Fix coverity issues

20 months agokernel-install/60-ukify: do not rebuild existing UKIs
Vitaly Kuznetsov [Mon, 25 Mar 2024 10:18:25 +0000 (11:18 +0100)]
kernel-install/60-ukify: do not rebuild existing UKIs

In case kernel-install is called to install what's already a UKI, 60-ukify
must be skipped. E.g. when distro shipped and signed UKI is being installed,
it is counter-productive to try to rebuild it with ukify. Also, the existing
script is not ready to handle UKIs with embedded initramfs.

Note, it is already possible to disable 60-ukify by setting
KERNEL_INSTALL_UKI_GENERATOR to something but in case it is not set, 60-ukify
assumes it should run.

20 months agoMerge pull request #31899 from yuwata/sd-journal-add-match
Yu Watanabe [Mon, 25 Mar 2024 17:56:58 +0000 (02:56 +0900)]
Merge pull request #31899 from yuwata/sd-journal-add-match

sd-journal: introduce two helpers for adding journal filter

20 months agoMerge pull request #31807 from yuwata/sd-ndisc-send
Yu Watanabe [Mon, 25 Mar 2024 17:55:33 +0000 (02:55 +0900)]
Merge pull request #31807 from yuwata/sd-ndisc-send

sd-ndisc: introduce sd_ndisc_send()

20 months agoMerge pull request #31938 from YHNdnzj/journalctl-facility
Yu Watanabe [Mon, 25 Mar 2024 17:23:50 +0000 (02:23 +0900)]
Merge pull request #31938 from YHNdnzj/journalctl-facility

journalctl: explicitly check < 0 for error

20 months agoMerge pull request #31870 from CodethinkLabs/base-image-tweaks
Daan De Meyer [Mon, 25 Mar 2024 17:04:49 +0000 (18:04 +0100)]
Merge pull request #31870 from CodethinkLabs/base-image-tweaks

Base image tweaks

20 months agomkosi: Add selinux support to CentOS and Fedora initrds
Richard Maw [Wed, 20 Mar 2024 15:22:36 +0000 (15:22 +0000)]
mkosi: Add selinux support to CentOS and Fedora initrds

The base initrd is also used by the system image
so selinux should be there even if not enabled by the base image.

20 months agomkosi: Remove testuser from base/mkosi.postinst.chroot
Richard Maw [Wed, 20 Mar 2024 14:33:17 +0000 (14:33 +0000)]
mkosi: Remove testuser from base/mkosi.postinst.chroot

The testuser user is only needed for integration tests,
which are used in the system user and this config
can be provided as drop-ins instead of inline in postinst scripts.

20 months agojournalctl: explicitly check < 0 for error
Mike Yuan [Mon, 25 Mar 2024 15:11:27 +0000 (23:11 +0800)]
journalctl: explicitly check < 0 for error

20 months agobasic/string-table: remove unnecessary brackets
Mike Yuan [Mon, 25 Mar 2024 15:10:52 +0000 (23:10 +0800)]
basic/string-table: remove unnecessary brackets

20 months agoMerge pull request #31730 from yuwata/network-dhcp-server-lease-file-follow-ups
Luca Boccassi [Mon, 25 Mar 2024 14:32:05 +0000 (14:32 +0000)]
Merge pull request #31730 from yuwata/network-dhcp-server-lease-file-follow-ups

network: several follow-ups for DHCP server lease file

20 months agoUse .git suffix for all submodule urls
Daan De Meyer [Mon, 25 Mar 2024 12:49:42 +0000 (13:49 +0100)]
Use .git suffix for all submodule urls

20 months agologs-show: use journal_add_matchf() and journal_add_match_pair()
Yu Watanabe [Thu, 21 Mar 2024 20:51:15 +0000 (05:51 +0900)]
logs-show: use journal_add_matchf() and journal_add_match_pair()

20 months agonetworkctl: use journal_add_matchf() and journal_add_match_pair()
Yu Watanabe [Thu, 21 Mar 2024 20:33:08 +0000 (05:33 +0900)]
networkctl: use journal_add_matchf() and journal_add_match_pair()

20 months agojournal-gateway: use journal_add_match_pair() and add_match_boot_id()
Yu Watanabe [Thu, 21 Mar 2024 20:26:02 +0000 (05:26 +0900)]
journal-gateway: use journal_add_match_pair() and add_match_boot_id()

20 months agocoredumpctl: use strv_skip()
Yu Watanabe [Thu, 21 Mar 2024 20:18:41 +0000 (05:18 +0900)]
coredumpctl: use strv_skip()

No functional change, just refactoring.

20 months agocoredumpctl: use journal_add_match_pair()
Yu Watanabe [Thu, 21 Mar 2024 20:14:33 +0000 (05:14 +0900)]
coredumpctl: use journal_add_match_pair()

Also,
- use is_path(),
- drop unused pid.

20 months agotest: add missing return value check in test-dirent-util
Luca Boccassi [Mon, 25 Mar 2024 12:05:28 +0000 (12:05 +0000)]
test: add missing return value check in test-dirent-util

CID#1540029

Follow-up for 6a57d86bf9d7f8d6f5d339f57665dfb2e1d191c5

20 months agomkosi: Use new environment variables for Arch
Daan De Meyer [Mon, 25 Mar 2024 11:27:56 +0000 (12:27 +0100)]
mkosi: Use new environment variables for Arch

These were changed to be prefixed with _systemd_ so let's account
for that.

20 months agohomework: add missing assert
Luca Boccassi [Mon, 25 Mar 2024 12:02:20 +0000 (12:02 +0000)]
homework: add missing assert

'cache' is used unconditionally in this function, so add an assert.

CID#1540860

20 months agohwdb: Add mapping for ACPI quickstart keys on Toshiba Z830
Hans de Goede [Sun, 24 Mar 2024 14:04:47 +0000 (15:04 +0100)]
hwdb: Add mapping for ACPI quickstart keys on Toshiba Z830

The Toshiba Z830 has 3 hotkeys which use the ACPI PNP0C32 quickstart spec:
https://archive.org/details/microsoft-acpi-dirapplaunch

These devices have an ACPI method called GHID() which suggests
it returns a value from the "HID Usage Tables" document, but these
methods simple returns a follow number for the button (1, 2 and 3).

The first 2 buttons are for what the manual calls "TOSHIBA eco button"
and "TOSHIBA Presentation button", since there is no good match for
these simply map them to KEY_PROG1 and KEY_PROG2.

The third button is intended to toggle the touchpad on/off, map
this to F21 which GNOME/KDE will interpret as touchpad toggle.

20 months agobuild(deps): bump pkg/arch from `4d1ecb0` to `3b86b91`
dependabot[bot] [Mon, 25 Mar 2024 09:13:21 +0000 (09:13 +0000)]
build(deps): bump pkg/arch from `4d1ecb0` to `3b86b91`

Bumps pkg/arch from `4d1ecb0` to `3b86b91`.

---
updated-dependencies:
- dependency-name: pkg/arch
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
20 months agobuild(deps): bump pkg/fedora from `2e32a33` to `f1d3866`
dependabot[bot] [Mon, 25 Mar 2024 09:13:26 +0000 (09:13 +0000)]
build(deps): bump pkg/fedora from `2e32a33` to `f1d3866`

Bumps pkg/fedora from `2e32a33` to `f1d3866`.

---
updated-dependencies:
- dependency-name: pkg/fedora
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
20 months agobuild(deps): bump pkg/debian from `3b47281` to `1932e19`
dependabot[bot] [Mon, 25 Mar 2024 09:13:18 +0000 (09:13 +0000)]
build(deps): bump pkg/debian from `3b47281` to `1932e19`

Bumps pkg/debian from `3b47281` to `1932e19`.

---
updated-dependencies:
- dependency-name: pkg/debian
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
20 months agotest: Add cases for failures to import the hierarchy
Krzesimir Nowak [Thu, 29 Feb 2024 07:19:16 +0000 (08:19 +0100)]
test: Add cases for failures to import the hierarchy

20 months agosysext: Fail when trying to import mutable layer that's a symlink to hierarchy
Krzesimir Nowak [Wed, 28 Feb 2024 15:34:05 +0000 (16:34 +0100)]
sysext: Fail when trying to import mutable layer that's a symlink to hierarchy

20 months agotest, sysext: Actually fail the whole operation if sd-merge worker failed
Krzesimir Nowak [Wed, 28 Feb 2024 14:41:46 +0000 (15:41 +0100)]
test, sysext: Actually fail the whole operation if sd-merge worker failed

This also fixes a wrong merge failure check.

20 months agotest: Add test cases for sysext ephemeral-import mode
Krzesimir Nowak [Thu, 29 Feb 2024 07:18:43 +0000 (08:18 +0100)]
test: Add test cases for sysext ephemeral-import mode

20 months agoman: Document sysext ephemeral-import mode
Krzesimir Nowak [Wed, 28 Feb 2024 13:50:05 +0000 (14:50 +0100)]
man: Document sysext ephemeral-import mode

20 months agosysext: Implement ephemeral import mode
Krzesimir Nowak [Wed, 28 Feb 2024 13:23:22 +0000 (14:23 +0100)]
sysext: Implement ephemeral import mode

To enable it, use "ephemeral-import" either for mutable mode environment
variable or for value of "--mutable=" flag.

This is a combination of "ephemeral" and "import" modes. It results in a
mutable hierarchy that includes contents of the mutable extension data, but the
modifications are thrown away when the hierarchy is unmerged.

20 months agotest: Extend sysext tests with cases using ephemeral mode
Krzesimir Nowak [Wed, 28 Feb 2024 08:59:18 +0000 (09:59 +0100)]
test: Extend sysext tests with cases using ephemeral mode

20 months agoman: Document sysext ephemeral mode
Krzesimir Nowak [Wed, 28 Feb 2024 08:42:25 +0000 (09:42 +0100)]
man: Document sysext ephemeral mode

20 months agosysext: Implement ephemeral mode
Krzesimir Nowak [Wed, 28 Feb 2024 08:17:27 +0000 (09:17 +0100)]
sysext: Implement ephemeral mode

To enable it, use "ephemeral" either for mutable mode environment variable or
for value of "--mutable=" flag.

Instead of using mutable dir in /var/lib/extensions.mutable/<hierarchy>, we
create a directory for overlayfs upperdir and workdir in the same tmpfs mount
that sysext worker process creates in /run/systemd/sysext. As the path for the
workdir will be gone when the worker quits, there is no need to do any
additional cleanup. As such, there is also no need to store a path to workdir
in the metadata directory.

20 months agosysext: Add missing --mutable mode in help output
Krzesimir Nowak [Tue, 27 Feb 2024 15:29:08 +0000 (16:29 +0100)]
sysext: Add missing --mutable mode in help output

20 months agoman: Install sysext man pages when ENABLE_SYSEXT is true
Krzesimir Nowak [Tue, 19 Mar 2024 13:47:36 +0000 (14:47 +0100)]
man: Install sysext man pages when ENABLE_SYSEXT is true

20 months agotest: Extend sysext tests with cases using env var for mutable mode
Krzesimir Nowak [Tue, 27 Feb 2024 13:52:30 +0000 (14:52 +0100)]
test: Extend sysext tests with cases using env var for mutable mode

20 months agotest: Fail sysext test if reusing a root directory
Krzesimir Nowak [Tue, 19 Mar 2024 13:40:57 +0000 (14:40 +0100)]
test: Fail sysext test if reusing a root directory

20 months agodocs: Document SYSTEMD_SYSEXT_MUTABLE_MODE env var
Krzesimir Nowak [Wed, 20 Mar 2024 07:34:41 +0000 (08:34 +0100)]
docs: Document SYSTEMD_SYSEXT_MUTABLE_MODE env var