]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
3 years agostub: Always use LINUX_INITRD_MEDIA_GUID if available 24751/head
Jan Janssen [Tue, 20 Sep 2022 08:08:05 +0000 (10:08 +0200)] 
stub: Always use LINUX_INITRD_MEDIA_GUID if available

The kernel PE image version can be used to detect support for this
feature, allowing us to prefer the generic code of the deprecated EFI
handover protocol.

3 years agostub: Be explicit about EFI handover calling convention
Jan Janssen [Tue, 20 Sep 2022 07:30:40 +0000 (09:30 +0200)] 
stub: Be explicit about EFI handover calling convention

3 years agostub: Remove unnecessary asm cli call
Jan Janssen [Tue, 20 Sep 2022 07:27:27 +0000 (09:27 +0200)] 
stub: Remove unnecessary asm cli call

Apparently, this is not needed when red zones are disabled and we do
that.

3 years agostub: Properly clean up pages on error
Jan Janssen [Sun, 18 Sep 2022 08:39:32 +0000 (10:39 +0200)] 
stub: Properly clean up pages on error

3 years agostub: Refuse operation if kernel lacks EFI handover support
Jan Janssen [Sat, 17 Sep 2022 20:35:23 +0000 (22:35 +0200)] 
stub: Refuse operation if kernel lacks EFI handover support

3 years agostub: Refuse operating above 4G if not supported
Jan Janssen [Sat, 17 Sep 2022 20:24:51 +0000 (22:24 +0200)] 
stub: Refuse operating above 4G if not supported

We could try to relocate these but that is probably not needed. So far
we have not been bitten by this in the real world and kernels we boot
likely already support this anyway.

3 years agostub: Provide a proper boot params page
Jan Janssen [Sat, 17 Sep 2022 20:02:42 +0000 (22:02 +0200)] 
stub: Provide a proper boot params page

The boot params passed to the kernel only has to be one page in size
and the size of the setup header has to be calculated as it depends on
the boot protocol version supported by the kernel.

3 years agostub: Fix above 4G boot
Jan Janssen [Sat, 17 Sep 2022 09:47:39 +0000 (11:47 +0200)] 
stub: Fix above 4G boot

The kernel x86 boot protocol does not expect this value to be set when
using EFI handover protocol. If the stub is loaded above 4G we would
end up discarding the high bits, breaking boot.

Fixes: #24707
3 years agoboot: Change the way we provide builtins
Jan Janssen [Sat, 10 Sep 2022 14:56:48 +0000 (16:56 +0200)] 
boot: Change the way we provide builtins

Relying on symbol aliasing seems to be rather unreliable. Instead just
use some light #ifdefery.

Fixes: #24630
3 years agoudev: use block_device_is_whole_disk()
Yu Watanabe [Tue, 20 Sep 2022 00:04:54 +0000 (09:04 +0900)] 
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.

3 years agosd-device: use fd_reopen() at one more place
Yu Watanabe [Tue, 20 Sep 2022 00:26:50 +0000 (09:26 +0900)] 
sd-device: use fd_reopen() at one more place

It provides recognizable error if /proc is not mounted.

3 years agocryptsetup: use TPM flags over bool
William Roberts [Mon, 19 Sep 2022 18:50:03 +0000 (13:50 -0500)] 
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>
3 years agomeson: make several tests run sequentially
Yu Watanabe [Mon, 19 Sep 2022 14:40:34 +0000 (23:40 +0900)] 
meson: make several tests run sequentially

Follow-up for f93ba375301e43900f1fe5a93a2b33b1efcc73e0.

3 years agoMerge pull request #24744 from yuwata/mkdir-chase-symlinks
Yu Watanabe [Mon, 19 Sep 2022 16:43:00 +0000 (01:43 +0900)] 
Merge pull request #24744 from yuwata/mkdir-chase-symlinks

mkdir: chase_symlinks_and_stat() does not return 0

3 years agoMerge pull request #24731 from yuwata/sd-device-opendir
Daan De Meyer [Mon, 19 Sep 2022 15:06:38 +0000 (17:06 +0200)] 
Merge pull request #24731 from yuwata/sd-device-opendir

sd-device: introduce device_opendir()

3 years agotest: add more test cases for mkdir_p_safe() and mkdir_p_root() 24744/head
Yu Watanabe [Thu, 25 Aug 2022 22:19:59 +0000 (07:19 +0900)] 
test: add more test cases for mkdir_p_safe() and mkdir_p_root()

3 years agomkdir: chase_symlinks_and_stat() does not return 0
Yu Watanabe [Thu, 25 Aug 2022 22:50:32 +0000 (07:50 +0900)] 
mkdir: chase_symlinks_and_stat() does not return 0

This reverts commits e22916e61d1fdb7b46918b605ebf783d9017f9d8 and
1e146d738232acbe7f72903e9c5e4d1166ea67f5.

3 years agoMerge pull request #24742 from keszybz/hwdb-252
Yu Watanabe [Mon, 19 Sep 2022 13:51:13 +0000 (22:51 +0900)] 
Merge pull request #24742 from keszybz/hwdb-252

hwdb update for v252-rc1

3 years agotpm2-util: make tpm2_pcr_bank_from_string() case-insensitive
Lennart Poettering [Fri, 16 Sep 2022 21:42:05 +0000 (23:42 +0200)] 
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.

3 years agoudev: use device_opendir() 24731/head
Yu Watanabe [Sun, 18 Sep 2022 22:36:09 +0000 (07:36 +0900)] 
udev: use device_opendir()

3 years agosd-device: use device_opendir()
Yu Watanabe [Sun, 18 Sep 2022 22:08:59 +0000 (07:08 +0900)] 
sd-device: use device_opendir()

3 years agosd-device: introduce device_opendir()
Yu Watanabe [Mon, 29 Aug 2022 20:23:05 +0000 (05:23 +0900)] 
sd-device: introduce device_opendir()

3 years agohwdb: run "update-hwdb-autosuspend" 24742/head
Zbigniew Jędrzejewski-Szmek [Thu, 18 Aug 2022 08:47:36 +0000 (10:47 +0200)] 
hwdb: run "update-hwdb-autosuspend"

3 years agohwdb: run "update-hwdb"
Zbigniew Jędrzejewski-Szmek [Mon, 19 Sep 2022 10:26:33 +0000 (12:26 +0200)] 
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.

3 years agoudev: use sd_device_get_sysattr_value()
Yu Watanabe [Sun, 18 Sep 2022 22:34:49 +0000 (07:34 +0900)] 
udev: use sd_device_get_sysattr_value()

No functional changes, just refactoring.

3 years agoudev: use faccessat()
Yu Watanabe [Sun, 18 Sep 2022 22:32:44 +0000 (07:32 +0900)] 
udev: use faccessat()

No functional changes, just refactoring.

3 years agosd-device: re-implement device_sysattrs_read_all() without recursion
Yu Watanabe [Sun, 18 Sep 2022 22:04:37 +0000 (07:04 +0900)] 
sd-device: re-implement device_sysattrs_read_all() without recursion

3 years agosd-device: use faccessat()
Yu Watanabe [Sun, 18 Sep 2022 22:23:30 +0000 (07:23 +0900)] 
sd-device: use faccessat()

No functional changes, just refactoring.

3 years agosd-device: use fstatat()
Yu Watanabe [Sun, 18 Sep 2022 22:08:13 +0000 (07:08 +0900)] 
sd-device: use fstatat()

No functional changes, just refactoring.

3 years agosd-device: use path_hash_ops to store sysattrs
Yu Watanabe [Sun, 18 Sep 2022 22:03:21 +0000 (07:03 +0900)] 
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.

3 years agoalso provide credentials in ExecStartPre
Jörg Thalheim [Fri, 16 Sep 2022 12:41:58 +0000 (14:41 +0200)] 
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

3 years agotest: add testcase for link priority
Yu Watanabe [Fri, 15 Apr 2022 02:13:29 +0000 (11:13 +0900)] 
test: add testcase for link priority

3 years agoMerge pull request #24646 from yuwata/udev-node-symlink_atomic
Yu Watanabe [Sun, 18 Sep 2022 20:25:58 +0000 (05:25 +0900)] 
Merge pull request #24646 from yuwata/udev-node-symlink_atomic

udev: introduce symlink_atomic_full() and use it

3 years agoMerge pull request #24725 from yuwata/blockdev-util-introduce-block_device_get_whole_disk
Yu Watanabe [Sun, 18 Sep 2022 20:25:09 +0000 (05:25 +0900)] 
Merge pull request #24725 from yuwata/blockdev-util-introduce-block_device_get_whole_disk

blockdev-util: introduce block_device_get_whole_disk()

3 years agoMerge pull request #24730 from yuwata/dissect-image-drop-reference-to-decrypted-image
Yu Watanabe [Sun, 18 Sep 2022 20:24:35 +0000 (05:24 +0900)] 
Merge pull request #24730 from yuwata/dissect-image-drop-reference-to-decrypted-image

dissect-image: introduce dissected_image_relinquish()

3 years agoman/systemd-run: Refer to man-pages project (man7.org) when citing bash(1)
BerndAdameit [Sun, 18 Sep 2022 10:20:32 +0000 (12:20 +0200)] 
man/systemd-run: Refer to man-pages project (man7.org) when citing bash(1)

3 years agopath-util: add examples for path_make_relative() and path_make_relative_parent()
Yu Watanabe [Sun, 18 Sep 2022 14:19:13 +0000 (23:19 +0900)] 
path-util: add examples for path_make_relative() and path_make_relative_parent()

Addresses https://github.com/systemd/systemd/pull/24646#discussion_r973691797.

3 years agotree-wide: drop unused reference to DecryptedImage 24730/head
Yu Watanabe [Sun, 11 Sep 2022 15:07:17 +0000 (00:07 +0900)] 
tree-wide: drop unused reference to DecryptedImage

3 years agotree-wide: use dissected_image_relinquish()
Yu Watanabe [Sun, 11 Sep 2022 14:42:01 +0000 (23:42 +0900)] 
tree-wide: use dissected_image_relinquish()

3 years agodissect-image: introduce dissected_image_relinquish()
Yu Watanabe [Sun, 11 Sep 2022 14:23:22 +0000 (23:23 +0900)] 
dissect-image: introduce dissected_image_relinquish()

3 years agoudev: do not ignore -ENOENT from sd_device_get_devname() for block device 24725/head
Yu Watanabe [Sun, 18 Sep 2022 14:32:21 +0000 (23:32 +0900)] 
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.

3 years agoudev: use block_device_get_whole_disk()
Yu Watanabe [Sun, 18 Sep 2022 04:24:12 +0000 (13:24 +0900)] 
udev: use block_device_get_whole_disk()

This should not change anything effectively.

3 years agoudev-node: use symlink_atomic_full_label() to create devlink 24646/head
Yu Watanabe [Mon, 11 Apr 2022 03:18:13 +0000 (12:18 +0900)] 
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.

3 years agoMerge pull request #24720 from yuwata/dissect-image-take-reference
Daan De Meyer [Sun, 18 Sep 2022 14:08:13 +0000 (16:08 +0200)] 
Merge pull request #24720 from yuwata/dissect-image-take-reference

dissect-image: make DissectedImage object take reference to DecryptedImage and LoopDevice

3 years agoblockdev-util: change return value when a partition device is passed to partition_enu...
Yu Watanabe [Sun, 18 Sep 2022 13:48:53 +0000 (22:48 +0900)] 
blockdev-util: change return value when a partition device is passed to partition_enumerator_new()

To make it consistent what returned by block_device_get_whole_disk().

3 years agoblockdev-util: introduce block_device_get_whole_disk()
Yu Watanabe [Sun, 18 Sep 2022 07:25:40 +0000 (16:25 +0900)] 
blockdev-util: introduce block_device_get_whole_disk()

3 years agoblockdev-util: split-out block_device_is_whole_disk()
Yu Watanabe [Sun, 18 Sep 2022 07:18:53 +0000 (16:18 +0900)] 
blockdev-util: split-out block_device_is_whole_disk()

No functional changes, just preparation for later commits.

3 years agoMerge pull request #24719 from yuwata/dissect-image-dissected-image-new
Yu Watanabe [Sun, 18 Sep 2022 13:41:49 +0000 (22:41 +0900)] 
Merge pull request #24719 from yuwata/dissect-image-dissected-image-new

dissect-image: introduce dissected_image_new()

3 years agosd-device: refuse block device without subsystem
Yu Watanabe [Sun, 18 Sep 2022 00:03:05 +0000 (09:03 +0900)] 
sd-device: refuse block device without subsystem

Previously, even if sd_device_get_subsystem() returns -ENOENT for block
device, we accepted that. This makes the check slightly stricter.

3 years agoMerge pull request #24691 from yuwata/udev-node-check-existence
Daan De Meyer [Sun, 18 Sep 2022 09:38:56 +0000 (11:38 +0200)] 
Merge pull request #24691 from yuwata/udev-node-check-existence

udev: check existence of device node

3 years agoMerge pull request #24710 from yuwata/test-50-dissect-cleanups
Daan De Meyer [Sun, 18 Sep 2022 09:21:30 +0000 (11:21 +0200)] 
Merge pull request #24710 from yuwata/test-50-dissect-cleanups

TEST-50-DISSECT: cleanups

3 years agodissect-image: free crypt_device object before trying to activate with unique name
Yu Watanabe [Sat, 17 Sep 2022 00:01:46 +0000 (09:01 +0900)] 
dissect-image: free crypt_device object before trying to activate with unique name

Otherwise we get error from libcryptsetup like the following:
systemd[1234]: Cannot use device /dev/loop5 which is in use (already mapped or mounted).

3 years agoudev: downgrade log level when device node is already removed
Yu Watanabe [Sat, 17 Sep 2022 21:03:14 +0000 (06:03 +0900)] 
udev: downgrade log level when device node is already removed

Follow-up for 790da548b0c37af60aed2f46867ba3885ea78718.

3 years agodissect-image: introduce DISSECTED_PARTITION_NULL 24719/head
Yu Watanabe [Fri, 9 Sep 2022 22:05:12 +0000 (07:05 +0900)] 
dissect-image: introduce DISSECTED_PARTITION_NULL

Currently, it is not necessary to set partno or architecture in
dissect_image_new(), but just for safety.
Preparation for later commits.

3 years agodissect-image: split out dissected_image_new()
Yu Watanabe [Fri, 9 Sep 2022 20:41:09 +0000 (05:41 +0900)] 
dissect-image: split out dissected_image_new()

To make dissect_image() shorter.
No functional changes, just refactoring.

3 years agodissect-image: take a reference of LoopDevice into DissectedImage 24720/head
Yu Watanabe [Sun, 11 Sep 2022 13:46:39 +0000 (22:46 +0900)] 
dissect-image: take a reference of LoopDevice into DissectedImage

To make LoopDevice object freed after DissectedImage is freed.
At least currently, this should not change anything. Preparation for
later commits.

3 years agoloop-util: introduce reference counter for LoopDevice
Yu Watanabe [Sun, 11 Sep 2022 13:41:03 +0000 (22:41 +0900)] 
loop-util: introduce reference counter for LoopDevice

3 years agodissect-image: take reference of DecryptedImage into DissectedImage
Yu Watanabe [Sun, 11 Sep 2022 14:08:25 +0000 (23:08 +0900)] 
dissect-image: take reference of DecryptedImage into DissectedImage

No functional changes. Preparation for later commits.

3 years agodissect-image: introduce reference counter for DecryptedImage
Yu Watanabe [Sun, 11 Sep 2022 14:07:29 +0000 (23:07 +0900)] 
dissect-image: introduce reference counter for DecryptedImage

3 years agodissect-image: lazily deactivate decrypted DM volumes 24667/head
Yu Watanabe [Wed, 14 Sep 2022 02:48:16 +0000 (11:48 +0900)] 
dissect-image: lazily deactivate decrypted DM volumes

The DM block device may be still used by other processes.

