]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
stub: slightly reorder things
authorLennart Poettering <lennart@poettering.net>
Wed, 26 Jun 2024 10:02:06 +0000 (12:02 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 26 Jun 2024 15:09:45 +0000 (17:09 +0200)
Let's do the section measurement first, before we use any data of it.

Let's bring up the boot splash next, so that it covers anything else we
might do.

src/boot/efi/stub.c

index 5c07b66ea878a3745ff47ba7d3276ba5844b89ea..a0237bf112fcf6e54bccf4bf50eebf9811791225 100644 (file)
@@ -881,8 +881,6 @@ static EFI_STATUS run(EFI_HANDLE image) {
         if (err != EFI_SUCCESS)
                 return log_error_status(err, "Error getting a LoadedImageProtocol handle: %m");
 
-        refresh_random_seed(loaded_image);
-
         err = pe_memory_locate_sections(loaded_image->ImageBase, unified_sections, sections);
         if (err != EFI_SUCCESS || !PE_SECTION_VECTOR_IS_SET(sections + UNIFIED_SECTION_LINUX)) {
                 if (err == EFI_SUCCESS)
@@ -890,6 +888,13 @@ static EFI_STATUS run(EFI_HANDLE image) {
                 return log_error_status(err, "Unable to locate embedded .linux section: %m");
         }
 
+        measure_sections(loaded_image, sections, &sections_measured);
+
+        /* Show splash screen as early as possible, but after measuring it */
+        display_splash(loaded_image, sections);
+
+        refresh_random_seed(loaded_image);
+
         lookup_uname(loaded_image, sections, &uname);
 
         /* Now that we have the UKI sections loaded, also load global first and then local (per-UKI)
@@ -897,11 +902,6 @@ static EFI_STATUS run(EFI_HANDLE image) {
         CLEANUP_ARRAY(dt_addons, n_dt_addons, devicetree_addon_free_many);
         load_all_addons(image, loaded_image, uname, &cmdline_addons, &dt_addons, &n_dt_addons);
 
-        measure_sections(loaded_image, sections, &sections_measured);
-
-        /* Show splash screen as early as possible */
-        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
                  * duplicates what we already did in the boot menu, if that was already used. However, since