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:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user