1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-30 06:25:37 +03:00
Commit Graph

56911 Commits

Author SHA1 Message Date
Yu Watanabe
873cf95c2f udevadm trigger: introduce --prioritized-subsystem option 2022-03-22 15:27:06 +09:00
Yu Watanabe
3c5cc23a93 sd-device-enumerator: introduce device_enumerator_scan_devices_and_subsystems() 2022-03-22 15:27:06 +09:00
Yu Watanabe
37cf83d9bf sd-device-enumerator: drop /sys/subsystem support
This addresses the comment by Lennart
https://github.com/systemd/systemd/pull/22662#discussion_r829799863:
> /sys/subsystem is preparation for a future that never came.
> And given that the main proponent of this left Linux kernel
> development (Kay), I doubt this will ever come. So maybe we
> should start dropping references to /sys/subsystem/ given it's
> unlikely to materialize anytime soon.
2022-03-22 15:27:06 +09:00
Yu Watanabe
95a6f969fc sd-device-enumerator: introduce device_enumerator_add_prioritized_subsystem()
If a subsystem is specified, then matching devices and their parents are
listed at first.
2022-03-22 12:29:08 +09:00
Yu Watanabe
87c3a0f9f8 sd-device-enumerator: introduce device_enumerator_sort_devices()
and devices are sorted when the iteration started.

Previously, devices added by udev_enumerate_add_syspath() ->
device_enumerator_add_device() are not sorted. This fixes the issue.
2022-03-22 11:56:18 +09:00
Yu Watanabe
deac0c9c04 sd-device-enumerator: introduce device_enumerator_unref_devices() helper function 2022-03-22 11:56:18 +09:00
Yu Watanabe
9e871965a0 sd-device-enumerator: introduce sound_device_compare() and devpath_is_late_block() helper functions 2022-03-22 11:56:13 +09:00
Lennart Poettering
41f630598d kernel-install: check for /loader/entries.srel file as explicit marker for standards compliant /loader/entries directory 2022-03-22 00:34:49 +01:00
Lennart Poettering
80889bd9cc bootctl: automatically write out $BOOT/entries/standard.srel 2022-03-22 00:34:49 +01:00
Lennart Poettering
a5b30e156a bootctl: generalize open_tmpfile_linkable() use a bit
We want FILE* here, instead of a plain fd. Let's generalize this in
tmpfile-util.c, so we can reuse it later easily.
2022-03-22 00:34:48 +01:00
Lennart Poettering
f6ad0282c9 docs: add /loader/entries.srel to the boot loader spec
This new file is supposed to address conflicts with Fedora/Grub's
frankenbootloaderspec implementation, that squatted the /loader/entries/
dir, but place incompatible files in them (that do variable expansion?).

A simple text file /loader/entries.srel shall indicate which spec is
implemented. If it contains the string "type1\n" then the
/loader/entries/ directory implements our standard spec, otherwise
something else.
2022-03-22 00:34:33 +01:00
Lennart Poettering
cafa9d87b4 man: clarify that type #1 entries are also read from the XBOOTLDR partition 2022-03-22 00:23:25 +01:00
Lennart Poettering
838f094ce7 man: also install systemd-stub man page as sd-stub
So, typically systemd-boot is referenced as sd-boot, due to te usual
shorter naming in ESP resources. systemd-stub didnt do that so far,
since it never appears as separate files in the ESP. However it's super
annoying that you can find "man sd-boot", but not the very closely
related "man sd-stub". Let's fix that, and also add an "sd-stub" alias
to the "systemd-stub" man page.
2022-03-22 00:22:07 +01:00
Lennart Poettering
d212b862bf man: clarify where the settings in type #1 entries are documented
So (maybe weirdly) loader.conf(5) documents both loader.conf and type #1
entries (because they share a similar syntax). But it then only lists
the options of loader.conf. Let's add an explicit hint where to find
the documentation of the type #1 entries.
2022-03-22 00:22:07 +01:00
Lennart Poettering
84df0f315a man: clarify the format used by sd-boot config files 2022-03-22 00:22:07 +01:00
Lennart Poettering
ffc97a1cc4 NEWS: try to fix old entry regarding KERNEL_INSTALL_LAYOUT
The old text was simply wrong, we used to read $layout from
/etc/kernel/install.conf and the machine ID from
$KERNEL_INSTALL_MACHINE_ID from /etc/machine-info. Correct that.

