H. Peter Anvin [Thu, 3 Jan 2013 17:29:51 +0000 (09:29 -0800)]
elflink: set the sonames of shared libraries
Set the sonames of shared libraries to the filename, so we don't end
up with full pathnames embedded in the files.
Matt Fleming [Thu, 6 Dec 2012 10:13:41 +0000 (10:13 +0000)]
Delete 16-bit COMBOOT support
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>
Matt Fleming [Tue, 4 Dec 2012 21:17:47 +0000 (21:17 +0000)]
Symbol export whitelist
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>
Matt Fleming [Wed, 5 Dec 2012 09:20:38 +0000 (09:20 +0000)]
core: Fix 'NoHalt'
Use the same variable in idle.c and ldlinux.c32.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Matt Fleming [Wed, 5 Dec 2012 13:28:38 +0000 (13:28 +0000)]
com32: Delete unused malloc.c and friends
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>
Matt Fleming [Tue, 4 Dec 2012 22:00:13 +0000 (22:00 +0000)]
Reduce the number of global variables
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>
Matt Fleming [Tue, 4 Dec 2012 21:51:46 +0000 (21:51 +0000)]
comboot: Mark API functions obsolete
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>
Matt Fleming [Tue, 4 Dec 2012 13:42:24 +0000 (13:42 +0000)]
doc: Further explanation for the PATH directive and lookup rules
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>
Matt Fleming [Tue, 4 Dec 2012 12:13:48 +0000 (12:13 +0000)]
Revert "menu: Inherit parent menu title"
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>
Matt Fleming [Tue, 4 Dec 2012 12:02:39 +0000 (12:02 +0000)]
ldlinux: Use get_msg_file() for F-keys
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>
Matt Fleming [Tue, 4 Dec 2012 11:56:04 +0000 (11:56 +0000)]
ldlinux: Remove default bold attribute typo
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>
Matt Fleming [Tue, 4 Dec 2012 11:50:19 +0000 (11:50 +0000)]
CLI: Don't always start the CLI at column 0
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>
Matt Fleming [Mon, 3 Dec 2012 13:30:36 +0000 (13:30 +0000)]
ldlinux: Move DISPLAY file handling out of the core
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>
Matt Fleming [Mon, 3 Dec 2012 13:27:11 +0000 (13:27 +0000)]
stdio: Fix unhexchar() for hex digits > 9
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>
Matt Fleming [Fri, 30 Nov 2012 13:40:32 +0000 (13:40 +0000)]
Merge branch 'searchdir_leak-5' of git://git.zytor.com/users/sha0/syslinux 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
Matt Fleming [Fri, 30 Nov 2012 09:50:53 +0000 (09:50 +0000)]
PATH: Use installation directory for 'PATH'
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>
Matt Fleming [Thu, 29 Nov 2012 22:52:42 +0000 (22:52 +0000)]
ldlinux: Don't try reloading ldlinux.c32 unless it's likely to succeed
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>
Matt Fleming [Thu, 29 Nov 2012 22:40:46 +0000 (22:40 +0000)]
module: Fix incorrect list_entry() use
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>
Shao Miller [Fri, 2 Nov 2012 15:59:10 +0000 (11:59 -0400)]
fs: Fix searchdir resource leak
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>
Matt Fleming [Thu, 29 Nov 2012 16:55:33 +0000 (16:55 +0000)]
CLI: Delete 'temp_cmdline' and put 'cmdline' on the stack
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>
Matt Fleming [Thu, 29 Nov 2012 11:35:28 +0000 (11:35 +0000)]
module: Stop silently failing to load dependency modules
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>
Matt Fleming [Thu, 29 Nov 2012 09:34:18 +0000 (09:34 +0000)]
ldlinux: Complain to user on failure to perform file operations
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>
Matt Fleming [Thu, 29 Nov 2012 09:06:41 +0000 (09:06 +0000)]
module: Append '/' to PATH strings if missing
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>
Matt Fleming [Thu, 29 Nov 2012 08:47:15 +0000 (08:47 +0000)]
ldlinux: Only append missing filename extensions
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>
Matt Fleming [Tue, 27 Nov 2012 21:13:45 +0000 (21:13 +0000)]
Merge branch 'coverity' into elflink
Matt Fleming [Tue, 27 Nov 2012 20:12:58 +0000 (20:12 +0000)]
core/elflink: Fix off-by-one error
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>
Matt Fleming [Tue, 27 Nov 2012 16:25:37 +0000 (16:25 +0000)]
module: Fix off-by-one error in findpath()
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>
Matt Fleming [Tue, 27 Nov 2012 16:19:17 +0000 (16:19 +0000)]
module: Fix memory leak in spawn_load()
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>
Matt Fleming [Tue, 27 Nov 2012 16:11:26 +0000 (16:11 +0000)]
pxe: Don't leak inode on timeout
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Matt Fleming [Tue, 27 Nov 2012 16:03:36 +0000 (16:03 +0000)]
screensize: Dereference pointers when checking cols/rows
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>
Matt Fleming [Fri, 16 Nov 2012 14:23:45 +0000 (14:23 +0000)]
hdt-cli: Correct malloc() size argument
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>
Matt Fleming [Tue, 27 Nov 2012 18:38:18 +0000 (18:38 +0000)]
Merge branch 'xfs-for-hpa' of git://zytor.com/users/pcacjr/syslinux into 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
Matt Fleming [Tue, 27 Nov 2012 15:01:12 +0000 (15:01 +0000)]
ldlinux: Reset the console whenever we execute a module
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>
Matt Fleming [Tue, 27 Nov 2012 13:31:26 +0000 (13:31 +0000)]
Revert "menu: Make "menu clear" the default"
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>
Matt Fleming [Mon, 26 Nov 2012 15:27:55 +0000 (15:27 +0000)]
gpllib: Distribute libcom32gpl.c32 in releases
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>
Matt Fleming [Tue, 27 Nov 2012 11:58:58 +0000 (11:58 +0000)]
module: Correct the size of the module symbol table
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>
Matt Fleming [Tue, 27 Nov 2012 11:57:59 +0000 (11:57 +0000)]
cmenu: Delete __intcall()s
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>
Matt Fleming [Tue, 27 Nov 2012 11:01:54 +0000 (11:01 +0000)]
Makefile: Add libmenu.c32 to list of modules
We need to install libmenu.c32 as it is required by modules like
hdt.c32.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Matt Fleming [Thu, 22 Nov 2012 14:31:06 +0000 (14:31 +0000)]
isolinux: Make BIOSName global
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>
Matt Fleming [Mon, 26 Nov 2012 13:13:07 +0000 (13:13 +0000)]
ldlinux: Fix OnError behaviour
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>
Matt Fleming [Mon, 26 Nov 2012 13:08:06 +0000 (13:08 +0000)]
ldlinux: Automatically apply ".c32" extension for COM32 files
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>
Matt Fleming [Wed, 21 Nov 2012 22:34:19 +0000 (22:34 +0000)]
runimage.c: Actually pass arguments to execute()
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>
Matt Fleming [Thu, 15 Nov 2012 19:46:54 +0000 (19:46 +0000)]
ldlinux: Don't return NULL on KEY_ESC.
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>
Matt Fleming [Wed, 21 Nov 2012 21:03:24 +0000 (21:03 +0000)]
ldlinux: Never exit from ldlinux.c32
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>
Matt Fleming [Thu, 15 Nov 2012 21:32:18 +0000 (21:32 +0000)]
chainboot: Delete extraneous free() in chainboot_file()
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>
Matt Fleming [Thu, 15 Nov 2012 21:27:59 +0000 (21:27 +0000)]
vesa: Fix double close() bug in vesacon_load_background()
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>
Matt Fleming [Thu, 15 Nov 2012 20:56:09 +0000 (20:56 +0000)]
asprintf: Ensure we always call va_end(ap)
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>
Matt Fleming [Thu, 15 Nov 2012 20:39:30 +0000 (20:39 +0000)]
bufprintf: Add va_end() for our va_copy()
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>
Matt Fleming [Tue, 13 Nov 2012 16:07:18 +0000 (16:07 +0000)]
ldlinux: Delete dead code and useless printf
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>
Matt Fleming [Tue, 13 Nov 2012 15:57:01 +0000 (15:57 +0000)]
ldlinux: Delete inaccurate 'insufficient memory' message
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>
Matt Fleming [Mon, 12 Nov 2012 15:38:33 +0000 (15:38 +0000)]
mk: Add Makefile variable for python
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>
Matt Fleming [Thu, 25 Oct 2012 10:35:14 +0000 (11:35 +0100)]
menu: Inherit parent menu title
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>
Matt Fleming [Wed, 7 Nov 2012 07:31:13 +0000 (07:31 +0000)]
Merge branch 'strerror-for-mfleming' of git://github.com/geneC/syslinux into 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
Gene Cumm [Sat, 16 Jun 2012 18:26:11 +0000 (14:26 -0400)]
com32 strerror(): Remove macro WITH_ERRLIST use
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
Gene Cumm [Wed, 7 Nov 2012 04:32:51 +0000 (23:32 -0500)]
com32 strerror: add errlist.o to Make
Exclude in .gitignore
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
Gene Cumm [Sat, 16 Jun 2012 17:33:19 +0000 (13:33 -0400)]
strerror: Use klibc version
Remove old in favor of current klibc version
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
Matt Fleming [Tue, 6 Nov 2012 19:56:01 +0000 (19:56 +0000)]
Merge branch 'hexdump' of git://git.zytor.com/users/sha0/syslinux into elflink
Pull new hexdump.c32 module from Shao Miller,
* 'hexdump' of git://git.zytor.com/users/sha0/syslinux:
hexdump.c32: Simple file hex-dumper
Matt Fleming [Mon, 5 Nov 2012 15:35:35 +0000 (15:35 +0000)]
Merge branch 'multi_initrd2-5.00-pre9' of 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
Shao Miller [Mon, 5 Nov 2012 02:23:09 +0000 (21:23 -0500)]
core: Fix realloc() code transcription error
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>
Matt Fleming [Fri, 2 Nov 2012 17:02:36 +0000 (17:02 +0000)]
extlinux: Avoid dereferencing a garbage pointer
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>
Shao Miller [Sun, 4 Nov 2012 04:26:32 +0000 (00:26 -0400)]
hexdump.c32: Simple file hex-dumper
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>
Shao Miller [Fri, 26 Oct 2012 06:14:28 +0000 (02:14 -0400)]
initramfs chain handling: Accounting fixes for padding, etc.
Signed-off-by: Shao Miller <sha0.miller@gmail.com>
Shao Miller [Fri, 26 Oct 2012 01:25:38 +0000 (21:25 -0400)]
linux.c32: Introduce initrdfile= option
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>
Shao Miller [Thu, 25 Oct 2012 07:58:07 +0000 (03:58 -0400)]
linux.c32: Add new initrd+= option for multiple initrds
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>
Shao Miller [Thu, 25 Oct 2012 06:17:36 +0000 (02:17 -0400)]
linux.c32: Move some initrd=x,y,z code out of main
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>
Matt Fleming [Sat, 3 Nov 2012 01:52:52 +0000 (21:52 -0400)]
linux.c32: Add find_arguments function
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>
Matt Fleming [Thu, 1 Nov 2012 12:26:22 +0000 (12:26 +0000)]
CLI: Add Ctrl + V support for printing the Syslinux version
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>
Matt Fleming [Thu, 1 Nov 2012 11:30:42 +0000 (11:30 +0000)]
win: Print error message if we fail to install to --directory
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>
Matt Fleming [Thu, 1 Nov 2012 11:12:03 +0000 (11:12 +0000)]
win: Fix installing to a directory
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>
Matt Fleming [Thu, 1 Nov 2012 10:56:06 +0000 (10:56 +0000)]
CLI: Fix command history traversal
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>
Matt Fleming [Thu, 1 Nov 2012 09:50:46 +0000 (09:50 +0000)]
com32: Include .init_array section in .ctors in linker script
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>
Matt Fleming [Wed, 31 Oct 2012 15:55:02 +0000 (15:55 +0000)]
ldlinux: get_key() requires raw access to user input
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>
Matt Fleming [Wed, 31 Oct 2012 12:42:25 +0000 (12:42 +0000)]
ldlinux: Fix logic if no DEFAULT or UI directive is found
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>
Matt Fleming [Wed, 31 Oct 2012 12:49:43 +0000 (12:49 +0000)]
ldlinux: Print a warning if no config file is found
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>
Matt Fleming [Wed, 31 Oct 2012 14:17:49 +0000 (14:17 +0000)]
pxe: Don't call open_config() from the pxe core
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>
Matt Fleming [Wed, 31 Oct 2012 11:08:03 +0000 (11:08 +0000)]
doc: Document the 'PATH' directive
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>
Matt Fleming [Wed, 31 Oct 2012 10:32:42 +0000 (10:32 +0000)]
NEWS: Document the major changes in 5.00
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Matt Fleming [Wed, 24 Oct 2012 13:41:00 +0000 (14:41 +0100)]
Merge branch 'master' into elflink
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
Matt Fleming [Tue, 23 Oct 2012 15:49:23 +0000 (16:49 +0100)]
diag/mbr: Fix typo in README
Reported-by: Ady <ady-sf@hotmail.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Matt Fleming [Tue, 23 Oct 2012 14:02:50 +0000 (15:02 +0100)]
Merge branch 'elflink' of git://github.com/aericson/syslinux into elflink
Conflicts:
com32/modules/Makefile
Kenneth J. Davis [Mon, 22 Oct 2012 18:20:18 +0000 (19:20 +0100)]
memdisk: Fix order of sectors/track and bytes/sector
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>
Matt Fleming [Mon, 22 Oct 2012 12:39:24 +0000 (13:39 +0100)]
NEWS: Document the VFAT relative path fix
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Matt Fleming [Mon, 22 Oct 2012 12:02:19 +0000 (13:02 +0100)]
README: Clarify the requirements for utils/isohybrid
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>
Matt Fleming [Wed, 17 Oct 2012 12:07:07 +0000 (13:07 +0100)]
NEWS: Fix some typos
Reported-by: Ady <ady-sf@hotmail.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Vanush "Misha" Paturyan [Wed, 17 Oct 2012 08:54:16 +0000 (09:54 +0100)]
doc: minor documentation updates
syslinux.txt: syslinux binary is in "linux" directory
menu.txt: menu.c32 and vesamenu.c32 are in com32/menu directory
H. Peter Anvin [Mon, 22 Oct 2012 20:44:53 +0000 (13:44 -0700)]
Revert "win: Add -mno-ms-bitfields"
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>
H. Peter Anvin [Mon, 22 Oct 2012 20:42:31 +0000 (13:42 -0700)]
Packed definition: workaround for mingw + gcc 4.7
__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>
Matt Fleming [Fri, 19 Oct 2012 13:41:12 +0000 (14:41 +0100)]
ldlinux: Use stdcon instead of rawcon for the console
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>
Matt Fleming [Fri, 19 Oct 2012 09:55:13 +0000 (10:55 +0100)]
Clean up $(GPLLIB) leak
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>
Matt Fleming [Fri, 19 Oct 2012 09:52:44 +0000 (10:52 +0100)]
core: Print error message if we don't load ldlinux.c32
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>
Sebastian Herbszt [Sun, 14 Oct 2012 13:38:58 +0000 (15:38 +0200)]
comboot: remove comapi_chainboot
comapi_chainboot was obsoleted in 3.80.
Signed-off-by: Sebastian Herbszt <herbszt@gmx.de>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Sebastian Herbszt [Sun, 14 Oct 2012 13:38:25 +0000 (15:38 +0200)]
comboot: fix documentation
comapi_shuffle was obsoleted in 3.80.
Signed-off-by: Sebastian Herbszt <herbszt@gmx.de>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Geert Stappers [Fri, 12 Oct 2012 19:36:50 +0000 (21:36 +0200)]
README: document the need for /usr/include/uuid/uuid.h
utils/isohybrid build depends on /usr/include/uuid/uuid.h The package
name varies between distribution families.
Matt Fleming [Fri, 12 Oct 2012 11:59:32 +0000 (12:59 +0100)]
menu: Disallow navigation to a disabled entry via *any* key
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>
Matt Fleming [Thu, 11 Oct 2012 20:18:10 +0000 (21:18 +0100)]
prdhcp.c32: Turn off DEBUG
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Matt Fleming [Thu, 11 Oct 2012 20:16:37 +0000 (21:16 +0100)]
Merge branch 'pxechn-fix-news-for-hpa-2' of git://github.com/geneC/syslinux
Conflicts:
NEWS
com32/modules/Makefile
Shao Miller [Thu, 11 Oct 2012 15:59:37 +0000 (11:59 -0400)]
win: Add -mno-ms-bitfields
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>
Frediano Ziglio [Fri, 31 Aug 2012 11:00:16 +0000 (12:00 +0100)]
isohybrid: fix isohybrid.c compile
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>
Frediano Ziglio [Thu, 2 Aug 2012 08:32:36 +0000 (09:32 +0100)]
ext2: add additional check to ext2 loader
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>
Frediano Ziglio [Thu, 2 Aug 2012 08:31:23 +0000 (09:31 +0100)]
mboot: fix typo in comment
Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>