]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
boot: Only do full driver initialization in VMs 25541/head
authorJan Janssen <medhefgo@web.de>
Sun, 27 Nov 2022 12:56:18 +0000 (13:56 +0100)
committerJan Janssen <medhefgo@web.de>
Tue, 29 Nov 2022 14:05:56 +0000 (15:05 +0100)
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
src/boot/efi/boot.c
src/boot/efi/vmm.c

index 9123c9a84c96cc65f9f847968a4b6603f3062a6e..9a562dcf223d05da007c5a74132cf0f3a036d1f8 100644 (file)
@@ -2638,12 +2638,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,
index b1bfd778fc490ed6733d5fd8607779843742785a..2260b217b79b318cdf09cfb3d2f7f453ee1b73fa 100644 (file)
@@ -83,6 +83,10 @@ EFI_STATUS vmm_open(EFI_HANDLE *ret_vmm_dev, EFI_FILE **ret_vmm_dir) {
         assert(ret_vmm_dev);
         assert(ret_vmm_dir);
 
+        /* Make sure all file systems have been initialized. Only do this in VMs as this is slow
+         * on some real firmwares. */
+        (void) reconnect_all_drivers();
+
         /* find all file system handles */
         err = BS->LocateHandleBuffer(ByProtocol, &FileSystemProtocol, NULL, &n_handles, &handles);
         if (err != EFI_SUCCESS)