Commit graph

25 commits

Author SHA1 Message Date
Myles Watson
9d6d811dd1 This patch converts __FUNCTION__ to __func__, since __func__ is standard.
Signed-off-by: Myles Watson <mylesgw@gmail.com>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>


git-svn-id: svn://coreboot.org/repository/coreboot-v3@1131 f3766cd6-281f-0410-b1cd-43a5c92072e9
2009-02-12 21:15:34 +00:00
Myles Watson
66843bacbf This patch fixes lar path handling. In particular, it adds new members to the
file struct for pathname and compression, so that directories can be correctly
recursed.

file-by-file:

util/lar/lar.c:
	make error messages more verbose
	pass a pointer to the file structure instead of the name
	parse the name here with lar_process_name

util/lar/lib.c:
	change handle_directory to use a path name and respect nocompress
	change add_files to use pre-processed names
	use sensible defaults for new file members when listing or extracting
	free pathname if allocated	

util/lar/lib.h:
	add new members to struct file
	change prototypes of add_files and lar_add_file

util/lar/stream.c:
	change lar_add_file to use pathname and compression from struct file
	
Signed-off-by: Myles Watson <mylesgw@gmail.com>
Acked-by: Peter Stuge <peter@stuge.se>


git-svn-id: svn://coreboot.org/repository/coreboot-v3@623 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-02-28 14:56:43 +00:00
Myles Watson
548bf497a7 This is a simple patch which corrects directory handling for add
(makes it the same as create.)

Without this patch you can create a lar and recursively add a
directory to it, but you can't add one with add.

Another patch might be to make lar -l print something when you use the
directory option, but I'm not sure what was intended originally.

Myles

Signed-off-by: Myles Watson <mylesgw@gmail.com>
Acked-by: Peter Stuge <peter@stuge.se>



git-svn-id: svn://coreboot.org/repository/coreboot-v3@618 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-02-25 16:06:36 +00:00
Myles Watson
2f5c48d0b2 This patch adds zero compression for bss segments. One of the reasons
for this is that currently, if you select no compression, the bss
segment of filo takes up 153K with just zeroes.  With this patch, it
always takes up a lar header + 1 byte.  I left the one byte so that
the checksum wouldn't be broken.

This patch could have taken out the calloc in the compression area,
but since it only uses compile-time memory, I decided to keep this
simple.

Myles

Signed-off-by: Myles Watson <myles@pel.cs.byu.edu>
Acked-by: Ronald G. Minnich <rminnich@gmail.com>


git-svn-id: svn://coreboot.org/repository/coreboot-v3@601 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-02-15 19:27:13 +00:00
Myles Watson
89b00ed4f0 This patch adds dst_len for the lar uncompress functions, enabling
buffer overflow checks.  It exits with an error instead of
overflowing.

Signed-off-by: Myles Watson <myles@pel.cs.byu.edu>
Acked-by: Ronald G. Minnich <rminnich@gmail.com>


git-svn-id: svn://coreboot.org/repository/coreboot-v3@594 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-02-13 22:15:59 +00:00
Myles Watson
6c88373502 This patch fixes a memory corruption error in lar when compiled on a 64-bit
architecture.  The function prototypes had a size mismatch, which overwrote
other things on the stack.  Now the prototypes use int for lengths.

Signed-off-by: Myles Watson <myles@pel.cs.byu.edu>
Acked-by: Ronald G. Minnich <rminnich@gmail.com>


git-svn-id: svn://coreboot.org/repository/coreboot-v3@592 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-02-13 17:30:49 +00:00
Stefan Reinauer
6220b632e7 Now version 3: LinuxBIOS -> coreboot rename.
- I left LB_TAG_ intact because they are used by the payloads
- file renames are still missing. see next commit
- some lb_ renames might be missing. feel free to provide patches.

Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Stefan Reinauer <stepan@coresystems.de>



git-svn-id: svn://coreboot.org/repository/coreboot-v3@564 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-01-27 18:54:57 +00:00
Stefan Reinauer
9cf00d18d4 small typo
Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Stefan Reinauer <stepan@coresystems.de>



git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@478 f3766cd6-281f-0410-b1cd-43a5c92072e9
2007-08-20 18:21:52 +00:00
Stefan Reinauer
7fb3e5a9c5 Fixes nocompress:-handling in lar
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Acked-by: Stefan Reinauer <stepan@coresystems.de>



git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@477 f3766cd6-281f-0410-b1cd-43a5c92072e9
2007-08-20 17:55:32 +00:00
Stefan Reinauer
dd35e9c402 fix mkdirp_below calls like I think Peter intended them
Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Stefan Reinauer <stepan@coresystems.de>



git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@476 f3766cd6-281f-0410-b1cd-43a5c92072e9
2007-08-20 00:48:06 +00:00
Stefan Reinauer
fd18b05542 Add another field to the filename specified for create and add
operations to specify the intended pathname for the blob.

Signed-off-by: Jordan Crouse <jordan.crouse@amd.com>
Acked-by: Stefan Reinauer <stepan@coresystems.de>



git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@471 f3766cd6-281f-0410-b1cd-43a5c92072e9
2007-08-19 23:33:41 +00:00
Stefan Reinauer
f2f4fc5fe7 In preparation for adding new LAR functionality - this patch
consolidates
creating and accessing the LAR into new code utilizing mmap which
facilitates moving about within the archive. 

This code also turns the bootblock path name as a constant value.
It also requires that the user specify a size when the LAR is
created.

This patch was missing do_no_uncompress() which was fixed before
commit. This part should be reviewed.

