]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
2 years agotimedatectl: port to new 'vertical' table type 25328/head
Lennart Poettering [Thu, 10 Nov 2022 12:32:08 +0000 (13:32 +0100)] 
timedatectl: port to new 'vertical' table type

2 years agoresolvectl: port to new 'vertical' table type
Lennart Poettering [Thu, 10 Nov 2022 12:31:43 +0000 (13:31 +0100)] 
resolvectl: port to new 'vertical' table type

2 years agoresolvectl: fail properly if we can't append to table
Lennart Poettering [Thu, 10 Nov 2022 12:30:02 +0000 (13:30 +0100)] 
resolvectl: fail properly if we can't append to table

2 years agoformat-table: add an explicit "vertical" mode
Lennart Poettering [Thu, 10 Nov 2022 11:52:08 +0000 (12:52 +0100)] 
format-table: add an explicit "vertical" mode

Originally, the table formatting code was written to display a number of
records, one per line, and within each line multiple fields of the same
record. The first line contains the column names.

It was then started to be used in a "vertical" mode however,
i.e. with field names on the left instead of the top. Let's support such
a mode explicitly, so that we can provide systematic styling, and can
properly convert this mode to JSON.

A new constructor "table_new_vertical()" is added creating such
"vertical" tables. Internally, this is a table with two columns: "key"
and "value". When outputting this as JSON we'll output a single JSON
object, with key/value as fields. (Which is different from the
traditional output where we'd use the first line as JSON field names,
and output an array of objects).

A new cell type TABLE_FIELD is added for specifically marking the
"field" cells, i.e. the cells in the first column. We'll automatically
suffic ":" to these fields on output.

2 years agomeson: install systemd-ac-power under /usr/bin
Yu Watanabe [Thu, 10 Nov 2022 16:17:57 +0000 (01:17 +0900)] 
meson: install systemd-ac-power under /usr/bin

And test the its help message.

The program is useful for e.g. scripts that conditionalize their tasks
to be invoked only when running on AC power.

2 years agoupdate TODO
Lennart Poettering [Thu, 10 Nov 2022 21:19:22 +0000 (22:19 +0100)] 
update TODO

2 years agopo: Translated using Weblate (Finnish)
Ricky Tigg [Thu, 10 Nov 2022 19:19:46 +0000 (20:19 +0100)] 
po: Translated using Weblate (Finnish)

Currently translated at 100.0% (193 of 193 strings)

Co-authored-by: Ricky Tigg <ricky.tigg@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/fi/
Translation: systemd/main

2 years agoupdate TODO
Lennart Poettering [Thu, 10 Nov 2022 14:59:58 +0000 (15:59 +0100)] 
update TODO

2 years agobuild: Use -fstrict-flex-arrays=1 if supported
Cristian Rodríguez [Wed, 9 Nov 2022 23:56:46 +0000 (23:56 +0000)] 
build: Use -fstrict-flex-arrays=1 if supported

Due to "historical reasons" both gcc and clang treat *all* trailing
arrays members as flexible arrays, this has an evil side effect
of inhibiting bounds checks on such members as __builtin_object_size
cannot say for sure that:

struct {
...
type foo[3];
}

has a trailing foo member of fixed size rather than unspecified.

Ideally we should use -fstrict-flex-arrays as is, but we have to
tolerate kernel uapi headers that use [0] and third party libraries
written in c89 that may use [1] like curl.

2 years agotest-network: skip test_match if alternative name is not supported by kernel
Yu Watanabe [Thu, 10 Nov 2022 07:21:28 +0000 (16:21 +0900)] 
test-network: skip test_match if alternative name is not supported by kernel

Fixes #25259.

2 years agoMerge pull request #24813 from DaanDeMeyer/at-all-the-things
Luca Boccassi [Thu, 10 Nov 2022 09:57:14 +0000 (10:57 +0100)] 
Merge pull request #24813 from DaanDeMeyer/at-all-the-things

Add more openat() style variants for existing stuff

2 years agoMerge pull request #25315 from poettering/dissect-mtree
Luca Boccassi [Thu, 10 Nov 2022 09:44:27 +0000 (10:44 +0100)] 
Merge pull request #25315 from poettering/dissect-mtree

dissect: add new --mtree switch to generate BSD comaptible mtree manifests of DDIs

2 years agoMerge pull request #25280 from keszybz/initrd-with-overlayfs
Frantisek Sumsal [Thu, 10 Nov 2022 08:22:15 +0000 (08:22 +0000)] 
Merge pull request #25280 from keszybz/initrd-with-overlayfs

Initrd with overlayfs

2 years agopid1: skip cleanup if root is not tmpfs/ramfs 25280/head
Zbigniew Jędrzejewski-Szmek [Mon, 7 Nov 2022 11:40:20 +0000 (12:40 +0100)] 
pid1: skip cleanup if root is not tmpfs/ramfs

