1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-25 06:03:40 +03:00

60924 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
3ca4ec2012 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.
2022-11-09 09:20:34 +01:00
Zbigniew Jędrzejewski-Szmek
b1fd5cd4ed 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.
2022-11-09 09:20:33 +01:00
Yu Watanabe
bf18862267
Merge pull request #25291 from keszybz/util-cleanup
Split/rename util.c+h and def.h
2022-11-09 09:23:17 +09:00
Khem Raj
239e4a42a6 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.
2022-11-09 01:17:37 +01:00
Yu Watanabe
68773437da
Merge pull request #25297 from mrc0mmand/aux-test-fixes
test: fix a race in the systemd-mount test
2022-11-09 06:34:23 +09:00
Lennart Poettering
bb69ec9507 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.
2022-11-08 21:35:34 +01:00
Zbigniew Jędrzejewski-Szmek
28db6fbff1 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.
2022-11-08 18:21:10 +01:00
Zbigniew Jędrzejewski-Szmek
db62f51a9f 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.
2022-11-08 18:21:10 +01:00
Zbigniew Jędrzejewski-Szmek
3ae6b3bf72 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.
2022-11-08 18:21:10 +01:00
Zbigniew Jędrzejewski-Szmek
ee617a4e5c 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.
2022-11-08 18:21:10 +01:00
Zbigniew Jędrzejewski-Szmek
c47511da7e 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.
2022-11-08 18:18:34 +01:00
Lennart Poettering
084ecae56f update TODO 2022-11-08 16:39:27 +01:00
Daan De Meyer
6c2ff4a050 mkosi: Build and install kernel selftests 2022-11-08 16:24:21 +01:00
Daan De Meyer
165176d199 mkosi: Add back libasan/libubsan libraries
These were accidentally removed as part of #24025
2022-11-08 16:20:51 +01:00
Zbigniew Jędrzejewski-Szmek
d6b4d1c7c4 basic: move version() to build.h+c 2022-11-08 13:41:14 +01:00
Zbigniew Jędrzejewski-Szmek
c8715007e0 basic,shared: move disable_coredumps() to coredump-util.[ch] 2022-11-08 13:41:13 +01:00
Zbigniew Jędrzejewski-Szmek
3ec2ad35ba 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.
2022-11-08 13:41:13 +01:00
Zbigniew Jędrzejewski-Szmek
baa6a42d27 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.
2022-11-08 13:41:13 +01:00
Zbigniew Jędrzejewski-Szmek
b61b95ae9e 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.
2022-11-08 13:41:13 +01:00
Zbigniew Jędrzejewski-Szmek
737f274e1e 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.
2022-11-08 13:41:13 +01:00
Zbigniew Jędrzejewski-Szmek
2ba6823716 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.
2022-11-08 13:41:13 +01:00
Zbigniew Jędrzejewski-Szmek
da603935d5 tests: create test-limits-util.c for limits-util funcs 2022-11-08 13:41:13 +01:00
Zbigniew Jędrzejewski-Szmek
0e58dc999c 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.
2022-11-08 13:41:13 +01:00
Frantisek Sumsal
45ff459b6a test: adjust systemd-mount's tests based on recent coverage reports 2022-11-08 12:44:37 +01:00
Frantisek Sumsal
bf9b5691b8 test: install realpath into the test images 2022-11-08 12:43:57 +01:00
Zbigniew Jędrzejewski-Szmek
2fa6574e83 man: add note that network-generator is not a generator
Also fix indentation.
2022-11-08 12:13:45 +01:00
Frantisek Sumsal
9ffa095e46 test: fix a race in the systemd-mount test
Where we might check the automount unit before systemd has a chance to
react.
2022-11-08 12:01:13 +01:00
Hans de Goede
493f67d21d 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.
2022-11-08 10:45:24 +09:00
drosdeck
4dbcb5dc10 Fix key toggle and programmable button for Positivo N14ZP 2022-11-07 22:30:33 +01:00
Luca Boccassi
cda4d00dfc 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
2022-11-07 22:30:07 +01:00
Luca Boccassi
1824d3d6cc
Merge pull request #25286 from mrc0mmand/systemd-mount-test-fix
test: replace tmpfs with vfat when testing --owner=
2022-11-07 20:24:52 +01:00
Antonio Alvarez Feijoo
802d9219aa 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.
2022-11-07 19:54:16 +01:00
Frantisek Sumsal
5c1a5ac172
Merge pull request #25279 from mrc0mmand/firstboot-test-fixes
test: cover some interactive/error paths in firstboot
2022-11-07 18:41:44 +00:00
Zbigniew Jędrzejewski-Szmek
e02db840ac 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.
2022-11-08 01:32:00 +09:00
Frantisek Sumsal
610eb3f826 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
```
2022-11-08 01:11:44 +09:00
Yu Watanabe
6c826ed161
Merge pull request #25282 from keszybz/trivial-cleanups
Trivial cleanups
2022-11-08 00:21:40 +09:00
Frantisek Sumsal
be7463e309 test: replace tmpfs with vfat when testing --owner= 2022-11-07 15:59:37 +01:00
Frantisek Sumsal
9bfd596674 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
2022-11-07 15:43:54 +01:00
Frantisek Sumsal
dbd8dbdfc1 test: cover some interactive/error paths in firstboot 2022-11-07 14:48:37 +01:00
Frantisek Sumsal
1edad89399 test: fix keymaps installation on Arch
Where the keymaps live under /usr/share/kbd/keymaps/.
2022-11-07 14:48:37 +01:00
Frantisek Sumsal
0c416ea01b 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.
2022-11-07 14:48:37 +01:00
Torsten Hilbrich
41cac2a8b9 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.
2022-11-07 22:00:42 +09:00
Yu Watanabe
aaa411b9f4
Merge pull request #25277 from mrc0mmand/also-coverage
test: add coverage for systemd-mount
2022-11-07 21:59:44 +09:00
Zbigniew Jędrzejewski-Szmek
db12cf926f udevadm: merge two log stmts 2022-11-07 13:22:09 +01:00
Zbigniew Jędrzejewski-Szmek
195427cd18 man: grammarro 2022-11-07 12:45:26 +01:00
Zbigniew Jędrzejewski-Szmek
586c8cee1c sd-event: adjust indentation 2022-11-07 12:45:26 +01:00
Lennart Poettering
bcb639662e
Merge pull request #25266 from poettering/dissect-fsck-fix
dissect: fix fsck invocation
2022-11-07 12:24:53 +01:00
Frantisek Sumsal
eb5d7730e1 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.
2022-11-07 12:18:49 +01:00
Frantisek Sumsal
6da7d0c766 test: add coverage for systemd-mount 2022-11-07 09:08:27 +01:00
Frantisek Sumsal
7d4f00c88c 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.
```
2022-11-07 00:03:49 +01:00