1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-02-19 21:57:27 +03:00

59944 Commits

Author SHA1 Message Date
Yu Watanabe
9616f550b8 core/device: introduce device_propagate_reload() 2022-09-21 03:12:12 +09:00
Yu Watanabe
c072b84c7e core/device: introduce device_by_path() helper function 2022-09-21 03:12:12 +09:00
Yu Watanabe
1cb89339bc core/device: removed devices are not ready 2022-09-21 03:12:12 +09:00
Yu Watanabe
ef9ca572e1 core/device: use DEVICE_NOT_FOUND 2022-09-21 03:12:12 +09:00
Yu Watanabe
0a935bb850
Merge pull request #24711 from poettering/verify_fsroot_dir-rework
find-esp: rework verify_fsroot_dir()  a bit
2022-09-21 00:56:00 +09:00
Lennart Poettering
739d9cae40 recurse-dir: use fd_reopen() at one more place
Inspired by 83b94cf10e4f76b2b415bc70bf65f1c28698b97c
2022-09-21 00:55:23 +09:00
Zbigniew Jędrzejewski-Szmek
7bb99e23e5
Delete CNAME 2022-09-20 17:46:40 +02:00
Luca BRUNO
72ceee435d docs: add a note about selectively overriding default dependencies
This documents that explicit `Before=`/`After=` dependencies can be
used to selectively override implicit ordering coming from default
dependencies. That allows for more granular control compared to the
already documented `DefaultDependencies=no` option.

The alternative approach came up in a discussion around the ordering
of `boot-complete.target`, so this also adds an explicit suggestion
in that direction to the "Automatic Boot Assessment" documentation.

Ref: https://lists.freedesktop.org/archives/systemd-devel/2022-September/048330.html
2022-09-20 13:57:26 +02:00
Lennart Poettering
2b3a821f91 find-esp: when searching, don't trip over inodes we expect to be dirs to be something else, just continue searching 2022-09-20 13:52:01 +02:00
Lennart Poettering
bd80fd7e56 find-esp: rework verify_fsroot_dir() around statx()
Let's rework verify_fsroot_dir() around two statx() calls, which should
usually give us all information we need. Let's then add a call to the
btrfs ioctl only if the caller actually wants to know the backing block
device (which it generally only wants if it then intends to verify
partition type, and similar).

This makes things more robust on new kernels, and bypasses the btrfs
ioctls in environments where we cannot actually interpret the results
properly (since they reference btrfs devices via /dev/ paths, which we
likely cannot resolve in containers)

Fixes: #24616
2022-09-20 13:52:01 +02:00
Lennart Poettering
52f19d9678 stat-util: add statx_mount_same() to check if two stax refer to the same mount 2022-09-20 13:52:01 +02:00
Lennart Poettering
2bd315fb2b stat-util: add statx_inode_same() helper to check if two statx structs refer to same inode
The same as stat_inode_same(), but for struct statx rather than struct
stat.
2022-09-20 13:52:01 +02:00
Lennart Poettering
d45dee7c00 chase-symlinks: don't insist on absolute paths if CHASE_PREFIX_ROOT is set
There's little reason to require this, given that we can just say that
if a relative path is specified it is to be read relative to the root.

This fixes a bootctl bug introduced by
3730dc5d5b4b7c4e1e7d0957c88568cc45de2390 which didn't bother prefixing
paths as necessary.
2022-09-20 13:52:01 +02:00
Lennart Poettering
13879c54d4 blockdev-util: make sure get_block_device_fd() works reliably for O_PATH, too 2022-09-20 13:52:01 +02:00
Lennart Poettering
fc5bd43503 test-blockdev-util: check if r is actually a failure before ERRNO_IS_PRIVILEGE 2022-09-20 13:52:01 +02:00
Jan Janssen
55b5daf9b2 boot: Change the way we provide builtins
Relying on symbol aliasing seems to be rather unreliable. Instead just
use some light #ifdefery.

Fixes: #24630
2022-09-20 12:43:48 +02:00
Yu Watanabe
2f9d231738 udev: use block_device_is_whole_disk()
No functional changes, just refactoring.

Note, this also makes synthesize_change() propagate the error from
synthesize_change_one(). However, the caller of synthesize_change()
ignores the failure anyway, hence the change does not take any effect.
2022-09-20 09:44:19 +02:00
Yu Watanabe
83b94cf10e sd-device: use fd_reopen() at one more place
It provides recognizable error if /proc is not mounted.
2022-09-20 09:41:34 +02:00
William Roberts
3fab44b2ff cryptsetup: use TPM flags over bool
This works becuase TPM2_FLAGS_USE_PIN is 1 and bool is a 1 so the bits
line up as expected, however if for some reason flags change values and
for clarity check if the boolean indicates this flag and pass the flag
value.

Signed-off-by: William Roberts <william.c.roberts@intel.com>
2022-09-20 08:05:33 +09:00
Yu Watanabe
57c15ca357 meson: make several tests run sequentially
Follow-up for f93ba375301e43900f1fe5a93a2b33b1efcc73e0.
2022-09-20 02:56:57 +09:00
Yu Watanabe
8ef0fc7acc
Merge pull request #24744 from yuwata/mkdir-chase-symlinks
mkdir: chase_symlinks_and_stat() does not return 0
2022-09-20 01:43:00 +09:00
Daan De Meyer
4cde368a08
Merge pull request #24731 from yuwata/sd-device-opendir
sd-device: introduce device_opendir()
2022-09-19 17:06:38 +02:00
Yu Watanabe
f8d5048dbf test: add more test cases for mkdir_p_safe() and mkdir_p_root() 2022-09-19 22:55:47 +09:00
Yu Watanabe
f1d93b84bc mkdir: chase_symlinks_and_stat() does not return 0
This reverts commits e22916e61d1fdb7b46918b605ebf783d9017f9d8 and
1e146d738232acbe7f72903e9c5e4d1166ea67f5.
2022-09-19 22:54:05 +09:00
Yu Watanabe
4b544b5ffd
Merge pull request #24742 from keszybz/hwdb-252
hwdb update for v252-rc1
2022-09-19 22:51:13 +09:00
Lennart Poettering
f92ebc86dd tpm2-util: make tpm2_pcr_bank_from_string() case-insensitive
This way we can use it directly in measure.c, and thus remove a bit of
redundant code.