in_initrd() was really doing two things: checking if we're in the initrd, and
also verifying that the initrd is set up correctly. But this second check is
complicated, in particular it would return false for overlayfs, even with an
upper tmpfs layer. It also doesn't support the use case of having an initial
initrd with tmpfs, and then transitioning into an intermediate initrd that is
e.g. a DDI, i.e. a filesystem possibly with verity arranged as a disk image.

We don't need to check if we're in initrd in every program. Instead, concerns
are separated:
- in_initrd() just does a simple check for /etc/initrd-release.
- When doing cleanup, pid1 checks if it's on a tmpfs before starting to wipe
  the old root. The only case where we want to remove the old root is when
  we're on a plain tempory filesystem. With an overlay, we'd be creating
  whiteout files, which is not very useful. (*)

This should resolve https://bugzilla.redhat.com/show_bug.cgi?id=2137631
which is caused by systemd refusing to treat the system as an initrd because
overlayfs is used.

(*) I think the idea of keeping the initrd fs around for shutdown is outdated.
We should just have a completely separate exitrd that is unpacked when we want
to shut down. This way, we don't waste memory at runtime, and we also don't
transition to a potentially older version of systemd. But we don't have support
for this yet.

This replaces 0fef5b0f0bd9ded1ae7bcb3e4e4b2893e36c51a6.

2 years agotest-fd-util: fix typos and use log_tests_skipped()
Zbigniew Jędrzejewski-Szmek [Tue, 8 Nov 2022 13:18:46 +0000 (14:18 +0100)] 
test-fd-util: fix typos and use log_tests_skipped()

2 years agotest: add trivial test for systemd-dissect --mtree 25315/head
Lennart Poettering [Wed, 9 Nov 2022 11:31:36 +0000 (12:31 +0100)] 
test: add trivial test for systemd-dissect --mtree

2 years agoman: document new systemd-dissect --mtree switch
Lennart Poettering [Wed, 9 Nov 2022 11:12:02 +0000 (12:12 +0100)] 
man: document new systemd-dissect --mtree switch

2 years agodissect: add a new "--mtree" switch for generating a BSD mtree(5) compatible file...
Lennart Poettering [Wed, 9 Nov 2022 10:34:52 +0000 (11:34 +0100)] 
dissect: add a new "--mtree" switch for generating a BSD mtree(5) compatible file manifest

2 years agomeson: add version.h dependency to more components
Frantisek Sumsal [Wed, 9 Nov 2022 12:33:39 +0000 (13:33 +0100)] 
meson: add version.h dependency to more components

Follow-up to c47511da7e2bab1a429fc1958a73d3f426ebb3da.

```
archlinux_systemd_ci: In file included from ../build/src/dissect/dissect.c:15:
archlinux_systemd_ci: ../build/src/basic/build.h:4:10: fatal error: version.h: No such file or directory
archlinux_systemd_ci:     4 | #include "version.h"
archlinux_systemd_ci:       |          ^~~~~~~~~~~
archlinux_systemd_ci: compilation terminated.
```

```
archlinux_systemd_ci: In file included from ../build/src/journal/cat.c:13:
archlinux_systemd_ci: ../build/src/basic/build.h:4:10: fatal error: 'version.h' file not found
archlinux_systemd_ci: #include "version.h"
archlinux_systemd_ci:          ^~~~~~~~~~~
archlinux_systemd_ci: 1 error generated.
```

```
archlinux_systemd_ci: In file included from ../build/src/sysext/sysext.c:10:
archlinux_systemd_ci: ../build/src/basic/build.h:4:10: fatal error: version.h: No such file or directory
archlinux_systemd_ci:     4 | #include "version.h"
archlinux_systemd_ci:       |          ^~~~~~~~~~~
archlinux_systemd_ci: compilation terminated.
archlinux_systemd_ci: FAILED: systemd-inhibit.p/src_login_inhibit.c.o
```

```
archlinux_systemd_ci: In file included from ../build/src/login/inhibit.c:12:
archlinux_systemd_ci: ../build/src/basic/build.h:4:10: fatal error: version.h: No such file or directory
archlinux_systemd_ci:     4 | #include "version.h"
archlinux_systemd_ci:       |          ^~~~~~~~~~~
archlinux_systemd_ci: compilation terminated.
```

...

2 years agorecurse-dir: optionally, call callback when entering/leaving toplevel dir, too
Lennart Poettering [Wed, 9 Nov 2022 10:31:15 +0000 (11:31 +0100)] 
recurse-dir: optionally, call callback when entering/leaving toplevel dir, too

So far recurse_dir() will call the callback whenever we enter a
directory, and then pass the struct dirent for that directory, and an fd
for the directory the dirent is part of (i.e. the parent of the
directory we call things for). For the top-level dir the function is
invoked for we will not call the callback however, because we have no
dirent for that, and not fd for the directory the top-level dir is part
of. Let's add a flag to call it anyway, and in that case pass a NULL
dirent and -1 as directory fd.

This is useful when we want to treat the top-level dir the same as any
dir further down.

