1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-12 13:18:14 +03:00
Commit Graph

65171 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
27140fc7d1 man: add example how to configure automatic signing
Fixes #978.
2023-06-14 13:18:00 +02:00
Zbigniew Jędrzejewski-Szmek
ff7580e280 test_ukify: cleanups suggested by pylint 2023-06-14 13:18:00 +02:00
Zbigniew Jędrzejewski-Szmek
a1c80efddc ukify: add 'genkey' verb
The idea is to make it easy to generate all the signing key and certs
that can be used for local signing. The verb is the modeled after
'mkosi genkey', but there are some important differences: we generate
the keys to the paths where they will be read from, both pcr signing
keys and the SecureBoot certificate+key.

If any of the outputs exist, operation is refused. Maybe we could add a
--force option in the future, but this operation should be rare, so I think
it's better to refuse to overwrite anything initially.

I'm only doing a token man page change here.
https://github.com/systemd/systemd/pull/27621 reworks the man page,
and the changes done here would conflict heavily with that work. I'll
submit a follow-up patch later.
2023-06-14 13:17:33 +02:00
Zbigniew Jędrzejewski-Szmek
b09a5315f5 ukify: move verb mangling to finalize_options()
This simplifies the logic: finalize_options() is the step that does the
checks and the mangling. The checks for consistency are done in more places,
so we need to pass a verb (we only have 'build', but once we add other verbs,
any would do).
2023-06-12 11:12:02 +02:00
Zbigniew Jędrzejewski-Szmek
9a1cb2038e ukify: split out iteration over phase path groups and keys
In preparation for future changes.
2023-06-12 11:12:02 +02:00
Zbigniew Jędrzejewski-Szmek
24f4ff8a09 man,test: root or hardware is not needed for ukify 2023-06-12 11:12:02 +02:00
Zbigniew Jędrzejewski-Szmek
794385f5df ukify: fix synopsis in --help
Missed in a3b227d28a.
2023-06-12 11:12:02 +02:00
Zbigniew Jędrzejewski-Szmek
6fa7913830 ukify: use pager for --help
The output is now too long to fit on one page, let's use a pager automatically
like in other places.

The implementation is copied from mkosi, but adjusted to follow what other
systemd tools do.
2023-06-12 11:12:02 +02:00
Zbigniew Jędrzejewski-Szmek
a3b227d28a ukify: add 'build' verb
The old syntax with linux + initrds as positional arguments is still accepted,
but a warning is emitted. We should remove the support for this after the
next release or so.

Adding a single verb by itself is not very useful, but opens the door to adding
other verbs.
2023-06-06 15:45:57 +02:00
Zbigniew Jędrzejewski-Szmek
320266b961 test_ukify: pass through path to addon stub
Without this, the tests would generally be skipped, since we haven't made a
release with the addon stub yet. But even if the file is there, we always want
to test the freshly-built item.
2023-06-06 15:45:57 +02:00
Zbigniew Jędrzejewski-Szmek
0d66468243 test_ukify: no stinky root needed for signing
C.f. b2efe28658.
2023-06-06 15:41:04 +02:00
Zbigniew Jędrzejewski-Szmek
1df35a4638 ukify: simplify creation of parser
00e5933f57 made all the positional arguments
optional, so let's take advantage of this to simplify variuos callers.
2023-06-06 15:41:01 +02:00
Zbigniew Jędrzejewski-Szmek
c4fc25463e ukify: make code pylint clean
The linter is imperfect, but it is useful as a very quick
check for typos and other silly mistakes. Add a few annotations
and do one small change to make it think the code is perfect.
2023-06-05 16:07:52 +02:00
Zbigniew Jędrzejewski-Szmek
1ab32e8aaf
Merge pull request #27871 from yuwata/udevadm-verify-downgrade-style-issues
udevadm-verify: downgrade log level about style issues
2023-06-05 16:07:19 +02:00
Zbigniew Jędrzejewski-Szmek
7dc3c94245
Merge pull request #27924 from poettering/low-battery-tool
ac-power: expose low battery state via systemd-ac-power
2023-06-05 16:03:57 +02:00
Frantisek Sumsal
0efa27bd4b test: allow running only specified subtests/testcases
Useful when debugging, e.g.:

make -C test/TEST-74-AUX-UTILS clean setup run TEST_MATCH_SUBTEST=run

Resolves: #27914
2023-06-05 15:58:37 +02:00
Lennart Poettering
24945c28db man: parition → partition typo fix
Follow-up for: #27848
2023-06-05 14:05:49 +02:00
Lennart Poettering
7f1520c6a1 ac-power: add --low switch to systemd-ac-power tool
This allows checking from shell scripts whether the system is in a low
battery state. It just exposed the code we anyway have in a directly
accessible way.

This is also very useful for testing things.
2023-06-05 12:21:28 +02:00
Lennart Poettering
c41e3605ec battery-util: be more careful when determining whether we are in a low battery state
Let's avoid assuming a low battery battery state if in doubt. That
means, handle errors reading battery state gracefully.
2023-06-05 12:20:41 +02:00
Lennart Poettering
319c46483e battery-util: move battery_is_discharging_and_low() to battery-util.[ch]
This moves a first batch of functions from sleep-config.[ch] over to
battery-util.[ch].

In the long run we should probably move even more stuff over, i.e.
anything that deals with the battery sysfs driver interface.

No code change.
2023-06-05 12:19:32 +02:00
Lennart Poettering
af4e8e86ec battery-util: split out code that checks AC power state into its own .c/.h pair
No code change, just some splitting out of the relevant code from
udev-util.[ch].