OpenSSL prefers uppercasing the MD names, others don't hence let's be
lenient here.
2022-09-19 22:50:44 +09:00
Yu Watanabe
97268bdf6f udev: use device_opendir() 2022-09-19 19:44:33 +09:00
Yu Watanabe
62ccd11d38 sd-device: use device_opendir() 2022-09-19 19:42:36 +09:00
Yu Watanabe
db3049b6f0 sd-device: introduce device_opendir() 2022-09-19 19:42:02 +09:00
Zbigniew Jędrzejewski-Szmek
f6a646b58b hwdb: run "update-hwdb-autosuspend" 2022-09-19 12:27:37 +02:00
Zbigniew Jędrzejewski-Szmek
ada4bb13ec hwdb: run "update-hwdb"
As usual, it seems to be mostly additions and corrections. Sadly, it seems a
bit of mojibake has crept in in various places. But it's hard to correct, in
particular because it's hard to detect all cases automatically. I think we can
ignore this for now.

When I run this a few weeks ago, ma-large.txt was gutted and 20-OUI.hwdb was
siginificantly smaller. For whatever reasons, it's back to normal now.
2022-09-19 12:27:17 +02:00
Yu Watanabe
a80ce209b9 udev: use sd_device_get_sysattr_value()
No functional changes, just refactoring.
2022-09-19 18:04:13 +09:00
Yu Watanabe
c42033e7be udev: use faccessat()
No functional changes, just refactoring.
2022-09-19 18:04:13 +09:00
Yu Watanabe
4bc9d8165b sd-device: re-implement device_sysattrs_read_all() without recursion 2022-09-19 18:04:13 +09:00
Yu Watanabe
5b304c7052 sd-device: use faccessat()
No functional changes, just refactoring.
2022-09-19 18:04:13 +09:00
Yu Watanabe
65c0f14bc1 sd-device: use fstatat()
No functional changes, just refactoring.
2022-09-19 18:04:13 +09:00
Yu Watanabe
bc5e8ebbfb sd-device: use path_hash_ops to store sysattrs
As the stored values are actually path. Just for safety.

This also drops unnecessary duplication of path.
2022-09-19 18:04:12 +09:00
Jörg Thalheim
e7f64b8962 also provide credentials in ExecStartPre
Systemd's credential interface is not yet natively supported by all
programs yet. Hence it's often required to run scripts to massage
secrets in the way the programs expect it.

This commit allows the ExecStartPre commands to access credentials.

Fixes https://github.com/systemd/systemd/issues/19604
2022-09-19 10:36:25 +02:00
Yu Watanabe
d64b44be52 test: add testcase for link priority 2022-09-19 06:08:58 +09:00
Yu Watanabe
5b4671ec47
Merge pull request #24646 from yuwata/udev-node-symlink_atomic
udev: introduce symlink_atomic_full() and use it
2022-09-19 05:25:58 +09:00
Yu Watanabe
3afe230d4a
Merge pull request #24725 from yuwata/blockdev-util-introduce-block_device_get_whole_disk
blockdev-util: introduce block_device_get_whole_disk()
2022-09-19 05:25:09 +09:00
Yu Watanabe
626f15a4c1
Merge pull request #24730 from yuwata/dissect-image-drop-reference-to-decrypted-image
dissect-image: introduce dissected_image_relinquish()
2022-09-19 05:24:35 +09:00
BerndAdameit
a3e03a3f18 man/systemd-run: Refer to man-pages project (man7.org) when citing bash(1) 2022-09-19 00:32:34 +09:00
Yu Watanabe
28f9bcd65a path-util: add examples for path_make_relative() and path_make_relative_parent()
Addresses https://github.com/systemd/systemd/pull/24646#discussion_r973691797.
2022-09-19 00:30:29 +09:00
Yu Watanabe
e330f97a89 tree-wide: drop unused reference to DecryptedImage 2022-09-18 23:47:20 +09:00
Yu Watanabe
3044d343dd tree-wide: use dissected_image_relinquish() 2022-09-18 23:47:20 +09:00
Yu Watanabe
f906075a15 dissect-image: introduce dissected_image_relinquish() 2022-09-18 23:47:20 +09:00
Yu Watanabe
d50c55bd43 udev: do not ignore -ENOENT from sd_device_get_devname() for block device
We already checked that the sd_device object 'dev' is for a whole block
device. So, -ENOENT should not be triggeered here, and if it is, there
exists something spurious. Hence we should not ignore the failure.
2022-09-18 23:32:24 +09:00
Yu Watanabe
8f71534e06 udev: use block_device_get_whole_disk()
This should not change anything effectively.
2022-09-18 23:30:21 +09:00
Yu Watanabe
6d42138593 udev-node: use symlink_atomic_full_label() to create devlink
If the filename of a device symlink is too long, then the temporary
filename may become invalid, and we fail to create symlink.

The function `tempfn_random()` used in symlink_atomic_full() generates
a safe temporary filename.

Note that, thanks to the PR #23043, now only one worker can handle
the same symlink simultaneously. Hence, the device ID based temporary
filename is not necessary.
2022-09-18 23:23:23 +09:00