This is done opt-in since the callback must be ablet to handle a NULL
dirent and a -1 directory fd.

2 years agorandom-seed: make sure to load machine id even if the seed file is missing
Franck Bui [Mon, 24 Oct 2022 09:30:29 +0000 (11:30 +0200)] 
random-seed: make sure to load machine id even if the seed file is missing

2 years agoMerge pull request #25321 from poettering/acpi-timing-fix
Lennart Poettering [Wed, 9 Nov 2022 17:32:34 +0000 (18:32 +0100)] 
Merge pull request #25321 from poettering/acpi-timing-fix

acp-fpdt: minor tweaks/fixes

2 years agoMerge pull request #25302 from poettering/dissect-with
Lennart Poettering [Wed, 9 Nov 2022 17:31:54 +0000 (18:31 +0100)] 
Merge pull request #25302 from poettering/dissect-with

dissect: add new --with command for excuting commands with a DDI mounted

2 years agoacpi-fpdt: make sure length/type fields are available in acpi_fpdt_header 25321/head
Lennart Poettering [Wed, 9 Nov 2022 14:16:09 +0000 (15:16 +0100)] 
acpi-fpdt: make sure length/type fields are available in acpi_fpdt_header

some extra safety: make sure the two fields we care about are actually
properly present before the buffer is over.

2 years agoacpi-fpdt: don't accidentally drop signedness of pread() return
Lennart Poettering [Wed, 9 Nov 2022 14:09:08 +0000 (15:09 +0100)] 
acpi-fpdt: don't accidentally drop signedness of pread() return

2 years agoacpi-fpdt: use our usual ret_xyz naming scheme
Lennart Poettering [Wed, 9 Nov 2022 14:08:40 +0000 (15:08 +0100)] 
acpi-fpdt: use our usual ret_xyz naming scheme

2 years agotest: extend TEST-50-DISSECT for systemd-dissect --list and --with 25302/head
Lennart Poettering [Tue, 8 Nov 2022 17:17:55 +0000 (18:17 +0100)] 
test: extend TEST-50-DISSECT for systemd-dissect --list and --with

2 years agoman: document the new --with switch of systemd-dissect
Lennart Poettering [Tue, 8 Nov 2022 16:36:46 +0000 (17:36 +0100)] 
man: document the new --with switch of systemd-dissect

2 years agodissect: add new --with command
Lennart Poettering [Tue, 25 Oct 2022 13:18:28 +0000 (15:18 +0200)] 
dissect: add new --with command

2 years agodissect: officially support initrd DDIs (to implement 2nd stage initrds)
Lennart Poettering [Tue, 8 Nov 2022 13:37:47 +0000 (14:37 +0100)] 
dissect: officially support initrd DDIs (to implement 2nd stage initrds)

Let's complete support for DDI discovery, and also support 2nd stage
initrds.

2 years agoMerge pull request #25314 from poettering/dissect-list-tweaks
Lennart Poettering [Wed, 9 Nov 2022 13:42:30 +0000 (14:42 +0100)] 
Merge pull request #25314 from poettering/dissect-list-tweaks

dissect: minor tweaks to "systemd-dissect --list"

2 years agodissect: open pager in --list mode, output might be long 25314/head
Lennart Poettering [Wed, 9 Nov 2022 10:52:50 +0000 (11:52 +0100)] 
dissect: open pager in --list mode, output might be long

2 years agodissect: simplify flags for recurse_dir()
Lennart Poettering [Wed, 9 Nov 2022 10:37:42 +0000 (11:37 +0100)] 
dissect: simplify flags for recurse_dir()

We are not interested in the struct dirent data, hence there's no point
in passing RECURSE_DIR_ENSURE_TYPE. Let's drop it, and thus avoid some
extrac work on file systems where readdir() does not report .d_type.

Also drop RECURSE_DIR_SAME_MOUNT, because DDIs after all may contain
multiple partitions, and we mount them all together. The --list command
really should report the full set of files in an image.

2 years agodissect: remove unused variable
Lennart Poettering [Wed, 9 Nov 2022 10:37:19 +0000 (11:37 +0100)] 
dissect: remove unused variable

2 years agotest-copy: Rework test_copy_tree_replace_dirs() to use new openat() helpers 24813/head
Daan De Meyer [Mon, 26 Sep 2022 20:33:23 +0000 (22:33 +0200)] 
test-copy: Rework test_copy_tree_replace_dirs() to use new openat() helpers

2 years agorm-rf: Add rm_rf_physical_and_close()
Daan De Meyer [Mon, 26 Sep 2022 20:31:52 +0000 (22:31 +0200)] 
rm-rf: Add rm_rf_physical_and_close()

In tests it's useful to be able to delete temporary directories
via a file descriptor to them, so let's add rm_rf_physical_and_close()
which gets the file descriptor path via /proc and tries to remove it
that way.

2 years agofileio: Add openat() like helpers
Daan De Meyer [Mon, 26 Sep 2022 09:34:47 +0000 (11:34 +0200)] 
fileio: Add openat() like helpers

