]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
2 years agomachine: update to use new-style sd-bus macros (#23012)
Amarjargal [Fri, 8 Apr 2022 20:43:18 +0000 (04:43 +0800)] 
machine: update to use new-style sd-bus macros (#23012)

* machine: update to use new-style sd-bus macros

Replace old SD_BUS_METHOD_WITH_NAMES and SD_BUS_SIGNAL_WITH_NAMES macros to
the new SD_BUS_METHOD_WITH_ARGS and SD_BUS_SIGNAL_WITH_ARGS macros.

Meson test, mkosi test image and running machinectl after build returned
no error. But since I don't have any virtual machines or containers, I'm not
sure how to test the changes thoroughly.

2 years agoupdate TODO
Lennart Poettering [Fri, 8 Apr 2022 20:23:11 +0000 (22:23 +0200)] 
update TODO

2 years agospecifier: use %q for pretty hostname
Lennart Poettering [Fri, 8 Apr 2022 16:09:18 +0000 (18:09 +0200)] 
specifier: use %q for pretty hostname

%R is already used in service manager specifier expansion (cgroup root),
hence use a different char, that was so far not used.

Follow-up for: 6ceb0a4094908dd213a78b9f6d0c59a684831ab0

2 years agosystemd-creds: fix name of env var
Lennart Poettering [Fri, 8 Apr 2022 16:45:47 +0000 (18:45 +0200)] 
systemd-creds: fix name of env var

The env var is called $CREDENTIALS_DIRECTORY, not $CREDENTIALS_PATH. Fix
message about it accordingly.

2 years agoupdate TODO
Lennart Poettering [Fri, 8 Apr 2022 16:59:47 +0000 (18:59 +0200)] 
update TODO

2 years agoupdate TODO
Lennart Poettering [Fri, 8 Apr 2022 16:41:40 +0000 (18:41 +0200)] 
update TODO

2 years agoupdate TODO
Lennart Poettering [Fri, 8 Apr 2022 15:43:48 +0000 (17:43 +0200)] 
update TODO

2 years agomeson: explicitly include coverage tweaks when built w/ --coverage
Frantisek Sumsal [Fri, 8 Apr 2022 11:20:15 +0000 (13:20 +0200)] 
meson: explicitly include coverage tweaks when built w/ --coverage

To make sure we don't miss any _exit() calls let's move the
coverage-related tweaks into a separate header file and include it
explicitly on the compiler command line using -include when a coverage
build is requested.

Follow-up to c6552ad381003a23cde7c3228e7071f30465df35.

2 years agoMerge pull request #23009 from keszybz/fix-detection-of-libsystemd-shared-with-suffix
Lennart Poettering [Fri, 8 Apr 2022 13:43:09 +0000 (15:43 +0200)] 
Merge pull request #23009 from keszybz/fix-detection-of-libsystemd-shared-with-suffix

Fix detection of libsystemd-shared with suffix

2 years agonetwork: ignore errors when CONFIG_NET_SCHED is disabled
Yu Watanabe [Fri, 8 Apr 2022 06:33:42 +0000 (15:33 +0900)] 
network: ignore errors when CONFIG_NET_SCHED is disabled

Follow-ups for 828a81a93783248be15683c9639b85098f331328.

Fixes #23014.

2 years agoMerge pull request #22803 from medhefgo/boot-cflags
Luca Boccassi [Thu, 7 Apr 2022 23:00:54 +0000 (00:00 +0100)] 
Merge pull request #22803 from medhefgo/boot-cflags

meson: Add support for building efi binaries on multilib

2 years agoMerge pull request #23008 from poettering/loop-dissect-tweaks-safe
Luca Boccassi [Thu, 7 Apr 2022 20:42:47 +0000 (21:42 +0100)] 
Merge pull request #23008 from poettering/loop-dissect-tweaks-safe

loop-util tweaks

2 years agodissect: improve debug logging in probe_filesystem() 23008/head
Lennart Poettering [Thu, 7 Apr 2022 12:11:44 +0000 (14:11 +0200)] 
dissect: improve debug logging in probe_filesystem()

2 years agotest-loop-block: conditionalize things on HAVE_BLKID correctly
Lennart Poettering [Wed, 6 Apr 2022 09:57:13 +0000 (11:57 +0200)] 
test-loop-block: conditionalize things on HAVE_BLKID correctly

2 years agotest: allow specifying test threads/iterations/timeouts via cmdline
Lennart Poettering [Wed, 6 Apr 2022 09:49:08 +0000 (11:49 +0200)] 
test: allow specifying test threads/iterations/timeouts via cmdline

That's useful when running tests manually.

2 years agoloop-util: add debug message with details about acquired loopback device
Lennart Poettering [Tue, 5 Apr 2022 21:36:33 +0000 (23:36 +0200)] 
loop-util: add debug message with details about acquired loopback device

2 years agoloop-util: explicitly close loopback block device before sleeping
Lennart Poettering [Tue, 5 Apr 2022 21:34:44 +0000 (23:34 +0200)] 
loop-util: explicitly close loopback block device before sleeping

attach_empty() file takes a BSD file lock on the device, and we really
should release that before going to sleep. hence explicitly close the
block device before the sleep instead of relying on _cleanup_ to close
it after the sleep.

2 years agoloop-util: use ERRNO_IS_DEVICE_ABSENT() macro where appropriate
Lennart Poettering [Tue, 5 Apr 2022 21:34:16 +0000 (23:34 +0200)] 
loop-util: use ERRNO_IS_DEVICE_ABSENT() macro where appropriate

2 years agoloop-util: take a LOCK_EX BSD file lock on control device while we acquire a loopback...
Lennart Poettering [Tue, 5 Apr 2022 16:56:47 +0000 (18:56 +0200)] 
loop-util: take a LOCK_EX BSD file lock on control device while we acquire a loopback device

2 years agotest-loop-block: don't spawn threads in case N_THREADS is 1
Lennart Poettering [Tue, 5 Apr 2022 16:09:10 +0000 (18:09 +0200)] 
test-loop-block: don't spawn threads in case N_THREADS is 1

Let's simplify things if we are only supposed to create a single thread.
Makes it easier to debug things with gdb.

2 years agoloop-util: slightly rework device_has_block_children()
Lennart Poettering [Tue, 5 Apr 2022 15:00:38 +0000 (17:00 +0200)] 
loop-util: slightly rework device_has_block_children()

Let's match by devtype, i.e. the official way to distinguish "whole"
block devices from partitions.

Also add debug logging for devices we thus ignore.

2 years agoloop-util: let's cut trailing whitespace, not trailing lines
Lennart Poettering [Tue, 5 Apr 2022 14:58:32 +0000 (16:58 +0200)] 
loop-util: let's cut trailing whitespace, not trailing lines

This doesn't really make any real difference, given the file should only
contain a single line. But it's conceptually more correct to just remove
the trailing newline/whitespace then the whole lines coming after that.
i.e. if the file actually contains more lines than one, this should
probably be considered an error.

2 years agoci: Add ia32 EFI multilib test 22803/head
Jan Janssen [Wed, 23 Mar 2022 13:40:06 +0000 (14:40 +0100)] 
ci: Add ia32 EFI multilib test

This makes sure that building ia32 EFI binaries on x86_64 works.
We force gnu-efi support to ensure it's not skipped by accident
and provide the lib32 dir manually, because clang does not support
'--print-multi-os-directory', which is used to auto-detect it.

2 years agoboot: Restrict block IO buf size
Jan Janssen [Thu, 24 Mar 2022 09:35:30 +0000 (10:35 +0100)] 
boot: Restrict block IO buf size

2 years agomeson: Add support for building efi binaries on multilib
Jan Janssen [Wed, 2 Feb 2022 10:24:41 +0000 (11:24 +0100)] 
meson: Add support for building efi binaries on multilib

This allows building 32bit versions of efi binaries on x86_64 machines
and vice-versa by passing "-Defi-cflags=-m32" to meson, provided the
32bit gnu-efi and gcc-multilib are available.

It is expected that distros that want to provide both ia32 and x64
versions to use a second build dir to build the non-native version
by adding -m32 to efi-cflags and then running the sd-boot/sd-stub
ninja target directly.

2 years agomeson: Add efi-cflags option
Jan Janssen [Fri, 28 Jan 2022 10:33:23 +0000 (11:33 +0100)] 
meson: Add efi-cflags option

2 years agocore: fix dm-verity auto-discovery in MountImageUnit()
Luca Boccassi [Wed, 6 Apr 2022 16:25:35 +0000 (17:25 +0100)] 
core: fix dm-verity auto-discovery in MountImageUnit()

The implementation of MountImageUnit()/systemctl mount-image was
changed to use a /proc/self/fd path as the source, but that causes
the dm-verity files autodiscovery to fail, as it looks for files
in the same directory as the image.

Use the original file path when setting up dm-verity.

2 years agosyscalls: update syscall definitions 23009/head
Zbigniew Jędrzejewski-Szmek [Thu, 7 Apr 2022 12:53:11 +0000 (14:53 +0200)] 
syscalls: update syscall definitions

2 years agovarious: add missing "#pragma once"
Zbigniew Jędrzejewski-Szmek [Thu, 7 Apr 2022 12:51:55 +0000 (14:51 +0200)] 
various: add missing "#pragma once"

2 years agoMerge parse-socket-bind-item.? into parse-helpers.?
Zbigniew Jędrzejewski-Szmek [Thu, 7 Apr 2022 12:03:26 +0000 (14:03 +0200)] 
Merge parse-socket-bind-item.? into parse-helpers.?

That file only exported one function, and it fits nicely within the scope of
"parse helpers". Let's move it there to reduce the file count a bit.

No functional change.

2 years agoMove path_simplify_and_warn() to new shared/parse-helpers.c
Zbigniew Jędrzejewski-Szmek [Thu, 7 Apr 2022 11:43:18 +0000 (13:43 +0200)] 
Move path_simplify_and_warn() to new shared/parse-helpers.c

This is a high-level function, and it belongs in libsystemd-shared. This way we
don't end up linking a separate copy into various binaries. It would even end
up in libsystemd, where it is not needed. (Maybe it'd be removed in some
optimization phase, but it's better to not rely on that.)

$ grep -l -r -a 'path is not absolute%s' build/
build/libnss_systemd.so.2
build/pam_systemd_home.so
build/test-dlopen
build/src/basic/libbasic.a.p/path-util.c.o
build/src/basic/libbasic.a
build/src/shared/libsystemd-shared-249.so
build/test-bus-error
build/libnss_mymachines.so.2
build/pam_systemd.so
build/libnss_resolve.so.2
build/libnss_myhostname.so.2
build/libsystemd.so.0.32.0
build/libudev.so.1.7.2

$ grep -l -r -a 'path is not absolute%s' build/
build/src/shared/libsystemd-shared-251.a.p/parse-helpers.c.o
build/src/shared/libsystemd-shared-251.a
build/src/shared/libsystemd-shared-251.so

No functional change.

2 years agotest-nspawn-util: fix the test to actually find anything
Zbigniew Jędrzejewski-Szmek [Thu, 7 Apr 2022 10:33:25 +0000 (12:33 +0200)] 
test-nspawn-util: fix the test to actually find anything

We would use a relative path, looking for globs like
'lib/systemd/libsystemd-shared-*.so' under the build directory, and never find
anything.

The test was supposed to find library in the current installation. But we
cannot assume that the right library is installed, so the test only printed the
result for manual inspection. Thus nobody noticed when it broke. I think it
broke in c6134d3e2f1d1d17b32b6e06556cd0c5429bc78a, path-util: get rid of prefix_root().
But that commit doesn't compile because of changes in meson, so this is just
a guess.

Before:
/* test_systemd_installation_has_version */
Current installation has systemd >= 0: no
Current installation has systemd >= 231: no
Current installation has systemd >= 249: no
Current installation has systemd >= 999: no

With the fix:
$ build/test-nspawn-util
/* test_systemd_installation_has_version */
Found libsystemd shared at "/lib/systemd/libsystemd-shared-245.so.so", version 245 (OK).
Current installation has systemd >= 0: yes
Found libsystemd shared at "/lib/systemd/libsystemd-shared-245.so.so", version 245 (OK).
Current installation has systemd >= 231: yes
Found libsystemd shared at "/lib/systemd/libsystemd-shared-245.so.so", version 245 (too old).
Found libsystemd shared at "/lib/systemd/libsystemd-shared-251.so.so", version 251 (OK).
Current installation has systemd >= 251: yes
Found libsystemd shared at "/lib/systemd/libsystemd-shared-245.so.so", version 245 (too old).
Found libsystemd shared at "/lib/systemd/libsystemd-shared-251.so.so", version 251 (too old).
Found libsystemd shared at "/lib/systemd/libsystemd-shared-250.so.so", version 250 (too old).
Found libsystemd shared at "/usr/lib/systemd/libsystemd-shared-245.so.so", version 245 (too old).
Found libsystemd shared at "/usr/lib/systemd/libsystemd-shared-251.so.so", version 251 (too old).
Found libsystemd shared at "/usr/lib/systemd/libsystemd-shared-250.so.so", version 250 (too old).
Current installation has systemd >= 999: no

$ build/test-nspawn-util /var/lib/machines/rawhide
/* test_systemd_installation_has_version */
/* test_systemd_installation_has_version */
Found libsystemd shared at "/var/lib/machines/rawhide/lib/systemd/libsystemd-shared-251-rc1-1.fc37.so.so", version 251 (OK).
/var/lib/machines/rawhide has systemd >= 0: yes
Found libsystemd shared at "/var/lib/machines/rawhide/lib/systemd/libsystemd-shared-251-rc1-1.fc37.so.so", version 251 (OK).
/var/lib/machines/rawhide has systemd >= 231: yes
Found libsystemd shared at "/var/lib/machines/rawhide/lib/systemd/libsystemd-shared-251-rc1-1.fc37.so.so", version 251 (OK).
/var/lib/machines/rawhide has systemd >= 251: yes
Found libsystemd shared at "/var/lib/machines/rawhide/lib/systemd/libsystemd-shared-251-rc1-1.fc37.so.so", version 251 (too old).
Found libsystemd shared at "/var/lib/machines/rawhide/usr/lib/systemd/libsystemd-shared-251-rc1-1.fc37.so.so", version 251 (too old).
/var/lib/machines/rawhide has systemd >= 999: no

While at it, NULSTR_FOREACH → FOREACH_STRING.

2 years agonspawn: fix comparisons of versions with non-numerical suffixes
Zbigniew Jędrzejewski-Szmek [Thu, 7 Apr 2022 10:15:04 +0000 (12:15 +0200)] 
nspawn: fix comparisons of versions with non-numerical suffixes

See a2b0cd3f5ab3f450e74e2085ad20372a05451c74. When -Dshared-lib-tag is used,
libsystemd-shared.so and libsystemd-core.so get a suffix which breaks the
parsing done by systemd_installation_has_version(). We can assume that the
tag will be something like "251-rc1-1.fc37" that is currently used in Fedora.
(Anything that does *not* start with the version would be completely crazy.)
By switching to strverscmp_improved() we simplify the code and fix comparisons
with such versions.

$ build/test-nspawn-util /var/lib/machines/rawhide
...
Found libsystemd shared at "/var/lib/machines/rawhide/lib/systemd/libsystemd-shared-251-rc1-1.fc37.so.so", version 251-rc1-1.fc37 (OK).
/var/lib/machines/rawhide has systemd >= 251: yes
...

I noticed this when I started a systemd-nspawn container with Redora rawhide
and got the message "Not running with unified cgroup hierarchy, LSM BPF is not
supported". I thought the message is in error, but it was actually correct:
nspawn was misdetecting that the container does not sport new-enough systemd
to support cgroups-v2.

2 years agoMove systemd_installation_has_version() to src/nspawn/
Zbigniew Jędrzejewski-Szmek [Thu, 7 Apr 2022 09:51:52 +0000 (11:51 +0200)] 
Move systemd_installation_has_version() to src/nspawn/

This function implements a heuristic that is only used by nspawn. It doesn't
belong in basic. I opted for a new file "nspawn-utils.c", because it seems
likely that we'll need some other new utilities like that in the future.

No functional change.

2 years agocalendarspec: fix possibly skips next elapse
Gibeom Gwon [Sun, 6 Mar 2022 00:45:38 +0000 (09:45 +0900)] 
calendarspec: fix possibly skips next elapse

If the time unit changes after adding the repetition value, the
timer may skip the next elapse. This patch reset sub time units
to minimum value when upper unit is changed.

Fixes #22665.

2 years agoMerge pull request #21795 from Werkov/bfq-io-weight-2
Zbigniew Jędrzejewski-Szmek [Thu, 7 Apr 2022 15:23:16 +0000 (17:23 +0200)] 
Merge pull request #21795 from Werkov/bfq-io-weight-2

IODeviceWeight= configures bfq.io.weight  too

2 years agoMerge pull request #23000 from mrc0mmand/coverage__exit
Frantisek Sumsal [Thu, 7 Apr 2022 13:08:55 +0000 (13:08 +0000)] 
Merge pull request #23000 from mrc0mmand/coverage__exit

macro: call __gcov_dump() before _exit() w/ coverage enabled

2 years agotest: ignore missing coverage in TEST-02 23000/head
Frantisek Sumsal [Thu, 7 Apr 2022 10:45:13 +0000 (12:45 +0200)] 
test: ignore missing coverage in TEST-02

Since c6552ad we now try to collect coverage even in situations where
it's basically impossible (like in test-mount-util where the whole / is
mounted as read-only). As dealing with this is not worth the trouble,
let's ignore the missing coverage errors thrown by gcov in such cases.

2 years agoREADME: add one more kernel-version line
Zbigniew Jędrzejewski-Szmek [Thu, 7 Apr 2022 09:23:32 +0000 (11:23 +0200)] 
README: add one more kernel-version line

I want to add as many as possible to show people that each kernel version
has something nice to entice them to keep moving up ;)

2 years agocore: inline an iterator variable
Zbigniew Jędrzejewski-Szmek [Thu, 7 Apr 2022 09:22:08 +0000 (11:22 +0200)] 
core: inline an iterator variable

2 years agomacro: call __gcov_dump() before _exit() w/ coverage enabled
Frantisek Sumsal [Wed, 6 Apr 2022 17:41:01 +0000 (19:41 +0200)] 
macro: call __gcov_dump() before _exit() w/ coverage enabled

_exit() skips at-exit hooks, causing lost coverage from processes
utilizing it.

Hopefully resolves systemd/systemd-centos-ci#482

2 years agosd-ipv4acd: actually drop the arp packet from one of the host interface
Yu Watanabe [Wed, 6 Apr 2022 18:38:56 +0000 (03:38 +0900)] 
sd-ipv4acd: actually drop the arp packet from one of the host interface

Fixes a bug in 7f77917c0effe92d5fed52503bceddabcb4667ba.

Fixes #23001.

2 years agosemaphoreci: re-enable rebooting tests
Luca Boccassi [Thu, 7 Apr 2022 00:18:53 +0000 (01:18 +0100)] 
semaphoreci: re-enable rebooting tests

Fixed by https://salsa.debian.org/systemd-team/systemd/-/commit/5738b62f5544d040550a018dcd02701bac4feec8

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

2 years agoMerge pull request #22965 from enr0n/oomd-used-memory-calc
Anita Zhang [Wed, 6 Apr 2022 23:42:46 +0000 (16:42 -0700)] 
Merge pull request #22965 from enr0n/oomd-used-memory-calc

oomd: calculate 'used' memory with MemAvailable instead of MemFree

2 years agoshutdown: get only active md arrays.
Mariusz Tkaczyk [Tue, 29 Mar 2022 10:49:54 +0000 (12:49 +0200)] 
shutdown: get only active md arrays.

Current md_list_get() implementation filters all block devices, started from
"md*". This is ambiguous because list could contain:
- partitions created upon md device (mdXpY)
- external metadata container- specific type of md array.

For partitions there is no issue, because they aren't handle STOP_ARRAY
ioctl sent later. It generates misleading errors only.

Second case is more problematic because containers are not locked in kernel.
They are stopped even if container member array is active. For that reason
reboot or shutdown flow could be blocked because metadata manager cannot be
restarted after switch root on shutdown.

Add filters to remove partitions and containers from md_list. Partitions
can be excluded by DEVTYPE. Containers are determined by MD_LEVEL
property, we are excluding all with "container" value.

Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
2 years agocore: taint if /usr is unmerged
Luca Boccassi [Tue, 5 Apr 2022 19:37:59 +0000 (20:37 +0100)] 
core: taint if /usr is unmerged

9afd5e7b975e8051c011ff9c07c95e80bd954469 introduced a build-time
taint, introduce a runtime one as well, in preparation for
removing support for unmerged-usr in a future release

2 years agoMerge pull request #22996 from yuwata/test-sfdisk-lock
Frantisek Sumsal [Wed, 6 Apr 2022 20:47:12 +0000 (20:47 +0000)] 
Merge pull request #22996 from yuwata/test-sfdisk-lock

test: use "udevadm lock" more

2 years agotest: drop unnecessary use of loop device 22996/head
Yu Watanabe [Wed, 6 Apr 2022 16:39:20 +0000 (01:39 +0900)] 
test: drop unnecessary use of loop device

To avoid inferences with udevd.

2 years agotest: use udevadm lock when partitioning block devices
Yu Watanabe [Wed, 6 Apr 2022 16:35:26 +0000 (01:35 +0900)] 
test: use udevadm lock when partitioning block devices

We can use `sfdisk --lock` for these cases, but some CI environments
have old sfdisk which does not support `--lock` option.

2 years agoupdate TODO
Lennart Poettering [Wed, 6 Apr 2022 16:37:51 +0000 (18:37 +0200)] 
update TODO

2 years agotest: --initialized=yes is the default for udevadm wait
Yu Watanabe [Wed, 6 Apr 2022 12:42:44 +0000 (21:42 +0900)] 
test: --initialized=yes is the default for udevadm wait

2 years agoMerge pull request #22993 from keszybz/refactor-manager_taint_string()
Yu Watanabe [Wed, 6 Apr 2022 15:36:45 +0000 (00:36 +0900)] 
Merge pull request #22993 from keszybz/refactor-manager_taint_string()

Refactor manager_taint_string()

2 years agohwdb: drop boilerplate about match patterns being unstable
Zbigniew Jędrzejewski-Szmek [Wed, 6 Apr 2022 09:56:05 +0000 (11:56 +0200)] 
hwdb: drop boilerplate about match patterns being unstable

We've had this text since the beginning, but in fact the patterns must be
stable in order for people to create local hwdb entries. And we support that
and can't change the match patterns without being very careful. So let's just
drop the text.

2 years agoanalyze: Fix verify exit status regression
Daan De Meyer [Wed, 6 Apr 2022 10:15:33 +0000 (12:15 +0200)] 
analyze: Fix verify exit status regression

Previously, systemd-analyze verify would return 0 even if warnings
were raised during analysis of the specified units or their
dependencies. With 3cc3dc7, verify was changed to return 1 when
warnings were raised.

This commit changes the default mode to _RECURSIVE_ERRORS_INVALID
so that verify returns zero again by default when warnings are
raised.

2 years agoREADME: rawhide -> Rawhide
Yu Watanabe [Wed, 6 Apr 2022 14:05:59 +0000 (23:05 +0900)] 
README: rawhide -> Rawhide

2 years agoREADME: add rawhide SELinux build status (#22997)
Yu Watanabe [Wed, 6 Apr 2022 14:13:10 +0000 (23:13 +0900)] 
README: add rawhide SELinux build status (#22997)

Co-authored-by: Frantisek Sumsal <frantisek@sumsal.cz>
2 years agoMerge pull request #22983 from yuwata/login-use-symlinks-under-static_node-tags
Yu Watanabe [Wed, 6 Apr 2022 14:11:56 +0000 (23:11 +0900)] 
Merge pull request #22983 from yuwata/login-use-symlinks-under-static_node-tags

login: shorten code a bit

2 years agoudev: add a brief comment about the origin of the filters
Yu Watanabe [Wed, 6 Apr 2022 11:18:51 +0000 (20:18 +0900)] 
udev: add a brief comment about the origin of the filters

I am not sure whether the original discussions are correct or not.
This is just for adding references for future verification for the
filters.

2 years agobasic/strv: fix typos and confusion whether we are escaping or unescaping 22993/head
Zbigniew Jędrzejewski-Szmek [Wed, 6 Apr 2022 10:50:44 +0000 (12:50 +0200)] 
basic/strv: fix typos and confusion whether we are escaping or unescaping

2 years agoAdd new test-manager.c and "test" manager_taint_string()
Zbigniew Jędrzejewski-Szmek [Wed, 6 Apr 2022 10:42:58 +0000 (12:42 +0200)] 
Add new test-manager.c and "test" manager_taint_string()

It seems it doesn't fit well anywhere else.

2 years agomanager: rework manager_taint_string()
Zbigniew Jędrzejewski-Szmek [Wed, 6 Apr 2022 10:26:50 +0000 (12:26 +0200)] 
manager: rework manager_taint_string()

When I see stpcpy, my brain bleeds. This function was too complicated
for it's own good.

2 years agologin: shorten code a bit 22983/head
Yu Watanabe [Tue, 5 Apr 2022 18:51:54 +0000 (03:51 +0900)] 
login: shorten code a bit

The symlinks under /run/udev/static_node-tags are pointing to the
corresponding device nodes. Let's read the symlinks.

2 years agoMerge pull request #22981 from yuwata/udev-node-cleanups
Yu Watanabe [Wed, 6 Apr 2022 10:34:59 +0000 (19:34 +0900)] 
Merge pull request #22981 from yuwata/udev-node-cleanups

udev: cleanups for device node handling

2 years agoMerge pull request #22985 from bluca/semaphore
Frantisek Sumsal [Wed, 6 Apr 2022 10:27:17 +0000 (10:27 +0000)] 
Merge pull request #22985 from bluca/semaphore

Semaphore CI fixes

2 years agoMerge pull request #22968 from keszybz/kernel-4.4
Lennart Poettering [Wed, 6 Apr 2022 10:03:47 +0000 (12:03 +0200)] 
Merge pull request #22968 from keszybz/kernel-4.4

Recommend kernel 4.15 or newer

2 years agoudev/net_id: avoid slot based names only for single function devices
Michal Sekletar [Wed, 23 Mar 2022 16:34:12 +0000 (17:34 +0100)] 
udev/net_id: avoid slot based names only for single function devices

If we have two or more devices that share the same slot but they are
also multifunction then it is OK to use the slot information even if it
is the same for all of them. Name conflict will be avoided because we
will append function number and form names like, ens1f1, ens1f2...

2 years agosemaphoreci: skip boot-and-services test 22985/head
Luca Boccassi [Wed, 6 Apr 2022 00:04:14 +0000 (01:04 +0100)] 
semaphoreci: skip boot-and-services test

It started failing, disable it for now

2 years agosemaphoreci: move runner from Bionic to Focal
Luca Boccassi [Tue, 5 Apr 2022 21:15:42 +0000 (22:15 +0100)] 
semaphoreci: move runner from Bionic to Focal

2 years agotest-network: rename one .netdev to make the file removed after the test
Yu Watanabe [Wed, 6 Apr 2022 05:41:50 +0000 (14:41 +0900)] 
test-network: rename one .netdev to make the file removed after the test

Follow-up for 7809cab71738aa582ac30e7dbc8d1e76c303ff9e.

2 years agoudevadm: lock: fix TOCTOU
Yu Watanabe [Tue, 5 Apr 2022 16:17:23 +0000 (01:17 +0900)] 
udevadm: lock: fix TOCTOU

Fixes CID#1487744.

2 years agoudev: move apply_static_dev_perms() to udev-node.c 22981/head
Yu Watanabe [Tue, 5 Apr 2022 17:31:19 +0000 (02:31 +0900)] 
udev: move apply_static_dev_perms() to udev-node.c

and make it internally use udev_node_apply_permissions_impl().

2 years agoudev: upgrade mode in udev_node_apply_permissions_impl()
Yu Watanabe [Tue, 5 Apr 2022 17:20:11 +0000 (02:20 +0900)] 
udev: upgrade mode in udev_node_apply_permissions_impl()

2 years agoudev: split udev_node_apply_permissions() into two
Yu Watanabe [Tue, 5 Apr 2022 16:51:47 +0000 (01:51 +0900)] 
udev: split udev_node_apply_permissions() into two

2 years agoudev: drop unnecessary code
Yu Watanabe [Tue, 5 Apr 2022 16:35:04 +0000 (01:35 +0900)] 
udev: drop unnecessary code

Follow-up for 78e278ad48e0d2854f950f261804fde70121820e.

2 years agoMerge pull request #22980 from keszybz/test-help-and-version-output
Yu Watanabe [Wed, 6 Apr 2022 04:42:12 +0000 (13:42 +0900)] 
Merge pull request #22980 from keszybz/test-help-and-version-output

Test --help and --version output in more cases

2 years agosemaphoreci: speed up package installation
Luca Boccassi [Tue, 5 Apr 2022 22:45:27 +0000 (23:45 +0100)] 
semaphoreci: speed up package installation

Disable updating the manpage database, and use dpkg's unsafe-io flag

2 years agosemaphoreci: run dhclient manually on setup
Luca Boccassi [Tue, 5 Apr 2022 21:23:49 +0000 (22:23 +0100)] 
semaphoreci: run dhclient manually on setup

For some reason the guest container stopped having its
network interface configured. Run the dhcp client manually.

2 years agosemaphoreci: check keys.opengpgp.org first
Luca Boccassi [Tue, 5 Apr 2022 21:11:55 +0000 (22:11 +0100)] 
semaphoreci: check keys.opengpgp.org first

Always resolves and it's faster than the others

+ for keyserver in "" "keys.gnupg.net" "keys.openpgp.org" "keyserver.ubuntu.com"
+ for retry in {1..5}
+ sudo lxc-create -n bullseye-amd64 -t download -- -d debian -r bullseye -a amd64
Setting up the GPG keyring
ERROR: Unable to fetch GPG key from keyserver
lxc-create: bullseye-amd64: lxccontainer.c: create_run_template: 1617 Failed to create container from template
lxc-create: bullseye-amd64: tools/lxc_create.c: main: 327 Failed to create container bullseye-amd64
+ sleep 1
+ for retry in {1..5}
+ sudo lxc-create -n bullseye-amd64 -t download -- -d debian -r bullseye -a amd64
Setting up the GPG keyring
ERROR: Unable to fetch GPG key from keyserver
lxc-create: bullseye-amd64: lxccontainer.c: create_run_template: 1617 Failed to create container from template
lxc-create: bullseye-amd64: tools/lxc_create.c: main: 327 Failed to create container bullseye-amd64
+ sleep 4
+ for retry in {1..5}
+ sudo lxc-create -n bullseye-amd64 -t download -- -d debian -r bullseye -a amd64
Setting up the GPG keyring
ERROR: Unable to fetch GPG key from keyserver
lxc-create: bullseye-amd64: lxccontainer.c: create_run_template: 1617 Failed to create container from template
lxc-create: bullseye-amd64: tools/lxc_create.c: main: 327 Failed to create container bullseye-amd64
+ sleep 9
+ for retry in {1..5}
+ sudo lxc-create -n bullseye-amd64 -t download -- -d debian -r bullseye -a amd64
Setting up the GPG keyring
ERROR: Unable to fetch GPG key from keyserver
lxc-create: bullseye-amd64: lxccontainer.c: create_run_template: 1617 Failed to create container from template
lxc-create: bullseye-amd64: tools/lxc_create.c: main: 327 Failed to create container bullseye-amd64
+ sleep 16
+ for retry in {1..5}
+ sudo lxc-create -n bullseye-amd64 -t download -- -d debian -r bullseye -a amd64
Setting up the GPG keyring
ERROR: Unable to fetch GPG key from keyserver
lxc-create: bullseye-amd64: lxccontainer.c: create_run_template: 1617 Failed to create container from template
lxc-create: bullseye-amd64: tools/lxc_create.c: main: 327 Failed to create container bullseye-amd64
+ sleep 25
+ for keyserver in "" "keys.gnupg.net" "keys.openpgp.org" "keyserver.ubuntu.com"
+ for retry in {1..5}
+ sudo lxc-create -n bullseye-amd64 -t download -- -d debian -r bullseye -a amd64 --keyserver keys.gnupg.net
Setting up the GPG keyring
ERROR: Unable to fetch GPG key from keyserver
lxc-create: bullseye-amd64: lxccontainer.c: create_run_template: 1617 Failed to create container from template
lxc-create: bullseye-amd64: tools/lxc_create.c: main: 327 Failed to create container bullseye-amd64
+ sleep 1
+ for retry in {1..5}
+ sudo lxc-create -n bullseye-amd64 -t download -- -d debian -r bullseye -a amd64 --keyserver keys.gnupg.net
Setting up the GPG keyring
ERROR: Unable to fetch GPG key from keyserver
lxc-create: bullseye-amd64: lxccontainer.c: create_run_template: 1617 Failed to create container from template
lxc-create: bullseye-amd64: tools/lxc_create.c: main: 327 Failed to create container bullseye-amd64
+ sleep 4
+ for retry in {1..5}
+ sudo lxc-create -n bullseye-amd64 -t download -- -d debian -r bullseye -a amd64 --keyserver keys.gnupg.net
Setting up the GPG keyring
ERROR: Unable to fetch GPG key from keyserver
lxc-create: bullseye-amd64: lxccontainer.c: create_run_template: 1617 Failed to create container from template
lxc-create: bullseye-amd64: tools/lxc_create.c: main: 327 Failed to create container bullseye-amd64
+ sleep 9
+ for retry in {1..5}
+ sudo lxc-create -n bullseye-amd64 -t download -- -d debian -r bullseye -a amd64 --keyserver keys.gnupg.net
Setting up the GPG keyring
ERROR: Unable to fetch GPG key from keyserver
lxc-create: bullseye-amd64: lxccontainer.c: create_run_template: 1617 Failed to create container from template
lxc-create: bullseye-amd64: tools/lxc_create.c: main: 327 Failed to create container bullseye-amd64
+ sleep 16
+ for retry in {1..5}
+ sudo lxc-create -n bullseye-amd64 -t download -- -d debian -r bullseye -a amd64 --keyserver keys.gnupg.net
Setting up the GPG keyring
ERROR: Unable to fetch GPG key from keyserver
lxc-create: bullseye-amd64: lxccontainer.c: create_run_template: 1617 Failed to create container from template
lxc-create: bullseye-amd64: tools/lxc_create.c: main: 327 Failed to create container bullseye-amd64
+ sleep 25
+ for keyserver in "" "keys.gnupg.net" "keys.openpgp.org" "keyserver.ubuntu.com"
+ for retry in {1..5}
+ sudo lxc-create -n bullseye-amd64 -t download -- -d debian -r bullseye -a amd64 --keyserver keys.openpgp.org
Setting up the GPG keyring
Downloading the image index
Downloading the rootfs

2 years agomeson: make kernel-install a template file, add --version, add to tests 22980/head
Zbigniew Jędrzejewski-Szmek [Tue, 5 Apr 2022 16:18:56 +0000 (18:18 +0200)] 
meson: make kernel-install a template file, add --version, add to tests

In --help output, change "$0" → "kernel-install". We generally don't include
the full path in --help output, and let's not do this here either.

kernel-install is now in build/ directly, not in the subdirectory.

2 years agomeson: also allow setting GIT_VERSION via templates
Zbigniew Jędrzejewski-Szmek [Tue, 5 Apr 2022 14:52:44 +0000 (16:52 +0200)] 
meson: also allow setting GIT_VERSION via templates

GIT_VERSION is not available as a config.h variable, because it's rendered
into version.h during builds. Let's rework jinja2 rendering to also
parse version.h. No functional change, the new variable is so far unused.

I guess this will make partial rebuilds a bit slower, but it's useful
to be able to use the full version string.

2 years agotest: do --help/--version checks for systemd, firstboot, cryptenroll, s-n-w-o
Zbigniew Jędrzejewski-Szmek [Tue, 5 Apr 2022 12:12:52 +0000 (14:12 +0200)] 
test: do --help/--version checks for systemd, firstboot, cryptenroll, s-n-w-o

I basically went by the list in systemd.directives for --help/-h.
kernel-install is also listed there, but will be added in a later commit.

2 years agofirstboot: make --help output fit in 80 columns
Zbigniew Jędrzejewski-Szmek [Tue, 5 Apr 2022 12:11:42 +0000 (14:11 +0200)] 
firstboot: make --help output fit in 80 columns

A long name of one parameter was making the whole thing very wide.
I think that it's obvious from the context what the argument is,
so a shorter name should be just as good.

2 years agopid1: make --help output fit in 80 columns
Zbigniew Jędrzejewski-Szmek [Tue, 5 Apr 2022 12:10:04 +0000 (14:10 +0200)] 
pid1: make --help output fit in 80 columns

2 years agotest/check-help: check that --help and -h are identical
Zbigniew Jędrzejewski-Szmek [Tue, 5 Apr 2022 09:00:59 +0000 (11:00 +0200)] 
test/check-help: check that --help and -h are identical

2 years agotests: add a smoke test for --version option in binaries
Zbigniew Jędrzejewski-Szmek [Tue, 5 Apr 2022 08:51:21 +0000 (10:51 +0200)] 
tests: add a smoke test for --version option in binaries

This is very similar to (and directly based on) the test for --help. I think
it's nice to do this: the test is very quick, but it'll catch cases where we
forgot to hook up the option, or forgot to exit after printing --version, and
it'll also increase our test coverage a bit.

2 years agohwdb: fix parsing options
Yu Watanabe [Tue, 5 Apr 2022 16:08:35 +0000 (01:08 +0900)] 
hwdb: fix parsing options

Fixes #22976.

2 years agomanager: fix typo 22968/head
Zbigniew Jędrzejewski-Szmek [Tue, 5 Apr 2022 18:31:59 +0000 (20:31 +0200)] 
manager: fix typo

I guess that we could make an overflow if all the taint flags were set.

2 years agoREADME: describe taint flags and how to check them
Zbigniew Jędrzejewski-Szmek [Tue, 5 Apr 2022 18:31:03 +0000 (20:31 +0200)] 
README: describe taint flags and how to check them

We should have this somewhere. We talk about versions of things
in the README, so it seems as good a place as any.

2 years agoREADME: say kernel 4.15 is the minimum recommended
Zbigniew Jędrzejewski-Szmek [Tue, 5 Apr 2022 08:24:27 +0000 (10:24 +0200)] 
README: say kernel 4.15 is the minimum recommended

After various long discussions
(https://lists.freedesktop.org/archives/systemd-devel/2022-March/047587.html,
https://lwn.net/Articles/889610/), there is no clear answer what the minimum
version should be. Bumping the version above 3.15 doesn't allow us to make any
significant simplifications (unless we went *much* higher). In particular, even
renameat2() is not fully supported with latest kernel versions, e.g. nfs still
doesn't have it. And the bpf stuff is optional anyway. So let's just say that
4.15 is what we recommend, because it provides fairly complete cgroups-v2, but
without any removals of compat in the code.

2 years agoMerge pull request #22975 from poettering/logind-longpress-followup
Lennart Poettering [Tue, 5 Apr 2022 16:42:17 +0000 (18:42 +0200)] 
Merge pull request #22975 from poettering/logind-longpress-followup

logind: "long press" follow-up

2 years agocore: command argument can be longer than PATH_MAX
Yu Watanabe [Tue, 5 Apr 2022 12:47:46 +0000 (21:47 +0900)] 
core: command argument can be longer than PATH_MAX

Fixes a bug introduced by 065364920281e1cf59cab989e17aff21790505c4.

Fixes #22957.

2 years agoman: split an overly long paragraph in two 22975/head
Lennart Poettering [Tue, 5 Apr 2022 13:59:01 +0000 (15:59 +0200)] 
man: split an overly long paragraph in two

2 years agologind: also show long press settings in default logind.conf
Lennart Poettering [Tue, 5 Apr 2022 13:52:49 +0000 (15:52 +0200)] 
logind: also show long press settings in default logind.conf

The configuration options where added back in
a520bb665417af7aa98dcb983f3583659bbab807 but this was never actually
added to the default logind.conf.

Follow-up-for: a520bb665417af7aa98dcb983f3583659bbab807
Follow-up-for: #19917

2 years agologind: expose long press actions on D-Bus
Lennart Poettering [Tue, 5 Apr 2022 13:50:56 +0000 (15:50 +0200)] 
logind: expose long press actions on D-Bus

The settings and internal varables were added, but this was never
exposed on the bus. Add that.

Follow-up-for: a520bb665417af7aa98dcb983f3583659bbab807
Follow-up-for: #19917

2 years agooomd: calculate 'used' memory with MemAvailable instead of MemFree 22965/head
Nick Rosbrook [Mon, 4 Apr 2022 19:06:07 +0000 (15:06 -0400)] 
oomd: calculate 'used' memory with MemAvailable instead of MemFree

The calculation for used memory in oomd_system_context_acquire is given
by MemTotal - MemFree from /proc/meminfo. This is too strict of a
calculation because it does not consider memory that is still available
for starting new applictions without swapping (MemAvailable). As a
result, systemd-oomd can start to kill processes before it is necessary.
This is more apparent on systems with low swap space.

Instead, compute 'used' memory as MemTotal - MemAvailable in
oomd_system_context_acquire and procfs_memory_get (which is used by
oomd_cgroup_context_acquire). And, rename oomd_mem_free_below to
oomd_mem_available_below for clarity.

2 years agoupdate TODO
Lennart Poettering [Tue, 5 Apr 2022 12:36:00 +0000 (14:36 +0200)] 
update TODO

2 years agofix TODO
Lennart Poettering [Tue, 5 Apr 2022 12:02:36 +0000 (14:02 +0200)] 
fix TODO

2 years agoupdate TODO
Lennart Poettering [Tue, 5 Apr 2022 11:59:39 +0000 (13:59 +0200)] 
update TODO

2 years agoMerge pull request #22953 from yuwata/test-sd-device
Luca Boccassi [Tue, 5 Apr 2022 10:10:20 +0000 (11:10 +0100)] 
Merge pull request #22953 from yuwata/test-sd-device

test: several fixlets for test-sd-device

2 years agoupdate TODO
Lennart Poettering [Tue, 5 Apr 2022 08:44:52 +0000 (10:44 +0200)] 
update TODO