mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-06 13:17:44 +03:00
boot: Only do full driver initialization in VMs
Doing the reconnect dance on some real firmware creates huge delays on
boot. This should not be needed anymore as we now ask the firmware to
make console devices and xbootldr partitions available explicitly in a
more targeted fashion.
Fixes: #25510
(cherry picked from commit f6d59e2ebf
)
Note: I reapplied the original patch by hand, hopefully breaking nothing
in the process. In 'main' open_volume() was changed to call either
vmm_open() or open_volume(), and the call to reconnect_all_drivers() was
moved to vmm_open(). Here, that call is moved to the point where open_volume()
is called, guarded by is_direct_boot(().
This commit is contained in:
parent
79b97ec652
commit
1c9e7fc8f2
@ -2655,12 +2655,6 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) {
|
||||
/* Uncomment the next line if you need to wait for debugger. */
|
||||
// debug_break();
|
||||
|
||||
/* The firmware may skip initializing some devices for the sake of a faster boot. This is especially
|
||||
* true for fastboot enabled firmwares. But this means that things we use like input devices or the
|
||||
* xbootldr partition may not be available yet. Reconnect all drivers should hopefully make the
|
||||
* firmware initialize everything we need. */
|
||||
(void) reconnect_all_drivers();
|
||||
|
||||
err = BS->OpenProtocol(image,
|
||||
&LoadedImageProtocol,
|
||||
(void **)&loaded_image,
|
||||
@ -2674,6 +2668,13 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) {
|
||||
|
||||
export_variables(loaded_image, loaded_image_path, init_usec);
|
||||
|
||||
/* The firmware may skip initializing some devices for the sake of a faster boot. This is especially
|
||||
* true for fastboot enabled firmwares. But this means that things we use like input devices or the
|
||||
* xbootldr partition may not be available yet. Reconnect all drivers should hopefully make the
|
||||
* firmware initialize everything we need. */
|
||||
if (is_direct_boot(loaded_image->DeviceHandle))
|
||||
(void) reconnect_all_drivers();
|
||||
|
||||
err = open_volume(loaded_image->DeviceHandle, &root_dir);
|
||||
if (err != EFI_SUCCESS)
|
||||
return log_error_status_stall(err, L"Unable to open root directory: %r", err);
|
||||
|
Loading…
Reference in New Issue
Block a user