2 years agomkdir: Add mkdirat_parents()
Daan De Meyer [Mon, 26 Sep 2022 09:19:03 +0000 (11:19 +0200)] 
mkdir: Add mkdirat_parents()

2 years agomkdir: Add mkdirat_safe()
Daan De Meyer [Mon, 26 Sep 2022 08:52:33 +0000 (10:52 +0200)] 
mkdir: Add mkdirat_safe()

2 years agofs-util: Add chown_and_chmod_at()
Daan De Meyer [Mon, 26 Sep 2022 08:15:03 +0000 (10:15 +0200)] 
fs-util: Add chown_and_chmod_at()

2 years agochase-symlinks: Add chase_symlinks_at()
Daan De Meyer [Sun, 25 Sep 2022 07:18:41 +0000 (09:18 +0200)] 
chase-symlinks: Add chase_symlinks_at()

2 years agopath-util: Add path_make_relative_cwd()
Daan De Meyer [Mon, 26 Sep 2022 11:06:47 +0000 (13:06 +0200)] 
path-util: Add path_make_relative_cwd()

2 years agotmpfile-util: Add fopen_temporary_at()
Daan De Meyer [Mon, 26 Sep 2022 09:59:21 +0000 (11:59 +0200)] 
tmpfile-util: Add fopen_temporary_at()

2 years agotmpfile-util: Introduce mkdtemp_open()
Daan De Meyer [Sat, 24 Sep 2022 15:10:40 +0000 (17:10 +0200)] 
tmpfile-util: Introduce mkdtemp_open()

2 years agoMerge pull request #25300 from DaanDeMeyer/kernel-selftests
Luca Boccassi [Wed, 9 Nov 2022 10:07:00 +0000 (11:07 +0100)] 
Merge pull request #25300 from DaanDeMeyer/kernel-selftests

mkosi: Build and install kernel selftests

2 years agopo: Translated using Weblate (French)
blutch112 [Mon, 7 Nov 2022 08:19:51 +0000 (09:19 +0100)] 
po: Translated using Weblate (French)

Currently translated at 100.0% (193 of 193 strings)

Co-authored-by: blutch112 <vincent.lefebvre59@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/fr/
Translation: systemd/main

2 years agobasic/virt: treat missing /proc as sign of being in a chroot
Zbigniew Jędrzejewski-Szmek [Fri, 28 Oct 2022 13:59:49 +0000 (15:59 +0200)] 
basic/virt: treat missing /proc as sign of being in a chroot

The logic of running_in_chroot() has been the same since the introduction of
this function in b4f10a5e8956d26f0bc6b9aef12846b57caee08b: if /proc is not
mounted, the function returns -ENOENT and all callers treat this as false. But
that might be the most common case of chrooted calls, esp. in all the naïve
chroots that were done with the chroot binary without additional setup.

(In particular rpm executes all scriptlets in a chroot without bothering to set
up /proc or /sys, and we have codepaths in sysusers and tmpfiles to support
running in such an environment.)

This change effectively shortcircuits various calls to udevadm, downgrades
logging in tmpfiles, and disables all verbs marked with VERB_ONLINE_ONLY in
systemctl. detect-virt -r is also affected:

$ sudo chroot /var/lib/machines/rawhide
before> systemd-detect-virt -r && echo OK
Failed to check for chroot() environment: No such file or directory
after> systemd-detect-virt -r && echo OK
OK

3 years agoshared: make libmount_parse() non-inline
Zbigniew Jędrzejewski-Szmek [Mon, 7 Nov 2022 10:49:36 +0000 (11:49 +0100)] 
shared: make libmount_parse() non-inline

Back in e2857b3d87306d93f0fba526f3e79f4f6806fb02 I added this function
as static inline in order to avoid linking libmount into libshared.
Nevertheless, a dependency on libmount was added to libbasic in
9e7f941acb0d8fe7a31eec7826ff2c9c6af7044f, and later moved to libshared
in 77c772f227d866331560a8d0487fba12dd128dd4. So the shenanigan with an
inline function is not useful, let's make it a normal function.

3 years agoshared/mount-util: fix comment
Zbigniew Jędrzejewski-Szmek [Mon, 7 Nov 2022 10:21:29 +0000 (11:21 +0100)] 
shared/mount-util: fix comment

Just typos and grammar. In the end didn't add a use of a function, but
I read the comment carefully, and this commit is the result of that.

3 years agoRevert "initrd: extend SYSTEMD_IN_INITRD to accept non-ramfs rootfs"
Zbigniew Jędrzejewski-Szmek [Sun, 6 Nov 2022 19:34:21 +0000 (20:34 +0100)] 
Revert "initrd: extend SYSTEMD_IN_INITRD to accept non-ramfs rootfs"

This reverts commit 1f22621ba33f8089d2ae5fbcaf8b3970dd68aaf0.

As described in the reverted commit, we don't want to get rid of the check
completely. But the check requires opting-in by setting SYSTEMD_IN_INITRD=lenient,
which is cumbersome and doesn't seem to actually happen.
https://bugzilla.redhat.com/show_bug.cgi?id=2137631 is caused by systemd refusing
to treat the system as an initrd because overlayfs is used. Let's revert this
approach and do something that doesn't require opt-in instead.

I don't think it makes sense to keep support for "SYSTEMD_IN_INITRD=lenient" or
"SYSTEMD_IN_INITRD=auto". To get "auto" behaviour, just unset the option. And
"lenient" will be reimplemented as a better check. Thus the changes to the
option interface are completely reverted.

3 years agoMerge pull request #25291 from keszybz/util-cleanup
Yu Watanabe [Wed, 9 Nov 2022 00:23:17 +0000 (09:23 +0900)] 
Merge pull request #25291 from keszybz/util-cleanup

Split/rename util.c+h and def.h

3 years agonetworkd-ipv4acd.c: Use net/if.h for getting IFF_LOOPBACK definition
Khem Raj [Tue, 8 Nov 2022 20:21:35 +0000 (12:21 -0800)] 
networkd-ipv4acd.c: Use net/if.h for getting IFF_LOOPBACK definition

This helps in avoiding compiling errors on musl. Definition of
IFF_LOOPBACK is the reason for including linux/if_arp.h, this however
could be obtained from net/if.h glibc header equally and makes it
portable as well.

3 years agoMerge pull request #25297 from mrc0mmand/aux-test-fixes
Yu Watanabe [Tue, 8 Nov 2022 21:34:23 +0000 (06:34 +0900)] 
Merge pull request #25297 from mrc0mmand/aux-test-fixes

test: fix a race in the systemd-mount test

3 years agodissect: grey out trailing slash in --list output
Lennart Poettering [Fri, 4 Nov 2022 17:29:58 +0000 (18:29 +0100)] 
dissect: grey out trailing slash in --list output

Given this is just auxiliary info, let's make it a tiny bit less visible
then the main part of the path.

3 years agoRename def.h to constants.h 25291/head
Zbigniew Jędrzejewski-Szmek [Mon, 7 Nov 2022 13:59:58 +0000 (14:59 +0100)] 
Rename def.h to constants.h

The name "def.h" originates from before the rule of "no needless abbreviations"
was established. Let's rename the file to clarify that it contains a collection
of various semi-related constants.

3 years agobasic/filesystems: fs_in_group() returns a boolean
Zbigniew Jędrzejewski-Szmek [Sun, 6 Nov 2022 17:41:48 +0000 (18:41 +0100)] 
basic/filesystems: fs_in_group() returns a boolean

is_{temporary,network}_fs() looked like they are incorrectly casting an error
to true, but actually the return type is misdeclared.

3 years agobasic: rename util.h to logarithm.h
Zbigniew Jędrzejewski-Szmek [Sun, 6 Nov 2022 15:54:32 +0000 (16:54 +0100)] 
basic: rename util.h to logarithm.h

util.h is now about logarithms only, so we can rename it. Many files included
util.h for no apparent reason… Those includes are dropped.

3 years agobasic: move a bunch of cmdline-related funcs to new argv-util.c+h
Zbigniew Jędrzejewski-Szmek [Sun, 6 Nov 2022 15:45:48 +0000 (16:45 +0100)] 
basic: move a bunch of cmdline-related funcs to new argv-util.c+h

I wanted to move saved_arg[cv] to process-util.c+h, but this causes problems:
process-util.h includes format-util.h which includes net/if.h, which conflicts
with linux/if.h. So we can't include process-util.h in some files.

But process-util.c is very long anyway, so it seems nice to create a new file.
rename_process(), invoked_as(), invoked_by_systemd(), and argv_looks_like_help()
which lived in process-util.c refer to saved_argc and saved_argv, so it seems
reasonable to move them to the new file too.

util.c is now empty, so it is removed. util.h remains.

3 years agomeson: add version.h as dependency to more targets
Zbigniew Jędrzejewski-Szmek [Tue, 8 Nov 2022 12:37:27 +0000 (13:37 +0100)] 
meson: add version.h as dependency to more targets

version.h can be generated after compilation starts, creating a race condition
between compilation of various .c files and creation of version.h. Let's add it
as a dependency to more build targets that require version.h or build.h.

So far we played whack'a'mole by adding versiondep whenever compilation failed.
In principle any target which includes compilation (i.e. any that has .c
sources directly), could require this. I don't understand why we didn't see
more failures… But it seems reasonable to just add the dependency more widely.

3 years agoupdate TODO
Lennart Poettering [Tue, 8 Nov 2022 13:37:26 +0000 (14:37 +0100)] 
update TODO

3 years agomkosi: Build and install kernel selftests 25300/head
Daan De Meyer [Wed, 2 Nov 2022 11:19:11 +0000 (12:19 +0100)] 
mkosi: Build and install kernel selftests

