]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
stub: show splash screen earlier
authorLennart Poettering <lennart@poettering.net>
Tue, 21 Sep 2021 17:33:01 +0000 (19:33 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 23 Sep 2021 15:24:10 +0000 (17:24 +0200)
let's move showing of the splash screen to the earliest place we know
the splash bmp address. After all a splash screen is all about showing
as early as we can. This matters as doing TPM stuff or packing up a
large cpio might take time.

While we are at it, move the conditionalization of the splash screen
into the function instead of doing it ahead of calling it. This should
encapsulate things more nicely.

src/boot/efi/splash.c
src/boot/efi/stub.c

index 0286a5a90642008d3830960f88ebe86feb05213f..bbc151767583913efda416df4981a11e94f4fe8b 100644 (file)
@@ -259,6 +259,9 @@ EFI_STATUS graphics_splash(UINT8 *content, UINTN len, const EFI_GRAPHICS_OUTPUT_
         UINTN y_pos = 0;
         EFI_STATUS err;
 
+        if (len == 0)
+                return EFI_SUCCESS;
+
         assert(content);
 
         if (!background) {
index f8f3e3662fc5bdb43cb813923f05ed6ddec620c8..23f558c885ef61457906a41d61e65a67e48b12ea 100644 (file)
@@ -172,6 +172,9 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) {
         if (EFI_ERROR(err))
                 return log_error_status_stall(err, L"Unable to locate embedded .linux section: %r", err);
 
+        /* Show splash screen as early as possible */
+        graphics_splash((UINT8*) loaded_image->ImageBase + addrs[SECTION_SPLASH], szs[SECTION_SPLASH], NULL);
+
         if (szs[SECTION_CMDLINE] > 0) {
                 cmdline = (CHAR8*) loaded_image->ImageBase + addrs[SECTION_CMDLINE];
                 cmdline_len = szs[SECTION_CMDLINE];
@@ -201,9 +204,6 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) {
 
         export_variables(loaded_image);
 
-        if (szs[SECTION_SPLASH] > 0)
-                graphics_splash((UINT8*) (UINTN) loaded_image->ImageBase + addrs[SECTION_SPLASH], szs[SECTION_SPLASH], NULL);
-
         (VOID) pack_cpio(loaded_image,
                          L".cred",
                          (const CHAR8*) ".extra/credentials",