cbfstool: Rework to use getopt style parameters

- Adding more and more optional and non-optional parameters
  bloated cbfstool and made the code hard to read with a lot
  of parsing in the actual cbfs handling functions. This change
  switches over to use getopt style options for everything but
  command and cbfs file name.
- This allows us to simplify the coreboot Makefiles a bit
- Also, add guards to include files
- Fix some 80+ character lines
- Add more detailed error reporting
- Free memory we're allocating

Signed-off-by: Stefan Reinauer <reinauer@google.com>
Change-Id: Ia9137942deb8d26bbb30068e6de72466afe9b0a7
Reviewed-on: http://review.coreboot.org/1800
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
This commit is contained in:
Stefan Reinauer
2012-10-29 16:52:36 -07:00
committed by Stefan Reinauer
parent e5a0a5d6df
commit 632175802e
7 changed files with 529 additions and 304 deletions

View File

@@ -16,6 +16,9 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA, 02110-1301 USA
*/
#ifndef __CBFS_H
#define __CBFS_H
#include <stdint.h>
struct cbfs_header {
@@ -93,3 +96,5 @@ struct cbfs_payload {
int cbfs_file_header(uint32_t physaddr);
struct cbfs_file *cbfs_create_empty_file(uint32_t physaddr, uint32_t size);
#endif