3 years agomkosi: Add back libasan/libubsan libraries
Daan De Meyer [Wed, 2 Nov 2022 10:46:14 +0000 (11:46 +0100)] 
mkosi: Add back libasan/libubsan libraries

These were accidentally removed as part of #24025

3 years agobasic: move version() to build.h+c
Zbigniew Jędrzejewski-Szmek [Sun, 6 Nov 2022 15:30:58 +0000 (16:30 +0100)] 
basic: move version() to build.h+c

3 years agobasic,shared: move disable_coredumps() to coredump-util.[ch]
Zbigniew Jędrzejewski-Szmek [Sat, 5 Nov 2022 16:47:06 +0000 (17:47 +0100)] 
basic,shared: move disable_coredumps() to coredump-util.[ch]

3 years agobasic: move container_get_leader() to process-util.[ch]
Zbigniew Jędrzejewski-Szmek [Sat, 5 Nov 2022 16:40:01 +0000 (17:40 +0100)] 
basic: move container_get_leader() to process-util.[ch]

basic/util.[ch] is a grab-bag of unrelated functions. Let's move a few
of the remaning functions to better locations.

3 years agobasic: create new basic/initrd-util.[ch] for initrd-related functions
Zbigniew Jędrzejewski-Szmek [Sat, 5 Nov 2022 16:29:43 +0000 (17:29 +0100)] 
basic: create new basic/initrd-util.[ch] for initrd-related functions

I changed imports of util.h to initrd-util.h, or added an import of
initrd-util.h, to keep compilation working. It turns out that many files didn't
import util.h directly.

When viewing the patch, don't be confused by git rename detection logic:
a new .c file is added and two functions moved into it.

3 years agotests: move tests for eqzero() to a new file
Zbigniew Jędrzejewski-Szmek [Sun, 6 Nov 2022 16:19:32 +0000 (17:19 +0100)] 
tests: move tests for eqzero() to a new file

It's a bit silly to have a separate file that one short test, but this is the
last part of the test code that is misplaced, and here consistency beats
brevity.

3 years agotests: move tests for PROTECT_ERRNO to the right file
Zbigniew Jędrzejewski-Szmek [Sun, 6 Nov 2022 16:15:56 +0000 (17:15 +0100)] 
tests: move tests for PROTECT_ERRNO to the right file

Also, rename them to uppercase so that the test name matches what we're
actually testing.

3 years agotests: create test-raw-clone.c for raw-clone.h
Zbigniew Jędrzejewski-Szmek [Sun, 6 Nov 2022 16:13:57 +0000 (17:13 +0100)] 
tests: create test-raw-clone.c for raw-clone.h

The include for process-util.h is added for reset_cached_pid(). This
essentially fixes a pre-existing missing include.

3 years agotests: create test-limits-util.c for limits-util funcs
Zbigniew Jędrzejewski-Szmek [Sun, 6 Nov 2022 15:59:04 +0000 (16:59 +0100)] 
tests: create test-limits-util.c for limits-util funcs

3 years agosd-journal: make prot_from_flags() static and rename
Zbigniew Jędrzejewski-Szmek [Sat, 5 Nov 2022 15:12:15 +0000 (16:12 +0100)] 
sd-journal: make prot_from_flags() static and rename

The function had just one caller and a name that didn't explain much.
Let's make it static and rename for clarity.

While at it, the only caller was not doing error handling correctly
— the function would potentially return a negative error value which
wasn't handled. In practice this couldn't happen, but let's remove
this ambiguity.

3 years agotest: adjust systemd-mount's tests based on recent coverage reports 25297/head
Frantisek Sumsal [Tue, 8 Nov 2022 11:44:37 +0000 (12:44 +0100)] 
test: adjust systemd-mount's tests based on recent coverage reports

3 years agotest: install realpath into the test images
Frantisek Sumsal [Tue, 8 Nov 2022 11:43:57 +0000 (12:43 +0100)] 
test: install realpath into the test images

3 years agoman: add note that network-generator is not a generator
Zbigniew Jędrzejewski-Szmek [Tue, 8 Nov 2022 10:07:02 +0000 (11:07 +0100)] 
man: add note that network-generator is not a generator

Also fix indentation.

3 years agotest: fix a race in the systemd-mount test
Frantisek Sumsal [Tue, 8 Nov 2022 11:01:13 +0000 (12:01 +0100)] 
test: fix a race in the systemd-mount test

Where we might check the automount unit before systemd has a chance to
react.

3 years agohwdb: Add accel orientation quirk for the Acer Switch V 10 SW5-017 2-in-1
Hans de Goede [Mon, 7 Nov 2022 20:46:56 +0000 (21:46 +0100)] 
hwdb: Add accel orientation quirk for the Acer Switch V 10 SW5-017 2-in-1

Add a quirk for the accelerometer orientation for
the Acer Switch V 10 SW5-017 2-in-1.

