1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-30 14:55:37 +03:00
Commit Graph

59333 Commits

Author SHA1 Message Date
Lennart Poettering
3a21f51c58 measure: fix minor memory leak
When using --current switch, copy in current hash, don't just reassign
buffers forgetting about the old.

While we are at it, allocate the local copy buffer later, in
measure_pcr() as we won#t need it in the --current case.
2022-08-23 19:31:58 +01:00
Frantisek Sumsal
bca762ce1a test: wait for the lodev to get properly initialized
Otherwise we might start writing to one of its partition before the
respective node is created under /dev, resulting in... interesting
stuff.

Resolves: #24390
2022-08-23 17:38:43 +00:00
Daan De Meyer
37d35150cb mkosi: Ensure we build all features/components in mkosi
Explicitly enable all features/components in the mkosi build to
ensure they all get built and we get an error if they can't be built.

We also rework the packages sections of all mkosi configs to reduce
duplication and cover all the dependencies necessary to build/use all
systemd features.

Note that for the final image, since systemd is installed by default
in base images, we rely on that to install the base library dependencies
and we only list extra optional dependencies and tools that aren't already
installed by default into the base image.

We also drop the centos stream 8 mkosi build as dependencies on that
distro are too out-of-date to be able to build all systemd features.
Since centos stream 9 has been out for a while, let's focus on that
and leave it to downstream to keep systemd building on centos stream 8.

Finally, there's a few additions to the mkosi scripts to make sure
services don't start by default on boot.
2022-08-23 15:19:26 +02:00
Luca Boccassi
0f74ca8668
Merge pull request #24412 from keszybz/man-similarly
man: grammar cleanups
2022-08-23 13:17:13 +01:00
Luca Boccassi
712e0b4792
Merge pull request #23893 from yuwata/core-mount-re-read-mountinfo
core/mount: adjust deserialized state based on if the corresponding mountinfo entry exists or not
2022-08-23 12:46:39 +01:00
Zbigniew Jędrzejewski-Szmek
6163dac48f man/crypttab: rework formatting in "key acquisition section"
<example> without <title> was rendered as "Example 1.", which did not
look good. While at it, the text is rewored to be, I hope, a bit easier to
read.
2022-08-23 12:32:17 +02:00
Frantisek Sumsal
3398a73254 test: install /etc/default/knot if available as well
The knot.service on Ubuntu Jammy loads an env file which we didn't
install, causing the service to fail:

```
knot.service: Will spawn child (service_enter_start_pre): /usr/sbin/knotc
knot.service: Failed to load environment files: No such file or directory
knot.service: Failed to run 'start-pre' task: No such file or directory
knot.service: Failed with result 'resources'.
knot.service: Service will not restart (restart setting)
```
2022-08-23 11:26:35 +01:00
Zbigniew Jędrzejewski-Szmek
15102ced42 man: similar → similarly
Something *is* similar
Something *works* similarly
Something does something, similarly to how something else does something

See https://sites.ulethbridge.ca/roussel/2017/11/29/similar-and-similarly-are-they-similar/
for a clear explanation.
2022-08-23 12:14:58 +02:00
Zbigniew Jędrzejewski-Szmek
00616643de
Merge pull request #24352 from DaanDeMeyer/mkosi-opensuse
mkosi: Update to latest commit
2022-08-23 11:05:02 +02:00
eggfly
6b5e82408d fix typos 2022-08-23 10:53:47 +02:00
jiangchuangang
9ed999cb5d fix typo 2022-08-23 09:23:49 +02:00
Goffredo Baroncelli
046f101bf6 Allow uneven length BootXXXX variables
The BootXXXX variables may have an uneven length. Don't return error
in this case.

Signed-off-by: Goffredo Baroncelli <kreijack@inwind.it>
2022-08-23 07:22:46 +02:00
Lennart Poettering
81a7eac1f7 chase-symlinks: refuse more chase_symlink() flags in the open/stat flavours
These flags make no sense when we try to access the final inode, hence
refuse.
2022-08-22 19:25:00 +01:00
Lennart Poettering
127b72da2b measure: add --current switch for "systemd-measure calculate"
This allows allows shortcutting measurements of the specified files and
use the information from /sys/ instead.

