]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
19 months agoMerge pull request #26292 from yuwata/locale-fix-enoent-handling
Zbigniew Jędrzejewski-Szmek [Thu, 2 Feb 2023 10:01:56 +0000 (11:01 +0100)] 
Merge pull request #26292 from yuwata/locale-fix-enoent-handling

locale: fix ENOENT handling for vconsole.conf or xorg.conf

19 months agotest-time-util: skip test for TIMESTAMP_DATE if the timestamp is too old
Yu Watanabe [Wed, 1 Feb 2023 19:36:29 +0000 (04:36 +0900)] 
test-time-util: skip test for TIMESTAMP_DATE if the timestamp is too old

Follow-up for 64f3419ec1f56a93b6dd48137ca40c945fc06c59.

If the input timestamp is too old (say, 1min since 1970-01-01), then
parse_timestamp() may fail on a timezone with positive shift e.g.
JST (UTC+9). Moreover, even if parse_timestamp() succeeds, its result
'y' and 'usec_sub_unsigned(x, 2 * USEC_PER_DAY)' are both zero, and
the assertion will be triggered.

Fixes #26172.

19 months agoudev: make get_virtfn_info() provide physical PCI device
Yu Watanabe [Wed, 1 Feb 2023 14:39:43 +0000 (23:39 +0900)] 
udev: make get_virtfn_info() provide physical PCI device

Fixes a bug introduced by 78463c6c4fdcb703bc0dc694c3ea77df3c5624e0.

Fixes #25545.

19 months agoMerge pull request #26180 from ddstreet/tpm2_cleanup
Luca Boccassi [Wed, 1 Feb 2023 23:40:52 +0000 (23:40 +0000)] 
Merge pull request #26180 from ddstreet/tpm2_cleanup

Add struct tpm2_handle and use _cleanup_ instead of goto

19 months agoMerge pull request #26269 from keszybz/sysusers-empty-etc-and-improved-messages
Luca Boccassi [Wed, 1 Feb 2023 23:14:59 +0000 (23:14 +0000)] 
Merge pull request #26269 from keszybz/sysusers-empty-etc-and-improved-messages

sysusers: improve messages and autocreate /etc

19 months agoman: add page for systemd-ac-power
Luca Boccassi [Wed, 1 Feb 2023 19:29:11 +0000 (19:29 +0000)] 
man: add page for systemd-ac-power

It is now a supported executable, so add manpage.

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

19 months agoMerge pull request #26287 from medhefgo/mkosi-auto-enroll
Luca Boccassi [Wed, 1 Feb 2023 21:51:04 +0000 (21:51 +0000)] 
Merge pull request #26287 from medhefgo/mkosi-auto-enroll

ci: Test with secure boot enabled under mkosi

19 months agoMerge pull request #26285 from yuwata/test-lvextend
Frantisek Sumsal [Wed, 1 Feb 2023 20:59:04 +0000 (20:59 +0000)] 
Merge pull request #26285 from yuwata/test-lvextend

test: add a testcase for lvextend

19 months agodocs: tweak rsync flags for moving existing home dir to systemd-homed
wouter bolsterlee [Wed, 1 Feb 2023 20:15:22 +0000 (21:15 +0100)] 
docs: tweak rsync flags for moving existing home dir to systemd-homed

The documentation on moving an existing homedir into a systemd-homed managed
one suggests using rsync(1) with a bunch of flags to preserve as much metadata
as possible: permissions, xattrs, timestamps, etc. The previously suggested
flags were:

    rsync -aHAXv --remove-source-files …

… which does include mtimes, but not ctimes and atimes, because -a does not
include those:

    --archive, -a            archive mode is -rlptgoD (no -A,-X,-U,-N,-H)

This change adds the -N and -U flags to preserve even more file timestamps,
turning the command into:

    rsync -aHANUXv --remove-source-files …

The new flags are:

    --crtimes, -N            preserve create times (newness)
    --atimes, -U             preserve access (use) times

19 months agolocale: drop context_clear_x11() 26292/head
Yu Watanabe [Wed, 1 Feb 2023 18:17:53 +0000 (03:17 +0900)] 
locale: drop context_clear_x11()

It is used at only place, and mostly trivial.
No functional change, just refactoring.

19 months agolocale: fix ENOENT handling for vconsole.conf or xorg.conf
Yu Watanabe [Wed, 1 Feb 2023 18:17:06 +0000 (03:17 +0900)] 
locale: fix ENOENT handling for vconsole.conf or xorg.conf

19 months agotpm2: add Tpm2Handle with automatic cleanup 26180/head
Dan Streetman [Tue, 24 Jan 2023 15:19:03 +0000 (10:19 -0500)] 
tpm2: add Tpm2Handle with automatic cleanup

