[syslinux] [GIT-PULL] fix can't call COM32 module with full path

Matt Fleming matt at console-pimps.org
Mon May 28 04:21:06 PDT 2012


On Mon, 2012-05-28 at 07:37 -0300, André Ericson wrote:
> At boot: prompt, COM32 module calls with full path fails silently.
> Please let me know if this is not the best fix for it.
> Also, please forgive me if this is not a bug and I did something wrong on my end.
> 
> The following changes since commit 2779b713bdd8644ee2b52962ece6daa209b4ba6b:
> 
>   com32: remove duplicate modules (2012-05-22 20:59:51 -0300)
> 
> are available in the git repository at:
> 
>   git://github.com/aericson/syslinux.git elflink
> 
> for you to fetch changes up to 7a505bfa33a2fda1d1a687ef42fe7bbf4c0f37ec:
> 
>   ldlinux: fixes bug that happens when using fullpath for a COM32 module (2012-05-28 07:19:39 -0300)
> 
> ----------------------------------------------------------------
> Andre Ericson (1):
>       ldlinux: fixes bug that happens when using fullpath for a COM32 module

This patch looks good to me! Thanks very much André. With your change we
can also get rid of the following hack from findpath() that deals with
loading files from the current working directory,

diff --git a/com32/lib/sys/module/common.c b/com32/lib/sys/module/common.c
index 9d29075..19742e6 100644
--- a/com32/lib/sys/module/common.c
+++ b/com32/lib/sys/module/common.c
@@ -78,15 +78,6 @@ again:
 	if (*p == ':')
 		p++;
 
-	if (path[0] == '.' && i == 1) {
-		if (!core_getcwd(path, sizeof(path))) {
-			DBG_PRINT("Could not get cwd\n");
-			return NULL;
-		}
-
-		i = strlen(path);
-	}
-
 	n = name;
 	while (*n && i < FILENAME_MAX)
 		path[i++] = *n++;
diff --git a/core/include/fs.h b/core/include/fs.h
index 40ca09a..01b6d57 100644
--- a/core/include/fs.h
+++ b/core/include/fs.h
@@ -179,7 +179,7 @@ static inline struct file *handle_to_file(uint16_t handle)
     return handle ? &files[handle-1] : NULL;
 }
 
-#define PATH_DEFAULT	".:/boot/syslinux/:/boot/"
+#define PATH_DEFAULT	"/boot/syslinux/:/boot/"
 extern char *PATH;
 
 /* fs.c */

-- 
Matt Fleming, Intel Open Source Technology Center




More information about the Syslinux mailing list