1
0
mirror of https://github.com/systemd/systemd.git synced 2025-02-04 21:47:31 +03:00

66585 Commits

Author SHA1 Message Date
Jan Kuparinen
6eb151e989 po: Translated using Weblate (Finnish)
Currently translated at 86.3% (196 of 227 strings)

Co-authored-by: Jan Kuparinen <copper_fin@hotmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/fi/
Translation: systemd/main
2023-08-09 03:22:54 +09:00
Lennart Poettering
5a96b32dea libfido2: pick up debug logging from libfido2, and funnel it through our log subsystem
Fixes: #27984
2023-08-08 15:41:43 +02:00
Luca Boccassi
5c240bdd50
Merge pull request #28710 from rpigott/zsh-non-template-cache
zsh completion speedups
2023-08-08 12:06:40 +01:00
Yu Watanabe
074d90926f udev: set ID_NAME and ID_SERIAL to MMC/memstick devices again
Fixes a bug introduced by 998db5871fea331ec00b26a3a3f5271df040a905.

Fixes #28671.
2023-08-08 12:05:30 +01:00
Ronan Pigott
2cbda74862 zsh: reintroduce pattern argument to uncached verbs
The systemctl completion previously made use of PREFIX as a pattern
argument to list-unit-files and list-units. This had the problem of
erroneously filtering the results that were stored in the cache, and
erroneously filtering results that might have been requested according
to the users configuration (e.g. _correct completer, certain
matcher-lists or tag-orders, etc.).

Unfortunately, the runtime of list-unit-files increases when no pattern
argument is provided, and systemctl show, used to filter those units,
can become unacceptably slow when provided with too many units to
describe.

Let's re-introduce the pattern argument to list-unit-files and
list-units where necessary in order to alleviate these bottlenecks
without poisining the cache. A 'use-pattern' style is introduced that
may be used to disable this behavior if it is undesired. We can still
expect that certain completions, like `systemctl start <TAB>` will be
slow, like before. To fix this we will need systemd to learn a more
efficient way of filtering the units than parsing systemctl show.
2023-08-08 01:57:45 -07:00
Yu Watanabe
beddf8ba29 busctl: fix showing array of dictionary in JSON format
This partially reverts the commit 684bce3d54463b3222246f72adfe82ad5d176fea
and fixes the issue introduced by it.

Fixes #28711.
2023-08-08 09:33:16 +01:00
Ronan Pigott
c8e2cd79c1 zsh: use sys_really_all_units for non-template names
The systemctl invocations used for these completions match the ones used
for the _sys_really_all_units parameter, so we should really just use
the cached parameter rather than recomputing the result.
2023-08-07 18:00:04 -07:00
Lennart Poettering
ab9617a766 shutdown: handle gracefully if MD_LEVEL udev propery is not set
See: #28490
2023-08-07 20:59:44 +01:00
Lennart Poettering
3c8680585c varlink: don't allocate fd control buffer on each read()
We'll need this on each read() again, hence let's just allocate this
once and then reuse it for subsequent read()s.

Follow-up for: #28639
2023-08-07 20:57:45 +01:00
Daan De Meyer
b57e752220 mkosi: Unmount /etc/resolv.conf if it's a mountpoint 2023-08-07 20:56:55 +01:00
Jan Macku
97eb826821 ci(lint): exclude .in files from ShellCheck lint
Exclude all `.in` files because they may contain unsupported syntax, and
they have to be preprocessed first. For example:

```sh
Error: SHELLCHECK_WARNING:
./src/rpm/systemd-update-helper.in:130:37: warning[SC1083]: This { is literal. Check expression (missing ;/\n?) or quote it.
```

