|
@@ -27,7 +27,6 @@
|
27
|
27
|
#include <stdlib.h>
|
28
|
28
|
#include <errno.h>
|
29
|
29
|
#include <gpxe/image.h>
|
30
|
|
-#include <gpxe/uri.h>
|
31
|
30
|
|
32
|
31
|
struct image_type script_image_type __image_type ( PROBE_NORMAL );
|
33
|
32
|
|
|
@@ -38,7 +37,6 @@ struct image_type script_image_type __image_type ( PROBE_NORMAL );
|
38
|
37
|
* @ret rc Return status code
|
39
|
38
|
*/
|
40
|
39
|
static int script_exec ( struct image *image ) {
|
41
|
|
- struct uri *old_cwuri;
|
42
|
40
|
char cmdbuf[256];
|
43
|
41
|
size_t offset = 0;
|
44
|
42
|
size_t remaining;
|
|
@@ -53,10 +51,6 @@ static int script_exec ( struct image *image ) {
|
53
|
51
|
image_get ( image );
|
54
|
52
|
unregister_image ( image );
|
55
|
53
|
|
56
|
|
- /* Switch current working directory to be that of the script itself */
|
57
|
|
- old_cwuri = uri_get ( cwuri );
|
58
|
|
- churi ( image->uri );
|
59
|
|
-
|
60
|
54
|
while ( offset < image->len ) {
|
61
|
55
|
|
62
|
56
|
/* Read up to cmdbuf bytes from script into buffer */
|
|
@@ -93,9 +87,7 @@ static int script_exec ( struct image *image ) {
|
93
|
87
|
|
94
|
88
|
rc = 0;
|
95
|
89
|
done:
|
96
|
|
- /* Reset current working directory, re-register image and return */
|
97
|
|
- churi ( old_cwuri );
|
98
|
|
- uri_put ( old_cwuri );
|
|
90
|
+ /* Re-register image and return */
|
99
|
91
|
register_image ( image );
|
100
|
92
|
image_put ( image );
|
101
|
93
|
return rc;
|