We already do this for handover, so systemd can show time spent since
barebox kicked off kernel boot.

Populate it for the non-legacy boot as well.

Signed-off-by: Ahmad Fatoum <[email protected]>
---
 efi/payload/image.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/efi/payload/image.c b/efi/payload/image.c
index 22ff5d27ced6..5e268ed0ce35 100644
--- a/efi/payload/image.c
+++ b/efi/payload/image.c
@@ -10,6 +10,7 @@
 #include <clock.h>
 #include <common.h>
 #include <linux/sizes.h>
+#include <linux/ktime.h>
 #include <memory.h>
 #include <init.h>
 #include <driver.h>
@@ -129,6 +130,9 @@ int efi_execute_image(efi_handle_t handle,
                }
                printf("...\n");
 
+               efi_set_variable_usec("LoaderTimeExecUSec", 
&efi_systemd_vendor_guid,
+                                     ktime_to_us(ktime_get()));
+
                shutdown_barebox();
        }
 
-- 
2.47.3


Reply via email to