Commit Graph
80514 Commits
Author SHA1 Message Date
Lennart Poettering a8b2302bc1 udev: add dissect_image builtin
Fixes: #33453 #27897 #18035
2025-04-03 11:08:57 +02:00
Lennart Poettering e71f60476b udev-builtin-blkid: skip GPT dissection unless we actually have partition support 2025-04-03 11:08:57 +02:00
Lennart Poettering 5d3243bd46 udev-builtin-blkid: look for ESP/XBOOTLDR only in initrd; afterwards just look at /
So far the gpt-auto symlinks would point to:

   1. the disk the ESP/XBOOTLDR is located on
   2. or to a loopback device whose filename field is set to "rootdisk"
      or "rootdisk.raw"

This makes sense in the initrd. But once we transition to the host this
is quite confusing, since the symlinks might point to a different place
than what we actually ended up transitioning too: the actual backing
device of the root file system might be different from what gpt-auto
found.

Let's clean this up: let's avoid any ambiguities here: let's extend the
rules above with one more rule:

   3. if we left the initrd, we'll make gpt-auto point to the selected
      root file system, if it otherwise would have been a candidate.

Or in other words, the ID_PART_GPT_AUTO_ROOT_DISK=1 udev property now
always makes sense: in the initrd it points to the future root disk, and
on the host to the actual root disk.

Fixes: #34319
2025-04-03 11:08:57 +02:00
Lennart Poettering e04c7a92cc generator: downgrade complaint about trying to fsck a non-block device 2025-04-03 10:22:46 +02:00
Lennart Poettering bed3ff8ebc generator: also suppress fsck early if we are adding a bind mount
There's no point in "fscking a bind mount". Let's not do it hence.
2025-04-03 10:22:46 +02:00
Yu Watanabe 90941d458a test: wait for the device node symlink being created
Follow-up for 6e003d18bb.

