]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
13 months agoMerge pull request #28552 from bluca/test_execute
Luca Boccassi [Fri, 28 Jul 2023 19:48:41 +0000 (20:48 +0100)] 
Merge pull request #28552 from bluca/test_execute

test-execute: measure, count and log test runs

13 months agotest-execute: count and log the number of individual tests actually executed 28552/head
Luca Boccassi [Fri, 28 Jul 2023 18:02:26 +0000 (19:02 +0100)] 
test-execute: count and log the number of individual tests actually executed

13 months agoDrop split-usr and unmerged-usr support
Luca Boccassi [Mon, 12 Jun 2023 01:15:19 +0000 (02:15 +0100)] 
Drop split-usr and unmerged-usr support

As previously announced, execute order 66:

https://lists.freedesktop.org/archives/systemd-devel/2022-September/048352.html

The meson options split-usr, rootlibdir and rootprefix become no-ops
that print a warning if they are set to anything other than the
default values. We can remove them in a future release.

13 months agotest-execute: measure and log time elapsed while running tests
Luca Boccassi [Tue, 25 Jul 2023 11:16:05 +0000 (12:16 +0100)] 
test-execute: measure and log time elapsed while running tests

In order to get a good approximation of latencies when starting
services, timestamp before/after running the test cases and print
the difference. This allows to measure while ignoring the setup/shutdown
time for the test harness.

13 months agoMerge pull request #28551 from mrc0mmand/unit-cleanup-set
Luca Boccassi [Fri, 28 Jul 2023 12:57:01 +0000 (13:57 +0100)] 
Merge pull request #28551 from mrc0mmand/unit-cleanup-set

core: free the strings in the set as well during unit cleanup

13 months agoMerge pull request #28359 from keszybz/ret-gather
Daan De Meyer [Fri, 28 Jul 2023 12:28:35 +0000 (14:28 +0200)] 
Merge pull request #28359 from keszybz/ret-gather

Add RET_GATHER macro to make continue-but-remember-first-error functions easier

13 months agocore: free the strings in the set as well during unit cleanup 28551/head
Frantisek Sumsal [Fri, 28 Jul 2023 10:24:32 +0000 (12:24 +0200)] 
core: free the strings in the set as well during unit cleanup

Spotted while fuzzing #27890.

=================================================================
==908098==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 64 byte(s) in 1 object(s) allocated from:
    #0 0x7f4efe6d81f5 in __interceptor_realloc.part.0 (/lib64/libasan.so.8+0xd81f5) (BuildId: dc689b05ca2577037af24700212bb5cce1f91c8a)
    #1 0x7f4efb8e3ace in greedy_realloc ../src/basic/alloc-util.c:70
    #2 0x7f4efb93b713 in extract_first_word ../src/basic/extract-word.c:62
    #3 0x7f4efb970d50 in set_put_strsplit ../src/basic/hashmap.c:1902
    #4 0x7f4efd76c27e in exec_context_deserialize ../src/core/execute-serialize.c:3341
    #5 0x7f4efd778dcb in exec_deserialize ../src/core/execute-serialize.c:4122
    #6 0x4032c0 in LLVMFuzzerTestOneInput ../src/core/fuzz-execute-serialize.c:60
    #7 0x403c58 in main ../src/fuzz/fuzz-main.c:50
    #8 0x7f4efecccb49 in __libc_start_call_main (/lib64/libc.so.6+0x27b49) (BuildId: 245240a31888ad5c11bbc55b18e02d87388f59a9)
    #9 0x7f4efecccc0a in __libc_start_main_alias_2 (/lib64/libc.so.6+0x27c0a) (BuildId: 245240a31888ad5c11bbc55b18e02d87388f59a9)
    #10 0x402344 in _start (/home/mrc0mmand/repos/@systemd/systemd/build-san/fuzz-execute-serialize+0x402344) (BuildId: 195f382cf1e39b9ba48d6dcf5a90f786d72837a8)

SUMMARY: AddressSanitizer: 64 byte(s) leaked in 1 allocation(s).
Aborted (core dumped)

