diff --git a/src/boot/efi/splash.c b/src/boot/efi/splash.c index 0286a5a906..bbc1517675 100644 --- a/src/boot/efi/splash.c +++ b/src/boot/efi/splash.c @@ -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) { diff --git a/src/boot/efi/stub.c b/src/boot/efi/stub.c index f8f3e3662f..23f558c885 100644 --- a/src/boot/efi/stub.c +++ b/src/boot/efi/stub.c @@ -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",