1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-22 17:35:35 +03:00
Commit Graph

66146 Commits

Author SHA1 Message Date
Daan De Meyer
9e72aa1832 units: Load agetty credentials in all getty units
In it's latest release, agetty will support reading the agetty.autologin
and login.noauth credentials, so let's make sure we import those in our
getty units so they're available to agetty to read.
2023-07-27 16:50:58 +02:00
Yu Watanabe
62843efc8f NEWS: fix typo 2023-07-25 15:50:29 +09:00
Luca Boccassi
5a945fab7a ukify: fix armv7 architecture mapping
$ uname -m
armv7l

Traceback (most recent call last):
  File "/<<PKGBUILDDIR>>/obj-arm-linux-gnueabihf/src/kernel-install/60-ukify.install", line 223, in <module>
    main()
  File "/<<PKGBUILDDIR>>/obj-arm-linux-gnueabihf/src/kernel-install/60-ukify.install", line 219, in main
    call_ukify(opts)
  File "/<<PKGBUILDDIR>>/obj-arm-linux-gnueabihf/src/kernel-install/60-ukify.install", line 205, in call_ukify
    ukify['finalize_options'](opts2)
  File "/<<PKGBUILDDIR>>/obj-arm-linux-gnueabihf/ukify", line 1423, in finalize_options
    opts.efi_arch = guess_efi_arch()
                    ^^^^^^^^^^^^^^^^
  File "/<<PKGBUILDDIR>>/obj-arm-linux-gnueabihf/ukify", line 78, in guess_efi_arch
    raise ValueError(f'Unsupported architecture {arch}')
ValueError: Unsupported architecture armv7l
2023-07-24 21:10:48 +02:00
Frantisek Sumsal
283f3bd588 shell-completion: include units in 'verify' completions
Resolves: #28500
2023-07-24 20:02:55 +01:00
Luca Boccassi
b9e39e11e2
Merge pull request #28505 from bluca/vconsole_debian
vconsole-setup: don't fail with an empty keymap
2023-07-24 18:02:32 +01:00
Luca Boccassi
febbc24ee0 mkosi: set default-keymap='' on Debian/Ubuntu 2023-07-24 15:43:16 +01:00
Luca Boccassi
1cd4211068 vconsole-setup: don't fail with an empty keymap
The new meson option 'default-keymap' means that by default there's always
a keymap to configure, so vconsole-setup fails. Allow to set
-Ddefault-keymap="" to disable it and skip gracefully again.

