aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2013-01-18slzm: don't use floadfile()slzmH. Peter Anvin2-23/+27
Don't use floadfile() for loading module data. The SLZM header contains both the compressed and uncompressed sizes, so we might as well just use that information to know ahead of time how much memory to allocate. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2013-01-17slzm: Syslinux compressed modulesH. Peter Anvin19-75/+602
Use ELF compressed into a custom lzo container. The reason for not using the standard lzop container is that we are doing one-shot decompression anyway, and by having the appropriate information in the header we can manage memory better. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2013-01-17core/lzo: move LZO back to uncompressed sectionH. Peter Anvin1-1/+1
The LZO decompressor really can't live in the compressed part of the core, for some odd reason. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2013-01-17elf: remove long-since-obsolete shallow module machineryH. Peter Anvin6-223/+5
Meant to handle symbols exported from the core, but we just pregenerate the dynamic section instead. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2013-01-17core: switch LZO decompressor to "fast safe" versionH. Peter Anvin8-17/+42
Switch LZO decompressor to the "fast safe" version (and bump LZO source to version 2.06). This allows us to use that decompressor for module compression later without carrying another decompressor. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2013-01-17core/fs: remove some stale functions, inode refcount debugH. Peter Anvin2-112/+9
Remove some stale (16-bit compatibility) functions in fs.c. Add some debugging for inode refcounts. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2013-01-17bios.h: add missing dependent #includeH. Peter Anvin1-0/+2
io_delay() defined in bios.h depends on outb() defined in <sys/io.h>. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2013-01-17Rename libcom32gpl.c32 to libgpl.c32H. Peter Anvin2-4/+4
Conform to 8.3 filenames for essential files. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2013-01-17Rename libutil_com.c32 to libutil.c32H. Peter Anvin5-8/+7
Conform to 8.3 filenames for essential files. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2013-01-17Always strip all the modulesH. Peter Anvin15-25/+35
Always strip the modules; they are too big unstripped. Specifically, we generate unstripped *.elf files, and then convert them to stripped *.c32 files. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2013-01-17dos: obtain the executable pathname, cleanupsH. Peter Anvin7-75/+175
DOS actually does provide the fully qualified pathname to the executable, which would be useful to make ldlinux.c32 data rather than live inside the executable itself -- it has gotten too large. Also, move some DOS internals -- inline functions only used inside the dos directory -- out of libinstaller. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2013-01-16ldlinux: Perform chdir() before parsing configsyslinux-5.01-pre3Matt Fleming1-3/+3
The old 4.x behaviour for handling CONFIG directives of the form, CONFIG foo.cfg /bar was to lookup the absolute pathname of foo.cfg, then chdir to /bar and finally to parse foo.cfg. The 5.x behaviour reversed the chdir and parsing steps. This meant if foo.cfg's contents were simply, INCLUDE say.txt 4.x would include /bar/say.txt and 5.x would include /boot/syslinux/say.txt (assuming the current working directory was /boot/syslinux). What's even worse is that because of the way 'config_cwd' is used in 5.x we'd actually perform the chdir() operation after the first INCLUDE in foo.cfg, e.g. INCLUDE say.txt INCLUDE say.txt would include /boot/syslinux/say.txt and /bar/say.txt, respectively. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-01-16module: Check return value of malloc()Matt Fleming1-0/+5
And return NULL after printing an appropriate error message if the call failed. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-01-15ldlinux: Strip whitespace from LABEL directiveMatt Fleming1-5/+11
Any LABEL directive arguments shouldn't include whitespace characters. If whitespace characters are needed use MENU LABEL. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-01-14PXELINUX: Fix IPAPPEND to include BOOTIF and SYSUUIDsyslinux-5.01-pre2Matt Fleming1-1/+3
commit 14531c47bc95 ("core: Delete code that is duplicated in ldlinux") erroneously deleted the BOOTIFStr and SYSUUIDStr entries from the PXELINUX-version of IPAppends, meaning that IPAPPEND 3 and IPAPPEND 4 didn't append the corresponding strings to the command line. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-01-11isolinux: Update LBA in getlinsec loopMatt Fleming1-0/+3
We need to increment the Logical Block Address in eax by the number of sectors we passed to getlinsec after every invocation, otherwise we'll start with the same sector everytime. This bug was discovered when booting an isohybrid image, which failed to boot after printing the following error, "Image checksum error, sorry..." because the isolinux.bin was bigger than 32K, and thus invoked the getlinsec loop that reads the file in chunks. Cc: H. Peter Anvin <hpa@zytor.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-01-10module: Allow .c32 files to execute themselvesMatt Fleming1-14/+2
Historically, .c32 files had to explicitly link against ldlinux.c32 in order to use its exported symbols. This lead to the undesirable situation during module dependency resolution where loading, e.g. menu.c32, would cause ldlinux.c32 to be reloaded, thus re-executing its main() function and dropping the user at a prompt instead of executing menu.c32. commit 1357b7e62706 ("elflink: Don't reload the current EXEC_MODULE module") was the solution to this problem, since you don't need to reload a module to link against it's symbols. Unfortunately, while this commit was intended to stop ldlinux.c32 being reloaded, it also broke the use case where a .c32 wants to load itself, e.g. when vesamenu.c32 wants to execute vesamenu.c32 with a different config. Luckily, modules no longer need to include ldlinux.c32 in their dependency list, since ldlinux.c32 is *always* loaded and any symbols can be automatically resolved. Which means that the check in spawn_load() can be deleted. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-01-10extlinux: Fix installation subdirectory patchingMatt Fleming1-7/+3
Commit a126f17f663c ("EXTLINUX: Initial XFS filesystem support") broke the code that inserts the installation subdirectory into the Extended Patch Area (EPA). The EPA entry is used to set the initial working directory on boot. This caused boot failures for users that chose an install directory other than /boot/syslinux (technically, it failed for any path not in 'search_directories' in load_env32()) due to ldlinux.c32 failing to load because the initial working directory was not set correctly. Cc: Paulo Alcantara <pcacjr@zytor.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-01-10extlinux: Make sure ldlinux.sys file is installedPaulo Alcantara1-0/+2
Due to delayed allocation feature on XFS filesystems, a write is not guaranteed to flushed out to the underlying file system after crash or something else - so we need to make sure that ldlinux.sys is installed correctly in the mounted filesystem. Signed-off-by: Paulo Alcantara <pcacjr@zytor.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-01-09menugen: Make it compatible with Py3kPaulo Alcantara1-28/+28
Signed-off-by: Paulo Alcantara <pcacjr@zytor.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-01-08core/kaboom.c: Export __bad_SEG()Matt Fleming1-1/+1
We need to add __bad_SEG() to the symbol export whitelist, otherwise ldlinux.c32 will fail to load if compiled with -DDEBUG=1 due to not being able to resolve __bad_SEG(). Cc: H. Peter Anvin <hpa@zytor.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-01-08version: Bump minor number and yearsyslinux-5.01-pre1Matt Fleming1-1/+1
Welcome to the 5.01 development cycle and 2013. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-01-04ldlinux: Dynamically alloc memory for kernel and initrd filenamesMatt Fleming1-19/+45
Absolutely no bounds checking is performed when copying filenames to 'cmdline_buf' and 'initrd_name' which means that sufficiently long strings will scribble over the stack. At best, the files will simply fail to load because the name is garbled. Allocate space for the cmdline at runtime to avoid these overflow problems. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-01-04ldlinux: Don't delete ldlinux.c32 with 'make clean'Matt Fleming1-4/+6
The documented command sequence for distributions wishing to package a Syslinux release is, make clean make installer Unfortunately, becaues ldlinux.c32 is deleted by 'make clean' the installer target fails like so, make[1]: *** No rule to make target `../com32/elflink/ldlinux/ldlinux.c32', needed by `ldlinuxc32_bin.c'. Stop. make: *** [installer] Error 2 Follow the example set by core/Makefile for ldlinux.sys, etc and add any build files that are required by the installers to $(BTARGET). $(BTARGET) only gets deleted when running 'make spotless'. Reported-by: László Házy <hazy_l@yahoo.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-01-03elflink: set the sonames of shared librariesH. Peter Anvin4-4/+4
Set the sonames of shared libraries to the filename, so we don't end up with full pathnames embedded in the files.
2012-12-06Delete 16-bit COMBOOT supportsyslinux-5.00Matt Fleming20-2443/+23
16-bit COMBOOT files are no longer supported by Syslinux in 5.00 so delete all references and change any 32-bit COMBOOT image references to mention ELF instead. Some of the COMBOOT stuff is still used internally so we can't nuke core/comboot.inc yet, but that will disappear in a future release. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-12-05Symbol export whitelistMatt Fleming44-92/+103
Before modules were dynamically loaded the boundary between GPL and non-GPL code was implicit because of the separate link domains for each module. With dynamic modules we need an explicit whitelist of core symbols that non-GPL code can link against at runtime without needing to be re-licensed under the GPL. Mark such symbols with __export, so that it is explicitly clear which symbols in the core can be linked against by non-GPL code. Reduce the visibility of symbols in both the core and ldlinux.c32 with -fvisibility=hidden. __export changes the visibility to 'default'. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-12-05core: Fix 'NoHalt'Matt Fleming3-5/+3
Use the same variable in idle.c and ldlinux.c32. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-12-05com32: Delete unused malloc.c and friendsMatt Fleming4-383/+0
The memory alloc files haven't been referenced since commit 880f67714ec0 ("elflink: remove the malloc.c/free.c/realloc.c/zalloc.c from com32"). They live in the core now. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-12-05Reduce the number of global variablesMatt Fleming16-270/+28
In preparation for strictly limiting the list of variables that are exported (global) in the core, delete any unused variables, rewrite variable declarations in C that are not referenced by asm and delete files that are no longer included in other asm files. Cc: H. Peter Anvin <hpa@zytor.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-12-05comboot: Mark API functions obsoleteMatt Fleming1-349/+37
Starting with Syslinux 5.00 the COMBOOT API is obsolete and should not be used by any modules. It is still used internally for some things, such as the ADV code in ldlinux.c32, but that will change in the future. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-12-04doc: Further explanation for the PATH directive and lookup rulesMatt Fleming1-1/+29
The PATH directive can be quite confusing when coupled with the fact that the current working directory is always searched first when opening files. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-12-04Revert "menu: Inherit parent menu title"Matt Fleming1-3/+0
This reverts commit 6387f043f7f870e4f0b402dae0b921d99eb82c39. We got reports of this change causing regressions. The reverted commit only goes half way to providing proper parent menu title inheritance, and breaks other configs where the menu label or submenu tagname are used for the title. Reported-by: Ady <ady-sf@hotmail.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-12-04ldlinux: Use get_msg_file() for F-keysMatt Fleming1-17/+2
The file that we display with the F-keys may contain background or foreground color codes and so needs to be interpreted by get_msg_file() instead of just printing the color codes as ascii to the screen with cat_file(). Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-12-04ldlinux: Remove default bold attribute typoMatt Fleming1-1/+1
commit 82cbb1bd4133 ("ldlinux: Move DISPLAY file handling out of the core") introduced a typo where the foreground color was always bold when displaying a DISPLAY file. Reported-by: Ady <ady-sf@hotmail.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-12-04CLI: Don't always start the CLI at column 0Matt Fleming1-3/+9
If we print files with no newline then it looks better if the CLI prompt is printed immediately after the file content, rather than erasing the line and printing prompt at column 0. This mainly affects files with one line of text and no newline character. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-12-03ldlinux: Move DISPLAY file handling out of the coresyslinux-5.00-pre13Matt Fleming3-340/+215
The code that handles the DISPLAY directive was writing directly to the BIOS VGA page with __intcall(0x10). This caused corruption problems on the screen because the ansi library code was also writing to the screen. The correct way to fix this is to always use the ansi library code (via printf()) instead of going behind its back and using separate code paths to write to the screen. Reported-by: Ady <ady-sf@hotmail.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-12-03stdio: Fix unhexchar() for hex digits > 9Matt Fleming1-3/+3
There was a typographical error in commit 9f51b69d7c050 ("core: Reimplement lots asm code in C") which re-wrote the asm implementation of unhexchar() in C. We should be adding 10, not subtracting to get the equivalent decimal integer. Also be explicit about the sign of 'data' and 'num'. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-11-30Merge branch 'searchdir_leak-5' of git://git.zytor.com/users/sha0/syslinux ↵Matt Fleming1-108/+155
into elflink-searchdir-leak Pull a change that fixes a resource leak from Shao Miller, * 'searchdir_leak-5' of git://git.zytor.com/users/sha0/syslinux: fs: Fix searchdir resource leak
2012-11-30PATH: Use installation directory for 'PATH'Matt Fleming2-4/+2
Files in the installation directory should be able to be executed (along with their dependencies) from any directory in the file hierarchy. Using the installation directory as the default value for 'PATH' is the most sensible way to do this. The PATH config directive still allows other directories to be appended to the 'PATH' variable, which is useful when there are other directories containing modules. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-11-30ldlinux: Don't try reloading ldlinux.c32 unless it's likely to succeedMatt Fleming2-1/+13
If we can't access ldlinux.c32 with findpath(), reloading it isn't going to work so don't unload it or any of the other modules. Instead return control to the caller. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-11-30module: Fix incorrect list_entry() useMatt Fleming1-1/+1
Correct the bogus use of list_entry() that was introduced in commit 8f1c64acf9c6 ("module: Stop silently failing to load dependency modules"). Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-11-29fs: Fix searchdir resource leakShao Miller1-108/+155
This is a significant rewrite of the generic lookup logic inside core/fs/fs.c's searchdir function. Previously, there was a memory leak if a path involved multiple directories. After a sufficiently large number of invocations, this could be observed. Reported-by: Ady <ady-sf@hotmail.com> Signed-off-by: Shao Miller <sha0.miller@gmail.com>
2012-11-29CLI: Delete 'temp_cmdline' and put 'cmdline' on the stackMatt Fleming1-17/+6
We don't need to preserve the contents of 'cmdline' across calls to edit_cmdline(). In fact, doing so causes things like the TAB key to not function properly because the previous command is used as a prefix to print_labels(), as though the user had typed it explicitly before hitting TAB. Delete 'temp_cmdline' because it no longer serves a purpose. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-11-29module: Stop silently failing to load dependency modulessyslinux-5.00-pre12Matt Fleming1-1/+11
We should be checking the return value of spawn_load() when loading a module's dependencies and printing some kind of an error message if they fail to load (for instance if the file is missing) and returning an error to the caller. Track the most recently loaded module in 'head' before we begin loading dependencies. That way we can unload any dependencies in the error path that were successfully loaded. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-11-29ldlinux: Complain to user on failure to perform file operationsMatt Fleming3-4/+4
If we fail to chdir or to execute a COM32 file we should inform the user so that they can debug the problem. We don't currently print anything if the user tries to execute a regular file, such as a config file, as an COM32 image. We also shouldn't be returning the exit value of the module from spawn_load(), because we have no way of doing anything useful with it, and just because a main() function returns -1 doesn't mean it failed to run. Modules need to take care of printing any error messages themselves. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-11-29module: Append '/' to PATH strings if missingMatt Fleming1-0/+4
We shouldn't be appending a filename to any path string that isn't terminated by a '/', otherwise we end up searching for files like '/isolinuxpwd.c32' Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-11-29ldlinux: Only append missing filename extensionsMatt Fleming1-3/+6
Don't append an extension like ".c32" if the command already has one! This bug lead to "config.c32" being executed as "config.c32.c32" with the below config snippet, LABEL config COM32 config.c32 /configs/isolinux.cfg Reported-by: Ady <ady-sf@hotmail.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-11-27Merge branch 'coverity' into elflinksyslinux-5.00-pre11Matt Fleming10-25/+32
2012-11-27core/elflink: Fix off-by-one errorMatt Fleming1-2/+3
We need to remember to allocate space for the terminating NULL in create_args_and_load() otherwise we will write a NUL-byte past the bounds of 'argv[]' to some random part of the stack. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-11-27module: Fix off-by-one error in findpath()Matt Fleming1-2/+2
We need to make sure that 'path' still has enough space to write the trailing NUL-byte. Without this patch it's possible to write a NUL-byte past the end of the on-stack buffer. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-11-27module: Fix memory leak in spawn_load()Matt Fleming1-10/+12
If for some reason we fail to load a module then we need to free the memory allocated to that module. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-11-27pxe: Don't leak inode on timeoutMatt Fleming1-1/+3
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-11-27screensize: Dereference pointers when checking cols/rowsMatt Fleming1-1/+1
Dereference 'rows' and 'cols' to check whether the data they point to is zero, which would indicate the screen size is bogus, instead of checking if they point to NULL. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-11-27hdt-cli: Correct malloc() size argumentMatt Fleming1-1/+1
We need to be allocating sizeof(char *) (4) not sizeof(char) (1) for 'new_argv'. Cc: Erwan Velu <erwanaliasr1@gmail.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-11-27Merge branch 'xfs-for-hpa' of git://zytor.com/users/pcacjr/syslinux into ↵Matt Fleming23-40/+5011
merge/elflink/xfs Pull XFS filesystem driver from Paulo Alcantara, * 'xfs-for-hpa' of git://zytor.com/users/pcacjr/syslinux: (60 commits) xfs: Fix the way we check di_mode of an inode xfs: Cleanup previous commit xfs: Add xfs_readlink() xfs: Cleanup and remove some trailing whitespaces xfs: Add XFS_DINODE_FMT_BTREE support in xfs_next_extent() xfs: Cleanup and remove some trailing whitespaces xfs: Rework xfs_dir2_get_right_blk() xfs: cleanup unused structure xfs: Remove some trailing whitespaces xfs: Add full B+tree search support in xfs_dir2_node_find_entry() xfs: Add xfs_fmt_btree_find_entry() xfs: Fix memory leak in xfs_dir2_node_find_entry() function xfs: Cleanup xfs_readdir_dir2_leaf() function xfs: Implement xfs_readdir_dir2_node() function EXTLINUX: Add sanity check for XFS filesystems xfs: Add xfs_fmt_local_readdir() function xfs: Add xfs_fmt_local_find_entry() function xfs: Move readdir functions to another source file xfs: Remove trailing whitespace in xfs_dir2_isleaf() function xfs: Move dir2 functions to another source file ... Conflicts: extlinux/main.c
2012-11-27ldlinux: Reset the console whenever we execute a moduleMatt Fleming3-1/+17
Each module expects the console to start in text mode and will make explicit calls to openconsole() when another console is required, e.g. in vesamenu.c32. This mimics the behaviour found in 4.0x. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-11-27Revert "menu: Make "menu clear" the default"Matt Fleming2-10/+4
This reverts commit 6ab02b6682c0b693b3e4f9afcc2ab8775f804f0a. People are reporting that the above commit causes a regression in behaviour between 4.0x and 5.0x. It also makes the MENU CLEAR directive obsolete and requires that users change their existing config files to restore the old behaviour. The commit was intended to solve the same bug that commit 87320b8de8f3 ("ldlinux: Disable VGA graphics when loading a kernel") addresses but without breaking vesacon, see, commit e04ee714164d ('Revert "ldlinux: Disable VGA graphics when loading a kernel"') for more details. Reported-by: Ady <ady-sf@hotmail.com> Cc: H. Peter Anvin <hpa@zytor.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-11-27gpllib: Distribute libcom32gpl.c32 in releasesMatt Fleming2-2/+2
This is a partial revert of commit b26d1c8642a8 ("Clean up $(GPLLIB) leak"). While we do need to use $(C_LIBS) and respect $(NOGPL), we should also be distributing libcom32gpl.c32. Now that we have ELF modules, such as hdt.c32, that need to have some of their symbols dynamically resolved at runtime we need to distribute libcom32gpl.c32. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-11-27module: Correct the size of the module symbol tableMatt Fleming1-7/+21
We were incorrectly grovelling around in the GNU hash table for the size of the symbol table. Instead we need to map the section headers and search for the SHT_DYNSYM entry. This bug caused hdt.c32 to refuse to load as some symbols were never resolved because not all of the SHT_UNDEF symbols in hdt.c32 were processed. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-11-27cmenu: Delete __intcall()sMatt Fleming1-45/+7
We can dynamically resolve our symbols and so we don't need to jump through __intcall(), which is deprecated anyway in favour of dynamic resolution. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-11-27Makefile: Add libmenu.c32 to list of modulesMatt Fleming1-1/+1
We need to install libmenu.c32 as it is required by modules like hdt.c32. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-11-26isolinux: Make BIOSName globalMatt Fleming1-0/+1
commit 967ee8a1ed49 ("CLI: Add Ctrl + V support for printing the Syslinux version") should have made the BIOSName symbol global in core/isolinux.asm. Without this change ldlinux.c32 will hang because it cannot resolve the 'BIOSName' symbol. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-11-26ldlinux: Fix OnError behaviourMatt Fleming1-2/+8
If the ONERROR directive references a label we need to lookup the label's command line and type. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-11-26ldlinux: Automatically apply ".c32" extension for COM32 filesMatt Fleming3-2/+13
If a type-specifier is used on the command line, e.g. .com32 pwd we should apply the ".c32" filename extension automatically as this works elsewhere and this behaviour was present in 4.0x. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-11-26runimage.c: Actually pass arguments to execute()Matt Fleming1-15/+11
Fix the breakage from commit 8486142cf304 ("elflink: Replace __intcall() with direct function calls"), where we stopped passing 'cmdline' to execute(). This bug resulted in things like config.c32 not respecting the <directory> argument. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-11-26ldlinux: Don't return NULL on KEY_ESC.Matt Fleming1-6/+0
The old command line code in 4.06 ignores KEY_ESC and KEY_CTRL('C') so we should do the same. What currently happens if a user hits ESC is that we return from edit_cmdline() as though we'd timed out waiting for user input. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-11-26ldlinux: Never exit from ldlinux.c32Matt Fleming3-24/+30
If there's no DEFAULT directive in the config file and the user hits the ENTER key enough times, or we timeout waiting for input, ldlinux.c32 will exit. This should never be allowed to happen, and we need to keep doing the ldlinux_auto_boot()/boot prompt dance. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-11-15chainboot: Delete extraneous free() in chainboot_file()Matt Fleming1-3/+1
We don't need to call free(buf) if we're jumping to the 'bail' label because 'buf' is always free'd there. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-11-15vesa: Fix double close() bug in vesacon_load_background()Matt Fleming1-1/+0
We always call fclose() on 'fp' if fopen() was successful, so delete the extraneous fclose() call in read_jpeg_file(). Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-11-15asprintf: Ensure we always call va_end(ap)Matt Fleming1-2/+3
There's currently the potential for us to exit early from asprintf() without calling va_end(ap). Rearrange things so that we always make the call. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-11-15bufprintf: Add va_end() for our va_copy()Matt Fleming1-2/+6
According to the stdarg(3) man page each invocation of va_copy() should be paired with an invocation of va_end(). Cc: Erwan Velu <erwanaliasr1@gmail.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-11-13ldlinux: Delete dead code and useless printfsyslinux-5.00-pre10Matt Fleming1-28/+0
Seeing the cmdline re-printed every time the user presses enter is very annoying, so delete the offending printf(). Also delete some code that has been commented out for ages. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-11-13ldlinux: Delete inaccurate 'insufficient memory' messageMatt Fleming1-3/+4
Instead, use strerror() to print a more useful message if we fail to load a kernel. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-11-12mk: Add Makefile variable for pythonMatt Fleming2-1/+2
Instead of hard-coding the python executable name use a make variable like we do for all other executables used during the build. This has the added bonus of allowing $(PYTHON) to be overridden on the command line, e.g. make PYTHON=python2 which is particularly useful for distributions where /usr/bin/python is actually python3. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-11-12menu: Inherit parent menu titleMatt Fleming1-0/+3
The documentation for the menu system clearly states that all properties of the parent are inherited in the submenu. Unfortunately there's a bug that means this isn't true for the parent's menu title, so fix that. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-11-07Merge branch 'strerror-for-mfleming' of git://github.com/geneC/syslinux into ↵Matt Fleming4-12/+122
elflink Pull klibc strerror() patches from Gene Cumm, Update strerror() to give english messages * 'strerror-for-mfleming' of git://github.com/geneC/syslinux: com32 strerror(): Remove macro WITH_ERRLIST use com32 strerror: add errlist.o to Make strerror: Use klibc version
2012-11-06com32 strerror(): Remove macro WITH_ERRLIST useGene Cumm1-2/+0
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2012-11-06com32 strerror: add errlist.o to MakeGene Cumm2-2/+6
Exclude in .gitignore Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2012-11-06strerror: Use klibc versionGene Cumm2-10/+118
Remove old in favor of current klibc version Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2012-11-06Merge branch 'hexdump' of git://git.zytor.com/users/sha0/syslinux into elflinkMatt Fleming2-1/+247
Pull new hexdump.c32 module from Shao Miller, * 'hexdump' of git://git.zytor.com/users/sha0/syslinux: hexdump.c32: Simple file hex-dumper
2012-11-05Merge branch 'multi_initrd2-5.00-pre9' of ↵Matt Fleming2-43/+172
git://git.zytor.com/users/sha0/syslinux into elflink Pull multi-initrd patches from Shao Miller, These patches provide two new options for the linux.c32 module. The "initrd+=" option allows you to append initramfs-style blobs (files which can be produced with 'cpio -o -H newc') to whatever "initrd" was specified via the "initrd=" option (or was specified indirectly via the INITRD directive). The "initrdfile=" option allows you to load a file and encapsulate it as though you had used 'cpio -o -H newc', and pass the resulting blob alongside the other items that might have been specified with "initrd=" or "initrd+=". * 'multi_initrd2-5.00-pre9' of git://git.zytor.com/users/sha0/syslinux: initramfs chain handling: Accounting fixes for padding, etc. linux.c32: Introduce initrdfile= option linux.c32: Add new initrd+= option for multiple initrds linux.c32: Move some initrd=x,y,z code out of main linux.c32: Add find_arguments function
2012-11-05core: Fix realloc() code transcription errorShao Miller1-2/+2
Commit 79459f631546eea83d4158f535c20ebd4ac18987 copied portions of com32/lib/realloc.c into core/mem/malloc.c, with minor changes for accessing allocation arena header attributes. The previous code used structure members and the current code uses bitmask macros. On a particular line in the original realloc(), there were two assignments in a single expression that included a compound assignment. This fact was missed when the code was copied and modified to use the bitmask macros. Signed-off-by: Shao Miller <sha0.miller@gmail.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-11-05extlinux: Avoid dereferencing a garbage pointerMatt Fleming1-3/+1
If opt.reset_adv is set the call to ext_read_adv() is skipped which would have initialised 'filename'. This means that a pointer containing random data from the stack is passed to ext_write_adv(). Just delete the opt.reset_adv logic since modify_adv() handles that case anyway. Reported-by: Frediano Ziglio <frediano.ziglio@citrix.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-11-04hexdump.c32: Simple file hex-dumperShao Miller2-1/+247
Usage: %s [<option> [...]] <filename> [<option> [...]] Options: -p --page . . . . . . . Pause output every 24 lines --no-buffer . . . . Load the entire file before dumping --extended-ascii . . Use extended ASCII chars in dump -? -h --help . . . . . . Display this help Signed-off-by: Shao Miller <sha0.miller@gmail.com>
2012-11-03initramfs chain handling: Accounting fixes for padding, etc.Shao Miller1-6/+9
Signed-off-by: Shao Miller <sha0.miller@gmail.com>
2012-11-03linux.c32: Introduce initrdfile= optionShao Miller1-0/+53
It is useful to be able to load a file and pass it into a kernel's rootfs via the initramfs scheme. Given "initrdfile=foo", we will load the file foo, encapsulate it with the initramfs cpio format, then pass it alongside any initramfs files that were specified by "initrd=" and "initrd+=" options. One can specify the desired path/filename for the file to have within the rootfs by using the at (@) sign, as in: initrdfile=foo@/goes/to/foo One can also specify multiple files, separated by commas, such as: initrdfile=foo,bar@/somewhere/bar,baz One can also use this option multiple times, as in: initrdfile=foo,bar initrdfile=baz@/somewhere/baz Signed-off-by: Shao Miller <sha0.miller@gmail.com>
2012-11-03linux.c32: Add new initrd+= option for multiple initrdsShao Miller1-0/+8
linux.c32 now processes the kernel's command-line for "initrd+=" options. Given "initrd+=foo", linux.c32 will concatenate the file "foo" to the initrds that it has already loaded due to the "initrd=" option. Given "initrd+=foo,bar", linux.c32 will concatenate both files "foo" and "bar" to the initrds that it has already loaded due to the "initrd=" option. That is, multiple filenames can be specified with comma separators. Given "initrd+=foo initrd+=bar", linux.c32 will concatenate both files "foo" and "bar" to the initrds that it has already loaded due to the "initrd=" option. That is, the "initrd+=" option can be specified multiple times. The position of any "initrd=" option relative to any "initrd+=" option is irrelevant. The "initrd=" option is always processed before all "initrd+=" options. PLEASE NOTE: It is important to note that there are NO SPACES involved in using the "initrd+=" option. "initrd += foo" will not work. Signed-off-by: Shao Miller <sha0.miller@gmail.com>
2012-11-03linux.c32: Move some initrd=x,y,z code out of mainShao Miller1-21/+61
In handling an "initrd=x,y,z" option, it seems reasonable to be able to handle similar options in a similar fashion, so some of the code has been moved out of 'main' and into a new 'process_initramfs_args' function. Signed-off-by: Shao Miller <sha0.miller@gmail.com>
2012-11-03linux.c32: Add find_arguments functionMatt Fleming1-16/+41
The 'find_argument' function already finds the last instance of a command-line option. For symmetry, we introduce a 'find_arguments' function which will help to iterate each instance of a command-line option. Also, this commit uses 'strncmp' in both, instead of 'memcmp'. Modified-by: Shao Miller <sha0.miller@gmail.com> Signed-off-by: Shao Miller <sha0.miller@gmail.com>
2012-11-02CLI: Add Ctrl + V support for printing the Syslinux versionMatt Fleming4-1/+14
The cli code is missing support for printing the version string that is available in Syslinux 4.06 and earlier. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-11-02win: Print error message if we fail to install to --directoryMatt Fleming1-2/+6
Instead of silently returning with no indication of error if we couldn't install to the --directory argument, print an error message that tells the user the files are not where they wanted. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-11-02win: Fix installing to a directoryMatt Fleming1-2/+2
commit bda54cb68067 ("installers: Install ldlinux.c32 automatically)" introduced a bug in the move_file() function. move_file() isn't deleting the destination path, including the --directory argument, that ldlinux.sys should be installed to ('new_name'), which means that the MoveFile() calls fails. What it's actually doing is deleting ldlinux.sys from the file destination system. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-11-02CLI: Fix command history traversalMatt Fleming1-4/+18
The up/down keys were broken with respect to traversing through the command history because it was dereferencing a NULL pointer on the first iteration. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-11-02com32: Include .init_array section in .ctors in linker scriptMatt Fleming3-27/+4
GCC 4.7 now places pointers to functions with the 'constructor' and 'destructor' function attributes in .init_array and .fini_array sections, respectively, whereas previously they were in the .ctors and .dtors sections. This change breaks the ctors/dtors code as it only expects function to be in the .ctors and .dtors sections, meaning the ctors and dtors functions are never executed. While a COM32_INIT() macro exists that places functions in the .init_array section, no function makes use of it, so there should be no fallout from this change. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-11-02ldlinux: get_key() requires raw access to user inputMatt Fleming3-2/+41
commit 4503e6260c0 ("ldlinux: Use stdcon instead of rawcon for the console") broke get_key() because it was no longer possible to read raw data from stdin. Provide a new function raw_read() that will return user input a character at a time. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-11-02ldlinux: Fix logic if no DEFAULT or UI directive is foundMatt Fleming3-30/+30
Somewhere along the way the code that prints, No DEFAULT or UI configuration directive found! was broken, and now no longer prints at all. While we're fixing this it's a good opportunity to rework the logic to be clearer. Now we only print the message if a config file was found, since these directives are obviously missing if there is no config file (a warning will be printed about the lack of config file anyway). Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-11-01ldlinux: Print a warning if no config file is foundMatt Fleming1-1/+4
This behaviour is taken from 4.06, where an error message is printed if no config file is found. A warning is a more user-friendly choice since Syslinux will still function without a config file. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-11-01pxe: Don't call open_config() from the pxe coreMatt Fleming1-12/+1
Delete some stale comments about ldlinux.c32 requiring ConfigName to be initialised before it's launched - this is no longer true. ldlinux.c32 takes care of opening the config files. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-10-31doc: Document the 'PATH' directivesyslinux-5.00-pre9Matt Fleming1-0/+7
The 'PATH' directive allows the user to specify a list of directories to search when loading modules. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-10-31NEWS: Document the major changes in 5.00Matt Fleming1-0/+24
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-10-24Merge branch 'master' into elflinkMatt Fleming38-406/+1455
The following conflict is a result of the fact comapi_chainboot was only stubbed out on the 'elflink' branch but was properly marked as obsolete in 'master'. Conflicts: core/comboot.inc
2012-10-23diag/mbr: Fix typo in READMEMatt Fleming1-1/+1
Reported-by: Ady <ady-sf@hotmail.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-10-23Merge branch 'elflink' of git://github.com/aericson/syslinux into elflinkMatt Fleming3-50/+15
Conflicts: com32/modules/Makefile
2012-10-23memdisk: Fix order of sectors/track and bytes/sectorsyslinux-4.06Kenneth J. Davis1-2/+2
Swap order of sectors/track with bytes/sector to match diskette parameter table order (as pointed to by INT 1Eh). References: (additional ones available if necessary) 'System BIOS for IBM PC/XT/AT computers and compatibles' by Phoenix Technologies Ltd. copyright 1987,88,89 3rd printing 1990 ISBN: 0-201-51806-6 pages 61-62 'PC Interrupts' 2nd edition by Ralf Brown & Jim Kyle copyright 1994 1st printing 1993 ISBN: 0-201-62485-0 page 211 Note: this fixes an issue with older FreeDOS kernels that expect this structure to contain valid values. Signed-off-by: Kenneth J. Davis <jeremyd@fdos.org> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-10-23NEWS: Document the VFAT relative path fixMatt Fleming1-0/+2
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-10-23README: Clarify the requirements for utils/isohybridMatt Fleming1-3/+3
Be clear that utils/isohybrid requires the UUID library as well as /usr/include/uuid/uuid.h. Reported-by: H. Peter Anvin <hpa@zytor.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-10-23NEWS: Fix some typosMatt Fleming1-4/+4
Reported-by: Ady <ady-sf@hotmail.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-10-23doc: minor documentation updatesVanush "Misha" Paturyan2-2/+2
syslinux.txt: syslinux binary is in "linux" directory menu.txt: menu.c32 and vesamenu.c32 are in com32/menu directory
2012-10-22Revert "win: Add -mno-ms-bitfields"H. Peter Anvin2-6/+5
This reverts commit 7d9ee65cc9577eb69782a49a34895ae80820e9ff. I am concerned that this may cause the Windows ABI header files to be misinterpreted. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2012-10-22Packed definition: workaround for mingw + gcc 4.7H. Peter Anvin1-6/+17
__attribute__((packed)) does the wrong thing when in ms-struct mode; this breaks compiling on mingw-w64. Therefore force gcc struct mode when we use packed. This obsoletes checkin 7d9ee65 win: Add -mno-ms-bitfields Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2012-10-19ldlinux: Use stdcon instead of rawcon for the consoleMatt Fleming1-1/+1
Switch to the stdcon input device so things like fgets() work correctly when reading from stdin. I noticed this was broken when running dmitest.c32. fgets() was returning NULL because there was no pending user input instead of waiting for/buffering the input. Modules are expecting stdin to be a line-oriented device, not a raw one where each module has to implement its own line support. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-10-19Clean up $(GPLLIB) leakMatt Fleming4-12/+9
Modules were linking against com32/gpllib/libcom32gpl.c32 even when NOGPL was set, so remove it from various modules Makefiles and use $(C_LIBS) in mk/elf.mk which already has the conditional-magic for $(GPLLIB). Also, the object files in com32/gpllib/ are not distributed in the release tarballs, which means that if a user does a 'make netinstall' they hit the following install error, install: cannot stat `com32/gpllib/*.c32': No such file or directory Add a $(INSTALLABLE_MODULES) variable to separate the list of build and install modules. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-10-19core: Print error message if we don't load ldlinux.c32Matt Fleming1-0/+2
If the user forgot to install ldlinux.c32 they're greeted with the following unhelpful message, Boot failed: press a key to retry, or wait for reset... We should explicitly tell the user that the reason for the boot failing is that ldlinux.c32 could not be loaded. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-10-15comboot: remove comapi_chainbootsyslinux-4.06-pre14Sebastian Herbszt2-37/+2
comapi_chainboot was obsoleted in 3.80. Signed-off-by: Sebastian Herbszt <herbszt@gmx.de> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-10-15comboot: fix documentationSebastian Herbszt1-51/+1
comapi_shuffle was obsoleted in 3.80. Signed-off-by: Sebastian Herbszt <herbszt@gmx.de> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-10-15README: document the need for /usr/include/uuid/uuid.hGeert Stappers1-0/+7
utils/isohybrid build depends on /usr/include/uuid/uuid.h The package name varies between distribution families.
2012-10-12menu: Disallow navigation to a disabled entry via *any* keyMatt Fleming1-2/+3
Generalise the fix from commit c823574f53c1 ("menu: Don't highlight disabled entries") as it only handled the case where we navigated to a disabled last entry by pressing Ctrl + N or the DOWN arrow key. Obviously, we can navigate with other keys such as END, PGDN, etc so we need to handle all cases. Reported-by: Ady <ady-sf@hotmail.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-10-11prdhcp.c32: Turn off DEBUGsyslinux-4.06-pre13Matt Fleming1-1/+1
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-10-11Merge branch 'pxechn-fix-news-for-hpa-2' of git://github.com/geneC/syslinuxMatt Fleming5-38/+287
Conflicts: NEWS com32/modules/Makefile
2012-10-11win: Add -mno-ms-bitfieldsShao Miller2-5/+6
Recent MinGW GCCs now have -mms-bitfields on by default, but it appears to break our intentions with __attribute__((packed)). See GCC bug 52991, http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52991 The undesired behaviour was noticed when the win32 installer had troubles identifying the media type field of a boot sector. Signed-off-by: Shao Miller <sha0.miller@gmail.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-10-10isohybrid: fix isohybrid.c compileFrediano Ziglio1-5/+5
Make isohybrid.c compile on gcc 4.4 32 bit instead of producing the following error, isohybrid.c: In function ‘lendian_64’: isohybrid.c:437: error: integer constant is too large for ‘long’ type Cc: Matthew Garrett <mjg@redhat.com> Cc: Michal Soltys <soltys@ziu.info> Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-10-10ext2: add additional check to ext2 loaderFrediano Ziglio1-0/+3
Check if a pointer is NULL due to specifying an invalid inode group number. Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-10-09mboot: fix typo in commentFrediano Ziglio1-1/+1
Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-10-09make some functions static remove unused NADV defineFrediano Ziglio2-6/+4
Just some minor cleanup Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-10-09menu: Add MENU GOTO support to the MENU DEFAULT parsing codeMatt Fleming1-1/+3
Tomas reported that the 'test1' submenu in the following config file snippet doesn't honour the MENU DEFAULT directive, MENU BEGIN test0 MENU START LABEL - MENU DEFAULT MENU LABEL OptionA MENU GOTO test1 MENU END MENU BEGIN test1 LABEL - MENU LABEL OptionA1 MENU GOTO test0 LABEL - MENU DEFAULT MENU LABEL OptionB1 MENU GOTO test0 MENU END The reason is that the menu config code doesn't know how to handle a default item that is a MENU GOTO directive. A trivial addition to the code in record() fixes this. Reported-by: Tomas M <tomas@slax.org> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-10-09menu: Don't highlight disabled entriesMatt Fleming1-2/+1
There's an off-by-one bug in the menu input handling code which makes it possible to highlight/select the last entry in a menu even if that entry is disabled. It should be noted that you can't actually *do* anything with the disabled entry, i.e. edit or execute it. Still, allowing it to be highlighted does look a little strange. Reported-by: Matt Sephton <matt.sephton@gmail.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-10-08com32: Add ifmemdsk.c32 to MakefileMatt Fleming1-1/+1
... so that it actually gets built. This should have been added to the Makefile when ifmemdsk.c was created. Reported-by: Ady <ady-sf@hotmail.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-10-05NEWS: Document changes between 4.05 and 4.06syslinux-4.06-pre12Matt Fleming1-0/+8
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-09-22In the current Lua.c32 DMI implementation, it is a flat table with dotted ↵Hung-chi Lihn2-208/+420
names in table entries. It also misses a number DMI sub-tables. This patch, cleans up the DMI table structure using Lua's nested table structure and adds all missing DMI sub-tables. If a DMI sub-table is not supported by the hardware (not filled), then the corresponding sub-table will not be generated. This helps to make the table structure cleaner and reflects the actual DMI information. Signed-off-by: Hung-chi Lihn <hlihn@google.com> Signed-off-by: Erwan Velu <erwanaliasr1@gmail.com>
2012-09-22Bug fix: Added the missing entry (boot_from_pcmcia) in struct s_characteristics.Hung-chi Lihn1-1/+2
In bios_charac_strings[] of /com32/gpllib/dmi/dmi_bios.c there are actually 29 entries. However, BIOS_CHAR_NB_ELEMENTS in /com32/gplinclude/dmi/dmi_bios.h was defined as 28 and struct s_characteristics in the same file also only had 28 entries. It turns out that there was a missing entry "boot_from_pcmcia" (the 16th entry representing bit 18) in s_characteristics. Signed-off-by: Hung-chi Lihn <hlihn@google.com> Signed-off-by: Erwan Velu <erwanaliasr1@gmail.com>
2012-09-22Added the native syslinux functions config_file(), ipappend_strs(), and ↵Hung-chi Lihn1-0/+33
reboot() to Lua.c32. This allows the Lua script to query the config file name and the ipappend strings (pxelinux only), as well as to perform reboot (warm and cold) to the system. In Lua.c32, the extension will be used as the following: 1. syslinux.config_file() will return the config file string. 2. syslinux.ipappend_strs() will return a table of IPAPPEND strings with numerical indices. 3. syslinux.reboot() will perform cold reboot, while syslinux.reboot(1) will perform warm reboot. Signed-off-by: Hung-chi Lihn <hlihn@google.com> Signed-off-by: Erwan Velu <erwanaliasr1@gmail.com>
2012-09-22The current Lua.c32 does not enable io.read() due to some missing library ↵Hung-chi Lihn1-11/+29
functions. However, this strongly limits the Lua script from getting user inputs and reading files (even in pxelinux via TFTP). This patch enables io.read() in Lua.c32 with some restrictions: 1. the io.read("*line") is fully supported. 2. the io.read("*number") is not supported due to the missing buffering in underlying file I/Os. However, the user can read a line using io.read() and convert the string to numbers using the built in pattern matching and number conversion features. 3. io.read(bytes) is supported. However, io.read(0) will not be a valid test for EOF due to the missing I/O buffering. io.read() will return nil if EOF is encountered. This offers an alternative way to handle EOF. Signed-off-by: Hung-chi Lihn <hlihn@google.com> Signed-off-by: Erwan Velu <erwanaliasr1@gmail.com>
2012-09-19installers: Install ldlinux.c32 automaticallysyslinux-5.00-pre8Matt Fleming14-152/+346
Because ldlinux.c32 is required for Syslinux to function correctly, we should be installing it automatically much like ldlinux.sys. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-09-16doc/pxechn.txt: updateGene Cumm1-5/+5
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2012-09-14extlinux: Handle error case for find_mount()Matt Fleming1-0/+2
find_mount() may return NULL, so we'd really better check for that *before* dereferencing the pointer. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-09-10NEWS: Adding 'silent' option from HDTErwan Velu1-1/+1
2012-09-10hdt: Release 0.5.2hdt/0.5.2Erwan Velu1-1/+1
New release with codename Manon
2012-09-10hdt: Adding Silent modeErwan Velu3-9/+19
By using the "silent" option at the cmdline, HDT tries not displaying any boring message. This is particulary interesting with the "display" option.
2012-09-10hdt: Removing remaining printf()Erwan Velu5-22/+22
Using more_printf allow to manage more easily several pages printing.
2012-09-10NEWS: Updating for HDT & kontron_wdtErwan Velu1-0/+6
2012-09-10kontron_wdt: Fixing makefileErwan Velu1-1/+1
Typo.
2012-09-10kontron_wdt: Enforce timeout value if already setErwan Velu1-0/+4
If the watchdog was already engaged, let's rewrite the timeout to insure the proper value is set.
2012-09-10kontron_wdt: Adjusting exit pathErwan Velu1-7/+10
If we fail, at least let's boot the expected image
2012-09-10kontron_wdt: Adding watchdog com32 moduleErwan Velu3-1/+525
When using a Kontron ETX board, it's possible to initialize and start the watchdog during syslinux booting. This allow protecting a boot sequence with a defined timeout. Bootloader is starting, engage the watchdog and then start a default entry (typically a Linux image). If the loaded OS, feed or reinitalize the watchdog, nothing occurs unless the system will reboot Conflicts: com32/modules/Makefile
2012-09-06doc/pxechn.txt: Fix old exampleGene Cumm1-4/+1
Command line options changed. Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2012-09-05Merge remote-tracking branch 'hpa/master'Erwan Velu23-126/+839
2012-09-05module: Fixed the upper limit in symbol table walk throughChandramouli Narayanan1-3/+3
Number of entries in symbol table should be sized by the table entry size. Without this, the loading of modules takes forever due to walking all over the memory. Signed-off-by: Chandramouli Narayanan <chandramouli.narayanan@intel.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-09-04console: Close stdin, stdout, stderr on ldlinux.c32 unloadMatt Fleming5-10/+13
The location of __file_info[] and ansicon_counter are split between the core and ldlinux.c32. We can end up calling __ansicon_close (from fp->oop->close) in the process of reloading ldlinux.c32, and while ansicon_counter is set to its initialised data value of 0 when reloading ldlinux.c32, the core is never reloaded, and so __file_info[] retains its pointers. What this amounts to is that when ldlinux.c32 tries to call openconsole() after being reloaded, the core tries to close the ansicon device (the core still has pointers to __ansicon_close) despite the ansicon code having no knowledge of ever being opened (because ansicon_counter was reinitialised). The most logical way to deal with this is to close stdin, stdout and stderr when unloading ldlinux.c32. It also turns out that sys/openconsole.o was present in two Makefile variables which lead to duplication of code, data, etc. We only need it present in libcom32min.a and not in the core since the core never handles opening consoles, at least not now that we've deleted printf_init() which is safe because we always open a console in ldlinux.c32 anyway. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-09-03doc/pxechn.txt: word wrapGene Cumm1-17/+49
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2012-09-03doc/pxechn.txt: Updates for clarity/flowGene Cumm1-27/+33
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2012-09-03doc/pxechn.txt: Change title for manpage use.Gene Cumm1-1/+1
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2012-09-02xfs: Fix the way we check di_mode of an inodePaulo Alcantara2-13/+13
The previous way to judge the di_mode of an inode could not distinguish S_IFREG and S_IFLNK. Fix it to a better judgement. Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
2012-09-02xfs: Cleanup previous commitPaulo Alcantara2-21/+19
Please Baozi, fix your editor! You keep putting f*cking trailing whitespaces in almost all patches yours. This patch cleanups, fixes some typo, fixes indentation and removes some trailing whitespaces from previous commit. Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
2012-09-02xfs: Add xfs_readlink()Chen Baozi4-0/+63
XFS's symbolic links to a file can be stored in one of two formats: "local" and "extents". The length of the symlink contents is always specified by the inode's di_size value. A symlink cannot be longer than 1024 characters. Signed-off-by: Chen Baozi <baozich@gmail.com> Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
2012-09-02xfs: Cleanup and remove some trailing whitespacesPaulo Alcantara2-8/+9
This patch cleanups and removes some trailing whitespaces introduced in the previous commit. Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
2012-09-02xfs: Add XFS_DINODE_FMT_BTREE support in xfs_next_extent()Chen Baozi3-20/+69
XFS's extent B+Tree is organized in the key of offset. So we cannot traverse the tree to look up the given extent number. Luckily, the tree has been already threaded. So what we have to do is just to find the first extent’s leaf, then traverse in a "linked list". Signed-off-by: Chen Baozi <baozich@gmail.com> Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
2012-09-02xfs: Cleanup and remove some trailing whitespacesPaulo Alcantara1-4/+8
This patch cleanups and removes some trailing whitespaces introduced in the previous commit. Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
2012-09-02xfs: Rework xfs_dir2_get_right_blk()Chen Baozi4-29/+237
In B+tree directory, besides the node/leaf blocks, all the extents which store xfs_bmbt_rec_t entries are also organized in B+tree. We need to rework xfs_dir2_get_right_blk() to make it workable in all cases. Signed-off-by: Chen Baozi <baozich@gmail.com> Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
2012-09-02xfs: cleanup unused structureChen Baozi1-14/+0
These two structures are not used anywhere right now. Signed-off-by: Chen Baozi <baozich@gmail.com> Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
2012-09-02xfs: Remove some trailing whitespacesPaulo Alcantara1-2/+5
This patch removes some trailing whitespaces from previous commit. Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
2012-09-02xfs: Add full B+tree search support in xfs_dir2_node_find_entry()Chen Baozi1-54/+54
According to the manual, the difference between B+tree directory and node directory is that the node/leaf trees can be more than one level deep in the B+tree format. That is to say we do not need to reimplemented a completely new function in B+tree case. What we've done here is to modify xfs_dir2_node_find_entry() to support searching in a B+tree more than one level. Signed-off-by: Chen Baozi <baozich@gmail.com> Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
2012-09-02xfs: Add xfs_fmt_btree_find_entry()Chen Baozi1-0/+9
Add the basic framework to handle B+Tree directory. Signed-off-by: Chen Baozi <baozich@gmail.com> Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
2012-08-07ldlinux: Use findpath() to lookup filenamessyslinux-5.00-pre7Matt Fleming3-5/+8
We should use the same method of opening files as the module code when searching for extensions. In particular, we should search all of PATH. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-08-02rawcon_read: Fix reading high part of input keysMatt Fleming1-4/+9
commit 8486142cf304 ("elflink: Replace __intcall() with direct function calls") made the mistake of zero'ing the high part of the input key on every invocation of __rawcon_read() instead of preserving it across calls like the old code, which lead to function keys such as KEY_UP, KEY_DOWN, etc not working. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-08-02ldlinux: Return to command prompt after loading COM32Matt Fleming6-45/+79
The old COM32 loading code would drop the user at a command prompt once execution returned from the COM32 amodule. We need to replicate this because most callers of execute() don't expect it to return. This bug was noticed when loading a COM32 module from vesamenu.c32. Once execution returned from the COM32 module the display became garbled because no code exists to reinitialise the screen for VGA. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2012-07-29xfs: Fix memory leak in xfs_dir2_node_find_entry() functionPaulo Alcantara2-3/+3
If xfs_dir2_node_find_entry() wasn't able to find a data block, the leaf pointer were not being freed through the label "out", so we must use the label "out1" instead. Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
2012-07-29xfs: Cleanup xfs_readdir_dir2_leaf() functionPaulo Alcantara1-21/+15
Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
2012-07-29xfs: Implement xfs_readdir_dir2_node() functionPaulo Alcantara5-12/+139
Now, xfs_readdir filesystem op will be able to list directory entries from node directories. Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
2012-07-29EXTLINUX: Add sanity check for XFS filesystemsPaulo Alcantara2-3/+67
Syslinux won't work on >4 KiB filesystem block sizes since there is no left space in MBR to determine where to install Syslinux bootsector. If one is trying to install Syslinux in a XFS partition with a filesystem block size different of 4 KiB, a proper error will be returned to the user informing that the current filesystem block size isn't supported by Syslinux. Reported-by: Gene Cumm <gene.cumm@gmail.com> Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
2012-07-28xfs: Add xfs_fmt_local_readdir() functionPaulo Alcantara1-3/+10
Do not call xfs_fmt_local_readdir() directly. As there is a xfs_fmt_extents_readdir() function which lists directory entries in inodes (with format "extents") in a generic way, we can have a xfs_fmt_local_readdir() function which lists directory entries in inodes (with format "local") in a generic way too. Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
2012-07-28xfs: Add xfs_fmt_local_find_entry() functionPaulo Alcantara1-6/+11
Do not call xfs_dir2_local_find_entry() directly. As there is a xfs_fmt_extents_find_entry() which lookups entries in inodes (with format "extents") in a generic way, we can have a xfs_fmt_local_find_entry() function which lookups entries in inodes (with format "local") in a generic way too. Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
2012-07-28xfs: Move readdir functions to another source filePaulo Alcantara3-265/+326
All readdir functions get bigger in size when lookup functions are added to xfs_dir2.c accordingly, so we need to move them out to another source file. Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
2012-07-28xfs: Remove trailing whitespace in xfs_dir2_isleaf() functionPaulo Alcantara1-1/+1
Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
2012-07-28xfs: Move dir2 functions to another source filePaulo Alcantara6-719/+843
Since xfs.c source file has growed up in size significatively, it would be better to move the dir2 functions (which are big ones) out to another source file. Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
2012-07-28xfs: Fix memory leaks in xfs_dir2_node_find_entry() functionPaulo Alcantara1-15/+24
This function has been leaking memory when it found or not an entry, since the leaf pointer were not being freed on either sucesss or fail. Also, after doing a binary search to find the hash we're interested in, and if it wasn't found, then the entry we want is not in that current directory, so we do not need to print out an error message in this case. Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
2012-07-26xfs: rework xfs_dir2_node_find_entry()Chen Baozi2-168/+157
- Considering that the node block stores info in Btree, there is no need for us to look into each entry's leaf one by one to get the result. Just to pick one containing the hashval and look into its leaf block. - The previous version only looks into the leaf's dir block which "entry->before" points to. But there would be more than one dir block within each leaf. That is to say we cannot find the target leaf if it doesn't locate in the first dir block the "entry->before" points. That's why the previous version failed in my test. - Also, we cannot get all cases of the data rec by simply add "newdb" to the first entry of data rec. Because the data rec entry may also represent more than one dir block in some situations. Besides, just fix some typo in other functions. Signed-off-by: Chen Baozi <baozich@gmail.com> Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
2012-07-26xfs: get_dirblks() with count.Chen Baozi1-12/+14
Since there can be more than one block counts in some bmbt_rec_t, we would like to change get_dirblk's semantic that get one directory block each time to get a number of directory block. Signed-off-by: Chen Baozi <baozich@gmail.com> Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
2012-07-24xfs: Implement xfs_dir2_node_find_entry() functionPaulo Alcantara2-4/+252
Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
2012-07-23xfs: Use xfs_debug() for "Entry not found!" messagePaulo Alcantara1-2/+2
Printing "Entry not found!" as an error message does not make any sense, so use xfs_debug() for printing it out instead. Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
2012-07-23xfs: Use dprintf() for debug messages in xfs_debug()Paulo Alcantara1-1/+2
xfs_debug() has been using printf() for debug messages. So, let's use dprintf() function for now (which is the correct to do). Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
2012-07-23xfs: Use bmbt_irec_get() to get extent information insteadPaulo Alcantara1-24/+6
There is no need to parse the whole 128-byte data (extent descriptor) in xfs_next_extent(), since there is a function (bmbt_irec_get()) that already does this. Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
2012-07-23xfs: Implement xfs_dir2_leaf_readdir() functionPaulo Alcantara1-6/+86
Add support to xfs_readdir() being able to list directory entries from leaf directories. Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
2012-07-23xfs: Fix binary search in xfs_dir2_leaf_find_entry() functionPaulo Alcantara1-1/+1
The "high" variable wasn't being updated correctly, so the "high" and "low" variables were containing the same value in the search. Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
2012-07-22xfs: Make xfs_da_hashname() function staticPaulo Alcantara1-1/+1
Since it won't certainly be exported to anywhere, make it static around the driver code. Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
2012-07-22xfs: Fix bug in xfs_dir2_leaf_find_entry() functionPaulo Alcantara2-55/+59
This patch fixes this error: fs/xfs/xfs.c: In function ‘xfs_iget’: fs/xfs/xfs.c:685:8: error: ‘hash’ may be used uninitialized in this function [-Werror=maybe-uninitialized] fs/xfs/xfs.c:646:14: note: ‘hash’ was declared here fs/xfs/xfs.c:811:22: error: ‘mid’ may be used uninitialized in this function [-Werror=maybe-uninitialized] Since hash variable wasn't set to any value by default in xfs_dir2_leaf_find_entry() function and hashwant would return 0 in a default case, then the check "if (hash != hashwant)" never would become true. The same would occur with mid variable and an identical fix has been provided on this patch. Also, this patch cleanups the previous commit by removing trailing whitespaces and moves xfs_da_hashname() and fill_xfs_inode_pvt() functions to a more readable place. Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
2012-07-22xfs: Implement xfs_dir2_leaf_find_entry() logic.Chen Baozi2-15/+265
xfs_dir2_leaf_find_entry() will first do binary search with hashval of target name in the leaf block, and then calculate which directory block the entry locates. Besides, xfs_dir2_isleaf() has also been implemented to judge whether it is a leaf directory or not. Signed-off-by: Chen Baozi <baozich@gmail.com> Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
2012-07-21xfs: Remove unnecessary debug message in xfs_getfssec()Paulo Alcantara1-2/+0
Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
2012-07-21xfs: Add xfs_readdir() to filesystem opsPaulo Alcantara1-9/+226
Only shortform and block directory entries are possible to be listed through sucessive readdir() calls. We need to write code for node and leaf directories (xfs_dir2_leaf_readdir() and xfs_dir2_node_readdir() functions) once xfs_dir2_leaf_find_entry() and xfs_dir2_node_find_entry() are both implemented. A test case would be simply execute the COM32 module ls (ls.c32) for listing directory entries. Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
2012-07-21xfs: CleanupPaulo Alcantara2-35/+39
This patch basically cleanups the previous one. Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
2012-07-21xfs: Implement dir2_block_find_entry() function.Chen Baozi2-22/+336
dir2_block_find_entry() is used to handle the Block Directory, which is the sub-case of a XFS_DINODE_FMT_EXTENTS. Besides, we have established the frame work to handle all cases of XFS_DINODE_FMT_EXENTS. What to be worked next step is dir2_leaf_find_entry() and dir2_node_find_entry. To test this patch, I just touched 24 extra empty file named from 0 to 23 in the /boot directory, which number is more than what short format holds and less than the Leaf Directory holds. Signed-off-by: Chen Baozi <baozich@gmail.com> Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
2012-07-21xfs: Cleanup fill_xfs_inode_pvt() functionPaulo Alcantara1-4/+3
Functions that need fs_info structure always place its pointer as the first argument, so make it the fist argument on this function as well. Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
2012-07-21xfs: Only call fill_xfs_inode_pvt() if dinode was readPaulo Alcantara1-2/+4
It does not make any sense to fill in private inode information when the requested dinode has not been read successfully. Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
2012-07-21xfs: Make sure that the dinode is read with successPaulo Alcantara1-1/+5
xfs_next_extent() does not make sure that the dinode has been read successfully without checking return of xfs_get_ino_core() function. Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
2012-07-21xfs: CleanupPaulo Alcantara1-12/+13
The commit "xfs: rework the logic of xfs_get_ino_core()" has added some trailing whitespaces, acrossed 80 columns in a few lines and used a signed intenger to determine the block's offset of the inode, which is actually a 64-bit unsigned integer. Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
2012-07-21xfs: rework the logic of xfs_get_ino_core()Chen Baozi2-276/+42
(Just remove a few lines of debugging dirty marks. Sorry for the previous carelessness.) Since we can calculate the real blk address directly by a given ino, there is no need for implementing such complex logic which would look up an inode from agi_root. It seems that XFS put 64 inodes into one logic chunk for performance consideration. That is to say, if our purporse is just to implement a workable read-only xfs support, there is also no need to handle this case, which do reduce lots of complexity. Also, in order to handle the inode whose starting address is in the middle of one block, we need to hold the info of i_block_offset, which can be calculated by XFS_INO_TO_OFFSET. Signed-off-by: Chen Baozi <baozich@gmail.com> Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
2012-07-21xfs: Add xfs_getfssec() and xfs_next_extent() functionsPaulo Alcantara3-24/+120
This is a initial implementation of both and they're not fully functional yet. xfs_getfssec() still needs to be modified to handle XFS-specific things and xfs_next_extent() must handle inodes with different dinode formats other than _only_ handling dinode format "extents". Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
2012-07-21xfs: Fix minor typoPaulo Alcantara1-1/+1
Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
2012-07-21xfs: Make for-statement declaration more readablePaulo Alcantara1-1/+1
Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
2012-07-21xfs: Remove unnecessary check in xfs_iget() functionPaulo Alcantara1-11/+7
xfs_iget() function is _never_ called with parent inodes with mode set to DT_REG (regular file) and this check was used for other puporses while doing some test cases. Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>