Age | Commit message (Collapse) | Author | Files | Lines |
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
io_delay() defined in bios.h depends on outb() defined in <sys/io.h>.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
|
Conform to 8.3 filenames for essential files.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
|
Conform to 8.3 filenames for essential files.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
|
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>
|
|
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>
|
|
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>
|
|
And return NULL after printing an appropriate error message if the
call failed.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
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>
|
|
Welcome to the 5.01 development cycle and 2013.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
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>
|
|
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>
|
|
Set the sonames of shared libraries to the filename, so we don't end
up with full pathnames embedded in the files.
|
|
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>
|
|
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>
|
|
Use the same variable in idle.c and ldlinux.c32.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
|
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
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>
|
|
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>
|
|
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
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
We need to install libmenu.c32 as it is required by modules like
hdt.c32.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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
|
|
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
Exclude in .gitignore
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
Remove old in favor of current klibc version
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
Pull new hexdump.c32 module from Shao Miller,
* 'hexdump' of git://git.zytor.com/users/sha0/syslinux:
hexdump.c32: Simple file hex-dumper
|
|
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
|
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Shao Miller <sha0.miller@gmail.com>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
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
|
|
Reported-by: Ady <ady-sf@hotmail.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
Conflicts:
com32/modules/Makefile
|
|
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>
|
|
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
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>
|
|
Reported-by: Ady <ady-sf@hotmail.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
syslinux.txt: syslinux binary is in "linux" directory
menu.txt: menu.c32 and vesamenu.c32 are in com32/menu directory
|
|
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>
|
|
__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>
|
|
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>
|
|
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>
|
|
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>
|
|
comapi_chainboot was obsoleted in 3.80.
Signed-off-by: Sebastian Herbszt <herbszt@gmx.de>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
comapi_shuffle was obsoleted in 3.80.
Signed-off-by: Sebastian Herbszt <herbszt@gmx.de>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
utils/isohybrid build depends on /usr/include/uuid/uuid.h The package
name varies between distribution families.
|
|
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>
|
|
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
Conflicts:
NEWS
com32/modules/Makefile
|
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
Just some minor cleanup
Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
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>
|
|
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>
|
|
... 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>
|
|
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
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>
|
|
|
|
New release with codename Manon
|
|
By using the "silent" option at the cmdline, HDT tries not displaying
any boring message.
This is particulary interesting with the "display" option.
|
|
Using more_printf allow to manage more easily several pages printing.
|
|
|
|
Typo.
|
|
If the watchdog was already engaged, let's rewrite the timeout to insure
the proper value is set.
|
|
If we fail, at least let's boot the expected image
|
|
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
|
|
Command line options changed.
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
|
|
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>
|
|
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>
|
|
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
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>
|
|
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>
|
|
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>
|
|
This patch cleanups and removes some trailing whitespaces introduced in
the previous commit.
Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
|
|
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>
|
|
This patch cleanups and removes some trailing whitespaces introduced in
the previous commit.
Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
|
|
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>
|
|
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>
|
|
This patch removes some trailing whitespaces from previous commit.
Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
|
|
Now, xfs_readdir filesystem op will be able to list directory entries
from node directories.
Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
|
|
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>
|
|
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>
|
|
- 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>
|
|
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>
|
|
Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
|
|
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>
|
|
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>
|
|
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>
|
|
Add support to xfs_readdir() being able to list directory entries from
leaf directories.
Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
|
|
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>
|
|
Since it won't certainly be exported to anywhere, make it static around
the driver code.
Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
|
|
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>
|
|
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>
|
|
Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
|
|
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>
|
|
This patch basically cleanups the previous one.
Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
(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>
|
|
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>
|
|
Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
|
|
Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
|
|
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>
|