Apparently KERNEL_INSTALL_MACHINE_ID was already known back in v235
times, hence don't mention it anymore.

it's kinda weird retro-fixing these NEWS entries, given we deprecate
them again, but I couldn't let this really incorrect stuff be.
2022-03-21 23:54:33 +01:00
Lennart Poettering
354a244177 kernel-install: list fields we honour in /etc/kernel/install.conf 2022-03-21 23:54:33 +01:00
Lennart Poettering
b72676e7a0 bootctl: load /etc/kernel/install.conf's $layout field, too
bootctl so far tried to determine the layout from /etc/machine-info, but
that's obsolete, and the kernel-install script never looked there. Let's
read the setting from /etc/kernel/install.conf instead, where
kernel-install actually looks.

Support for reading the field from /etc/machine-info is retained for
compat.

This means we'll now read /etc/machine-id, /etc/machine-info and
/etc/kernel/install.conf, and read the machine ID from the former too
and the layout setting from the latter two.
2022-03-21 23:54:33 +01:00
Lennart Poettering
ea29abece9 bootctl: $KERNEL_INSTALL_MACHINE_ID + $KERNEL_INSTALL_LAYOUT are deprecated
Let's add a comment about this, and generate log messages if these
fields are actually used.
2022-03-21 23:50:17 +01:00
Lennart Poettering
a321e0e463 sd-event: fix creation of floating event_add_time_change() event sources
We shouldn't auto-disable event sources we create in "floating" mode.
Hence don#t use the disabling destructor for event sources.

Given that noone else has access to this event source we just allocated
anyway there's no point in explicitly disabling it before freeing it.

Follow-up for ec75e8e07a
2022-03-21 21:57:36 +00:00
Luca Boccassi
94c17d67be
Merge pull request #22808 from poettering/openat-report-newly
journal: add openat() wrapper that reports file creation, and use it in journal
2022-03-21 21:56:37 +00:00
Anita Zhang
a4cc838e8c man: fix sysupdate typos 2022-03-21 20:06:13 +00:00
Luca Boccassi
a557e61993
Merge pull request #22804 from mrc0mmand/test-tweaks
A couple of TEST-69 tweaks
2022-03-21 20:05:06 +00:00
Nishal Kulkarni
f7829525be core/cgroup: Add OOM check
Check if process(es) of a cgroup were killed by Kernel OOM killer
or systemd-oomd before we send the cgroup empty notification.

This allows us to show the right exit state(ServiceResult)
2022-03-22 00:52:35 +05:30
Lennart Poettering
db5e7d75dc journal-file: port journal_file_open() to openat_report_new()
We so far had some magic logic in place that files we open for write
with size zero are freshly created. That of course is a bogus
assumption, in particular as this code deals with corrupted file systems
which oftentimes contain zero size inodes from left-over runs.

Let's fix this properly, and actually let the kernel tell us whether it
create the file or not.
2022-03-21 18:23:44 +01:00
Lennart Poettering
d120d897ec sd-journal: refuse invocation of journal_file_open() with O_RDONLY|O_CREAT 2022-03-21 18:23:44 +01:00
Lennart Poettering
ca8503f168 fs-util: add openat_report_new() wrapper around openat()
This is a wrapper around openat(). It works mostly the same, except for
one thing: it race-freely reports whether we just created the indicated
file in case O_CREAT is passed without O_EXCL.
2022-03-21 18:23:44 +01:00
Lennart Poettering
f5d0f21c37 update TODO 2022-03-21 18:17:04 +01:00
Frantisek Sumsal
1b87ca4fe9 test: use a dropin to override the end.service unit
instead of removing it.
2022-03-21 16:41:49 +01:00
Frantisek Sumsal
3fe2885cc5 test: run test-shutdown.py in verbose mode
To make the debugging of spurious fails a bit easier.
2022-03-21 16:13:09 +01:00
Frantisek Sumsal
c3d83ff940 test: don't try to execute a non-existing script 2022-03-21 15:55:49 +01:00
Luca Boccassi
7659e52397
Merge pull request #22798 from keszybz/test-output-narrow-and-timeouts
Increase timeout for a flaky test and make test names shorter to avoid line wrapping in output
2022-03-21 14:13:22 +00:00
Luca Boccassi
02036ca7e9
Merge pull request #22799 from keszybz/man-spelling-and-crosslinks
Typos and more internal links in documentation
2022-03-21 13:40:03 +00:00
Zbigniew Jędrzejewski-Szmek
9b01798b98 basic/strv: avoid potential UB with references to array[-1]
"""
Given an array a[N] of N elements of type T:
- Forming a pointer &a[i] (or a + i) with 0 ≤ i ≤ N is safe.
- Forming a pointer &a[i] with i < 0 or i > N causes undefined behavior.
- Dereferencing a pointer &a[i] with 0 ≤ i < N is safe.
- Dereferencing a pointer &a[i] with i < 0 or i ≥ N causes undefined behavior.
"""

