summaryrefslogtreecommitdiffstats
path: root/arch/efi/efi/efi-image.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2016-01-15 09:05:37 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2016-01-26 22:45:36 +0100
commit3f0835e0741c80305faf638aaf174ac9d235e83e (patch)
tree1e8febe8e4c5b09ab34c05ecbce1fdbb34098edd /arch/efi/efi/efi-image.c
parent80f6d5db3041f2ae1109f3f811cf48e4f25142e4 (diff)
downloadbarebox-3f0835e0741c80305faf638aaf174ac9d235e83e.tar.gz
barebox-3f0835e0741c80305faf638aaf174ac9d235e83e.tar.xz
bootm: Push dryrun to handlers
We can make the dryrun option more useful by calling into the handlers. With this we can detect more cases that can go wrong during boot. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/efi/efi/efi-image.c')
-rw-r--r--arch/efi/efi/efi-image.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/arch/efi/efi/efi-image.c b/arch/efi/efi/efi-image.c
index b6437f407..c78043b0d 100644
--- a/arch/efi/efi/efi-image.c
+++ b/arch/efi/efi/efi-image.c
@@ -190,7 +190,7 @@ static inline void linux_efi_handover(efi_handle_t handle,
static int do_bootm_efi(struct image_data *data)
{
void *tmp;
- void *initrd;
+ void *initrd = NULL;
size_t size;
efi_handle_t handle;
int ret;
@@ -244,6 +244,13 @@ static int do_bootm_efi(struct image_data *data)
printf("...\n");
}
+ if (data->dryrun) {
+ BS->unload_image(handle);
+ free(boot_header);
+ free(initrd);
+ return 0;
+ }
+
efi_set_variable_usec("LoaderTimeExecUSec", &efi_systemd_vendor_guid,
get_time_ns()/1000);