Follow-up for f129d0e77c
2023-07-24 15:43:11 +01:00
Luca Boccassi
739bbc5869 NEWS: update for rc3 2023-07-24 12:47:28 +01:00
Zbigniew Jędrzejewski-Szmek
779268d202
Merge pull request #28503 from bluca/rc
RC busywork
2023-07-24 13:42:17 +02:00
Luca Boccassi
0b5e5e4cb4 NEWS: update contributors list 2023-07-24 11:46:33 +01:00
Luca Boccassi
f07775a2a0 hwdb: run update-hwdb
git diff hwdb.d/*.hwdb looks sensible
2023-07-24 11:42:23 +01:00
Luca Boccassi
291c66914f
Merge pull request #28498 from bluca/softreboot
softreboot: ensure all processes are killed
2023-07-24 11:36:16 +01:00
Luca Boccassi
2bfe7261de
Merge pull request #28497 from bluca/run
switch-root: use MS_REC for /run, unless we are soft-rebooting
2023-07-24 11:20:06 +01:00
Luca Boccassi
7f0bf48d31 Update NEWS 2023-07-24 10:45:28 +01:00
Luca Boccassi
b41ab9b3f4 softreboot: ensure all processes are killed
Having surviving processes is not ready yet as a feature, so ensure
everything is killed on the transition for now
2023-07-24 10:45:28 +01:00
Frantisek Sumsal
8256994c63 test: check if we correctly propagate /run mounts during switch root
Since 7c764d4 we bind mount certain directories during switch root
instead of moving the mount directly, and for /run we do this without
MS_REC. This, unfortunately, leaves all mounts under /run behind
in the old root, which breaks certain use cases.

See: https://github.com/systemd/systemd/issues/28452
2023-07-24 10:39:14 +01:00
Luca Boccassi
b12d41a8bb switch-root: use MS_REC for /run, unless we are soft-rebooting
There are applications that rely on mounts under /run surviving the
switch from initrd to rootfs, so use MS_REC unless we are soft
rebooting.

Follow-up for 7c764d4599

Fixes https://github.com/systemd/systemd/issues/28452
2023-07-24 10:39:14 +01:00
Luca Boccassi
3835b9aa4b Revert "core: add IgnoreOnSoftReboot= unit option"
The feature is not ready, postpone it

This reverts commit b80fc61e89.
2023-07-22 23:27:27 +01:00
Yu Watanabe
16bfb12c8f Revert "network: delay to configure address until it is removed on reconfigure"
This reverts commit 6e8477edd3.

The commit intended to fix a race reported at #28009. However,
unfortunately, it does not fix the root of the race, and reveals
the race in more simple setups. See reports in #28358.
2023-07-22 23:03:57 +01:00
Daniel Rusek
acfff02c8f po: Translated using Weblate (Czech)
Currently translated at 93.3% (212 of 227 strings)

Co-authored-by: Daniel Rusek <mail@asciiwolf.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/cs/
Translation: systemd/main
2023-07-22 18:43:25 +01:00
Dan Streetman
63477a71df tpm2: instead of adjusting authValue trailing 0(s), trim them as required by tpm spec
To keep compatibility with any existing object authValues with trailing 0's,
change tpm2_get_pin_auth() to trim trailing 0's, which is what the TPM
implementation will do. This should retain compatibility with any existing
authValues that contain trailing 0's.

Note that any existing authValues with trailing 0's are unlikely to have worked
in the way that systemd uses them in object sealing, which is as a bind key for
the encryption (and policy) session. However, it is better to be compatible
with the TPM spec (and implementations) even if previously created objects that
are affected may not have worked.

Fixes: #28414
2023-07-21 23:10:03 +01:00
Luca Boccassi
73d6f20155
Merge pull request #28487 from yuwata/statx-fixlets
util: fix error handling of statx()
2023-07-21 23:09:40 +01:00
Dan Streetman
adb7fe82c7 Revert "cryptenroll: drop unmet condition"
This reverts commit cefa4a02ab.

Because the first 'break' is inside a nested for loop, this second 'break' is
needed to exit the outer for loop.

Fixes: #28451
2023-07-21 18:59:26 +01:00
Luca Boccassi
686b983040
Merge pull request #26541 from DaanDeMeyer/xfs-whitespace-fix
mkfs-util: Escape spaces with slashes in protofile format
2023-07-21 18:58:27 +01:00
Yu Watanabe
68a4fc8b53 fd-util: do not call statx() twice when it does not provide mount ID
Previously, in path_is_root_at(), if statx() does not provide mount ID,
path_get_mnt_id_at() was called, but it also calls statx(). Let's avoid
the second trial.
2023-07-22 02:22:06 +09:00
Yu Watanabe
bd96111d5f fd-util: make path_is_root_at() not fail even when /proc is mounted
path_get_mnt_id_at() -> fd_fdinfo_mnt_id() may return -EOPNOTSUPP when
/proc is mounted, and -ENOSYS otherwise, when an old kernel is used.
2023-07-22 02:20:27 +09:00
Yu Watanabe
7487115766 mountpoint-util: statx() may return EINVAL if the kernel does not support the syscall
When statx() is called with AT_STATX_DONT_SYNC, glibc's fallback code
returns EINVAL. See statx_generic() in glibc.
2023-07-22 02:20:22 +09:00
Yu Watanabe
d35ff4b60e stat-util: fix error handling of statx()
When newer glibc is used, but kernel does not support statx(), then
glibc try to fallback with fstatat(). That's quite similar to our
implementation, but the supported flags are different, and if
unsupported flags are specified, it returns EINVAL.

Let's handle the case more gracefully.
2023-07-22 02:14:54 +09:00
Zbigniew Jędrzejewski-Szmek
671903b315
Merge pull request #28436 from rpigott/zsh-fixups
zsh systemctl completion fixups
2023-07-21 19:13:53 +02:00
Luca Boccassi
b80fc61e89 core: add IgnoreOnSoftReboot= unit option
As it says on the tin, configures the unit to survive a soft reboot.
Currently all the following options have to be set by hand:

Conflicts=reboot.target kexec.target poweroff.target halt.target
Before=reboot.target kexec.target poweroff.target halt.target
After=sysinit.target basic.target
DefaultDependencies=no
IgnoreOnIsolate=yes

This is not very user friendly. If new default dependencies are added,
or new shutdown/reboot types, they also have to be added manually.

The new option is much simpler, easy to find, and does the right thing
by default.
2023-07-21 18:05:41 +02:00
Zbigniew Jędrzejewski-Szmek
03d298e1e5
Merge pull request #28460 from bluca/scope_run_env
run: disable --expand-environment by default for --scope
2023-07-21 15:41:56 +02:00
Daan De Meyer
776be5964d mkfs-util: Escape spaces with slashes in protofile format 2023-07-21 15:35:50 +02:00
Yu Watanabe
dc8b82a5b4 test-ukify: use systemd-measure and bootctl in build directory
And skip tests if systemd-measure is not found.
Then, we can safely run test_ukify.py directly.
2023-07-21 15:32:02 +02:00
Daan De Meyer
ce8b4261eb xfs: Bump minimal size to 300M
From the xfsprogs source code:

* We don't support filesystems smaller than 300MB anymore.  Tiny
* filesystems have never been XFS' design target.  This limit has been
* carefully calculated to prevent formatting with a log smaller than
* the "realistic" size.
*
* If the realistic log size is 64MB, there are four AGs, and the log
* AG should be at least 1/8 free after formatting, this gives us:
*
* 64MB * (8 / 7) * 4 = 293MB

So let's accommodate and bump the minimal XFS filesystem size to 300M.
2023-07-21 14:22:53 +02:00
Topi Miettinen
d0b2839ddc homework-luks: fix typos 2023-07-21 21:11:04 +09:00
Yu Watanabe
df1dccd255 udev: decrease devlink priority for iso disks
Previously, if the priority is same, devlinks are always replaced by
newer events. The commit 331aa7aa15 changes
that to keep the existing devlink. That should not change any behavior
when the devices that request the same symlink do not have any
dependency, e.g. when /dev/sda1 and /dev/adb1 request the same
/dev/disk/by-label symlink, as there are no guarantee that which device
is processed first.

However, when devices has dependency, e.g. /dev/sda and /dev/sda1
request the same /dev/disk/by-label symlink, previously the symlink
always pointed to the partition, as the partition is always processed
later. But, 331aa7aa15 makes the symlink
point to the whole disk.

The change by 331aa7aa15 is crucial to
improve performance of devlink handling, especially when a system has
large number of disks with same label or so. Hence, cannot and should
not be reverted.

So, let's workaround the case, as such situation should happen only when
the disk is a hybrind ISO image, I guess.

Fixes #28468.
2023-07-21 11:42:34 +01:00
Yu Watanabe
dc3b5e0432 tree-wide: fix typo found by Fossies Codespell report 2023-07-21 19:12:08 +09:00
Michael A Cassaniti
66a8c74c35 repart: Set sector size of loopback devices
When an explicit sector size is set by the user it is also necessary to set the
sector size of any loopback devices. If the sector size is not set for loopback
devices then it can cause file system creation to fail or run into odd issues.
2023-07-21 11:04:39 +01:00
Yu Watanabe
01b030c201 udev: downgrade log level when running without cgroup
The cgroup path is optional, hence it is not necessary to warn the
failure loudly.

Follow-up for f8371dbd56.

Closes #28469.
2023-07-21 12:38:33 +09:00
Yu Watanabe
c0d998248e tree-wide: drop references to /dev/loop/by-ref
Follow-up for #28476.
2023-07-21 10:24:20 +09:00
Yu Watanabe
d168daa5c2
Merge pull request #28476 from bluca/revert_loop_links
Revert "udev: add /dev/loop/ symlinks"
2023-07-21 10:21:06 +09:00
Luca Boccassi
9915cc6086 Revert "udev: add /dev/loop/ symlinks"
Turns out this causes a regression and breaks losetup. It will need to
be reworked in conjunction with util-linux changes.

Fixes https://github.com/systemd/systemd/issues/28475

This reverts commit 5ac52d1f7b.
2023-07-20 22:28:23 +01:00
Luca Boccassi
5022fab15f Revert "test: test new systemd-dissect --attach/--detach/--loop-ref= and /dev/loop/* symlinks"
This reverts commit f5e46b9e09.
2023-07-20 22:26:40 +01:00
Luca Boccassi
d05553797e NEWS: note that sd-run --expand-environment will change 2023-07-20 17:41:38 +01:00
Luca Boccassi
8167c56bfa run: disable --expand-environment by default for --scope
The intention was to have this option enabled by default everywhere,
but unfortunately at least one case was found where it breaks
compatibility of a program using systemd-run --scopes and expecting
variables not to be expanded:

https://sources.debian.org/src/pbuilder/0.231/pbuilder-checkparams/#L400

Example run:

systemd-run --quiet --scope --description=pbuilder_build_xfce4-notes-plugin_1.10.0-1.dsc '--slice=system-pbuilder-build-xfce4\x2dnotes\x2dplugin_1.10.0\x2d1-449932.slice' chroot /var/cache/pbuilder/build/449932 dpkg-query -W '--showformat=${Version}' apt

Restore backward compatibility and make the option disabled by default
when --scope is used, and enabled by default for other types.

In case --expand-environment is not specified and a '$' character is
detected, print a warning to nudge users toward specifying the
parameter as needed. In the future we can then flip the default.

Follow-up for 2ed7a221fa
2023-07-20 17:37:27 +01:00
Yu Watanabe
b0efbe9b81 test: use XDG_STATE_HOME for %S and %L
This fixes the test failure when invoked by a user.
===
Running ./systemd-tmpfiles --user on 'f /tmp/test-systemd-tmpfiles.1foag_ur/test-content.n_9r_xhm/arg - - - - %S'
expect: '/home/watanabe/.config'
actual: '/home/watanabe/.local/state'
Traceback (most recent call last):
  File "/home/watanabe/git/systemd/test/test-systemd-tmpfiles.py", line 233, in <module>
    test_valid_specifiers(user=True)
  File "/home/watanabe/git/systemd/test/test-systemd-tmpfiles.py", line 135, in test_valid_specifiers
    test_content('f {} - - - - %S',
  File "/home/watanabe/git/systemd/test/test-systemd-tmpfiles.py", line 88, in test_content
    assert content == expected
           ^^^^^^^^^^^^^^^^^^^
AssertionError
===

This also makes the test uses fallback paths.

Follow-up for b50aadaff2.
2023-07-20 12:54:54 +01:00
Yu Watanabe
4fc925a026 test: fix a syntax error in test-ukify
Follow-up for d7d36252e5.

Fixes #28464.
2023-07-20 09:55:32 +02:00
Ronan Pigott
9ec0808370 zsh: use glob matching for template names
Template names can be learned from the filesystem, so there isn't a need
to parse the output of systemctl list-unit-files in this case. This
should accelerate the completion of some verbs like enable.
2023-07-19 15:07:39 -07:00
Ronan Pigott
ae6fb82cd9 zsh: remove unit property caching
The existing caching policy isn't very sensible for this cache. We could
write a different policy, but I don't think there is much value in
caching these values, as in my experience the command used to generate
them is quick.
2023-07-19 14:27:45 -07:00
Ronan Pigott
110ba0ccf9 zsh: update default caching policy for units
The existing caching policy was completely bogus.

In the first stanza, despite the comment, the pattern given would
consider the cache invalid if it was more than 1 hour old.

The second stanza was also incorrect, since the output of `systemctl
--all` is not unit file paths, but unit names. When they were being
tested against the cachefile mtime, the test would always fail becuase
of the nonexistant file (hopefully).

In fact it's not very useful to test if the unit files have newer mtime
in this case anyway, since we are only caching their names. Also,
`systemctl --all` is an unfortunately slow operation to be used in
testing for the cache validity — we want this operation to at least be
faster than rebuilding the cache.

I've rewritten this stanza with my best guess at its original intent. It
now checks against the mtime of the parent directories in the search
path, which should be updated and cause the cache to rebuild when we
add, remove, or rename any unit files.
2023-07-19 14:27:45 -07:00