==911550==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 17 byte(s) in 1 object(s) allocated from:
    #0 0x4df281 in strdup (/home/mrc0mmand/repos/@systemd/systemd/build-libfuzz/fuzz-execute-serialize+0x4df281) (BuildId: 4e58706e607b8be7972d83c421bc0b625d509ec6)
    #1 0x7fe4ae2b38fc in _set_put_strndup_full /home/mrc0mmand/repos/@systemd/systemd/build-libfuzz/../src/basic/hashmap.c:1868:21
    #2 0x7fe4b0bad897 in exec_context_deserialize /home/mrc0mmand/repos/@systemd/systemd/build-libfuzz/../src/core/execute-serialize.c:3914:29
    #3 0x7fe4b0b80592 in exec_deserialize /home/mrc0mmand/repos/@systemd/systemd/build-libfuzz/../src/core/execute-serialize.c:4109:13
    #4 0x531d0f in LLVMFuzzerTestOneInput /home/mrc0mmand/repos/@systemd/systemd/build-libfuzz/../src/core/fuzz-execute-serialize.c:59:16
    #5 0x440594 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) (/home/mrc0mmand/repos/@systemd/systemd/build-libfuzz/fuzz-execute-serialize+0x440594) (BuildId: 4e58706e607b8be7972d83c421bc0b625d509ec6)
    #6 0x43f9b9 in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*) (/home/mrc0mmand/repos/@systemd/systemd/build-libfuzz/fuzz-execute-serialize+0x43f9b9) (BuildId: 4e58706e607b8be7972d83c421bc0b625d509ec6)
    #7 0x440fd5 in fuzzer::Fuzzer::MutateAndTestOne() (/home/mrc0mmand/repos/@systemd/systemd/build-libfuzz/fuzz-execute-serialize+0x440fd5) (BuildId: 4e58706e607b8be7972d83c421bc0b625d509ec6)
    #8 0x441955 in fuzzer::Fuzzer::Loop(std::vector<fuzzer::SizedFile, std::allocator<fuzzer::SizedFile>>&) (/home/mrc0mmand/repos/@systemd/systemd/build-libfuzz/fuzz-execute-serialize+0x441955) (BuildId: 4e58706e607b8be7972d83c421bc0b625d509ec6)
    #9 0x42e151 in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) (/home/mrc0mmand/repos/@systemd/systemd/build-libfuzz/fuzz-execute-serialize+0x42e151) (BuildId: 4e58706e607b8be7972d83c421bc0b625d509ec6)
    #10 0x45a916 in main (/home/mrc0mmand/repos/@systemd/systemd/build-libfuzz/fuzz-execute-serialize+0x45a916) (BuildId: 4e58706e607b8be7972d83c421bc0b625d509ec6)
    #11 0x7fe4ac449b49 in __libc_start_call_main (/lib64/libc.so.6+0x27b49) (BuildId: 245240a31888ad5c11bbc55b18e02d87388f59a9)
    #12 0x7fe4ac449c0a in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x27c0a) (BuildId: 245240a31888ad5c11bbc55b18e02d87388f59a9)
    #13 0x422b74 in _start (/home/mrc0mmand/repos/@systemd/systemd/build-libfuzz/fuzz-execute-serialize+0x422b74) (BuildId: 4e58706e607b8be7972d83c421bc0b625d509ec6)
SUMMARY: AddressSanitizer: 17 byte(s) leaked in 1 allocation(s).

13 months agoMerge pull request #28335 from ssahani/dhcp4-route-option
Luca Boccassi [Fri, 28 Jul 2023 08:57:19 +0000 (09:57 +0100)] 
Merge pull request #28335 from ssahani/dhcp4-route-option

network: DHCP4 allow to set InitialCongestionWindow and InitialAdvert…

13 months agoMerge pull request #28360 from keszybz/pointingstick-accel-drop
Luca Boccassi [Fri, 28 Jul 2023 08:57:04 +0000 (09:57 +0100)] 
Merge pull request #28360 from keszybz/pointingstick-accel-drop

hwdb: drop POINTINGSTICK_CONST_ACCEL

13 months agoMerge pull request #28527 from medhefgo/boot-stack-guard
Luca Boccassi [Fri, 28 Jul 2023 08:56:41 +0000 (09:56 +0100)] 
Merge pull request #28527 from medhefgo/boot-stack-guard

boot: Fall back to using image load address for stack guard

13 months agoMerge pull request #28430 from keszybz/cleanups
Luca Boccassi [Fri, 28 Jul 2023 08:56:28 +0000 (09:56 +0100)] 
Merge pull request #28430 from keszybz/cleanups

Various small cleanups

13 months agoMerge pull request #28417 from bluca/coverity
Luca Boccassi [Fri, 28 Jul 2023 08:56:08 +0000 (09:56 +0100)] 
Merge pull request #28417 from bluca/coverity

Some coverity fixes

13 months agoMerge pull request #27621 from esposem/ukify_read
Luca Boccassi [Fri, 28 Jul 2023 08:55:03 +0000 (09:55 +0100)] 
Merge pull request #27621 from esposem/ukify_read

ukify: add an option to read the PE sections

13 months agoNEWS: finalize for v254 v254
Luca Boccassi [Fri, 28 Jul 2023 08:26:29 +0000 (09:26 +0100)] 
NEWS: finalize for v254

A release is never late, nor is it early, it arrives precisely when it
means to.

13 months agoNEWS: mention that fsck will be ran for systemd.mount-extra=
Luca Boccassi [Fri, 28 Jul 2023 08:25:25 +0000 (09:25 +0100)] 
NEWS: mention that fsck will be ran for systemd.mount-extra=

13 months agoNEWS: update contributors list
Luca Boccassi [Fri, 28 Jul 2023 08:23:32 +0000 (09:23 +0100)] 
NEWS: update contributors list

13 months agoMerge pull request #28543 from bluca/hwdb
Luca Boccassi [Fri, 28 Jul 2023 08:16:12 +0000 (09:16 +0100)] 
Merge pull request #28543 from bluca/hwdb

hwdb and NEWS updates

13 months agoMerge pull request #28544 from yuwata/fstab-generator-fsck
Zbigniew Jędrzejewski-Szmek [Fri, 28 Jul 2023 06:49:40 +0000 (08:49 +0200)] 
Merge pull request #28544 from yuwata/fstab-generator-fsck

fstab-generator: enable fsck for block device mounts specified in sys…

13 months agoMerge pull request #28548 from yuwata/meson-confext
Zbigniew Jędrzejewski-Szmek [Fri, 28 Jul 2023 06:46:27 +0000 (08:46 +0200)] 
Merge pull request #28548 from yuwata/meson-confext

meson: do not create dead systemd-confext symlink if sysext is disabled

13 months agomeson: do not create dead systemd-confext symlink if sysext is disabled 28548/head
Yu Watanabe [Fri, 28 Jul 2023 03:15:47 +0000 (12:15 +0900)] 
meson: do not create dead systemd-confext symlink if sysext is disabled