This makes sense on its own, but is also prepartion to move the code
that checks for low battery state into battery-util.[ch], too.
2023-06-05 12:18:21 +02:00
Stefan Roesch
85614c6e2f add support for KSM
This adds support for KSM (kernel samepage merging). It adds a new
boolean parameter called MemoryKSM to enable the feature. The feature
can only be enabled with newer kernels.
2023-06-05 11:22:43 +02:00
Yu Watanabe
308b189511 chase: fix triggering assertion 2023-06-05 10:22:47 +02:00
jonathanmetzman
56595a3730
ci: Report results from CIFuzz using SARIF
Upload results from CIFuzz using SARIF.
This will allow CIFuzz to report issues in the security tab.
This is a better UI than having to look through logs.
TODO(google/oss-fuzz#10452): Add proper descriptions of UBSAN bugs.
2023-06-05 07:37:34 +02:00
Gaël PORTAY
150231d25d path-util: fix typo in comment
The comment makes a reference to the function fchmod_path() but this
function does not exist in the source tree.

However, the function fchmod_opath() exists; it was introduced by the
commit 4dfaa528d4.

As the comment tells, the function futimens_opath() introduced by the
commit f25bff5eaf is similar to the
function fchmod_opath(); therefore, it should reference it.

This fixes the typo in the comment by referencing the proper function
fchmod_opath().
2023-06-05 14:21:43 +09:00
Yu Watanabe
1bf3dd4153 udev: downgrade log level about style issues
And add --no-style switch that make style issues not critical.
2023-06-05 11:37:26 +09:00
Yu Watanabe
2ef0959fbe test: drop unnecessary copy of expected output 2023-06-05 11:21:28 +09:00
Yu Watanabe
4134614fc0 udev-rules: terminate log messages with period 2023-06-05 11:21:28 +09:00
Yu Watanabe
c507c81ee7
Merge pull request #27907 from mrc0mmand/quick-test-tweaks
test: a couple of tweaks for recent CI fails
2023-06-04 05:22:53 +09:00
Frantisek Sumsal
e5ea38db28
Merge pull request #27908 from weblate/weblate-systemd-master
Translations update from Fedora Weblate
2023-06-03 17:54:46 +02:00
김인수
966e021025 po: Translated using Weblate (Korean)
Currently translated at 100.0% (193 of 193 strings)

Co-authored-by: 김인수 <simmon@nplob.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/ko/
Translation: systemd/main
2023-06-03 17:48:02 +02:00
Asier Sarasua Garmendia
6fce42e15d po: Translated using Weblate (Basque)
Currently translated at 16.5% (32 of 193 strings)

po: Added translation using Weblate (Basque)

Co-authored-by: Asier Sarasua Garmendia <asier.sarasua@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/eu/
Translation: systemd/main
2023-06-03 17:48:02 +02:00
Lennart Poettering
798e811733 umount: /usr/ should never be unmounted regardless of HAVE_SPLIT_USR or not
Whether we put some binaries in /bin or in /usr/bin should not have any
effect on unmounting during shutdown. Even if people split /usr/ off we
should not try to unmount it, no matter what as it is simply where
binaries are placed.
2023-06-03 16:48:00 +01:00
Frantisek Sumsal
d99e099fb4 test: drop the --recursive=no test
As the outcome also depends on availability of the PID namespace, so
the test might (and does) unexpectedly pass in some environments.
2023-06-03 16:30:46 +02:00
Frantisek Sumsal
686da1c095 test: ignore missing coverage in TEST-82-SOFTREBOOT
As we temporarily mount rootfs read-only there.
2023-06-03 16:30:46 +02:00
Adrian Vovk
0470f91983 sysupdate.d: Add way to drop binaries into $BOOT
As described in the BLS, we should place binaries into the XBOOTLDR
directory if it is available, otherwise into the ESP. Thus, we might
need to put binaries into /boot or into /efi depending on the existence
of the XBOOTLDR partition.

With this change, we introduce a new PathRelativeTo= config option that
makes this functionality possible
2023-06-03 09:13:27 +02:00
Luca Boccassi
58a5a2362c
Merge pull request #27904 from DaanDeMeyer/lsm
mkosi: Enable more options
2023-06-02 23:57:21 +01:00
Luca Boccassi
e1aacab7d5
Merge pull request #27903 from mrc0mmand/test-followups
test: a couple of systemd-{coredump,pstore,run} followups
2023-06-02 23:56:58 +01:00
Lennart Poettering
4d824ac0d3
Merge pull request #27435 from poettering/renew-reboot
pid1: add a new method of rebooting: userspace only under the name "soft-reboot"
2023-06-02 23:27:45 +02:00
Lennart Poettering
2e04ba9de9
Merge pull request #27896 from poettering/umount-detach-rework
shutdown: refactoring + tone down log message a bit
2023-06-02 21:47:09 +02:00
Lennart Poettering
db41880d34
Merge pull request #27902 from poettering/round-up
add ROUND_UP() macro for rounding integer up to next multiple of some value
2023-06-02 21:46:50 +02:00
Lennart Poettering
5596fd8ff7 update TODO 2023-06-02 18:43:11 +02:00
Lennart Poettering
093d545658 test: add integration test for soft reboots incl. fdstore passing 2023-06-02 18:43:11 +02:00
Lennart Poettering
8af66251a1 test: disable SoftReboot() in dfuzzer test for now
As requested:

https://github.com/systemd/systemd/pull/27435#issuecomment-1527810336
2023-06-02 18:43:11 +02:00
Lennart Poettering
4de665812a man: document the soft reboot operation 2023-06-02 18:43:10 +02:00
Lennart Poettering
ba1af88c3c fstab-util: consider /run/nextroot/ among extrinsic mounts
This way we'll not add deps for the mount point that unmount it during
shutdown. This is similar as for /run/initramfs/ which we want to
transition into during shutdown.

This way we don't have to add "-o x-initrd.mount" to all bind mounts for
/run/nextroot anymore to make it survive the reboot, it will be implied.
2023-06-02 18:43:10 +02:00
Lennart Poettering
d585065624 mount-setup: exclude /run/nextroot/ from relabelling
Just like /run/initramfs/ the data in /run/nextroot/ should be a
self-contained OS tree, and not require labelling, hence don't.
2023-06-02 18:43:10 +02:00
Lennart Poettering
f717d7a40a switch-root: automatically make target switch root dir a mount point
Let's make sure implicitly that the target directory is a mount point,
instead of doing so manually beforehand. This allows us to drop this
step from the transition into the /run/initramfs/ dir at shutdown.

During the initrd→host transition the switch root operations so far
where towards pre-existing mount points, but there are cetrainly
usecases where it might make sense to siwtch into arbitrary
subdirectories, too.
2023-06-02 18:43:10 +02:00
Lennart Poettering
f9ad896ee2 mount-util: add fd_make_mount_point() helper 2023-06-02 18:43:10 +02:00
Daan De Meyer
cc532533b8 mkosi: Enable more options
We build with support for selinux/apparmor where applicable but
disable them at runtime as even in permissive mode they're horribly
broken.
2023-06-02 17:25:23 +02:00