Related to: https://github.com/systemd/systemd/pull/28521
2023-08-07 19:28:23 +02:00
Zbigniew Jędrzejewski-Szmek
69674726e3
Merge pull request #28521 from keszybz/rpm-reload
rpm: add %systemd_postun_with_reload and %systemd_user_postun_with_reload
2023-08-07 19:27:13 +02:00
Vincent Haupert
81e0478110 repart: derive verity salt and uuid from seed 2023-08-07 16:03:44 +01:00
Daan De Meyer
2208d49263 repart: Extend check for read-only verity partitions
Let's check for verity signature partitions as well. Let's also
check the configured verity mode, which is another way to indicate
verity partitions aside from the type UUID.
2023-08-07 16:54:40 +02:00
Lennart Poettering
c578345334 update TODO 2023-08-07 16:51:49 +02:00
Emil Renner Berthing
2bca841137 90-loaderentry: support installing device trees
Like the cmdline file we look for a devicetree file in
$KERNEL_INSTALL_CONF_ROOT, /etc/kernel and /usr/lib/kernel. If it is
present we look for the specified device tree that comes with the kernel
we're adding and install it into $ENTRY_DIR_ABS and add a devicetree
stanza to the loader entry.

Unfortunately it seems there is no common consensus on where to install
device tree blobs, so we have to look in a few different places for it.
2023-08-07 14:54:23 +02:00
Zbigniew Jędrzejewski-Szmek
9ff28e312b rpm: add %systemd_user_daemon_reexec
This macros wraps the call to daemon-reexec in all user managers. It would be
called for example from systemd %post right after the call to systemctl
daemon-reexec.

This will be used in the Fedora systemd package to fix a long-standing FIXME.

Tested via building and reinstalling the systemd package with the patches.
2023-08-07 12:15:54 +02:00
Zbigniew Jędrzejewski-Szmek
c6699598e2 rpm: use rpm.execute() in more cases
7bde8293a4f4ccfe4b5c5000869068e3c1ac45c6 converted all the posix.execp()
calls, but I do not see why we shouldn't also convert the posix.exec()
calls.
2023-08-07 12:15:52 +02:00
Zbigniew Jędrzejewski-Szmek
631d2b05ec rpm: add %systemd_postun_with_reload and %systemd_user_postun_with_reload
For some units, the package would like to issue a reload. The machinery was
already in place since c9615f73521986b3607b852c139036d58973043c:

  systemctl reload-or-restart --marked

  Enqueues restart jobs for all units that have the 'needs-restart'
  mark, and reload jobs for units that have the 'needs-reload' mark.
  When a unit marked for reload does not support reload, restart will
  be queued.

The new macros allow a reload to be issued instead of a restart.

Based on the discussion on fedora-devel:
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/IJSUGIEJNYZZRE53FF4YFUEBRHRAVIXR/

Tested using dummy package https://github.com/keszybz/rpm-test-reload.
2023-08-07 12:12:55 +02:00
Zbigniew Jędrzejewski-Szmek
8ea8e23f40 manager: fix reloading in reload-or-restart --marked
bus_unit_queue_job_one has two callers:
- bus_unit_queue_job which would do the appropriate transormations
  to turn JOB_TRY_RESTART into JOB_TRY_RELOAD,
- and method_enqueue_marked_jobs which did not.
In effect, method_enqueue_marked_jobs() would queue restart jobs for
units which has Markers= needs-reload or needs-restart.

When the chunk of code which does the transformations is moved from
bus_unit_queue_job to bus_unit_queue_job_one, there is no change for
bus_unit_queue_job, and method_enqueue_marked_jobs is fixed.

The additional checks that are done seem reasonable to do from
method_enqueue_marked_jobs: we shouldn't be restarting units which are
configured to not allow that, or force unwanted start of dbus-broker.
2023-08-07 12:12:55 +02:00
Marc Pervaz Boocha
f3d1d7609d Teach 60-ukify.install to search the staging dir
60-ukify.install would only work with initrd provided by command line
arguements. Fixed to look for both microcode and initrd is found in
$KERNEL_INSTALL_STAGING_AREA which is placed by initrd generator like
mkinitcpio
2023-08-07 12:11:05 +02:00
Lennart Poettering
27edb18db0
Merge pull request #28627 from yuwata/udev-default-children-max
udev: allow to set 0 for the maximum number of worker process
2023-08-07 11:36:20 +02:00
Daan De Meyer
6ac299e3ce repart: Stat temporary file again after mkfs
This makes sure we use the actual size after mkfs which seems to be
important for btrfs as it refuses to mount the partition otherwise.

Follow-up for 2843df3e5734aa07b82b96ba46b799921a6495b8
2023-08-05 23:08:05 +01:00
Mike Yuan
cc1e1bb03e shared/fstab-util: use is_device_path instead of is_device_node
Follow-up for 99299d0d5a722812cedc0a23e4987f90a257c2d2

is_device_node() calls lstat(), causing device node
symlinks under /dev/disk/ not being compared correctly
using devnode_same().

Fixes #28585
2023-08-05 22:39:46 +01:00
Frantisek Sumsal
0be1de7ffc ukify: don't panic when prepending to an undefined list
Handle the case when all the arguments are passed in through a
configuration file:

$ cat ukify.conf
[UKI]
Linux = /boot/vmlinuz-linux
Initrd = /boot/initramfs-linux.img

Before:
$ src/ukify/ukify.py --config ukify.conf build
Traceback (most recent call last):
  File "/root/systemd/src/ukify/ukify.py", line 1604, in <module>
    main()
  File "/root/systemd/src/ukify/ukify.py", line 1590, in main
    opts = parse_args()
           ^^^^^^^^^^^^
  File "/root/systemd/src/ukify/ukify.py", line 1584, in parse_args
    apply_config(opts)
  File "/root/systemd/src/ukify/ukify.py", line 1431, in apply_config
    item.apply_config(namespace, section_name, group, key, value)
  File "/root/systemd/src/ukify/ukify.py", line 1123, in apply_config
    self.config_push(namespace, group, dest, value)
  File "/root/systemd/src/ukify/ukify.py", line 1019, in config_list_prepend
    setattr(namespace, dest, value + old)
                             ~~~~~~^~~~~
TypeError: can only concatenate list (not "NoneType") to list

After:
$ src/ukify/ukify.py --config ukify.conf build
Kernel version not specified, starting autodetection 😖.
Found uname version: 6.4.7-arch1-3
Wrote unsigned vmlinuz-linux.unsigned.efi

Resolves: #28688
2023-08-05 22:38:46 +01:00
Yu Watanabe
7b5ca134a5 man: update document about the maximum number of child processes 2023-08-05 15:40:02 +09:00
Yu Watanabe
2cba1d3753 udev: allow to set the maximum number of worker process to 0
In that case, the maximum is calculated based on the system resources.
2023-08-05 15:40:02 +09:00
Yu Watanabe
ce5ddbc465 udev: split out manager_set_default_children_max() 2023-08-05 15:39:58 +09:00
Mike Yuan
804c6397bc man/systemd: avoid duplicate variable name 2023-08-05 15:05:10 +09:00
Frantisek Sumsal
04bce24d4e test: ignore missing libudev when creating the test image
Same scenario as with libsystemd - ldd might use unprefixed RPATH, and
we install our own stuff into the image unconditionally anyway.

Also, bail out early if we hit a missing DSO with a possibly helpful
message.
2023-08-05 13:32:17 +09:00
Dan Streetman
9afd4dde22 tpm2: use ELEMENTSOF() instead of sizeof() for TPML_PCR_SELECTION pcrSelections field
The count field indicates the number of elements in the pcrSelections field,
and the size of each elements is greater than 1 byte, so using sizeof() is
incorrect when verifying the count field is valid; instead ELEMENTSOF() should
be used.

Caught by coverity check: https://github.com/systemd/systemd/pull/26331#pullrequestreview-1556629586
2023-08-05 13:31:59 +09:00
Yu Watanabe
42f13f10d5
Merge pull request #28681 from yuwata/udev-vs-tmpfiles
Udev vs tmpfiles
2023-08-05 13:30:49 +09:00
Luca Boccassi
06e8f7af7b
Merge pull request #28398 from ddstreet/tpm2_specify_pcr_value
Tpm2 specify pcr value
2023-08-04 21:04:03 +01:00
Yu Watanabe
23acdb8d0b test: shorten timeout for 'udevadm monitor'
The command should never finish, it is not necessary to wait so long.
2023-08-05 05:03:20 +09:00
Yu Watanabe
b768379e8b test: add short test for device node permission 2023-08-05 04:52:16 +09:00
Yu Watanabe
31845ef554 unit: make udev rules take precesence over tmpfiles
Without this change, there are no ordering between udevd and tmpfiles,
and if tmpfiles is invoked later it may discard the permission set by
udevd.

Fixes an issue introduced by b42482af904ae0b94a6e4501ec595448f0ba1c06.

Fixes #28588 and #28653.
2023-08-05 04:38:39 +09:00
Yu Watanabe
33b91308c2 Revert "tmpfiles.d: adjust /dev/vfio/vfio access mode"
The issue needs to be fixed by setting proper ordering between the
tmpfiles and udevd.

See issue #28653, especially
https://github.com/systemd/systemd/issues/28653#issuecomment-1665181625.

This reverts commit a3d610998ad3b4c88224fe89a048a84dbceb652b.
2023-08-05 04:32:01 +09:00
Zbigniew Jędrzejewski-Szmek
8cb0008977 journalctl: fix loggging invocation
Fixup for f882a986c271c3de1c622df0f1586946b4a09fef.
2023-08-04 20:21:13 +01:00
Luca Boccassi
7f878268ff
Merge pull request #28679 from keszybz/two-new-news-tweaks
Two news tweaks
2023-08-04 19:24:46 +01:00
Daan De Meyer
73e6b6974b
Merge pull request #28669 from DaanDeMeyer/mkosi-fix
mkosi: Make sure our systemd build always overrides the distros
2023-08-04 20:16:55 +02:00
Daan De Meyer
5dd814d7cd tmpfiles: Consider ENOPKG as information not available
We already handle the case where /etc/machine-id is empty. Let's make
sure we also handle the case where /etc/machine-id is "uninitialized".
2023-08-04 20:16:23 +02:00
Luca Boccassi
bdfa3f3a5c portablectl: fix regression when using --force without extension parameters
c18f4eb9e96836a made it possible to use --force with various verbs, by
going through the newer D-Bus methods. Except it didn't, as it regressed
during PR review refactorings, and nobody noticed because there were no
tests for it. Fix it, and add tests.

Follow-up for c18f4eb9e96836a6a8285ec42fd8a34c8909f6d9
2023-08-04 18:29:57 +01:00
Luca Boccassi
0e387e1295
Merge pull request #28673 from YHNdnzj/hibernate-resume-escape-node
hibernate-resume-generator: escape device path passed to hibernate-resume
2023-08-04 16:46:56 +01:00
Dan Streetman
e85ddd9644 tpm2: update TEST-70-TPM2 to test passing PCR value to systemd-cryptenroll
Add tests to use expected, not current, PCR values during sealing.
2023-08-04 11:20:33 -04:00
Dan Streetman
1782b0b88c man: update systemd-cryptenroll man page with details on --tpm2-pcrs format change
The previous commit extended the accepted format of --tpm2-pcrs to allow
specifying the hash algorithm (i.e. PCR bank) and hash digest value, this
updates the man page with those changes.
2023-08-04 11:20:31 -04:00
Dan Streetman
9e4379945b tpm2: move policy calculation out of tpm2_seal()
Move the calculation of the sealed object policy hash out of the tpm2_seal()
function. Instead, callers of tpm2_seal() can directly call
tpm2_calculate_sealing_policy() and then provide the policy hash to
tpm2_seal().
2023-08-04 11:20:22 -04:00
Dan Streetman
e3acb4d24c tpm2: add functions to convert TPM2B_PUBLIC to/from openssl pkey or PEM
Add functions to convert a PEM or pkey to TPM2B_PUBLIC, and functions to
convert TPM2B_PUBLIC to pkey or fingerprint.

Supports both RSA and ECC keys.

Add ECC support to some test-tpm2 tests, and tests to cover the newly added functions.
2023-08-04 11:19:54 -04:00
Dan Streetman
cffeee92bb openssl: add test-openssl
Add openssl unit tests.
2023-08-04 11:18:14 -04:00
Dan Streetman
0fdcfa7812 test: add DEFINE_HEX_PTR() helper function
Use function in test-tpm2 to convert hex strings to void* and len vars.
2023-08-04 10:57:08 -04:00
Dan Streetman
900e73f80e openssl: add ecc_pkey_new(), ecc_pkey_from_curve_x_y(), ecc_pkey_to_curve_x_y()
Add function to create openssl pkey from ECC curve and point, and function to
get curve id and x/y point from existing ECC pkey. Also add function to create
new ECC key for specified curve.

Also add DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_MACRO() to handle case when func() is
a macro, not a function symbol; specifically in this case it is used for
OPENSSL_free() which is a macro.
2023-08-04 10:57:08 -04:00