From: Simon Glass <sjg@chromium.org>
This feature was designed for tracing but can be useful for debugging
too, since it is possible to examine the state of the system just before
handing off to the OS.
Provide a separate CONFIG_BOOTM_FAKE_GO option to allow this feature to
be used separate from tracing. Enable it for the EFI app.
Signed-off-by: Simon Glass <sjg@chromium.org>
---
boot/Kconfig | 8 ++++++++
boot/bootm.c | 5 ++---
2 files changed, 10 insertions(+), 3 deletions(-)
@@ -453,6 +453,14 @@ config BOOTM_VXWORKS
help
Support booting VxWorks images via the bootm command.
+config BOOTM_FAKE_GO
+ bool "Support faking a boot, for debugging purposes"
+ default y if TRACE || EFI_APP
+ help
+ Provides a way to fake the boot, so that almost everything is done
+ to prepare for the boot, but the jump to the OS does not actually
+ happen. This can be useful for debugging.
+
endif # BOOT
config PXE_UTILS
@@ -1260,9 +1260,9 @@ int bootm_run_states(struct bootm_info *bmi, int states)
ret = boot_fn(BOOTM_STATE_OS_PREP, bmi);
}
-#ifdef CONFIG_TRACE
/* Pretend to run the OS, then run a user command */
- if (!ret && (states & BOOTM_STATE_OS_FAKE_GO)) {
+ if (IS_ENABLED(CONFIG_BOOTM_FAKE_GO) && !ret &&
+ (states & BOOTM_STATE_OS_FAKE_GO)) {
char *cmd_list = env_get("fakegocmd");
log_debug("fake_go\n");
@@ -1270,7 +1270,6 @@ int bootm_run_states(struct bootm_info *bmi, int states)
if (!ret && cmd_list)
ret = run_command_list(cmd_list, -1, 0);
}
-#endif
/* Check for unsupported subcommand. */
if (ret) {