summaryrefslogtreecommitdiffstats
path: root/src/image/script.c
diff options
context:
space:
mode:
authorMichael Brown2007-08-07 15:50:12 +0200
committerMichael Brown2007-08-07 15:50:12 +0200
commitcfcc41d407e99968c23c2402a600263401ee41b8 (patch)
tree24f42fa8779441dcf73d75801bcb27419dfe8d99 /src/image/script.c
parentAdd PXE FILE API. (diff)
downloadipxe-cfcc41d407e99968c23c2402a600263401ee41b8.tar.gz
ipxe-cfcc41d407e99968c23c2402a600263401ee41b8.tar.xz
ipxe-cfcc41d407e99968c23c2402a600263401ee41b8.zip
Set current working URI to be that of the executable image when
executing any image, not just a script. (This will enable pxelinux to use relative URIs, should it wish to.)
Diffstat (limited to 'src/image/script.c')
-rw-r--r--src/image/script.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/image/script.c b/src/image/script.c
index 2f159c97..c8821522 100644
--- a/src/image/script.c
+++ b/src/image/script.c
@@ -27,7 +27,6 @@
#include <stdlib.h>
#include <errno.h>
#include <gpxe/image.h>
-#include <gpxe/uri.h>
struct image_type script_image_type __image_type ( PROBE_NORMAL );
@@ -38,7 +37,6 @@ struct image_type script_image_type __image_type ( PROBE_NORMAL );
* @ret rc Return status code
*/
static int script_exec ( struct image *image ) {
- struct uri *old_cwuri;
char cmdbuf[256];
size_t offset = 0;
size_t remaining;
@@ -53,10 +51,6 @@ static int script_exec ( struct image *image ) {
image_get ( image );
unregister_image ( image );
- /* Switch current working directory to be that of the script itself */
- old_cwuri = uri_get ( cwuri );
- churi ( image->uri );
-
while ( offset < image->len ) {
/* Read up to cmdbuf bytes from script into buffer */
@@ -93,9 +87,7 @@ static int script_exec ( struct image *image ) {
rc = 0;
done:
- /* Reset current working directory, re-register image and return */
- churi ( old_cwuri );
- uri_put ( old_cwuri );
+ /* Re-register image and return */
register_image ( image );
image_put ( image );
return rc;