This allows using _cleanup_ with the handles, which then allows removing the
use of goto in all functions that use the handles.

19 months agotpm2: use Tpm2Context* instead of ESYS_CONTEXT*
Dan Streetman [Tue, 6 Dec 2022 18:07:34 +0000 (13:07 -0500)] 
tpm2: use Tpm2Context* instead of ESYS_CONTEXT*

This is needed for later patches that use Tpm2Handle, which requires access
to the Tpm2Context.

19 months agotpm2: use ref counter for Tpm2Context
Dan Streetman [Tue, 24 Jan 2023 00:52:56 +0000 (19:52 -0500)] 
tpm2: use ref counter for Tpm2Context

This will be used by Tpm2Handle instances, which is added in later patches.

The refcounting allows the context to be retained until all Tpm2Handles have
been cleaned up, and the initial ref is released, before cleaning the context.

19 months agotpm2: rename struct tpm2_context to Tpm2Context
Dan Streetman [Tue, 24 Jan 2023 00:52:56 +0000 (19:52 -0500)] 
tpm2: rename struct tpm2_context to Tpm2Context

This aligns with systemd coding guidelines for struct naming

19 months agotpm2: rename tpm2 alg id<->string functions
Dan Streetman [Fri, 9 Dec 2022 22:20:24 +0000 (17:20 -0500)] 
tpm2: rename tpm2 alg id<->string functions

The 'pcr_bank' functions operate on hash algs, and are not specific to the PCR
banks, while the 'primary_alg' functions operate on asymmetric algs, and are
not specific to primary keys.

19 months agoMerge pull request #26219 from yuwata/localed-follow-ups
Zbigniew Jędrzejewski-Szmek [Wed, 1 Feb 2023 16:18:35 +0000 (17:18 +0100)] 
Merge pull request #26219 from yuwata/localed-follow-ups

locale: check conversion before polkit

19 months agoci: Test with secure boot enabled under mkosi 26287/head
Jan Janssen [Tue, 31 Jan 2023 17:53:28 +0000 (18:53 +0100)] 
ci: Test with secure boot enabled under mkosi

This gives us some nice test coverage for secure boot enrolling and the
stub secure boot workound. The authenticated EFI variables are already
created by mkosi, all we need to do is request secure boot to be used.

19 months agoMerge pull request #26286 from keszybz/two-doc-updates
Zbigniew Jędrzejewski-Szmek [Wed, 1 Feb 2023 16:03:46 +0000 (17:03 +0100)] 
Merge pull request #26286 from keszybz/two-doc-updates

Two doc updates

19 months agogit: Ignore mkosi secure boot keys
Jan Janssen [Wed, 1 Feb 2023 14:27:45 +0000 (15:27 +0100)] 
git: Ignore mkosi secure boot keys

19 months agoboot: Add if-safe mode for secure boot enrollment
Jan Janssen [Wed, 1 Feb 2023 14:23:25 +0000 (15:23 +0100)] 
boot: Add if-safe mode for secure boot enrollment

19 months agoman: Use sbsigntools for secure boot key generation example
Jan Janssen [Wed, 1 Feb 2023 13:43:59 +0000 (14:43 +0100)] 
man: Use sbsigntools for secure boot key generation example

This way, people do not need efitools installed to generate these as
sbsigntools has everything needed to produce signed EFI variables.

19 months agotest: add a testcase for lvextend 26285/head
Yu Watanabe [Wed, 1 Feb 2023 12:25:40 +0000 (21:25 +0900)] 
test: add a testcase for lvextend

For RHBZ#2158628 (https://bugzilla.redhat.com/show_bug.cgi?id=2158628)

19 months agoman: strengthen language about generator output 26286/head
Zbigniew Jędrzejewski-Szmek [Wed, 1 Feb 2023 14:34:38 +0000 (15:34 +0100)] 
man: strengthen language about generator output

Inspired by https://bugzilla.redhat.com/show_bug.cgi?id=2165433.

19 months agoNEWS: extend entry for systemd-journald-audit.socket
Zbigniew Jędrzejewski-Szmek [Thu, 26 Jan 2023 15:33:42 +0000 (16:33 +0100)] 
NEWS: extend entry for systemd-journald-audit.socket

I knew about the change but forgot to update the packaging scriptlets…
Let's add this to make it easier for other distros to notice.

19 months agotest-journal-flush: minor modernizations
Lennart Poettering [Mon, 30 Jan 2023 17:39:20 +0000 (18:39 +0100)] 
test-journal-flush: minor modernizations

let's automatically destroy test dirs, instead of manually.

19 months agoid128: introduce ERRNO_IS_MACHINE_ID_UNSET() helper macro
Lennart Poettering [Wed, 1 Feb 2023 11:08:25 +0000 (12:08 +0100)] 
id128: introduce ERRNO_IS_MACHINE_ID_UNSET() helper macro

19 months agotest: make helper_check_device_units() log unit name
Yu Watanabe [Wed, 1 Feb 2023 14:03:54 +0000 (23:03 +0900)] 
test: make helper_check_device_units() log unit name

19 months agopid1: fix segv triggered by status query (#26279)
Robin Humble [Wed, 1 Feb 2023 12:36:48 +0000 (23:36 +1100)] 
pid1: fix segv triggered by status query (#26279)

If any query makes it to the end of install_info_follow() then I think symlink_target is set to NULL.
If that is followed by -EXDEV from unit_file_load_or_readlink(), then that causes basename(NULL)
which segfaults pid 1.

This is triggered by eg. "systemctl status crond" in RHEL9 if

/etc/systemd/system/crond.service
  -> /ram/etc/systemd/system/crond.service
  -> /usr/lib/systemd/system/.crond.service.blah.blah
  -> /usr/lib/systemd/system/crond.service

19 months agocore: split system/user job timeouts and make them configurable
Zbigniew Jędrzejewski-Szmek [Tue, 26 Jan 2021 19:23:12 +0000 (20:23 +0100)] 
core: split system/user job timeouts and make them configurable

Config options are -Ddefault-timeout-sec= and -Ddefault-user-timeout-sec=.
Existing -Dupdate-helper-user-timeout= is renamed to -Dupdate-helper-user-timeout-sec=
for consistency. All three options take an integer value in seconds. The
renaming and type-change of the option is a small compat break, but it's just
at compile time and result in a clear error message. I also doubt that anyone was
actually using the option.

This commit separates the user manager timeouts, but keeps them unchanged at 90 s.
The timeout for the user manager is set to 4/3*user-timeout, which means that it
is still 120 s.

Fedora wants to experiment with lower timeouts, but doing this via a patch would
be annoying and more work than necessary. Let's make this easy to configure.

19 months agotest-sysusers: check that sysusers creates /etc when missing 26269/head
Zbigniew Jędrzejewski-Szmek [Tue, 31 Jan 2023 15:41:16 +0000 (16:41 +0100)] 
test-sysusers: check that sysusers creates /etc when missing

19 months agobasic/user-util: create /etc from take_etc_passwd_lock
Zbigniew Jędrzejewski-Szmek [Tue, 31 Jan 2023 15:24:50 +0000 (16:24 +0100)] 
basic/user-util: create /etc from take_etc_passwd_lock

This allows sysusers to operate with --root that is an empty directory.
It may be useful to, for example, populate the user database before installing
anything else.

firstboot was already doing this, so drop the duplicated call there.

19 months agobasic/user-util: convert prefix_roota→path_join and use _cleanup_ more
Zbigniew Jędrzejewski-Szmek [Tue, 31 Jan 2023 15:17:12 +0000 (16:17 +0100)] 
basic/user-util: convert prefix_roota→path_join and use _cleanup_ more

19 months agobasic: reword some comments
Zbigniew Jędrzejewski-Szmek [Tue, 31 Jan 2023 15:16:55 +0000 (16:16 +0100)] 
basic: reword some comments

Without commas, the sentences can be hard to parse.

19 months agosysusers: when comparing items, log debug the difference
Zbigniew Jędrzejewski-Szmek [Tue, 31 Jan 2023 14:10:03 +0000 (15:10 +0100)] 
sysusers: when comparing items, log debug the difference

19 months agosysusers: add helper to create new Item
Zbigniew Jędrzejewski-Szmek [Tue, 31 Jan 2023 13:16:48 +0000 (14:16 +0100)] 
sysusers: add helper to create new Item

19 months agobuild(deps): bump systemd/mkosi
dependabot[bot] [Wed, 1 Feb 2023 09:01:53 +0000 (09:01 +0000)] 
build(deps): bump systemd/mkosi

Bumps [systemd/mkosi](https://github.com/systemd/mkosi) from f36983f552a197faf9e36361cc68a297e68bee73 to 500f93a36cc3d5bf1d06848a0a8870bf1424625f.
- [Release notes](https://github.com/systemd/mkosi/releases)
- [Changelog](https://github.com/systemd/mkosi/blob/main/NEWS.md)
- [Commits](https://github.com/systemd/mkosi/compare/f36983f552a197faf9e36361cc68a297e68bee73...500f93a36cc3d5bf1d06848a0a8870bf1424625f)

---
updated-dependencies:
- dependency-name: systemd/mkosi
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
19 months agobuild(deps): bump actions/github-script from 6.3.3 to 6.4.0
dependabot[bot] [Wed, 1 Feb 2023 09:01:43 +0000 (09:01 +0000)] 
build(deps): bump actions/github-script from 6.3.3 to 6.4.0

Bumps [actions/github-script](https://github.com/actions/github-script) from 6.3.3 to 6.4.0.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](https://github.com/actions/github-script/compare/d556feaca394842dc55e4734bf3bb9f685482fa0...98814c53be79b1d30f795b907e553d8679345975)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
19 months agobuild(deps): bump redhat-plumbers-in-action/advanced-issue-labeler
dependabot[bot] [Wed, 1 Feb 2023 09:01:40 +0000 (09:01 +0000)] 
build(deps): bump redhat-plumbers-in-action/advanced-issue-labeler

Bumps [redhat-plumbers-in-action/advanced-issue-labeler](https://github.com/redhat-plumbers-in-action/advanced-issue-labeler) from 2.0.1 to 2.0.4.
- [Release notes](https://github.com/redhat-plumbers-in-action/advanced-issue-labeler/releases)
- [Commits](https://github.com/redhat-plumbers-in-action/advanced-issue-labeler/compare/88209aef583c66312529c515d41ea6a710a4baba...25a1e41826424cdf577c71b58c852df4347f13b8)

---
updated-dependencies:
- dependency-name: redhat-plumbers-in-action/advanced-issue-labeler
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
19 months agoMerge pull request #26236 from medhefgo/meson-fixes
Zbigniew Jędrzejewski-Szmek [Wed, 1 Feb 2023 09:05:36 +0000 (10:05 +0100)] 
Merge pull request #26236 from medhefgo/meson-fixes

meson: Fixes

19 months agojournald: some minor modernizations
Lennart Poettering [Tue, 31 Jan 2023 15:21:54 +0000 (16:21 +0100)] 
journald: some minor modernizations

19 months agojournal: generate a clean message when we try to write to a journal file from a diffe...
Lennart Poettering [Tue, 31 Jan 2023 12:40:23 +0000 (13:40 +0100)] 
journal: generate a clean message when we try to write to a journal file from a different host

19 months agojournal-file: refuse writing to journal files where the header size is different...
Lennart Poettering [Tue, 31 Jan 2023 22:00:07 +0000 (23:00 +0100)] 
journal-file: refuse writing to journal files where the header size is different then expected

We keep adding fields to the header, and it's fine reading files with
different header sizes, as we check via the size if the fields we need
are included. However, let's be stricter when writing journal files than
when reading, and insist that the header structure in the file actually
matches our expectations. Refuse otherwise, so that a new file is
created after rotation that then matches our expectations.

This makes sure that mismatch in header size is treated exactly as
unknown "compatible" flags, which is our other mechanism to allow
extending the journal file format in a non-breaking way.

19 months agoglibc: Conditionally #include <linux/fs.h> to resolve fsconfig_command/mount_attr...
Rudi Heitbaum [Tue, 31 Jan 2023 12:06:56 +0000 (12:06 +0000)] 
glibc: Conditionally #include <linux/fs.h> to resolve fsconfig_command/mount_attr conflict with glibc 2.36

Co-authored-by: Frantisek Sumsal <frantisek@sumsal.cz>
19 months agosysusers: insist that root group is 0
Zbigniew Jędrzejewski-Szmek [Tue, 31 Jan 2023 16:04:10 +0000 (17:04 +0100)] 
sysusers: insist that root group is 0

In https://bugzilla.redhat.com/show_bug.cgi?id=2156900 sysusers was reporting a
conflict between the following lines:
  u root 0:0 "Super User" /root /bin/bash
  u root    0     "Super User" /root

The problem is that those configurations are indeed not equivalent. If group 0
exists with a different name, the first line would just create the user, but the
second line would create a 'root' group with a different GID. The second
behaviour seems definitely wrong. (Or at least more confusing in practice than
the first one. The system is in a strange shape, but the second approach takes
an additional step than is worse than doing nothing.)

When this line was initially added, we didn't have the uid:gid functionality for
'u', so we didn't think about this too much. But now we do, so we should use it.

$ build/systemd-sysusers --root=/var/tmp/inst7 --inline 'g foobar 0'
Creating group 'foobar' with GID 0.

$ build/systemd-sysusers --root=/var/tmp/inst7 --inline 'u root 0 "Zuper zuper"'
src/sysusers/sysusers.c:1365: Creating group 'root' with GID 999.
src/sysusers/sysusers.c:1115: Suggested user ID 0 for root already used.
src/sysusers/sysusers.c:1183: Creating user 'root' (Zuper zuper) with UID 999 and GID 999.

vs.

$ build/systemd-sysusers --root=/var/tmp/inst7 --inline 'u root 0:0 "Zuper zuper"'
src/sysusers/sysusers.c:1183: Creating user 'root' (Zuper zuper) with UID 0 and GID 0.

19 months agomeson: fail build on implicit int warnings
Zbigniew Jędrzejewski-Szmek [Tue, 31 Jan 2023 15:12:09 +0000 (16:12 +0100)] 
meson: fail build on implicit int warnings

19 months agonetwork: dhcp-server: do not create DHCPServer object when the DHCP server is running...
Yu Watanabe [Mon, 30 Jan 2023 09:55:10 +0000 (18:55 +0900)] 
network: dhcp-server: do not create DHCPServer object when the DHCP server is running in relaying mode

Follow-up for c95df5879eeb2cec8bc8eec2cfa7e741e1d9469f.

Fixes #26196.

19 months agonetwork/dhcp4: accept local subnet routes from DHCP
Tuetuopay [Fri, 27 Jan 2023 14:10:49 +0000 (15:10 +0100)] 
network/dhcp4: accept local subnet routes from DHCP

RFC3442 specifies option 121 (Classless Static Routes) that allow a DHCP
server to push arbitrary routes to a client. It has a Local Subnet
Routes section expliciting the behavior of routes with a null (0.0.0.0)
gateway.

Such routes are to be installed on the interface with a Link scope, to
mark them as directly available on the link without any gateway.

Networkd currently drops those routes, which is against the RFC, as
Linux has proper support for such routes.

Fixes: 7f20627 ("network: dhcp4: ignore gateway in static routes if destination is link-local or in the same network")
19 months agoukify: don't install ukify man page if ukify is not enabled
Frantisek Sumsal [Tue, 31 Jan 2023 20:43:53 +0000 (21:43 +0100)] 
ukify: don't install ukify man page if ukify is not enabled

Checking for gnu-efi is not enough, since ukify can be explicitly
disabled.

Resolves: #26274

19 months agopid1,sysusers: drop unused SYNTHETIC_ERRNO
Zbigniew Jędrzejewski-Szmek [Tue, 31 Jan 2023 13:21:49 +0000 (14:21 +0100)] 
pid1,sysusers: drop unused SYNTHETIC_ERRNO

The only function of SYNTHETIC_ERRNO is to set the return value.
If we're ignoring the return value, it shouldn't be used.

19 months agosysusers: drop counterproductive bitfield annotations
Zbigniew Jędrzejewski-Szmek [Tue, 31 Jan 2023 12:47:17 +0000 (13:47 +0100)] 
sysusers: drop counterproductive bitfield annotations

The usual story:
$ diff -u <(pahole build/systemd-sysusers.0) <(pahole build/systemd-sysusers)
  /* size: 80, cachelines: 2, members: 15 */
- /* sum members: 68, holes: 1, sum holes: 4 */
- /* sum bitfield members: 5 bits (0 bytes) */
- /* padding: 7 */
- /* bit_padding: 3 bits */
+ /* sum members: 73, holes: 1, sum holes: 4 */
+ /* padding: 3 */
  /* last cacheline: 16 bytes */

Effectively, because of padding, we were not saving anything. We're not putting
struct Item in arrays, but when allocating on the heap, we're going to round up to
normal alignment too.

The code becomes shorter (and quicker):
$ size build/systemd-sysusers{,.0}
   text    data     bss     dec     hex filename
  79967    2040     264   82271   1415f build/systemd-sysusers.0
  79726    2040     264   82030   1406e build/systemd-sysusers

(In case you're wondering, I wrote this long commit message for a very simple
change on purpose: I want to deflate the bitfield cargo cult a bit.)

19 months agobpf: fix restrict_fs on s390x
Ilya Leoshkevich [Mon, 30 Jan 2023 20:21:48 +0000 (21:21 +0100)] 
bpf: fix restrict_fs on s390x

Linux kernel's bpf-next contains BPF LSM support for s390x. systemd's
test-bpf-lsm currently fails with this kernel.

This is an endianness issue: in the restrict_fs bpf program,
magic_number has type unsigned long (64 bits on s390x), but magic_map
keys are uint32_t (32 bits). Accessing magic_map using 64-bit keys may
work by accident on little-endian systems, but fails hard on big-endian
ones.

Fix by casting magic_number to uint32_t.

19 months agoimportd: Always specify file unpacked by tar
Arsen Arsenović [Sat, 28 Jan 2023 21:32:41 +0000 (22:32 +0100)] 
importd: Always specify file unpacked by tar

Despite popular belief, the default file extracted by GNU tar is not stdin.  It
is the value of the TAPE environment variable, falling back on a compile-time
constant.  On my system, the default value is /dev/full, which causes tar to
just spin forever due to --ignore-zeros.  Always specifying this flag is the
safe thing to do.

  ~$ tar --show-defaults
  --format=gnu -f/dev/full -b20 --quoting-style=escape
  --rmt-command=/usr/sbin/grmt

See also: ``(tar)defaults'', available via Info viewers, and in HTML form at:
https://www.gnu.org/s/tar/manual/html_node/defaults.html

19 months agoMerge pull request #26249 from DaanDeMeyer/nspawn-uid-fix
Lennart Poettering [Tue, 31 Jan 2023 11:21:09 +0000 (12:21 +0100)] 
Merge pull request #26249 from DaanDeMeyer/nspawn-uid-fix

nspawn: Make sure we create bind mount points as the correct UID/GID

19 months agoMerge pull request #26245 from ldv-alt/tmpfiles-fixes
Lennart Poettering [Mon, 30 Jan 2023 16:14:03 +0000 (17:14 +0100)] 
Merge pull request #26245 from ldv-alt/tmpfiles-fixes

tmpfiles: fix specifier expansion in arguments of C and L lines

19 months agoMerge pull request #23956 from mrc0mmand/resolved-ipv6
Yu Watanabe [Mon, 30 Jan 2023 10:21:19 +0000 (19:21 +0900)] 
Merge pull request #23956 from mrc0mmand/resolved-ipv6

test: cover (not only) IPv6 in the resolved test suite

19 months agoMerge pull request #25374 from yuwata/sleep-fixlets
Luca Boccassi [Mon, 30 Jan 2023 09:51:21 +0000 (09:51 +0000)] 
Merge pull request #25374 from yuwata/sleep-fixlets

sleep: several fixlets

19 months agoMerge pull request #26252 from DaanDeMeyer/mkosi-drop-workaround
Daan De Meyer [Sun, 29 Jan 2023 18:31:15 +0000 (19:31 +0100)] 
Merge pull request #26252 from DaanDeMeyer/mkosi-drop-workaround

mkosi fixes

19 months agotest-systemd-tmpfiles: Fix execution when user is not in /etc/passwd
Daan De Meyer [Sat, 28 Jan 2023 14:09:25 +0000 (15:09 +0100)] 
test-systemd-tmpfiles: Fix execution when user is not in /etc/passwd

We might be running in a chroot as a uid that doesn't exist in /etc/passwd.
Let's make sure we don't fail in this scenario.

We pass $HOME when resetting the env so that we can find a home directory
and skip tests that depend on user name/group.

19 months agomkosi: Disable auditd when running with nspawn in CI 26252/head
Daan De Meyer [Sun, 29 Jan 2023 16:34:21 +0000 (17:34 +0100)] 
mkosi: Disable auditd when running with nspawn in CI

auditd fails to start in CentOS Stream 9 causing CI failures so let's
disable it when running with nspawn in CI.

19 months agomkosi: Add back CentOS Stream 8 to CI
Daan De Meyer [Sun, 29 Jan 2023 14:17:06 +0000 (15:17 +0100)] 
mkosi: Add back CentOS Stream 8 to CI

It's still useful to test the EFI handover logic in systemd-boot.
We use a mkosi.prepare script to install a newer python and update
the system to use it.

19 months agomkosi: Drop focal workaround in build script
Daan De Meyer [Sun, 29 Jan 2023 14:07:38 +0000 (15:07 +0100)] 
mkosi: Drop focal workaround in build script

Now that jammy is the latest LTS, lets drop the focal workaround
from the build script.

19 months agomkosi: Don't modify rootfs in build script
Daan De Meyer [Sun, 29 Jan 2023 14:04:13 +0000 (15:04 +0100)] 
mkosi: Don't modify rootfs in build script

When unprivileged mkosi becomes available, builds will be executed
as an unprivileged user, so we won't be able to modify the rootfs
anymore. Let's update the build script to account for this.

19 months agomkosi: Fix shellcheck warnings
Daan De Meyer [Sun, 29 Jan 2023 16:05:04 +0000 (17:05 +0100)] 
mkosi: Fix shellcheck warnings

19 months agoupdate footer to 2023
cake03 [Sun, 29 Jan 2023 05:13:10 +0000 (05:13 +0000)] 
update footer to 2023

19 months agomkosi: Drop epel-testing repository from centos config
Daan De Meyer [Sun, 29 Jan 2023 09:45:17 +0000 (10:45 +0100)] 
mkosi: Drop epel-testing repository from centos config

python3-pefile was pushed to epel 9 stable.

19 months agonspawn: Make sure we create bind mount points as the correct UID/GID 26249/head
Daan De Meyer [Sat, 28 Jan 2023 14:12:08 +0000 (15:12 +0100)] 
nspawn: Make sure we create bind mount points as the correct UID/GID

When using --private-users, we have to create bind mount points as
the user that will become root in the user namespace, so let's take
that into account.

19 months agomkdir-label: Add mkdir_parents_safe_label()
Daan De Meyer [Sat, 28 Jan 2023 14:11:29 +0000 (15:11 +0100)] 
mkdir-label: Add mkdir_parents_safe_label()

19 months agosd-dhcp-server: allow to send header only message
Yu Watanabe [Sat, 28 Jan 2023 05:01:37 +0000 (14:01 +0900)] 
sd-dhcp-server: allow to send header only message

If we receive a header only message, and the server is running in relay
mode, then the assertion was triggered.

Fixes #26151.

19 months agotest: add tests for localectl --no-convert 26219/head
Yu Watanabe [Thu, 26 Jan 2023 14:09:08 +0000 (23:09 +0900)] 
test: add tests for localectl --no-convert

19 months agolocale: downgrade level of one more log message
Yu Watanabe [Thu, 26 Jan 2023 14:31:10 +0000 (23:31 +0900)] 
locale: downgrade level of one more log message

19 months agolocale: move logging from library-like functions to caller
Yu Watanabe [Thu, 26 Jan 2023 14:30:27 +0000 (23:30 +0900)] 
locale: move logging from library-like functions to caller

19 months agolocale: decouple vconsole_read_data() from x11_read_data()
Yu Watanabe [Sat, 28 Jan 2023 06:01:38 +0000 (15:01 +0900)] 
locale: decouple vconsole_read_data() from x11_read_data()

Let's make library-functions simple and independent as possible as they
are. No functional change, just refactoring.

19 months agolocale: also check if converted keymap or friends is same as the current settings
Yu Watanabe [Thu, 26 Jan 2023 09:05:32 +0000 (18:05 +0900)] 
locale: also check if converted keymap or friends is same as the current settings

Before this commit, if virtual console keymap is unchanged, localed just
returns without modifying anything. However, the X11 part may need updating.
So we should check for both and ensure they are unmodified.

Replaces #26190.

19 months agolocale: sync two X11 contexts on update
Yu Watanabe [Thu, 26 Jan 2023 08:41:47 +0000 (17:41 +0900)] 
locale: sync two X11 contexts on update

19 months agolocale: always check input keyboard layout and friends earlier
Yu Watanabe [Thu, 26 Jan 2023 08:48:11 +0000 (17:48 +0900)] 
locale: always check input keyboard layout and friends earlier

19 months agolocale: replace context_get_x11_context() with context_get_x11_context_safe()
Yu Watanabe [Thu, 26 Jan 2023 08:34:08 +0000 (17:34 +0900)] 
locale: replace context_get_x11_context() with context_get_x11_context_safe()

Then, context_get_x11_context() always replies a valid X11 context.
No functional change, just refactoring.

19 months agolocale: make vconsole_convert_to_x11() not update Context
Yu Watanabe [Wed, 25 Jan 2023 04:35:42 +0000 (13:35 +0900)] 
locale: make vconsole_convert_to_x11() not update Context

This also makes x11_convert_to_vconsole() changed in the same way.
Then, their callers update Context if necessary.

No functional change, just preparation for later commits.

19 months agolocale: introduce VCContext and several helper functions for the struct
Yu Watanabe [Wed, 25 Jan 2023 03:11:40 +0000 (12:11 +0900)] 
locale: introduce VCContext and several helper functions for the struct

No functional changes, preparation for later commits.

19 months agolocale: add missing logs
Yu Watanabe [Sat, 28 Jan 2023 05:46:49 +0000 (14:46 +0900)] 
locale: add missing logs

19 months agoukify: python 3.9 compat followup
Daan De Meyer [Fri, 27 Jan 2023 20:21:51 +0000 (21:21 +0100)] 
ukify: python 3.9 compat followup

19 months agosleep: enumerate only existing and non-device batteries 25374/head
Yu Watanabe [Sun, 13 Nov 2022 17:54:50 +0000 (02:54 +0900)] 
sleep: enumerate only existing and non-device batteries

The enumerator is now mostly consistent with on_ac_power() in
udev-util.c.

19 months agosleep: fix indentation
Yu Watanabe [Sun, 13 Nov 2022 17:52:55 +0000 (02:52 +0900)] 
sleep: fix indentation

19 months agosleep: introduce siphash24_compress_id128()
Yu Watanabe [Sun, 13 Nov 2022 17:49:19 +0000 (02:49 +0900)] 
sleep: introduce siphash24_compress_id128()

Also, rename get_battery_identifier() to siphash24_compress_device_sysattr().

This also makes any errors in sd_id128_get_machine() or id128_get_product()
ignored. For the machine ID, the failure should not be significant unless
the file stored in the discharge level is reused by another system, which
is quite unusual. For the product ID, if the firmware provides useless
ID (all zero or all 0xFF), then loading/storing the discharge rate
becomes completely broken, that should be avoided.

Note, now sysattrs are used instead of properties in uevent files, but
both provide the same information, hence no functionality should be
changed.

19 months agosleep: simplify code a bit
Yu Watanabe [Sun, 13 Nov 2022 17:46:53 +0000 (02:46 +0900)] 
sleep: simplify code a bit

- use device_get_sysattr_int(),
- drop redundant log message.

19 months agosleep: coding style fixlets
Yu Watanabe [Sun, 13 Nov 2022 17:44:13 +0000 (02:44 +0900)] 
sleep: coding style fixlets

19 months agosleep: introduce SuspendEstimationSec=
Yu Watanabe [Sun, 13 Nov 2022 17:08:05 +0000 (02:08 +0900)] 
sleep: introduce SuspendEstimationSec=

Before v252, HibernateDelaySec= specifies the maximum timespan that the
system in suspend state, and the system hibernate after the timespan.

However, after 96d662fa4c8cab24da57523c5e49e6ef3967fc13, the setting is
repurposed as the default interval to measure battery charge level and
estimate the battery discharging late. And if the system has enough
battery capacity, then the system will stay in suspend state and not
hibernate even if the time passed. See issue #25269.

To keep the backward compatibility, let's introduce another setting
SuspendEstimationSec= for controlling the interval to measure
battery charge level, and make HibernateDelaySec= work as of v251.

This also drops implementation details from the man page.

Fixes #25269.

19 months agomeson: Use files() in one more place 26236/head
Jan Janssen [Fri, 27 Jan 2023 17:37:15 +0000 (18:37 +0100)] 
meson: Use files() in one more place

19 months agomeson: Install missing udev rule
Jan Janssen [Fri, 27 Jan 2023 17:23:02 +0000 (18:23 +0100)] 
meson: Install missing udev rule

19 months agomeson: Install missing bash-completions
Jan Janssen [Fri, 27 Jan 2023 16:56:12 +0000 (17:56 +0100)] 
meson: Install missing bash-completions

19 months agomeson: Install missing network file
Jan Janssen [Fri, 27 Jan 2023 16:50:27 +0000 (17:50 +0100)] 
meson: Install missing network file

19 months agomeson: Install all catalogs
Jan Janssen [Fri, 27 Jan 2023 13:37:45 +0000 (14:37 +0100)] 
meson: Install all catalogs

19 months agomeson: Properly install 90-uki-copy.install
Jan Janssen [Fri, 27 Jan 2023 13:28:58 +0000 (14:28 +0100)] 
meson: Properly install 90-uki-copy.install

19 months agomeson: Remove unused variables
Jan Janssen [Fri, 27 Jan 2023 13:28:15 +0000 (14:28 +0100)] 
meson: Remove unused variables

19 months agotest: wrap delv & dig when running with sanitizers 23956/head
Frantisek Sumsal [Fri, 27 Jan 2023 14:34:36 +0000 (15:34 +0100)] 
test: wrap delv & dig when running with sanitizers

On Arch both delv and dig pull in libnss_resolve:

```
$ grep resolve /etc/nsswitch.conf
hosts: mymachines resolve [!UNAVAIL=return] files myhostname dns
```

19 months agotest: don't hang indefinitely on no match
Frantisek Sumsal [Fri, 27 Jan 2023 13:29:42 +0000 (14:29 +0100)] 
test: don't hang indefinitely on no match

19 months agotest: add a test for the OPENPGPKEY RR
Frantisek Sumsal [Fri, 8 Jul 2022 18:23:13 +0000 (20:23 +0200)] 
test: add a test for the OPENPGPKEY RR

19 months agotest: add a couple of SRV records to check service resolution
Frantisek Sumsal [Fri, 8 Jul 2022 16:12:47 +0000 (18:12 +0200)] 
test: add a couple of SRV records to check service resolution

19 months agotest: cover IPv6 in the resolved test suite
Frantisek Sumsal [Fri, 8 Jul 2022 11:36:03 +0000 (13:36 +0200)] 
test: cover IPv6 in the resolved test suite

19 months agomkosi: Update and enable ukify in mkosi builds
Daan De Meyer [Tue, 24 Jan 2023 11:51:31 +0000 (12:51 +0100)] 
mkosi: Update and enable ukify in mkosi builds

We also add the necessary deps for ukify to the mkosi configs.

CentOS Stream 8 is dropped from CI because its python version is too
old (3.6) to be able to run ukify.