13 months agofstab-generator: enable fsck for block device mounts specified in systemd.mount-extra= 28544/head
Yu Watanabe [Thu, 27 Jul 2023 21:07:17 +0000 (06:07 +0900)] 
fstab-generator: enable fsck for block device mounts specified in systemd.mount-extra=

Like we do for root= or so.

Another possible option is adding support of fifth (sixth?) field in
systemd.mount-extra=. But that may be overkill, hence let's do that
later if someone request that.

Fixes fsck part of issue #28541.

13 months agoNEWS: mention agetty/login credentials 28543/head
Luca Boccassi [Thu, 27 Jul 2023 23:39:59 +0000 (00:39 +0100)] 
NEWS: mention agetty/login credentials

13 months agohwdb: run update-hwdb
Luca Boccassi [Thu, 27 Jul 2023 23:30:53 +0000 (00:30 +0100)] 
hwdb: run update-hwdb

git diff hwdb.d/*.hwdb looks sensible

13 months agotest: fix typo
Yu Watanabe [Thu, 27 Jul 2023 20:55:42 +0000 (05:55 +0900)] 
test: fix typo

13 months agoMerge pull request #28540 from DaanDeMeyer/getty-credentials
Luca Boccassi [Thu, 27 Jul 2023 20:12:14 +0000 (21:12 +0100)] 
Merge pull request #28540 from DaanDeMeyer/getty-credentials

units: Load agetty credentials in all getty units

13 months agoMerge pull request #28518 from yuwata/fstab-generator-fixes
Luca Boccassi [Thu, 27 Jul 2023 17:47:41 +0000 (18:47 +0100)] 
Merge pull request #28518 from yuwata/fstab-generator-fixes

fstab-generator: fixes for systemd.mount-extra=

13 months agounits: Load agetty credentials in all getty units 28540/head
Daan De Meyer [Thu, 27 Jul 2023 14:50:58 +0000 (16:50 +0200)] 
units: Load agetty credentials in all getty units

In it's latest release, agetty will support reading the agetty.autologin
and login.noauth credentials, so let's make sure we import those in our
getty units so they're available to agetty to read.

13 months agoci: explicitly install python3-lldb-$COMPILER_VERSION
Frantisek Sumsal [Thu, 27 Jul 2023 11:20:17 +0000 (13:20 +0200)] 
ci: explicitly install python3-lldb-$COMPILER_VERSION

To avoid apt complaining:

 + apt-get -y install clang-15 lldb-15 lld-15 clangd-15
Reading package lists...
Building dependency tree...
Reading state information...
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 python3-lldb-14 : Conflicts: python3-lldb-x.y
 python3-lldb-15 : Conflicts: python3-lldb-x.y
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

13 months agosleep: don't init /sys/power/resume if 'resume=' option is missing and EFI is disabled
Franck Bui [Wed, 26 Jul 2023 15:04:10 +0000 (17:04 +0200)] 
sleep: don't init /sys/power/resume if 'resume=' option is missing and EFI is disabled

Otherwise in such case a first `systemctl hibernate` would fail but would still
initialize /sys/power/resume fooling a second `systemctl hibernate` into
believing that 'resume=' is correctly set and can be used by the resume process
to find the swap device to resume from.

Follow-up for #27330.

13 months agonetwork: don't log non-negative errno
Frantisek Sumsal [Thu, 27 Jul 2023 09:21:36 +0000 (11:21 +0200)] 
network: don't log non-negative errno

Otherwise bad things happen:

systemd-networkd[3140]: wlan0: Saved new link: ifindex=5, iftype=ETHER(1), kind=n/a
systemd-networkd[3140]: Assertion '(_error) != 0' failed at src/network/networkd-wifi.c:119, function manager_genl_process_nl80211_config(). Aborting.

Resolves: #28534

13 months agoman: fix typos
Erik Sjölund [Wed, 21 Jun 2023 06:35:03 +0000 (08:35 +0200)] 
man: fix typos

13 months agomkosi: install sd-boot on opensuse in base image
Luca Boccassi [Wed, 26 Jul 2023 20:18:07 +0000 (21:18 +0100)] 
mkosi: install sd-boot on opensuse in base image

Workaround for CI issue, the sd-stub we build is overwritten in the final
image as the package gets pulled there, install it in the base to
work around it for now

13 months agomissing: include linux/types.h for __s64 and __u64
Yu Watanabe [Wed, 26 Jul 2023 16:14:14 +0000 (01:14 +0900)] 
missing: include linux/types.h for __s64 and __u64

Fixes #28529.

13 months agoefi: link with -z nopack-relative-relocs
Luca Boccassi [Wed, 26 Jul 2023 10:29:57 +0000 (11:29 +0100)] 
efi: link with -z nopack-relative-relocs

elf2efi.py cannot handle DT_RELR relocations, so disable it
if we can

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

13 months agotest-fstab-generator: add more tests for systemd.mount-extra= and friends 28518/head
Yu Watanabe [Tue, 25 Jul 2023 22:37:29 +0000 (07:37 +0900)] 
test-fstab-generator: add more tests for systemd.mount-extra= and friends

13 months agotest-fstab-generator: also test with SYSTEMD_IN_INITRD=no
Yu Watanabe [Tue, 25 Jul 2023 22:04:48 +0000 (07:04 +0900)] 
test-fstab-generator: also test with SYSTEMD_IN_INITRD=no

13 months agotest-fstab-generator: extract core part as a function
Yu Watanabe [Tue, 25 Jul 2023 21:30:37 +0000 (06:30 +0900)] 
test-fstab-generator: extract core part as a function

No functional change, preparation for later commits.

13 months agofstab-generator: add a flag to accept entry for "/" in initrd
Yu Watanabe [Wed, 26 Jul 2023 00:39:23 +0000 (09:39 +0900)] 
fstab-generator: add a flag to accept entry for "/" in initrd

When both prefix_sysroot and accept_root is true, the entry for "/" will
be accepted and converted to "/sysroot/".

Why? If the entry is read from the main system's fstab, then we already
mounted /sysroot/, hence it is not and should not re-add the .mount unit
for /sysroot/. However, if we want to specify the root mount through the
kernel command line or credential, without this change, we need to
specify the same entry in the two options. E.g.
===
systemd.mount-extra=/dev/sda1:/:auto:defaults
rd.systemd.mount-extra=/dev/sda1:/sysroot:auto:defaults
===
That's inconvenient. Of course, we can dedup that by using traditional
options, but cannot when defined in credential.

13 months agofstab-generator: read both credentials in initrd
Yu Watanabe [Tue, 25 Jul 2023 19:25:57 +0000 (04:25 +0900)] 
fstab-generator: read both credentials in initrd

This makes the behavior consistent with the way we already do for
fstab and command line options.
In initrd, entries read from fstab.extra are mounted under /sysroot.

13 months agofstab-generator: add rd.systemd.mount-extra= and friends
Yu Watanabe [Tue, 25 Jul 2023 19:17:27 +0000 (04:17 +0900)] 
fstab-generator: add rd.systemd.mount-extra= and friends

Previously, mounts specified in systemd.mount-extra= are equally handled
both in initrd and the main system. So, the mounts for the main system
are also mounted in initrd.

This introduces rd.systemd.mount-extra=, which specifies mounts in initrd.
Then, mounts specified in systemd.mount-extra= are still mounted both in
initrd and the main system, but prefixed with /sysroot/ when running in
initrd.

Fixes #28516.

13 months agofstab-generator: fix target of /sysroot/usr
Yu Watanabe [Wed, 26 Jul 2023 00:31:54 +0000 (09:31 +0900)] 
fstab-generator: fix target of /sysroot/usr

If /usr mount is picked from the main system's fstab file (prefix_sysroot
is true, and the path is prefixed as /sysroot/usr), then previously it
was installed in the wrong target unit.

13 months agoboot: Fall back to using image load address for stack guard 28527/head
Jan Janssen [Wed, 26 Jul 2023 13:08:53 +0000 (15:08 +0200)] 
boot: Fall back to using image load address for stack guard

If we cannot get random data from the RNG protocol we can still use our
load address to make the stack guard a little less static.

13 months agomkosi: add drop-in to make emergency.service shut down the system
Luca Boccassi [Wed, 26 Jul 2023 11:36:40 +0000 (12:36 +0100)] 
mkosi: add drop-in to make emergency.service shut down the system

When the mkosi CI fails to boot, it just sits there waiting at the emergency
console until the job times out. Add a drop-in for emergency.service in the
CI configuration so that instead it exists immediately.

13 months agoMerge pull request #28511 from YHNdnzj/gpt-auto-no-duplicate
Zbigniew Jędrzejewski-Szmek [Wed, 26 Jul 2023 12:34:08 +0000 (14:34 +0200)] 
Merge pull request #28511 from YHNdnzj/gpt-auto-no-duplicate

gpt-auto: skip mounting ESP if fstab for /boot/ uses the same device as discovered one

13 months agogpt-auto: skip mounting ESP if fstab for /boot/ uses the same device as discovered one 28511/head
Mike Yuan [Wed, 26 Jul 2023 04:10:43 +0000 (12:10 +0800)] 
gpt-auto: skip mounting ESP if fstab for /boot/ uses the same device as discovered one

Follow-up for 6a488fa7cce8124fa885adf8a2f31363fe62f636

Currently, if an fstab entry for /boot/ exists, we'll skip to try /efi/
instead. However, if it's already using the same device as the discovered
one, we should not duplicate the mount.

13 months agofstab-util: add fstab_is_mount_point_full which takes a source path to compare
Mike Yuan [Wed, 26 Jul 2023 04:04:07 +0000 (12:04 +0800)] 
fstab-util: add fstab_is_mount_point_full which takes a source path to compare

13 months agopam: lower warning about closing sd-bus after fork
Luca Boccassi [Tue, 25 Jul 2023 18:47:29 +0000 (19:47 +0100)] 
pam: lower warning about closing sd-bus after fork

There is some issue in our code that triggers this warning constantly,
but it's nothing users can solve, so downgrade to debug level until
we can figure out the original issue (which is a permission denied
error on ReleaseSession D-Bus method call).

Related to https://github.com/systemd/systemd/issues/28514

13 months agofstab-generator: rename 'initrd' flag to 'prefix_sysroot'
Yu Watanabe [Tue, 25 Jul 2023 18:17:01 +0000 (03:17 +0900)] 
fstab-generator: rename 'initrd' flag to 'prefix_sysroot'

The name 'initrd' is confusing with 'in_initrd()'.

13 months agoudev: set ID_PATH properties for all pci, usb, and platform devices
Yu Watanabe [Mon, 24 Jul 2023 20:18:53 +0000 (05:18 +0900)] 
udev: set ID_PATH properties for all pci, usb, and platform devices

Before c43ff248f94266cfc93e300a2d3d163ed805e55b, the following line in
60-drm.rules also sets ID_PATH for all pci, usb, and platform devices:
===
ACTION!="remove", SUBSYSTEM=="drm", SUBSYSTEMS=="pci|usb|platform", IMPORT{builtin}="path_id"
===
Unfortunately, some existing rules rely on the unexpected behavior.
To keep the backward compatibility, let's set ID_PATH for them.

Fixes #28411.

13 months agoNEWS: fix typo
Yu Watanabe [Tue, 25 Jul 2023 06:50:29 +0000 (15:50 +0900)] 
NEWS: fix typo

14 months agoukify: fix armv7 architecture mapping
Luca Boccassi [Mon, 24 Jul 2023 17:06:30 +0000 (18:06 +0100)] 
ukify: fix armv7 architecture mapping

$ uname -m
armv7l

Traceback (most recent call last):
  File "/<<PKGBUILDDIR>>/obj-arm-linux-gnueabihf/src/kernel-install/60-ukify.install", line 223, in <module>
    main()
  File "/<<PKGBUILDDIR>>/obj-arm-linux-gnueabihf/src/kernel-install/60-ukify.install", line 219, in main
    call_ukify(opts)
  File "/<<PKGBUILDDIR>>/obj-arm-linux-gnueabihf/src/kernel-install/60-ukify.install", line 205, in call_ukify
    ukify['finalize_options'](opts2)
  File "/<<PKGBUILDDIR>>/obj-arm-linux-gnueabihf/ukify", line 1423, in finalize_options
    opts.efi_arch = guess_efi_arch()
                    ^^^^^^^^^^^^^^^^
  File "/<<PKGBUILDDIR>>/obj-arm-linux-gnueabihf/ukify", line 78, in guess_efi_arch
    raise ValueError(f'Unsupported architecture {arch}')
ValueError: Unsupported architecture armv7l

14 months agoshell-completion: include units in 'verify' completions
Frantisek Sumsal [Mon, 24 Jul 2023 18:21:17 +0000 (20:21 +0200)] 
shell-completion: include units in 'verify' completions

Resolves: #28500

14 months agoMerge pull request #28505 from bluca/vconsole_debian
Luca Boccassi [Mon, 24 Jul 2023 17:02:32 +0000 (18:02 +0100)] 
Merge pull request #28505 from bluca/vconsole_debian

vconsole-setup: don't fail with an empty keymap

14 months agomkosi: set default-keymap='' on Debian/Ubuntu 28505/head
Luca Boccassi [Mon, 24 Jul 2023 14:35:47 +0000 (15:35 +0100)] 
mkosi: set default-keymap='' on Debian/Ubuntu

14 months agovconsole-setup: don't fail with an empty keymap
Luca Boccassi [Mon, 24 Jul 2023 14:31:02 +0000 (15:31 +0100)] 
vconsole-setup: don't fail with an empty keymap

The new meson option 'default-keymap' means that by default there's always
a keymap to configure, so vconsole-setup fails. Allow to set
-Ddefault-keymap="" to disable it and skip gracefully again.

Follow-up for f129d0e77c4c9a0e12ae38cd241cd49846844a80

14 months agoNEWS: update for rc3 v254-rc3
Luca Boccassi [Mon, 24 Jul 2023 11:03:20 +0000 (12:03 +0100)] 
NEWS: update for rc3

14 months agoMerge pull request #28503 from bluca/rc
Zbigniew Jędrzejewski-Szmek [Mon, 24 Jul 2023 11:42:17 +0000 (13:42 +0200)] 
Merge pull request #28503 from bluca/rc

RC busywork

14 months agoNEWS: update contributors list 28503/head
Luca Boccassi [Mon, 24 Jul 2023 10:46:33 +0000 (11:46 +0100)] 
NEWS: update contributors list

14 months agohwdb: run update-hwdb
Luca Boccassi [Mon, 24 Jul 2023 10:40:51 +0000 (11:40 +0100)] 
hwdb: run update-hwdb

git diff hwdb.d/*.hwdb looks sensible

14 months agoMerge pull request #28498 from bluca/softreboot
Luca Boccassi [Mon, 24 Jul 2023 10:36:16 +0000 (11:36 +0100)] 
Merge pull request #28498 from bluca/softreboot

softreboot: ensure all processes are killed

14 months agoMerge pull request #28497 from bluca/run
Luca Boccassi [Mon, 24 Jul 2023 10:20:06 +0000 (11:20 +0100)] 
Merge pull request #28497 from bluca/run

switch-root: use MS_REC for /run, unless we are soft-rebooting

14 months agoUpdate NEWS 28498/head
Luca Boccassi [Sat, 22 Jul 2023 22:35:49 +0000 (23:35 +0100)] 
Update NEWS

14 months agosoftreboot: ensure all processes are killed
Luca Boccassi [Sat, 22 Jul 2023 22:35:40 +0000 (23:35 +0100)] 
softreboot: ensure all processes are killed

Having surviving processes is not ready yet as a feature, so ensure
everything is killed on the transition for now

14 months agotest: check if we correctly propagate /run mounts during switch root 28497/head
Frantisek Sumsal [Wed, 19 Jul 2023 12:26:26 +0000 (14:26 +0200)] 
test: check if we correctly propagate /run mounts during switch root

Since 7c764d4 we bind mount certain directories during switch root
instead of moving the mount directly, and for /run we do this without
MS_REC. This, unfortunately, leaves all mounts under /run behind
in the old root, which breaks certain use cases.

See: https://github.com/systemd/systemd/issues/28452

14 months agoswitch-root: use MS_REC for /run, unless we are soft-rebooting
Luca Boccassi [Sat, 22 Jul 2023 21:45:16 +0000 (22:45 +0100)] 
switch-root: use MS_REC for /run, unless we are soft-rebooting

There are applications that rely on mounts under /run surviving the
switch from initrd to rootfs, so use MS_REC unless we are soft
rebooting.

Follow-up for 7c764d45997721705e43ac66fbb5a56747d00d40

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

14 months agoRevert "core: add IgnoreOnSoftReboot= unit option"
Luca Boccassi [Sat, 22 Jul 2023 22:27:15 +0000 (23:27 +0100)] 
Revert "core: add IgnoreOnSoftReboot= unit option"

The feature is not ready, postpone it

This reverts commit b80fc61e8971283606f9cd0a48e31d0f701c82f1.

14 months agoRevert "network: delay to configure address until it is removed on reconfigure"
Yu Watanabe [Sat, 22 Jul 2023 06:10:49 +0000 (15:10 +0900)] 
Revert "network: delay to configure address until it is removed on reconfigure"

This reverts commit 6e8477edd3a988357ad5f5fa6610904d44ec402c.

The commit intended to fix a race reported at #28009. However,
unfortunately, it does not fix the root of the race, and reveals
the race in more simple setups. See reports in #28358.

14 months agopo: Translated using Weblate (Czech)
Daniel Rusek [Sat, 22 Jul 2023 16:21:00 +0000 (18:21 +0200)] 
po: Translated using Weblate (Czech)

Currently translated at 93.3% (212 of 227 strings)

Co-authored-by: Daniel Rusek <mail@asciiwolf.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/cs/
Translation: systemd/main

14 months agotpm2: instead of adjusting authValue trailing 0(s), trim them as required by tpm...
Dan Streetman [Fri, 21 Jul 2023 15:23:22 +0000 (11:23 -0400)] 
tpm2: instead of adjusting authValue trailing 0(s), trim them as required by tpm spec

To keep compatibility with any existing object authValues with trailing 0's,
change tpm2_get_pin_auth() to trim trailing 0's, which is what the TPM
implementation will do. This should retain compatibility with any existing
authValues that contain trailing 0's.

Note that any existing authValues with trailing 0's are unlikely to have worked
in the way that systemd uses them in object sealing, which is as a bind key for
the encryption (and policy) session. However, it is better to be compatible
with the TPM spec (and implementations) even if previously created objects that
are affected may not have worked.

Fixes: #28414
14 months agoMerge pull request #28487 from yuwata/statx-fixlets
Luca Boccassi [Fri, 21 Jul 2023 22:09:40 +0000 (23:09 +0100)] 
Merge pull request #28487 from yuwata/statx-fixlets

util: fix error handling of statx()

14 months agoRevert "cryptenroll: drop unmet condition"
Dan Streetman [Fri, 21 Jul 2023 14:45:16 +0000 (10:45 -0400)] 
Revert "cryptenroll: drop unmet condition"

This reverts commit cefa4a02ab8f3c941e54b5ad1a90b5cf133264a7.

Because the first 'break' is inside a nested for loop, this second 'break' is
needed to exit the outer for loop.

Fixes: #28451
14 months agoMerge pull request #26541 from DaanDeMeyer/xfs-whitespace-fix
Luca Boccassi [Fri, 21 Jul 2023 17:58:27 +0000 (18:58 +0100)] 
Merge pull request #26541 from DaanDeMeyer/xfs-whitespace-fix

mkfs-util: Escape spaces with slashes in protofile format

14 months agofd-util: do not call statx() twice when it does not provide mount ID 28487/head
Yu Watanabe [Fri, 21 Jul 2023 16:31:16 +0000 (01:31 +0900)] 
fd-util: do not call statx() twice when it does not provide mount ID

Previously, in path_is_root_at(), if statx() does not provide mount ID,
path_get_mnt_id_at() was called, but it also calls statx(). Let's avoid
the second trial.

14 months agofd-util: make path_is_root_at() not fail even when /proc is mounted
Yu Watanabe [Fri, 21 Jul 2023 16:23:17 +0000 (01:23 +0900)] 
fd-util: make path_is_root_at() not fail even when /proc is mounted

path_get_mnt_id_at() -> fd_fdinfo_mnt_id() may return -EOPNOTSUPP when
/proc is mounted, and -ENOSYS otherwise, when an old kernel is used.

14 months agomountpoint-util: statx() may return EINVAL if the kernel does not support the syscall
Yu Watanabe [Fri, 21 Jul 2023 16:15:59 +0000 (01:15 +0900)] 
mountpoint-util: statx() may return EINVAL if the kernel does not support the syscall

When statx() is called with AT_STATX_DONT_SYNC, glibc's fallback code
returns EINVAL. See statx_generic() in glibc.

14 months agostat-util: fix error handling of statx()
Yu Watanabe [Fri, 21 Jul 2023 16:07:36 +0000 (01:07 +0900)] 
stat-util: fix error handling of statx()

When newer glibc is used, but kernel does not support statx(), then
glibc try to fallback with fstatat(). That's quite similar to our
implementation, but the supported flags are different, and if
unsupported flags are specified, it returns EINVAL.

Let's handle the case more gracefully.

14 months agoMerge pull request #28436 from rpigott/zsh-fixups
Zbigniew Jędrzejewski-Szmek [Fri, 21 Jul 2023 17:13:53 +0000 (19:13 +0200)] 
Merge pull request #28436 from rpigott/zsh-fixups

zsh systemctl completion fixups

14 months agocore: add IgnoreOnSoftReboot= unit option
Luca Boccassi [Thu, 20 Jul 2023 00:22:52 +0000 (01:22 +0100)] 
core: add IgnoreOnSoftReboot= unit option

As it says on the tin, configures the unit to survive a soft reboot.
Currently all the following options have to be set by hand:

Conflicts=reboot.target kexec.target poweroff.target halt.target
Before=reboot.target kexec.target poweroff.target halt.target
After=sysinit.target basic.target
DefaultDependencies=no
IgnoreOnIsolate=yes

This is not very user friendly. If new default dependencies are added,
or new shutdown/reboot types, they also have to be added manually.

The new option is much simpler, easy to find, and does the right thing
by default.

14 months agoMerge pull request #28460 from bluca/scope_run_env
Zbigniew Jędrzejewski-Szmek [Fri, 21 Jul 2023 13:41:56 +0000 (15:41 +0200)] 
Merge pull request #28460 from bluca/scope_run_env

run: disable --expand-environment by default for --scope

14 months agomkfs-util: Escape spaces with slashes in protofile format 26541/head
Daan De Meyer [Wed, 22 Feb 2023 13:36:14 +0000 (14:36 +0100)] 
mkfs-util: Escape spaces with slashes in protofile format

14 months agotest-ukify: use systemd-measure and bootctl in build directory
Yu Watanabe [Thu, 20 Jul 2023 11:26:24 +0000 (20:26 +0900)] 
test-ukify: use systemd-measure and bootctl in build directory

And skip tests if systemd-measure is not found.
Then, we can safely run test_ukify.py directly.

14 months agoxfs: Bump minimal size to 300M
Daan De Meyer [Fri, 21 Jul 2023 12:21:44 +0000 (14:21 +0200)] 
xfs: Bump minimal size to 300M

From the xfsprogs source code:

* We don't support filesystems smaller than 300MB anymore.  Tiny
* filesystems have never been XFS' design target.  This limit has been
* carefully calculated to prevent formatting with a log smaller than
* the "realistic" size.
*
* If the realistic log size is 64MB, there are four AGs, and the log
* AG should be at least 1/8 free after formatting, this gives us:
*
* 64MB * (8 / 7) * 4 = 293MB

So let's accommodate and bump the minimal XFS filesystem size to 300M.

14 months agohomework-luks: fix typos
Topi Miettinen [Fri, 21 Jul 2023 11:55:40 +0000 (11:55 +0000)] 
homework-luks: fix typos

14 months agoudev: decrease devlink priority for iso disks
Yu Watanabe [Fri, 21 Jul 2023 02:39:45 +0000 (11:39 +0900)] 
udev: decrease devlink priority for iso disks

Previously, if the priority is same, devlinks are always replaced by
newer events. The commit 331aa7aa15ee5dd12b369b276f575d521435eb52 changes
that to keep the existing devlink. That should not change any behavior
when the devices that request the same symlink do not have any
dependency, e.g. when /dev/sda1 and /dev/adb1 request the same
/dev/disk/by-label symlink, as there are no guarantee that which device
is processed first.

However, when devices has dependency, e.g. /dev/sda and /dev/sda1
request the same /dev/disk/by-label symlink, previously the symlink
always pointed to the partition, as the partition is always processed
later. But, 331aa7aa15ee5dd12b369b276f575d521435eb52 makes the symlink
point to the whole disk.

The change by 331aa7aa15ee5dd12b369b276f575d521435eb52 is crucial to
improve performance of devlink handling, especially when a system has
large number of disks with same label or so. Hence, cannot and should
not be reverted.

So, let's workaround the case, as such situation should happen only when
the disk is a hybrind ISO image, I guess.

Fixes #28468.

14 months agotree-wide: fix typo found by Fossies Codespell report
Yu Watanabe [Fri, 21 Jul 2023 10:12:08 +0000 (19:12 +0900)] 
tree-wide: fix typo found by Fossies Codespell report

14 months agorepart: Set sector size of loopback devices
Michael A Cassaniti [Fri, 21 Jul 2023 01:41:09 +0000 (11:41 +1000)] 
repart: Set sector size of loopback devices

When an explicit sector size is set by the user it is also necessary to set the
sector size of any loopback devices. If the sector size is not set for loopback
devices then it can cause file system creation to fail or run into odd issues.

14 months agoudev: downgrade log level when running without cgroup
Yu Watanabe [Fri, 21 Jul 2023 01:00:27 +0000 (10:00 +0900)] 
udev: downgrade log level when running without cgroup

The cgroup path is optional, hence it is not necessary to warn the
failure loudly.

Follow-up for f8371dbd56d27621932ecbe3f5c1246e925fd53a.

Closes #28469.

14 months agotree-wide: drop references to /dev/loop/by-ref
Yu Watanabe [Fri, 21 Jul 2023 01:24:17 +0000 (10:24 +0900)] 
tree-wide: drop references to /dev/loop/by-ref

Follow-up for #28476.

14 months agoMerge pull request #28476 from bluca/revert_loop_links
Yu Watanabe [Fri, 21 Jul 2023 01:21:06 +0000 (10:21 +0900)] 
Merge pull request #28476 from bluca/revert_loop_links

Revert "udev: add /dev/loop/ symlinks"

14 months agoRevert "udev: add /dev/loop/ symlinks" 28476/head
Luca Boccassi [Thu, 20 Jul 2023 21:28:13 +0000 (22:28 +0100)] 
Revert "udev: add /dev/loop/ symlinks"

Turns out this causes a regression and breaks losetup. It will need to
be reworked in conjunction with util-linux changes.

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

This reverts commit 5ac52d1f7b7cd11cad8b5c2e9812d7ee7560a517.

14 months agoRevert "test: test new systemd-dissect --attach/--detach/--loop-ref= and /dev/loop...
Luca Boccassi [Thu, 20 Jul 2023 21:26:40 +0000 (22:26 +0100)] 
Revert "test: test new systemd-dissect --attach/--detach/--loop-ref= and /dev/loop/* symlinks"

This reverts commit f5e46b9e09d4ff3f1e6ee6e3a90adc704780a661.

14 months agoNEWS: note that sd-run --expand-environment will change 28460/head
Luca Boccassi [Thu, 20 Jul 2023 16:41:38 +0000 (17:41 +0100)] 
NEWS: note that sd-run --expand-environment will change

14 months agorun: disable --expand-environment by default for --scope
Luca Boccassi [Wed, 19 Jul 2023 21:56:02 +0000 (22:56 +0100)] 
run: disable --expand-environment by default for --scope

The intention was to have this option enabled by default everywhere,
but unfortunately at least one case was found where it breaks
compatibility of a program using systemd-run --scopes and expecting
variables not to be expanded:

https://sources.debian.org/src/pbuilder/0.231/pbuilder-checkparams/#L400

Example run:

systemd-run --quiet --scope --description=pbuilder_build_xfce4-notes-plugin_1.10.0-1.dsc '--slice=system-pbuilder-build-xfce4\x2dnotes\x2dplugin_1.10.0\x2d1-449932.slice' chroot /var/cache/pbuilder/build/449932 dpkg-query -W '--showformat=${Version}' apt

Restore backward compatibility and make the option disabled by default
when --scope is used, and enabled by default for other types.

In case --expand-environment is not specified and a '$' character is
detected, print a warning to nudge users toward specifying the
parameter as needed. In the future we can then flip the default.

Follow-up for 2ed7a221fafb25eea937c4e86fb88ee501dba51e

14 months agotest: use XDG_STATE_HOME for %S and %L
Yu Watanabe [Thu, 20 Jul 2023 07:07:58 +0000 (16:07 +0900)] 
test: use XDG_STATE_HOME for %S and %L

This fixes the test failure when invoked by a user.
===
Running ./systemd-tmpfiles --user on 'f /tmp/test-systemd-tmpfiles.1foag_ur/test-content.n_9r_xhm/arg - - - - %S'
expect: '/home/watanabe/.config'
actual: '/home/watanabe/.local/state'
Traceback (most recent call last):
  File "/home/watanabe/git/systemd/test/test-systemd-tmpfiles.py", line 233, in <module>
    test_valid_specifiers(user=True)
  File "/home/watanabe/git/systemd/test/test-systemd-tmpfiles.py", line 135, in test_valid_specifiers
    test_content('f {} - - - - %S',
  File "/home/watanabe/git/systemd/test/test-systemd-tmpfiles.py", line 88, in test_content
    assert content == expected
           ^^^^^^^^^^^^^^^^^^^
AssertionError
===

This also makes the test uses fallback paths.

Follow-up for b50aadaff22f9b3ad3bbcbfd2edd661456a5b4bf.

14 months agotest: fix a syntax error in test-ukify
Yu Watanabe [Thu, 20 Jul 2023 07:42:35 +0000 (16:42 +0900)] 
test: fix a syntax error in test-ukify

Follow-up for d7d36252e5fdc345b110f824031e20f41ee75e86.

Fixes #28464.

14 months agozsh: use glob matching for template names 28436/head
Ronan Pigott [Wed, 19 Jul 2023 21:26:14 +0000 (14:26 -0700)] 
zsh: use glob matching for template names

Template names can be learned from the filesystem, so there isn't a need
to parse the output of systemctl list-unit-files in this case. This
should accelerate the completion of some verbs like enable.

14 months agozsh: remove unit property caching
Ronan Pigott [Tue, 18 Jul 2023 23:52:18 +0000 (16:52 -0700)] 
zsh: remove unit property caching

The existing caching policy isn't very sensible for this cache. We could
write a different policy, but I don't think there is much value in
caching these values, as in my experience the command used to generate
them is quick.

14 months agozsh: update default caching policy for units
Ronan Pigott [Mon, 17 Jul 2023 23:24:36 +0000 (16:24 -0700)] 
zsh: update default caching policy for units

The existing caching policy was completely bogus.

In the first stanza, despite the comment, the pattern given would
consider the cache invalid if it was more than 1 hour old.

The second stanza was also incorrect, since the output of `systemctl
--all` is not unit file paths, but unit names. When they were being
tested against the cachefile mtime, the test would always fail becuase
of the nonexistant file (hopefully).

In fact it's not very useful to test if the unit files have newer mtime
in this case anyway, since we are only caching their names. Also,
`systemctl --all` is an unfortunately slow operation to be used in
testing for the cache validity — we want this operation to at least be
faster than rebuilding the cache.

I've rewritten this stanza with my best guess at its original intent. It
now checks against the mtime of the parent directories in the search
path, which should be updated and cause the cache to rebuild when we
add, remove, or rename any unit files.

14 months agoman: clarify DNSSEC= again
Zbigniew Jędrzejewski-Szmek [Wed, 19 Jul 2023 12:16:15 +0000 (14:16 +0200)] 
man: clarify DNSSEC= again

https://github.com/systemd/systemd/pull/28407#issuecomment-1640900239

14 months agolocale-util: fix _() definition
Dmitry V. Levin [Tue, 18 Jul 2023 08:00:00 +0000 (08:00 +0000)] 
locale-util: fix _() definition

The previous definition was not quite appropriate for the library code
because it relied on the message domain set by textdomain() invocation
which is not necessarily the same message domain defined in
GETTEXT_PACKAGE macro.

The only code that uses _() so far is located in pam_systemd_home.c.

Fixes: 20f56fddcd5 ("Add gettext support")