From: Lennart Poettering Date: Wed, 26 Jun 2024 10:00:46 +0000 (+0200) Subject: stub: split out code that displays boot splash X-Git-Tag: v257-rc1~1041^2~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=248b3257a17e50a1f7bf214d9b1dfe417e3958a0;p=thirdparty%2Fsystemd.git stub: split out code that displays boot splash --- diff --git a/src/boot/efi/stub.c b/src/boot/efi/stub.c index b8daf1d88f2..5c07b66ea87 100644 --- a/src/boot/efi/stub.c +++ b/src/boot/efi/stub.c @@ -851,6 +851,19 @@ static void load_all_addons( log_error_status(err, "Error loading UKI-specific addons, ignoring: %m"); } +static void display_splash( + EFI_LOADED_IMAGE_PROTOCOL *loaded_image, + const PeSectionVector sections[static _UNIFIED_SECTION_MAX]) { + + assert(loaded_image); + assert(sections); + + if (!PE_SECTION_VECTOR_IS_SET(sections + UNIFIED_SECTION_SPLASH)) + return; + + graphics_splash((const uint8_t*) loaded_image->ImageBase + sections[UNIFIED_SECTION_SPLASH].memory_offset, sections[UNIFIED_SECTION_SPLASH].size); +} + static EFI_STATUS run(EFI_HANDLE image) { _cleanup_(initrds_free) struct iovec initrds[_INITRD_MAX] = {}; DevicetreeAddon *dt_addons = NULL; @@ -887,8 +900,7 @@ static EFI_STATUS run(EFI_HANDLE image) { measure_sections(loaded_image, sections, §ions_measured); /* Show splash screen as early as possible */ - if (PE_SECTION_VECTOR_IS_SET(sections + UNIFIED_SECTION_SPLASH)) - graphics_splash((const uint8_t*) loaded_image->ImageBase + sections[UNIFIED_SECTION_SPLASH].memory_offset, sections[UNIFIED_SECTION_SPLASH].size); + display_splash(loaded_image, sections); if (use_load_options(image, loaded_image, /* have_cmdline= */ PE_SECTION_VECTOR_IS_SET(sections + UNIFIED_SECTION_CMDLINE), &cmdline)) { /* Let's measure the passed kernel command line into the TPM. Note that this possibly