3 years agoFix key toggle and programmable button for Positivo N14ZP
drosdeck [Mon, 7 Nov 2022 15:14:07 +0000 (12:14 -0300)] 
Fix key toggle and programmable button for Positivo N14ZP

3 years agokernel-install: skip 50-depmod if depmod is not available
Luca Boccassi [Mon, 7 Nov 2022 16:28:33 +0000 (16:28 +0000)] 
kernel-install: skip 50-depmod if depmod is not available

Images might be built without any kernel module, and without
installing depmod as it is not needed. Skip it.

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1023607

3 years agoMerge pull request #25286 from mrc0mmand/systemd-mount-test-fix
Luca Boccassi [Mon, 7 Nov 2022 19:24:52 +0000 (20:24 +0100)] 
Merge pull request #25286 from mrc0mmand/systemd-mount-test-fix

test: replace tmpfs with vfat when testing --owner=

3 years agokernel-install/90-loaderentry: do not override an existing systemd.machine_id
Antonio Alvarez Feijoo [Mon, 7 Nov 2022 14:25:25 +0000 (15:25 +0100)] 
kernel-install/90-loaderentry: do not override an existing systemd.machine_id

If the systemd.machine_id command line option is already set, do not override
it.

3 years agoMerge pull request #25279 from mrc0mmand/firstboot-test-fixes
Frantisek Sumsal [Mon, 7 Nov 2022 18:41:44 +0000 (18:41 +0000)] 
Merge pull request #25279 from mrc0mmand/firstboot-test-fixes

test: cover some interactive/error paths in firstboot

3 years agomkosi: use the new mkosi.conf suffix
Zbigniew Jędrzejewski-Szmek [Fri, 28 Oct 2022 15:39:50 +0000 (17:39 +0200)] 
mkosi: use the new mkosi.conf suffix

Mkosi 14 is out, compat with old mkosi is not terribly important. Let's
use the new nice suffix.

3 years agosemaphore: remove the Semaphore repositories recursively
Frantisek Sumsal [Mon, 7 Nov 2022 15:39:12 +0000 (16:39 +0100)] 
semaphore: remove the Semaphore repositories recursively

The list of disabled repositories was recently converted from a single
file into a directory with separate repository files, so let's adjust
the setup script accordingly.

```
$ ls -lR /etc/apt/sources.list.d/
/etc/apt/sources.list.d/:
total 36
-rw-r--r-- 1 root root   76 Nov  3 10:28 azure-cli.list
-rw-r--r-- 1 root root   72 Nov  3 10:22 bazel.list
drwxr-xr-x 2 root root 4096 Nov  3 10:31 disabled
-rw-r--r-- 1 root root  113 Nov  3 10:13 docker-source.list
-rw-r--r-- 1 root root  367 Nov  3 10:28 github_git-lfs.list
-rw-r--r-- 1 root root  111 Nov  3 10:25 google-chrome-source.list
-rw-r--r-- 1 root root   64 Nov  3 10:14 google-cloud-sdk.list
-rw-r--r-- 1 root root   54 Nov  3 10:23 helm-stable-debian.list
-rw-r--r-- 1 root root   89 Nov  3 10:29 yarn-source.list

/etc/apt/sources.list.d/disabled:
total 20
-rw-r--r-- 1 root root 100 Nov  3 10:23 devel_kubic_libcontainers_stable.list
-rw-r--r-- 1 root root 103 Nov  3 10:27 git.list
-rw-r--r-- 1 root root 105 Nov  3 10:22 gradle.list
-rw-r--r-- 1 root root 118 Nov  3 10:13 pypy.list
-rw-r--r-- 1 root root 104 Nov  3 10:13 python.list
```

3 years agoMerge pull request #25282 from keszybz/trivial-cleanups
Yu Watanabe [Mon, 7 Nov 2022 15:21:40 +0000 (00:21 +0900)] 
Merge pull request #25282 from keszybz/trivial-cleanups

Trivial cleanups

3 years agotest: replace tmpfs with vfat when testing --owner= 25286/head
Frantisek Sumsal [Mon, 7 Nov 2022 14:55:08 +0000 (15:55 +0100)] 
test: replace tmpfs with vfat when testing --owner=

3 years agoRevert "mountpoint-util: tmpfs supports uid=/gid= mount options"
Frantisek Sumsal [Mon, 7 Nov 2022 14:43:54 +0000 (15:43 +0100)] 
Revert "mountpoint-util: tmpfs supports uid=/gid= mount options"

This reverts commit 7d4f00c88c65532bf66d20b3ec498b5bfaa621d2.

fstype_can_uid_gid() is about fixating all files to the specified
uid/gid. tmpfs does not qualify. The uid/gid parameter there is simply
about the default uid/gid for the root inode of the tmpfs, it allows
setting uids/gid arbirarily for all inodes after that.

This distinction matters: for file systems this function returns true
for we can use this in place of uidmapped mounts. But for tmpfs this is
not going to work, given inodes on that fs can end up having arbitrary
uid/gid.

See: https://github.com/systemd/systemd/pull/25284#issue-1438427144