3 years agomeasure: rename measure_pcr() to measure_kernel()
Lennart Poettering [Sat, 17 Sep 2022 13:20:32 +0000 (15:20 +0200)] 
measure: rename measure_pcr() to measure_kernel()

Let's say what we actually measure, not what into (which is obvious
anyway).

This is generally more descriptive, but also good for later work that
allows measuring the boot phase too.

3 years agocryptsetup-util: introduce crypt_free_and_replace()
Yu Watanabe [Fri, 16 Sep 2022 18:24:26 +0000 (03:24 +0900)] 
cryptsetup-util: introduce crypt_free_and_replace()

3 years agoMerge pull request #24622 from yuwata/udev-open-with-noctty
Lennart Poettering [Sat, 17 Sep 2022 17:03:15 +0000 (19:03 +0200)] 
Merge pull request #24622 from yuwata/udev-open-with-noctty

udev: open with O_NOCTTY

3 years agoMerge pull request #24708 from keszybz/not-available-in-tables
Zbigniew Jędrzejewski-Szmek [Sat, 17 Sep 2022 16:16:42 +0000 (18:16 +0200)] 
Merge pull request #24708 from keszybz/not-available-in-tables

various: use "-" instead of "n/a" in tables

3 years agotest-50-dissect: do not fail test on cleanup 24710/head
Yu Watanabe [Sat, 17 Sep 2022 12:27:31 +0000 (21:27 +0900)] 
test-50-dissect: do not fail test on cleanup

These paths are read-only mount points. Hence, we cannot remove the
contents.

3 years agotest-50-dissect: check mount destination instead of mount source
Yu Watanabe [Sun, 11 Sep 2022 15:37:01 +0000 (00:37 +0900)] 
test-50-dissect: check mount destination instead of mount source

And rebreak long lines.

This should take no effective change, just refactoring.

3 years agoMerge pull request #24670 from keszybz/early-boot-ordering
Zbigniew Jędrzejewski-Szmek [Sat, 17 Sep 2022 11:26:51 +0000 (13:26 +0200)] 
Merge pull request #24670 from keszybz/early-boot-ordering

Early boot ordering

3 years agocoredumpctl: rename table entry 24708/head
Zbigniew Jędrzejewski-Szmek [Sat, 17 Sep 2022 10:20:33 +0000 (12:20 +0200)] 
coredumpctl: rename table entry

"Disk Size" could be mistaken for "Size of the Disk".

3 years agovarious: use "-" instead of "n/a" in tables
Zbigniew Jędrzejewski-Szmek [Sat, 17 Sep 2022 09:06:39 +0000 (11:06 +0200)] 
various: use "-" instead of "n/a" in tables

In the context of a table, both would be generally understood to have the same
meaning. "n/a" is a strange beast. It was useful when tables were produced on
the typewriter with "---------" used to separate rows. It is visually more
pleasing to use "-", and there is no risk of it being mistaken for a row
separator.

3 years agoMerge pull request #24703 from yuwata/dissect-image-verity-partition-make-fail
Daan De Meyer [Sat, 17 Sep 2022 07:57:20 +0000 (09:57 +0200)] 
Merge pull request #24703 from yuwata/dissect-image-verity-partition-make-fail

dissect-image: make verity_partition() actually fail when all attempts of activation failed

3 years agofd-util: rename CLOSE_AND_REPLACE() -> close_and_replace()
Yu Watanabe [Fri, 16 Sep 2022 16:57:04 +0000 (01:57 +0900)] 
fd-util: rename CLOSE_AND_REPLACE() -> close_and_replace()

We have free_and_replace() and friends, they are all named with lower
letters, even they are macros, not functions.
For consistency, let's rename CLOSE_AND_REPLACE() with lower letters.

This also mekes the macro used more places.

3 years agodissect-image: make verity_partition() actually fail when all attempts of activation... 24703/head
Yu Watanabe [Fri, 16 Sep 2022 20:11:43 +0000 (05:11 +0900)] 
dissect-image: make verity_partition() actually fail when all attempts of activation failed