As pointed by by @medhefgo, here we were forming a pointer to a[-1]. a itself
wasn't NULL, so a > 0, and a-1 was also >= 0, and this didn't seem to cause any
problems. But it's better to be formally correct, especially if we move the
code to src/fundamental/ later on and compile it differently.

Compilation shows no size change (with -O0 -g) on build/systemd, so this should
have no effect whatsoever.
2022-03-21 13:48:00 +01:00
Zbigniew Jędrzejewski-Szmek
e7949be790 Drop unused variables to fix build
This is a merge conflict between #22740 and #20156.
2022-03-21 13:30:42 +01:00
Zbigniew Jędrzejewski-Szmek
a0aa38389d man: cross-link to BLS in more places, use "Type #1", "Type #2" as appropriate 2022-03-21 12:16:54 +01:00
Zbigniew Jędrzejewski-Szmek
c3fb1e43c1 spelling: weekday names are capitalized 2022-03-21 12:16:54 +01:00
Zbigniew Jędrzejewski-Szmek
7ff9846956
Merge pull request #20156 from poettering/sysupdate
new "systemd-sysupdate" component
2022-03-21 12:06:48 +01:00
Zbigniew Jędrzejewski-Szmek
57ff888f9f test-nss-host: increase timeout
With my crappy home network the test takes 29.5s usually. But with any
tiny slowdown, it goes above the 30s limit and fails. Let's bump the
timeout to avoid spurious failures.
2022-03-21 11:43:47 +01:00
Zbigniew Jędrzejewski-Szmek
8e1fc5d939 fuzz: rename fuzz-dhcp-server-relay-message to fuzz-dhcp-server-relay
We can only relay messages, so we can make the name shorter without
losing informational value. This makes meson test output look better.
2022-03-21 11:43:47 +01:00
Zbigniew Jędrzejewski-Szmek
8e2131bfae fuzz: rename the longest test samples
"meson test" uses a test name generated from the file name and those long names
cause the test log output to exceed terminal width which looks bad. Let's replace
some long names with more-meaningful names that actually say something about
the tests.
2022-03-21 11:42:35 +01:00
Zbigniew Jędrzejewski-Szmek
b0a5e59622
Merge pull request #22740 from yuwata/list
tree-wide: declare iterator of LIST_FOREACH() in the loop
2022-03-21 10:52:03 +01:00
Yu Watanabe
59b8e67582
Merge pull request #22789 from poettering/timesync-struct-log
timesyncd: various refactorings and cleanup + structured log msg on first sync
2022-03-21 02:26:59 +09:00
Andrea Pappacoda
6725a64f6e po: fix "sistemd" typo in it.po
Also use "ricaricare" instead of "riavviare" for "reload"
2022-03-20 09:47:33 +01:00
Yu Watanabe
de010b0b2e strv: make iterator in STRV_FOREACH() declaread in the loop
This also avoids multiple evaluations in STRV_FOREACH_BACKWARDS()
2022-03-19 08:33:33 +09:00
Lennart Poettering
178d3ff2aa update TODO 2022-03-19 00:14:55 +01:00
Lennart Poettering
7910ec3bcd test: add integration test for sysupdate 2022-03-19 00:13:55 +01:00
Lennart Poettering
436aa3b16f man: add sysupdate documentation 2022-03-19 00:13:55 +01:00
Lennart Poettering
4a05d7ed72 unit: add units for new "systemd-sysupdate" tool
These unit (if enabled) will try to update the OS in regular intervals.
Moreover, every day in the early morning this will attempt to reboot the
system if there's a newer version installed than running.
2022-03-19 00:13:55 +01:00
Lennart Poettering
43cc7a3ef4 sysupdate: add new component "sysupdate" 2022-03-19 00:13:55 +01:00