3 years agotest: cover some interactive/error paths in firstboot 25279/head
Frantisek Sumsal [Sun, 6 Nov 2022 21:40:33 +0000 (22:40 +0100)] 
test: cover some interactive/error paths in firstboot

3 years agotest: fix keymaps installation on Arch
Frantisek Sumsal [Mon, 7 Nov 2022 11:07:27 +0000 (12:07 +0100)] 
test: fix keymaps installation on Arch

Where the keymaps live under /usr/share/kbd/keymaps/.

3 years agotest: fix locale installation when locale-gen is used
Frantisek Sumsal [Mon, 7 Nov 2022 10:57:59 +0000 (11:57 +0100)] 
test: fix locale installation when locale-gen is used

locale-gen might merge all compiled locales into a simple archive, so we
need to install it as well if necessary.

3 years agotest: compile test-utmp.c only if UTMP is enabled
Torsten Hilbrich [Mon, 7 Nov 2022 07:38:58 +0000 (08:38 +0100)] 
test: compile test-utmp.c only if UTMP is enabled

When compiling with -D utmp=false the compilation fails with:

../../git/systemd/src/test/test-utmp.c: In function ‘test_dump_run_utmp’:
../../git/systemd/src/test/test-utmp.c:21:9: error: cleanup argument not a function
   21 |         _unused_ _cleanup_(utxent_cleanup) bool utmpx = false;
      |         ^~~~~~~~
../../git/systemd/src/test/test-utmp.c:23:17: error: implicit declaration of function ‘utxent_start’ [-Werror=implicit-function-declaration]
   23 |         utmpx = utxent_start();
      |                 ^~~~~~~~~~~~

any many other errors

Add a conditional to compile test-utmp.c only if ENABLE_UTMP is true.

3 years agoMerge pull request #25277 from mrc0mmand/also-coverage
Yu Watanabe [Mon, 7 Nov 2022 12:59:44 +0000 (21:59 +0900)] 
Merge pull request #25277 from mrc0mmand/also-coverage

test: add coverage for systemd-mount

3 years agoudevadm: merge two log stmts 25282/head
Zbigniew Jędrzejewski-Szmek [Fri, 28 Oct 2022 14:00:13 +0000 (16:00 +0200)] 
udevadm: merge two log stmts

3 years agoman: grammarro
Zbigniew Jędrzejewski-Szmek [Tue, 18 Jan 2022 11:08:05 +0000 (12:08 +0100)] 
man: grammarro

3 years agosd-event: adjust indentation
Zbigniew Jędrzejewski-Szmek [Fri, 28 Oct 2022 14:38:46 +0000 (16:38 +0200)] 
sd-event: adjust indentation

3 years agoMerge pull request #25266 from poettering/dissect-fsck-fix
Lennart Poettering [Mon, 7 Nov 2022 11:24:53 +0000 (12:24 +0100)] 
Merge pull request #25266 from poettering/dissect-fsck-fix

dissect: fix fsck invocation

3 years agotest: don't ignore non-existent paths in inst_recursive()
Frantisek Sumsal [Mon, 7 Nov 2022 10:55:29 +0000 (11:55 +0100)] 
test: don't ignore non-existent paths in inst_recursive()

The process substitution in the while loop hides errors raised by the
find utility, which might (and did), in turn, hide errors in test setup.

3 years agotest: add coverage for systemd-mount 25277/head
Frantisek Sumsal [Sun, 6 Nov 2022 21:40:40 +0000 (22:40 +0100)] 
test: add coverage for systemd-mount

3 years agomountpoint-util: tmpfs supports uid=/gid= mount options
Frantisek Sumsal [Sun, 6 Nov 2022 21:49:47 +0000 (22:49 +0100)] 
mountpoint-util: tmpfs supports uid=/gid= mount options

As tmpfs(5) says, both uid= and gid= are supported since kernel 2.5.7 and
the mount utility seems to agree:

```
# stat -c "%U:%G" mnt
root:root
# mount -o uid=testuser,gid=testuser -t tmpfs tmpfs mnt
# stat -c "%U:%G" mnt
testuser:testuser
```

However, systemd-mount currently complains:

```
# systemd-mount --owner testuser -t tmpfs tmpfs mnt
File system type tmpfs is not known to support uid=/gid=, refusing.
```

3 years agoMerge pull request #25107 from lucab/ups/sysusers-gid-check-username
Luca Boccassi [Sun, 6 Nov 2022 22:58:53 +0000 (23:58 +0100)] 
Merge pull request #25107 from lucab/ups/sysusers-gid-check-username

sysusers: cross-check user and group names too

3 years agoloop-util: open lock fd read-only
Christian Göttsche [Fri, 4 Nov 2022 18:36:31 +0000 (19:36 +0100)] 
loop-util: open lock fd read-only

flock(2) works with file descriptors opened with O_RDONLY.

This affects SELinux systems where access to block devices is quite
restricted to avoid bypasses on filesystem objects.