3 years agodissect-image: split out verity_timeout()
Yu Watanabe [Fri, 16 Sep 2022 18:24:57 +0000 (03:24 +0900)] 
dissect-image: split out verity_timeout()

To make verity_partition() shorten. No functional changes, just
refactoring.

3 years agoman: explicitly document that "reboot -f" is different from "systemctl reboot -f"
Yu Watanabe [Fri, 16 Sep 2022 16:25:44 +0000 (01:25 +0900)] 
man: explicitly document that "reboot -f" is different from "systemctl reboot -f"

Closes #24696.

3 years agonspawn: fix two error strings
Lennart Poettering [Fri, 16 Sep 2022 16:08:19 +0000 (18:08 +0200)] 
nspawn: fix two error strings

3 years agoadd CAP_LINUX_IMMUTABLE to systemd-machined, so it can handle machinectl read-only...
Dan Streetman [Fri, 16 Sep 2022 14:50:59 +0000 (10:50 -0400)] 
add CAP_LINUX_IMMUTABLE to systemd-machined, so it can handle machinectl read-only requests

Without this, the 'machinectl read-only ...' command always fails.

3 years agosd-netlink: unexport sd-netlink
Yu Watanabe [Fri, 16 Sep 2022 14:20:46 +0000 (23:20 +0900)] 
sd-netlink: unexport sd-netlink

This effectively reverts 84e1001541151da71bae2137e2a1c254b5a3b89f.

The sd-netlink library has several issues, and we should not export it
without solving them. See issues #24258 and #24124.

3 years agoMerge pull request #24692 from yuwata/dissect-image-fix-memleak
Yu Watanabe [Fri, 16 Sep 2022 16:31:32 +0000 (01:31 +0900)] 
Merge pull request #24692 from yuwata/dissect-image-fix-memleak

dissect-image: fix memleak

3 years agoupdate TODO
Lennart Poettering [Fri, 16 Sep 2022 15:24:08 +0000 (16:24 +0100)] 
update TODO

Seeding RNG via SMBIOS is bad idea, since often measurement of SMBIOS
tables is used for TPM policies, under the assumption SMBIOS remains
static after a certain point.

3 years agotmpfiles: let's suffix path to dirs with '/' also in log messages
Lennart Poettering [Fri, 16 Sep 2022 12:53:35 +0000 (13:53 +0100)] 
tmpfiles: let's suffix path to dirs with '/' also in log messages

3 years agotmpfiles: drop redundant forward declarations
Lennart Poettering [Sun, 11 Sep 2022 10:16:17 +0000 (12:16 +0200)] 
tmpfiles: drop redundant forward declarations

3 years agoMerge pull request #24664 from yuwata/watchdog
Yu Watanabe [Fri, 16 Sep 2022 15:18:53 +0000 (00:18 +0900)] 
Merge pull request #24664 from yuwata/watchdog

watchdog: open /dev/watchdog0 only if it exists

3 years agoMerge pull request #24688 from yuwata/watchdog-dbus-properties-follow-ups
Yu Watanabe [Fri, 16 Sep 2022 15:18:05 +0000 (00:18 +0900)] 
Merge pull request #24688 from yuwata/watchdog-dbus-properties-follow-ups

pid1: follow-ups for watchdog DBus properties

3 years agojournalctl: respect --quiet flag during file concistency verification
Daniel Braunwarth [Fri, 16 Sep 2022 09:15:06 +0000 (11:15 +0200)] 
journalctl: respect --quiet flag during file concistency verification

Fixes #24563.

3 years agoMerge pull request #24685 from yuwata/uid-range
Yu Watanabe [Fri, 16 Sep 2022 15:16:07 +0000 (00:16 +0900)] 
Merge pull request #24685 from yuwata/uid-range

uid-range: several cleanups

3 years agodissect-image: handle all non-negative return values as success 24692/head
Yu Watanabe [Wed, 14 Sep 2022 03:25:08 +0000 (12:25 +0900)] 
dissect-image: handle all non-negative return values as success

No functional changes, just coding syle update.

3 years agodissect-image: fix memleak on failure
Yu Watanabe [Wed, 14 Sep 2022 03:21:56 +0000 (12:21 +0900)] 
dissect-image: fix memleak on failure

