Sebastian Herbszt
2008-Jun-17 19:51 UTC
[syslinux] ldlinux: CurrentDir not set if syslinux.cfg is missing
If a syslinux floppy does not contain a config file (syslinux.cfg) modules are not being found unless specified with a directory prefix (e.g. /pcitest.c32). The reason is that CurrentDir is only set if there is a config file present. This is a possible regression since commit 68eefb79e2cbb590ebf958dd0c50ce00b941abd2. Before this change RootDir was used in searchdir and now it's CurrentDir unless the filename starts with '/'. Possible fix is to set CurrentDir to RootDir if no config file is found. - Sebastian --- core/ldlinux.asm.orig 2008-06-17 19:25:35.000000000 +0200 +++ core/ldlinux.asm 2008-06-17 19:36:13.000000000 +0200 @@ -909,6 +909,8 @@ jnz .config_open mov di,syslinux_cfg3 call open + mov eax,[RootDir] ; Make the root directory ... + mov [CurrentDir],eax ; ... the current directory jz no_config_file .config_open: mov eax,[PrevDir] ; Make the directory with syslinux.cfg ...
Sebastian Herbszt
2008-Jun-18 10:31 UTC
[syslinux] ldlinux: CurrentDir not set if syslinux.cfg is missing
> If a syslinux floppy does not contain a config file (syslinux.cfg) modules are > not being found unless specified with a directory prefix (e.g. /pcitest.c32). > The reason is that CurrentDir is only set if there is a config file present. This is a > possible regression since commit 68eefb79e2cbb590ebf958dd0c50ce00b941abd2. > Before this change RootDir was used in searchdir and now it's CurrentDir unless > the filename starts with '/'. Possible fix is to set CurrentDir to RootDir if no config > file is found.Actually it seems better to move this to the top of the "check for config file" block. Initialize CurrentDir to RootDir and change it if a config file is found. - Sebastian --- core/ldlinux.asm.orig 2008-06-17 19:25:35.000000000 +0200 +++ core/ldlinux.asm 2008-06-18 12:10:45.000000000 +0200 @@ -901,6 +901,8 @@ mov di,ConfigName call strcpy + mov eax,[RootDir] ; Make the root directory ... + mov [CurrentDir],eax ; ... the current directory mov di,syslinux_cfg1 call open jnz .config_open
Possibly Parallel Threads
- [RESEND][PATCH] ldlinux: CurrentDir not set if syslinux.cfg is missing
- [PATCH 1/1] COMBOOT: add get config file full name
- [PATCH 1/1] COMBOOT API: Add get current working directory call to most
- [PATCH 1/1] COMBOOT API: Add calls for directory functions; Implement for FAT; Try 2
- [PATCH 1/1] COMBOOT API: Add calls for directory functions; Implement for FAT