Signed-off-by: Jordan crouse <jordan.crouse@amd.com>
Acked-by: Stefan Reinauer <stepan@coresystems.de>



git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@470 f3766cd6-281f-0410-b1cd-43a5c92072e9
2007-08-19 23:31:58 +00:00
Stefan Reinauer
9ca9df3d92 - adds missing include
- test(1) doesn't understand == on Solaris, but = seems to be equivalent

Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Acked-by: Stefan Reinauer <stepan@coresystems.de>



git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@461 f3766cd6-281f-0410-b1cd-43a5c92072e9
2007-07-21 14:33:54 +00:00
Peter Stuge
7f49e38558 Replaces mkdirp() with mkdirp_below() that aborts directory creation and
returns an error if any part of dirpath is located outside the specified
parent directory. Use the parent "/" to allow new directories anywhere.
Note that dirpath is relative to the working directory, not to parent.

Signed-off-by: Peter Stuge <peter@stuge.se>
Acked-by: Stefan Reinauer <stepan@coresystems.de>


git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@453 f3766cd6-281f-0410-b1cd-43a5c92072e9
2007-07-13 10:40:31 +00:00
Uwe Hermann
d8ad5a5bc9 - Extend lar format to support compression (incompatible format change!)
- Adapt the compression utilities for integration into lar
- Add compression capabilities to lar and expose in user interface
- Provide a way to mark files as non-compressible

Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>

- Diese und die folgenden Zeilen werden ignoriert --

M    include/lar.h
M    util/lzma/minilzma.cc
M    util/nrv2b/nrv2b.c
M    util/lar/lar.c
M    util/lar/create.c
M    util/lar/lar.h
M    util/lar/lib.c
M    util/lar/extract.c
M    util/lar/list.c


git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@366 f3766cd6-281f-0410-b1cd-43a5c92072e9
2007-06-26 11:55:06 +00:00
Uwe Hermann
53099f8d1c Fix various license headers.
Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Stefan Reinauer <stepan@coresystems.de>



git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@330 f3766cd6-281f-0410-b1cd-43a5c92072e9
2007-05-20 20:35:59 +00:00
Stefan Reinauer
5870a97218 - solaris already has an mkdirp in libgen (and thus in its header) with
different arguments, change mkdirp in util/lar/lib.* to match that
- still use it on solaris as lar uses libgen.h but not libgen (but it
  needs libgen.h!)

Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Acked-by: Stefan Reinauer <stepan@coresystems.de>



git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@280 f3766cd6-281f-0410-b1cd-43a5c92072e9
2007-04-14 16:22:49 +00:00
Uwe Hermann
bd5ca845e9 Run indent for util/lar/*. Cosmetic fixes in arch/x86/Makefile (trivial).
Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>



git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@235 f3766cd6-281f-0410-b1cd-43a5c92072e9
2007-03-10 16:31:02 +00:00
Uwe Hermann
88f2f6402a This is a major update to the lar archiver. It simplifies the build process and
is a base change to make the whole linuxbios.rom a lar file.

* fix a whole lot of lar bugs (that never showed up in production yet)
* add proper option parsing to lar
* add verbose option
* add option to automatically pad lar archive to a certain size
* add proper file handling (specifying a directory will now pack all files
  in that directory into the lar, instead of a 4k dummy file)
* catch lots of user errors, less implicit assumptions
* merge all header files into lib.h (except lar.h which is needed by other
  programs using the lar format). lib.h is still very small.
* print errors to stderr
* (slipped in) copy linuxbios.rom to bios.bin for qemu ;-)
* adapt arch/x86/Makefile to use the new features.
* set version to 0.9
* lots of security bugs fixed (thanks to Uwe!)
* catch low memory conditions in strdup

Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>



git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@234 f3766cd6-281f-0410-b1cd-43a5c92072e9
2007-03-10 16:20:01 +00:00
Uwe Hermann
1a4be55c7f Cosmetic changes (trivial).
Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>



git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@152 f3766cd6-281f-0410-b1cd-43a5c92072e9
2007-02-27 21:33:33 +00:00
Uwe Hermann
0f7316cbfc Various, mostly cosmetic fixes (trivial).
Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>



git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@148 f3766cd6-281f-0410-b1cd-43a5c92072e9
2007-02-27 20:40:47 +00:00
Stefan Reinauer
86d6551987 Fix coding style of util/lar/*.[ch] by running:
indent -npro -kr -i8 -ts8 -sob -l80 -ss -ncs *.[ch]

Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Stefan Reinauer <stepan@coresystems.de>



git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@142 f3766cd6-281f-0410-b1cd-43a5c92072e9
2007-02-27 13:00:22 +00:00
Stefan Reinauer
2e42b88a9a Large patch but trivial: Fix Copright error.
Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Stefan Reinauer <stepan@coresystems.de>



git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@137 f3766cd6-281f-0410-b1cd-43a5c92072e9
2007-02-26 23:17:40 +00:00
Uwe Hermann
4a133b426c Use the same format for the lar license headers as in the rest of the
LinuxBIOS code.

Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Stefan Reinauer <stepan@coresystems.de>



git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@45 f3766cd6-281f-0410-b1cd-43a5c92072e9
2006-11-10 17:06:53 +00:00
Stefan Reinauer
92efb61fa7 Add initial version of lar to the archive.
Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Acked-By: Stefan Reinauer  <stepan@coresystems.de> and others.


git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@39 f3766cd6-281f-0410-b1cd-43a5c92072e9
2006-11-07 17:32:43 +00:00