Commit Graph

56865 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
93efd9cadb Merge pull request #22778 from poettering/kernel-install-layout-rework
kernel-install/bootctl: layout fixes
2022-03-22 13:57:28 +01:00
Lennart Poettering
c0f6a6a542 Merge pull request #22662 from yuwata/udev-trigger-priority
udevadm trigger: add --prioritized-subsystem option
2022-03-22 12:56:32 +01:00
Jason A. Donenfeld
d328346944 random-util: use correct minimum pool size constant
The actual minimum size of the pool across supported kernel versions is
32 bytes. So adjust this minimum.

I've audited every single usage of random_pool_size(), and cannot see
anywhere that this would have any impact at all on anything. We could
actually just not change the constant and everything would be fine, or
we could change it here and that's fine too. From both a functionality
and crypto perspective, it doesn't really seem to make a substantive
difference any which way, so long as the value is ≥32. However, it's
better to be correct and have the function do what it says, so clamp it
to the right minimum.
2022-03-22 08:46:20 +01:00
Zbigniew Jędrzejewski-Szmek
8bab619383 Merge pull request #22813 from poettering/sd-boot-man-fixes
man: some sd-boot doc tweaks
2022-03-22 08:26:57 +01:00
Danilo Krummrich
678f2b1667 udevadm: trigger: implement --initialized-match/nomatch arguments
systemd-udev-trigger.service by default triggeres all devices regardless
of whether they were already recognized by systemd-udevd.

There are machines (especially in embedded environments) where
systemd-udev-trigger.service is configured to run at a later stage of
the boot sequence, which can lead to quite a lot of devices being
triggered although they were already recognized by systemd-udevd.

Re-triggering a lot of devices is a relatively expensive operation and
therefore should be avoided if unnecessary.

Therefore this patch introduces --initialized-nomatch, which filters out
devices that are already present in the udev database. For consistance
reasons --initialized-match is implemented as well, which filters out devices
that are *not* already present in the udev database.

Replaces #19949.
2022-03-22 15:54:10 +09:00
Yu Watanabe
d8b50e5df7 sd-device-enumerator: support to list only initialized or uninitialized devices 2022-03-22 15:27:06 +09:00
Yu Watanabe
2336bde964 unit: make systemd-udev-trigger.service use --prioritized-subsystem
Replaces #19637 and #22643.
2022-03-22 15:27:06 +09:00
Yu Watanabe
1baeee5784 udevadm trigger: introduce --type=all option 2022-03-22 15:27:06 +09:00
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