This is not too useful on its own given that "systemd-measure status"
already exists which displays the current, relevant PCR values. The main
difference is how "complete" the information is. "status" will detect if
the measurements make any sense, and show more than PCR 11. "calculate
--current" otoh only reads PCR 11 and uses that, and that's really it.

This is mainly preparation for later work to add PCR signing to the
tool, where usually it makes most sense to sign prepared kernel images,
but for testing it's really useful to shortcut signing to the current
PCR values instead
2022-08-22 19:17:18 +01:00
Lennart Poettering
8e7e4a730b tree-wide: use path_join() instead of prefix_roota() in various cases
prefix_roota() is something we should stop using. It is bad for three
reasons:

1. As it names suggests it's supposed to be used when working relative
   to some root directory, but given it doesn't follow symlinks (and
   instead just stupidly joins paths) it is not a good choice for that.

2. More often than not it is currently used with inputs under control of
   the user, and that is icky given it typically allocates memory on the
   stack.

3. It's a redundant interface, where chase_symlinks() and path_join()
   already exist as better, safer interfaces.

Hence, let's start moving things from prefix_roota() to path_join() for
the cases where that's appropriate.
2022-08-22 19:15:29 +01:00
Lennart Poettering
8ef6106de4
Merge pull request #24392 from poettering/chase-symlinks-more-stuff
some tweaks to chase_symlinks() and port some code from prefix_roota() over
2022-08-22 18:41:14 +02:00
Yu Watanabe
760971125d test: make TEST-58-REPART support nspawn 2022-08-22 17:00:38 +02:00
Yu Watanabe
2b21522e82 test: merge test-repart.sh and TEST-58-REPART 2022-08-22 17:00:38 +02:00
Yu Watanabe
5996f11679 test: modernize TEST-58-REPART 2022-08-22 17:00:38 +02:00
Yu Watanabe
655eb07391 gpt: fix alignment 2022-08-22 17:00:38 +02:00
Yu Watanabe
4565246911 gpt: fix native uuids for s390x
__s390__ is defined for both s390 and s390x. Hence, we need to define
the native uuids for s390x at first.
2022-08-22 17:00:38 +02:00
Yu Watanabe
400e3d21f8 udev: fix inversed inequality for timeout of retrying event
Follow-up for 5d354e525a.
2022-08-22 17:00:38 +02:00
Yu Watanabe
695cfd53fe repart: drop doubled space 2022-08-22 17:00:38 +02:00
Antonio Alvarez Feijoo
aa2118cb0b bash-completion: add systemd-sysext support 2022-08-22 15:41:38 +01:00
Antonio Alvarez Feijoo
782e41ab88 sysext: add missing COMMAND to the help output and man synopsis 2022-08-22 15:41:12 +01:00
Luca Boccassi
d4001c518a
Merge pull request #24385 from yuwata/hostname-chassis
hostname: fix fallback chassis type
2022-08-22 15:40:38 +01:00
Jan Macku
3d59b0470a ci: Drop actions/setup-node - unused
In `issue_labeler.yml` is no need for node.js runtime (`actions/setup-node`). It was accidentally added by `copy & paste` from another workflow.
2022-08-22 21:21:08 +09:00
Lennart Poettering
1d1c226f6c conf-files: port conf_files_list() over to chase_symlinks() from prefix_roota() 2022-08-22 14:08:48 +02:00
Lennart Poettering
3979ea8644 hwdb-test: don't rely on --root= quirk
Previously, the test would rely on the fact that systemd-hwdb would
follow symlinks outside of the --root= hierarchy. That's a bug however,
and systemd-hwdb shouldn't do that. Hence let's remove the fact that the
test relies on it, so that we can then fix systemd-hwdb (specifically:
conf_files_list()) accordingly.
2022-08-22 14:07:45 +02:00
Lennart Poettering
3730dc5d5b bootctl: port some more code over to chase_symlinks() from prefix_roota()
This is far from complete, but let's start moving this way.
2022-08-22 14:07:45 +02:00
Lennart Poettering
2b2caea21d chase-symlinks: add chase_symlinks_and_access() helper
This is similar to chase_symlinks_and_access() but wraps access() rather
than stat()
2022-08-22 13:40:13 +02:00
Lennart Poettering
37b9bc56fc chase-symlinks: fix shortcut condition 2022-08-22 13:40:13 +02:00
Lennart Poettering
6957023208 chase-symlinks: honour CHASE_NOFOLLOW flag properly in some cases 2022-08-22 13:40:13 +02:00
Yu Watanabe
1283eea8f4 test: add test case for chassis type 2022-08-22 19:26:31 +09:00
Tomáš Hnyk
376a30a7e5 Add support for Fn+PrtSc on Thinkpads
This adds support for Fn+PrtSc on my Lenovo Thinkpad Extreme gen 2. Judging by the picture on the key, it should probably instead of prog2 be "selective_screenshot" (that is a possible value from judging this list e18d950ce5/keynames.txt ) but that does not register with evtest at all. With this change, evtest reports:

```
Event: time 1661081631.027773, type 1 (EV_KEY), code 149 (KEY_PROG2), value 1
Event: time 1661081631.027773, -------------- SYN_REPORT ------------
Event: time 1661081631.027886, type 1 (EV_KEY), code 149 (KEY_PROG2), value 0
Event: time 1661081631.027886, -------------- SYN_REPORT ------------
```

I am not sure if systemd is the right place to add this, if not, please refer me somewhere else.
2022-08-22 10:34:21 +01:00
jiangchuangang
e3a4724db2 take jointly mounted controllers into account when migrate cgroups, otherwise "CGroupMask done" seems to be redundant. 2022-08-22 14:21:31 +09:00
Yu Watanabe
471fdebfde hostname: make chassis type actually obtained from ACPI when nothing from DMI
Fixes a bug introduced by 8c8b1800e9.

Fixes #24384.
2022-08-22 13:38:26 +09:00
Luca Boccassi
20e72c2bd4
Merge pull request #24379 from mrc0mmand/llvm-15
ci: build with clang-15; drop clang-12
2022-08-20 23:38:52 +01:00
Daan De Meyer
819a2502f2 mkosi: Install tests in final image 2022-08-20 23:24:19 +02:00
Frantisek Sumsal
3b2b3d2985 hashmap: use assert_se() to make clang happy
Otherwise it complains about a set but unused variable:

```
../src/basic/hashmap.c:1070:48: error: variable 'n_rehashed' set but not used [-Werror,-Wunused-but-set-variable]
        unsigned old_n_buckets, new_n_buckets, n_rehashed, new_n_entries;
                                                       ^
                                                       1 error generated.
```
2022-08-20 21:57:18 +02:00
Frantisek Sumsal
9abe4cfc39 coredump: drop an unused variable 2022-08-20 21:04:24 +02:00
Frantisek Sumsal
f8769631e1 network: drop an unused variable 2022-08-20 21:00:14 +02:00
Frantisek Sumsal
f7c1808e69 machine: drop an unused variable 2022-08-20 20:47:48 +02:00
Frantisek Sumsal
94510784e1 sd-journal: drop an unused variable 2022-08-20 20:46:23 +02:00
Frantisek Sumsal
d7c1024b6b ci: build with clang-15; drop clang-12 2022-08-20 20:12:03 +02:00
Yu Watanabe
645deddbaf
Merge pull request #24378 from yuwata/test-network-issue-24377
test-network: add test case for issue #24377
2022-08-20 22:24:53 +09:00
Yu Watanabe
b249834bc3 test-network: add test for issue #24377
The issue has been already fixed by
b05e52000b (PR #24020).
2022-08-20 20:50:02 +09:00
Yu Watanabe
5bd2a7c580 test-network: add helper functions for reading logs of networkd 2022-08-20 20:35:18 +09:00
Yu Watanabe
0f27758ae9
Merge pull request #24356 from keszybz/sd-netlink-api
Small improvements to the sd-netlink api
2022-08-20 19:11:02 +09:00
Aryan singh
131298867b
hwdb: Add Avita Liber NS13A2 (#24376)
This fixes the discrepancies in the coordinate ranges for the touchpad, touchpad in this device(NS13A2) is generic and the same one is used in most models.
2022-08-20 12:02:54 +02:00