mirror of https://github.com/ipxe/ipxe.git
[script] Allow scripts to be replaced
A script that downloads a new image using imgdownload() with the action register_and_replace_image() can now be freed immediately before the replacement image is executed. This functionality is not yet exposed via an iPXE command. Signed-off-by: Michael Brown <mcb30@ipxe.org>pull/1/head
parent
4562223420
commit
e934447a60
|
@ -148,9 +148,13 @@ static int script_exec ( struct image *image ) {
|
||||||
rc = process_script ( image, script_exec_line,
|
rc = process_script ( image, script_exec_line,
|
||||||
terminate_on_exit_or_failure );
|
terminate_on_exit_or_failure );
|
||||||
|
|
||||||
/* Restore saved state, re-register image, and return */
|
/* Restore saved state */
|
||||||
script_offset = saved_offset;
|
script_offset = saved_offset;
|
||||||
|
|
||||||
|
/* Re-register image (unless we have been replaced) */
|
||||||
|
if ( ! image->replacement )
|
||||||
register_image ( image );
|
register_image ( image );
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue