André Ericson
2012-May-28 10:37 UTC
[syslinux] [GIT-PULL] fix can't call COM32 module with full path
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 com32/lib/sys/module/common.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/com32/lib/sys/module/common.c b/com32/lib/sys/module/common.c index eeb2607..9d29075 100644 --- a/com32/lib/sys/module/common.c +++ b/com32/lib/sys/module/common.c @@ -64,6 +64,10 @@ static FILE *findpath(char *name) char *p, *n; int i; + f = fopen(name, "rb"); /* for full path */ + if (f) + return f; + p = PATH; again: i = 0;
Matt Fleming
2012-May-28 11:21 UTC
[syslinux] [GIT-PULL] fix can't call COM32 module with full path
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 moduleThis 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
Paulo Alcantara
2012-May-28 13:53 UTC
[syslinux] [GIT-PULL] fix can't call COM32 module with full path
Hi Andr?, From: Andr? Ericson <de.ericson at gmail.com> Date: Mon, 28 May 2012 07:37:35 -0300> 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 moduleNote that your branch is with a commit that is not upstream yet, which is the commit 2779b7. So, before sending pull requests make sure you are working against an upstream branch, otherwise one would pull your branch with that commit that hasn't been reviewed or applied yet. Paulo