2
0
mirror of https://github.com/xcat2/xNBA.git synced 2025-08-14 15:30:17 +00:00

[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>
This commit is contained in:
Michael Brown
2011-03-09 17:32:32 +00:00
parent 4562223420
commit e934447a60

View File

@@ -148,9 +148,13 @@ static int script_exec ( struct image *image ) {
rc = process_script ( image, script_exec_line,
terminate_on_exit_or_failure );
/* Restore saved state, re-register image, and return */
/* Restore saved state */
script_offset = saved_offset;
register_image ( image );
/* Re-register image (unless we have been replaced) */
if ( ! image->replacement )
register_image ( image );
return rc;
}