From ab839dc3e6c1d07bc926199f3eebace0804f2ecf Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 27 Feb 2014 13:26:23 -0700 Subject: sandbox: Add options to clean up temporary files When jumping from one sandbox U-Boot to another in sandbox, the RAM buffer is preserved in the jump by using a temporary file. Add an option to tell the receiving U-Boot to remove this file when it is no longer needed. Similarly the old U-Boot image is left behind in this case. We cannot delete it immediately since gdb cannot then find its debug symbols. Delete it just before exiting. Together these changes ensure that temporary files are removed both for memory and U-Boot. Signed-off-by: Simon Glass --- arch/sandbox/cpu/os.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'arch/sandbox/cpu/os.c') diff --git a/arch/sandbox/cpu/os.c b/arch/sandbox/cpu/os.c index 9de71bb2b4f..57d04a45b22 100644 --- a/arch/sandbox/cpu/os.c +++ b/arch/sandbox/cpu/os.c @@ -488,7 +488,7 @@ int os_jump_to_image(const void *dest, int size) struct sandbox_state *state = state_get_current(); char fname[30], mem_fname[30]; int fd, err; - const char *extra_args[4]; + const char *extra_args[5]; char **argv = state->argv; #ifdef DEBUG int argc, i; @@ -513,6 +513,7 @@ int os_jump_to_image(const void *dest, int size) extra_args[1] = fname; extra_args[2] = "-m"; extra_args[3] = mem_fname; + extra_args[4] = "--rm_memory"; err = add_args(&argv, extra_args, sizeof(extra_args) / sizeof(extra_args[0])); if (err) -- cgit v1.2.3