Hopefully fixes the following failure:
```
[   50.650939] TEST-87-AUX-UTILS-VM.sh[3637]: + mkdir -p /tmp/validatefs-test.mount/somewhere/else
[   50.652499] TEST-87-AUX-UTILS-VM.sh[3637]: + mount /dev/disk/by-label/qnurx /tmp/validatefs-test.mount/somewhere/else
[   50.660885] /dev/disk/by-label/qnurx: Can't lookup blockdev
[   50.654964] TEST-87-AUX-UTILS-VM.sh[3731]: mount: /tmp/validatefs-test.mount/somewhere/else: special device /dev/disk/by-label/qnurx does not exist.
```
2025-04-03 09:41:35 +02:00
Yu Watanabe 5c311ea21a test: Use test.service template for all integration tests (#36979)
Instead of having some tests have their own unit, let's make
test.service.in generic enough so that it works for all integration
tests.
2025-04-03 12:11:49 +09:00
Yu Watanabe 3ff6d02320 test: set timeout for udevadm settle/wait/lock
Otherwise, if a test in a spurious state, it consumes quite long time.
Let's fail earlier in such case.

This also drops an unnecessary calls of 'udevadm settle' in
testcase_nvme_basic() of TEST-64-UDEV-STORAGE.
2025-04-03 10:28:25 +09:00
Yu Watanabe a345f47625 Two trivial cleanups (#36980) 2025-04-03 08:56:46 +09:00
Matteo Croce 3ad3ee8e54 test logind restart
Add a simple check which ensures that a user service survives
a logind restart.
2025-04-03 08:55:21 +09:00
Lennart Poettering 4dba936a03 dissect-image: after probing file systems, we still have the chance to not use a partition
Just because we found something we should still allow it to not be used,
hence include UNUSED in the found flags.
2025-04-03 06:09:01 +09:00
Werner Sembach c47f16ea96 hwdb/keyboard: Map FN key on TUXEDO NB02 devices
Map the FN key of TUXEDO NB02 devices that produces a scancode unrecognized by
the Linux kernel.

Signed-off-by: Werner Sembach <wse@tuxedocomputers.com>
2025-04-03 06:07:54 +09:00
Yu Watanabe 9ec7d7ae90 tree-wide: replace unsigned int -> unsigned, long int -> long 2025-04-03 06:01:31 +09:00
Yu Watanabe dba777cf26 memfd-util: make memfd_add/get_seals() static 2025-04-03 06:01:31 +09:00
Daan De Meyer 48e19280b2 test: Use test.service template for all integration tests
Instead of having some tests have their own unit, let's make
test.service.in generic enough so that it works for all integration
tests.
2025-04-02 21:58:59 +02:00
Lennart Poettering e3f6ae1d09 rules: split out gpt-root rules from 99-systemd.rules
All other rules in 99-systemd.rules are pretty much concerned about
SYSTEMD_READY=1 and tagging devices the service manager shall track. But
the gpt-root symlink is different, and it makes sense independently of
the service manager. Hence give it a separate file.

This introduces indentation for inner sections skipped via GOTO=. The
rules parser supports that. In order to make this more readable, let's
maybe make use of this.
2025-04-03 04:32:18 +09:00
Yu Watanabe 101b248002 journald: two minor tweaks (#36966) 2025-04-03 04:31:55 +09:00
Yu Watanabe daaf66fb1b journald: split out varlink code into .c/.h file and add varlink documentation to it (#36965)
No real code changes.
2025-04-03 04:31:15 +09:00
z z a6be40d33d po: Translated using Weblate (Chinese (Simplified) (zh_CN))
Currently translated at 99.2% (255 of 257 strings)

Co-authored-by: z z <3397542367@qq.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/zh_CN/
Translation: systemd/main
2025-04-03 04:19:14 +09:00
Yu Watanabe c421abaf80 sd_journal_get_cursor() tweaks (#36964) 2025-04-03 04:11:35 +09:00
Yu Watanabe 8f9737bf7e prioq: minor tweaks (#36963) 2025-04-03 04:10:10 +09:00
Lennart Poettering b49ba39071 sd-event: don't consider no pending IO event a programming error in sd_event_source_get_io_revents() 2025-04-03 04:07:44 +09:00
Lennart Poettering a7d58b7d3d varlink: add common helper that refuse method calls from unpriv clients 2025-04-03 04:07:08 +09:00
Yu Watanabe 0f2373f214 Several cleanups for rc-local-generator (#36953) 2025-04-03 04:05:45 +09:00
Daan De Meyer 1da030e6e1 test: Unset JOURNAL_STREAM for integration test units
We use StandardOutput=journal+console for integration test units
to make sure the output from the test ends up on both the serial
console and in the journal. Unfortunately this only works for
messages written to stdout/stderr of the test service. All journal
messages logged by systemd tools will only end up in the journal and
not on the serial console. This makes test failures harder to debug
than needed because developers have to fetch the journal to figure
out the actual error that was logged by any systemd tool that failed
when invoked from the integration test script.

To fix this, let's unset $JOURNAL_STREAM for the integration test
units. This forces all output to go through stdout, which will make
journald forward it to the console and save it in the journal.
2025-04-02 20:43:41 +02:00
Yu Watanabe 2e338f3ac1 logind: utmp fix (#36958)
Fixes: #36930
2025-04-03 02:41:26 +09:00
Yu Watanabe 8ebc5cf91d udevdm: use PidRef at one more place (#36959) 2025-04-03 02:26:42 +09:00
Yu Watanabe fd386a6a9d tree-wide: pass -EBADF to device_monitor_new_full()
Prompted by https://github.com/systemd/systemd/pull/36922#discussion_r2024940885.
2025-04-03 02:14:52 +09:00
Yu Watanabe 5833a3340c udev: use notify socket to send message from worker processes to manager process (#36922)
This replaces home-grown notification method from worker processes to
manager process with sd-notify. Then, we can reuse many library
functions commonly used by many components.
Hopefully, this does not change any effective functionalities.
2025-04-03 02:09:36 +09:00
Yu Watanabe abaa8bc7ca some selinux modernizations (#36955) 2025-04-03 01:30:03 +09:00
Yu Watanabe d4a6d44210 udev: introduce rm_rf_safep() and modernize udev_watch_restore() (#36923) 2025-04-03 01:28:34 +09:00
victor-ok 3365c40640 test: converted unittest in src/test/test-mkdir.c to use new ASSERT_OK() macros and friends 2025-04-03 01:21:18 +09:00
Lennart Poettering 808a751fac journald: do not schedule idle timer if our event loop is dying 2025-04-02 17:37:58 +02:00
Lennart Poettering ead537940c journald: rename stdout_stream_destroy() → stdout_stream_terminate() 2025-04-02 17:37:58 +02:00
Lennart Poettering 737bf89cca journald: document Varlink interface 2025-04-02 17:32:05 +02:00
Lennart Poettering 3e414aa7c9 journald: split out varlink code into a separate .c file
No actual code changes just splitting out code.
2025-04-02 17:32:05 +02:00
Lennart Poettering 2868d57b77 sd-journal: document relevant sd_journal_get_cursor() error codes 2025-04-02 17:29:49 +02:00
Lennart Poettering 98d6578335 sd-journal: make return parameter to sd_journal_get_cursor() optional 2025-04-02 17:29:04 +02:00
Lennart Poettering 39ce0324f9 prioq: add some minor overflow checking assert()s 2025-04-02 17:27:15 +02:00
Lennart Poettering bbcfac20a6 prioq: invalidate index pointers on removal 2025-04-02 17:27:15 +02:00
Yu Watanabe 011360eed3 meson: rename RC_LOCAL_PATH -> SYSTEM_SYSVRCLOCAL_PATH
No functional change, but just for emphasizing that this is for
SysV compatibility.
2025-04-03 00:19:49 +09:00
Yu Watanabe 74f25ea7a9 meson: disable rc-local-generator when an empty string is specified to rc-local= meson option
In such case, the generator is meaningless. Let's kill it.
2025-04-03 00:18:48 +09:00
Yu Watanabe b0c9ba4eb1 core: delegate mountns implicitly when any of pidns/cgns/netns is in use, clean up private cgroupfs mount (#36892)
Fixes #36952
2025-04-03 00:15:33 +09:00
Lennart Poettering 5af674214a logind: save logind session information to disk once we acquired it via utmp
Fixes: #36930
2025-04-02 17:12:42 +02:00
Lennart Poettering 700f37c367 logind: split utmp related code into logind-utmp.[ch]
No real changes, just moving of code around.
2025-04-02 17:12:42 +02:00
Yu Watanabe 7207bb0269 udevadm-lock: use PidRef 2025-04-03 00:11:27 +09:00
Yu Watanabe 147f1d7b26 process-util: make wait_for_terminate() as trivial wrapper of its PidRef version 2025-04-03 00:11:27 +09:00
Lennart Poettering 4ecc87bf1c process-util: add pidref-based version of wait_for_terminate_and_check() 2025-04-03 00:11:27 +09:00
Yu Watanabe 4df96908d1 udev-manager: use PidRef for managing worker processes 2025-04-02 23:30:40 +09:00
Yu Watanabe 0ba9d06963 udev: use sd_notify to communicate between worker and manager processes
Let's replace home-grown notification from worker to manager process
with sd_notify.
2025-04-02 23:27:15 +09:00