3 years agoudev-node: do not create symlink to a non-existing device node 24691/head
Yu Watanabe [Tue, 13 Sep 2022 21:07:09 +0000 (06:07 +0900)] 
udev-node: do not create symlink to a non-existing device node

Previously, the stack directory contains empty regular files named with
device ID, and we create sd_device object from the device name.
Hence, we implicitly checked the existence of the device node.

However, now the files in the stack directory are symlink, and we
retrieve the path to the device node and its priority from the symlink.
Hence, the existence of the device node is not checked.
Let's check if the device node is still exist.

3 years agoudev-node: split out stack_directory_read_one()
Yu Watanabe [Mon, 12 Sep 2022 19:42:38 +0000 (04:42 +0900)] 
udev-node: split out stack_directory_read_one()

No functional changes, just refactoring.

3 years agowatchdog: use /dev/watchdog0 only if it exists 24664/head
Yu Watanabe [Tue, 13 Sep 2022 19:55:35 +0000 (04:55 +0900)] 
watchdog: use /dev/watchdog0 only if it exists

Fixes #24661.

3 years agoupdate TODO
Lennart Poettering [Thu, 15 Sep 2022 18:22:35 +0000 (19:22 +0100)] 
update TODO

3 years agopid1: drop redundant DBus properties 24688/head
Yu Watanabe [Fri, 16 Sep 2022 12:50:58 +0000 (21:50 +0900)] 
pid1: drop redundant DBus properties

Follow-up for 10f3f4ed016b9fe92ca3d093fcfaed8278e69220.

We already have RuntimeWatchdogUSec or friends. Let's not introduce
redundant properties.

Also, drop the const qualifier for WatchdogLastPingTimestamp, as they
are actually not constant.

3 years agowatchdog: explicitly initialize global variable
Yu Watanabe [Fri, 16 Sep 2022 12:48:39 +0000 (21:48 +0900)] 
watchdog: explicitly initialize global variable

No functional change, as they were implicitly initialized with zero.

3 years agotest: add tests for uid_range_coalesce() 24685/head
Yu Watanabe [Fri, 16 Sep 2022 12:11:19 +0000 (21:11 +0900)] 
test: add tests for uid_range_coalesce()

3 years agouid-range: tie up number and array of uid range entries
Yu Watanabe [Fri, 16 Sep 2022 01:52:00 +0000 (10:52 +0900)] 
uid-range: tie up number and array of uid range entries

This renames UidRange -> UidRangeEntry, and reintroduces UidRange which
contains the array of UidRangeEntry and its size.
No fucntional changes, just refactoring.

3 years agouid-range: make uid_range_intersect() take two UidRange objects
Yu Watanabe [Fri, 16 Sep 2022 01:51:36 +0000 (10:51 +0900)] 
uid-range: make uid_range_intersect() take two UidRange objects

No functional changes, just refactoring.

3 years agouid-range: optimize to load uid_map file
Yu Watanabe [Fri, 16 Sep 2022 01:40:14 +0000 (10:40 +0900)] 
uid-range: optimize to load uid_map file

If uid_map contains many lines, then the previous logic takes O(n^2 log n),
This makes O(n log n).

3 years agouid-range: escape from loop earlier
Yu Watanabe [Fri, 16 Sep 2022 01:29:56 +0000 (10:29 +0900)] 
uid-range: escape from loop earlier

The array of uid range entries are already sorted. Hence, if x and y are
does not have intersection, then the remaining entries neither have
intersection with x.

3 years agouid-range: sort uid range entries in uid_range_coalesce()
Yu Watanabe [Fri, 16 Sep 2022 01:20:55 +0000 (10:20 +0900)] 
uid-range: sort uid range entries in uid_range_coalesce()

As the logic in uid_range_coalesce() assumes the array of entries are
already sorted.
No functional changes, just refactoring.

3 years agouid-range: use parse_uid_range()
Yu Watanabe [Fri, 16 Sep 2022 01:23:43 +0000 (10:23 +0900)] 
uid-range: use parse_uid_range()