diff options
-rw-r--r-- | util/cbfstool/EXAMPLE | 8 | ||||
-rw-r--r-- | util/cbfstool/Makefile (renamed from util/romtool/Makefile) | 14 | ||||
-rw-r--r-- | util/cbfstool/README (renamed from util/romtool/README) | 50 | ||||
-rw-r--r-- | util/cbfstool/TODO (renamed from util/romtool/TODO) | 2 | ||||
-rw-r--r-- | util/cbfstool/add.c (renamed from util/romtool/add.c) | 18 | ||||
-rw-r--r-- | util/cbfstool/bootblock.c (renamed from util/romtool/bootblock.c) | 4 | ||||
-rw-r--r-- | util/cbfstool/cbfs.h (renamed from util/romtool/romfs.h) | 38 | ||||
-rw-r--r-- | util/cbfstool/cbfstool.c (renamed from util/romtool/romtool.c) | 16 | ||||
-rw-r--r-- | util/cbfstool/cbfstool.h (renamed from util/romtool/romtool.h) | 16 | ||||
-rw-r--r-- | util/cbfstool/create.c (renamed from util/romtool/create.c) | 4 | ||||
-rw-r--r-- | util/cbfstool/delete.c (renamed from util/romtool/delete.c) | 4 | ||||
-rw-r--r-- | util/cbfstool/fs.c (renamed from util/romtool/fs.c) | 44 | ||||
-rw-r--r-- | util/cbfstool/print.c (renamed from util/romtool/print.c) | 14 | ||||
-rw-r--r-- | util/cbfstool/resize.c (renamed from util/romtool/resize.c) | 12 | ||||
-rw-r--r-- | util/cbfstool/tools/Makefile (renamed from util/romtool/tools/Makefile) | 0 | ||||
-rw-r--r-- | util/cbfstool/tools/common.c (renamed from util/romtool/tools/common.c) | 2 | ||||
-rw-r--r-- | util/cbfstool/tools/common.h (renamed from util/romtool/tools/common.h) | 2 | ||||
-rw-r--r-- | util/cbfstool/tools/compress.c (renamed from util/romtool/tools/compress.c) | 2 | ||||
-rw-r--r-- | util/cbfstool/tools/elf.h (renamed from util/romtool/tools/elf.h) | 0 | ||||
-rw-r--r-- | util/cbfstool/tools/lzma/C/7zip/Common/InBuffer.h (renamed from util/romtool/tools/lzma/C/7zip/Common/InBuffer.h) | 0 | ||||
-rw-r--r-- | util/cbfstool/tools/lzma/C/7zip/Common/OutBuffer.cpp (renamed from util/romtool/tools/lzma/C/7zip/Common/OutBuffer.cpp) | 0 | ||||
-rw-r--r-- | util/cbfstool/tools/lzma/C/7zip/Common/OutBuffer.h (renamed from util/romtool/tools/lzma/C/7zip/Common/OutBuffer.h) | 0 | ||||
-rw-r--r-- | util/cbfstool/tools/lzma/C/7zip/Common/StdAfx.h (renamed from util/romtool/tools/lzma/C/7zip/Common/StdAfx.h) | 0 | ||||
-rw-r--r-- | util/cbfstool/tools/lzma/C/7zip/Common/StreamUtils.cpp (renamed from util/romtool/tools/lzma/C/7zip/Common/StreamUtils.cpp) | 0 | ||||
-rw-r--r-- | util/cbfstool/tools/lzma/C/7zip/Common/StreamUtils.h (renamed from util/romtool/tools/lzma/C/7zip/Common/StreamUtils.h) | 0 | ||||
-rw-r--r-- | util/cbfstool/tools/lzma/C/7zip/Compress/LZ/BinTree/BinTree.h (renamed from util/romtool/tools/lzma/C/7zip/Compress/LZ/BinTree/BinTree.h) | 0 | ||||
-rw-r--r-- | util/cbfstool/tools/lzma/C/7zip/Compress/LZ/BinTree/BinTree2.h (renamed from util/romtool/tools/lzma/C/7zip/Compress/LZ/BinTree/BinTree2.h) | 0 | ||||
-rw-r--r-- | util/cbfstool/tools/lzma/C/7zip/Compress/LZ/BinTree/BinTree3.h (renamed from util/romtool/tools/lzma/C/7zip/Compress/LZ/BinTree/BinTree3.h) | 0 | ||||
-rw-r--r-- | util/cbfstool/tools/lzma/C/7zip/Compress/LZ/BinTree/BinTree4.h (renamed from util/romtool/tools/lzma/C/7zip/Compress/LZ/BinTree/BinTree4.h) | 0 | ||||
-rw-r--r-- | util/cbfstool/tools/lzma/C/7zip/Compress/LZ/BinTree/BinTreeMain.h (renamed from util/romtool/tools/lzma/C/7zip/Compress/LZ/BinTree/BinTreeMain.h) | 0 | ||||
-rw-r--r-- | util/cbfstool/tools/lzma/C/7zip/Compress/LZ/HashChain/HC4.h (renamed from util/romtool/tools/lzma/C/7zip/Compress/LZ/HashChain/HC4.h) | 0 | ||||
-rw-r--r-- | util/cbfstool/tools/lzma/C/7zip/Compress/LZ/HashChain/HCMain.h (renamed from util/romtool/tools/lzma/C/7zip/Compress/LZ/HashChain/HCMain.h) | 0 | ||||
-rw-r--r-- | util/cbfstool/tools/lzma/C/7zip/Compress/LZ/IMatchFinder.h (renamed from util/romtool/tools/lzma/C/7zip/Compress/LZ/IMatchFinder.h) | 0 | ||||
-rw-r--r-- | util/cbfstool/tools/lzma/C/7zip/Compress/LZ/LZInWindow.cpp (renamed from util/romtool/tools/lzma/C/7zip/Compress/LZ/LZInWindow.cpp) | 0 | ||||
-rw-r--r-- | util/cbfstool/tools/lzma/C/7zip/Compress/LZ/LZInWindow.h (renamed from util/romtool/tools/lzma/C/7zip/Compress/LZ/LZInWindow.h) | 0 | ||||
-rw-r--r-- | util/cbfstool/tools/lzma/C/7zip/Compress/LZ/StdAfx.h (renamed from util/romtool/tools/lzma/C/7zip/Compress/LZ/StdAfx.h) | 0 | ||||
-rw-r--r-- | util/cbfstool/tools/lzma/C/7zip/Compress/LZMA/LZMA.h (renamed from util/romtool/tools/lzma/C/7zip/Compress/LZMA/LZMA.h) | 0 | ||||
-rw-r--r-- | util/cbfstool/tools/lzma/C/7zip/Compress/LZMA/LZMAEncoder.cpp (renamed from util/romtool/tools/lzma/C/7zip/Compress/LZMA/LZMAEncoder.cpp) | 0 | ||||
-rw-r--r-- | util/cbfstool/tools/lzma/C/7zip/Compress/LZMA/LZMAEncoder.h (renamed from util/romtool/tools/lzma/C/7zip/Compress/LZMA/LZMAEncoder.h) | 0 | ||||
-rw-r--r-- | util/cbfstool/tools/lzma/C/7zip/Compress/LZMA/StdAfx.h (renamed from util/romtool/tools/lzma/C/7zip/Compress/LZMA/StdAfx.h) | 0 | ||||
-rw-r--r-- | util/cbfstool/tools/lzma/C/7zip/Compress/RangeCoder/RangeCoder.h (renamed from util/romtool/tools/lzma/C/7zip/Compress/RangeCoder/RangeCoder.h) | 0 | ||||
-rw-r--r-- | util/cbfstool/tools/lzma/C/7zip/Compress/RangeCoder/RangeCoderBit.cpp (renamed from util/romtool/tools/lzma/C/7zip/Compress/RangeCoder/RangeCoderBit.cpp) | 0 | ||||
-rw-r--r-- | util/cbfstool/tools/lzma/C/7zip/Compress/RangeCoder/RangeCoderBit.h (renamed from util/romtool/tools/lzma/C/7zip/Compress/RangeCoder/RangeCoderBit.h) | 0 | ||||
-rw-r--r-- | util/cbfstool/tools/lzma/C/7zip/Compress/RangeCoder/RangeCoderBitTree.h (renamed from util/romtool/tools/lzma/C/7zip/Compress/RangeCoder/RangeCoderBitTree.h) | 0 | ||||
-rw-r--r-- | util/cbfstool/tools/lzma/C/7zip/Compress/RangeCoder/RangeCoderOpt.h (renamed from util/romtool/tools/lzma/C/7zip/Compress/RangeCoder/RangeCoderOpt.h) | 0 | ||||
-rw-r--r-- | util/cbfstool/tools/lzma/C/7zip/Compress/RangeCoder/StdAfx.h (renamed from util/romtool/tools/lzma/C/7zip/Compress/RangeCoder/StdAfx.h) | 0 | ||||
-rw-r--r-- | util/cbfstool/tools/lzma/C/7zip/Decompress/LzmaDecode.c (renamed from util/romtool/tools/lzma/C/7zip/Decompress/LzmaDecode.c) | 0 | ||||
-rw-r--r-- | util/cbfstool/tools/lzma/C/7zip/Decompress/LzmaDecode.h (renamed from util/romtool/tools/lzma/C/7zip/Decompress/LzmaDecode.h) | 0 | ||||
-rw-r--r-- | util/cbfstool/tools/lzma/C/7zip/ICoder.h (renamed from util/romtool/tools/lzma/C/7zip/ICoder.h) | 0 | ||||
-rw-r--r-- | util/cbfstool/tools/lzma/C/7zip/IStream.h (renamed from util/romtool/tools/lzma/C/7zip/IStream.h) | 0 | ||||
-rw-r--r-- | util/cbfstool/tools/lzma/C/Common/Alloc.cpp (renamed from util/romtool/tools/lzma/C/Common/Alloc.cpp) | 0 | ||||
-rw-r--r-- | util/cbfstool/tools/lzma/C/Common/Alloc.h (renamed from util/romtool/tools/lzma/C/Common/Alloc.h) | 0 | ||||
-rw-r--r-- | util/cbfstool/tools/lzma/C/Common/CRC.cpp (renamed from util/romtool/tools/lzma/C/Common/CRC.cpp) | 0 | ||||
-rw-r--r-- | util/cbfstool/tools/lzma/C/Common/CRC.h (renamed from util/romtool/tools/lzma/C/Common/CRC.h) | 0 | ||||
-rw-r--r-- | util/cbfstool/tools/lzma/C/Common/Defs.h (renamed from util/romtool/tools/lzma/C/Common/Defs.h) | 0 | ||||
-rw-r--r-- | util/cbfstool/tools/lzma/C/Common/MyCom.h (renamed from util/romtool/tools/lzma/C/Common/MyCom.h) | 0 | ||||
-rw-r--r-- | util/cbfstool/tools/lzma/C/Common/MyGuidDef.h (renamed from util/romtool/tools/lzma/C/Common/MyGuidDef.h) | 0 | ||||
-rw-r--r-- | util/cbfstool/tools/lzma/C/Common/MyInitGuid.h (renamed from util/romtool/tools/lzma/C/Common/MyInitGuid.h) | 0 | ||||
-rw-r--r-- | util/cbfstool/tools/lzma/C/Common/MyUnknown.h (renamed from util/romtool/tools/lzma/C/Common/MyUnknown.h) | 0 | ||||
-rw-r--r-- | util/cbfstool/tools/lzma/C/Common/MyWindows.h (renamed from util/romtool/tools/lzma/C/Common/MyWindows.h) | 0 | ||||
-rw-r--r-- | util/cbfstool/tools/lzma/C/Common/NewHandler.h (renamed from util/romtool/tools/lzma/C/Common/NewHandler.h) | 0 | ||||
-rw-r--r-- | util/cbfstool/tools/lzma/C/Common/StdAfx.h (renamed from util/romtool/tools/lzma/C/Common/StdAfx.h) | 0 | ||||
-rw-r--r-- | util/cbfstool/tools/lzma/C/Common/Types.h (renamed from util/romtool/tools/lzma/C/Common/Types.h) | 0 | ||||
-rw-r--r-- | util/cbfstool/tools/lzma/C/LGPL.txt (renamed from util/romtool/tools/lzma/C/LGPL.txt) | 0 | ||||
-rw-r--r-- | util/cbfstool/tools/lzma/C/ORIGIN (renamed from util/romtool/tools/lzma/C/ORIGIN) | 2 | ||||
-rw-r--r-- | util/cbfstool/tools/lzma/Makefile (renamed from util/romtool/tools/lzma/Makefile) | 0 | ||||
-rw-r--r-- | util/cbfstool/tools/lzma/minilzma.cc (renamed from util/romtool/tools/lzma/minilzma.cc) | 0 | ||||
-rw-r--r-- | util/cbfstool/tools/rom-mkpayload.c (renamed from util/romtool/tools/rom-mkpayload.c) | 20 | ||||
-rw-r--r-- | util/cbfstool/tools/rom-mkstage.c (renamed from util/romtool/tools/rom-mkstage.c) | 22 | ||||
-rw-r--r-- | util/cbfstool/types.c (renamed from util/romtool/types.c) | 4 | ||||
-rw-r--r-- | util/cbfstool/util.c (renamed from util/romtool/util.c) | 26 | ||||
-rw-r--r-- | util/romtool/EXAMPLE | 8 |
72 files changed, 166 insertions, 166 deletions
diff --git a/util/cbfstool/EXAMPLE b/util/cbfstool/EXAMPLE new file mode 100644 index 0000000000..e4e198e355 --- /dev/null +++ b/util/cbfstool/EXAMPLE @@ -0,0 +1,8 @@ + rm coreboot.rom; +./cbfstool coreboot.rom create 0x80000 0x10000 /tmp/coreboot.strip +./cbfstool coreboot.rom add-payload /tmp/filo.elf normal/payload l +./cbfstool coreboot.rom print +#./cbfstool coreboot.rom add-stage /tmp/filo.elf normal/payload + +./cbfstool coreboot.rom print +cp coreboot.rom /home/rminnich/qemutest/ diff --git a/util/romtool/Makefile b/util/cbfstool/Makefile index 291c940a18..71e0d3b7d7 100644 --- a/util/romtool/Makefile +++ b/util/cbfstool/Makefile @@ -5,17 +5,17 @@ obj ?= $(shell pwd) COMMANDS=create.o bootblock.o delete.o add.o print.o resize.o -OBJ=$(COMMANDS) romtool.o util.o fs.o -INC=romtool.h romfs.h +OBJ=$(COMMANDS) cbfstool.o util.o fs.o +INC=cbfstool.h cbfs.h CC=gcc CFLAGS=-g -Wall # -W -Werror DESTDIR ?= /usr/local/bin -all: $(obj)/romtool $(obj)/tools/rom-mkpayload $(obj)/tools/rom-mkstage +all: $(obj)/cbfstool $(obj)/tools/rom-mkpayload $(obj)/tools/rom-mkstage -$(obj)/romtool: $(patsubst %,$(obj)/%,$(OBJ)) +$(obj)/cbfstool: $(patsubst %,$(obj)/%,$(OBJ)) $(CC) -o $@ $(patsubst %,$(obj)/%,$(OBJ)) tobj = $(obj)/tools @@ -26,9 +26,9 @@ include $(tsrc)/Makefile $(obj)/%.o: %.c $(INC) $(CC) $(CFLAGS) -c -o $@ $< -install: $(obj)/romtool $(obj)/tools/rom-mkpayload $(obj)/tools/rom-mkstage +install: $(obj)/cbfstool $(obj)/tools/rom-mkpayload $(obj)/tools/rom-mkstage @ install -d $(DESTDIR) - @ install -m 0755 $(obj)/romtool $(DESTDIR)/romtool + @ install -m 0755 $(obj)/cbfstool $(DESTDIR)/cbfstool @ install -m 0755 $(obj)/tools/rom-mkstage $(DESTDIR)/rom-mkstage @ install -m 0755 $(obj)/tools/rom-mkpayload $(DESTDIR)/rom-mkpayload @@ -36,5 +36,5 @@ tags: ctags *.[ch] */*.[ch] clean: tools-clean - rm -f $(patsubst %,$(obj)/%,$(OBJ)) $(obj)/romtool + rm -f $(patsubst %,$(obj)/%,$(OBJ)) $(obj)/cbfstool diff --git a/util/romtool/README b/util/cbfstool/README index 10c5cdf5d6..9c8e818721 100644 --- a/util/romtool/README +++ b/util/cbfstool/README @@ -1,16 +1,16 @@ -Coreboot ROMFS Specification +Coreboot CBFS Specification Jordan Crouse <jordan@cosmicpenguin.net> = Introduction = -This document describes the coreboot ROMFS specification (from here referred -to as ROMFS). ROMFS is a scheme for managing independent chunks of data in +This document describes the coreboot CBFS specification (from here referred +to as CBFS). CBFS is a scheme for managing independent chunks of data in a system ROM. Though not a true filesystem, the style and concepts are similar. = Architecture = -The ROMFS architecture looks like the following: +The CBFS architecture looks like the following: /---------------\ <-- Start of ROM | /-----------\ | --| @@ -41,7 +41,7 @@ The ROMFS architecture looks like the following: \---------------/ -The ROMFS architecture consists of a binary associated with a physical +The CBFS architecture consists of a binary associated with a physical ROM disk referred hereafter as the ROM. A number of independent of components, each with a header prepended on to data are located within the ROM. The components are nominally arranged sequentially, though they @@ -50,12 +50,12 @@ are aligned along a pre-defined boundary. The bootblock occupies the last 20k of the ROM. Within the bootblock is a master header containing information about the ROM including the size, alignment of the components, and the offset of the -start of the first ROMFS component within the ROM. +start of the first CBFS component within the ROM. = Master Header = The master header contains essential information about the ROM that is -used by both the ROMFS implementation within coreboot at runtime as well +used by both the CBFS implementation within coreboot at runtime as well as host based utilities to create and manage the ROM. The master header will be located somewhere within the bootblock (high end of the ROM). A pointer to the location of the header will be located at offset @@ -67,7 +67,7 @@ need to read the pointer and do the appropriate math to locate the header. The following is the structure of the master header: -struct romfs_header { +struct cbfs_header { unsigned int magic; unsigned int version; unsigned int romsize; @@ -79,10 +79,10 @@ struct romfs_header { The meaning of each member is as follows: -'magic' is a 32 bit number that identifies the ROM as a ROMFS type. The magic +'magic' is a 32 bit number that identifies the ROM as a CBFS type. The magic number is 0x4F524243, which is 'ORBC' in ASCII. -'version' is a 32 bit number that identifies the version of ROMFS. The current +'version' is a 32 bit number that identifies the version of CBFS. The current version is 0x31313131 ('1111' in ASCII) which is endian-independent. 'romsize' is the size of the ROM in bytes. Coreboot will subtract 'size' from @@ -96,7 +96,7 @@ ROM. This is used to make sure that each component is aligned correctly with regards to the erase block sizes on the ROM - allowing one to replace a component at runtime without disturbing the others. -'offset' is the offset of the the first ROMFS component (from the start of +'offset' is the offset of the the first CBFS component (from the start of the ROM). This is to allow for arbitrary space to be left at the beginning of the ROM for things like embedded controller firmware. @@ -111,19 +111,19 @@ firmware. The bootblock does not have a component header attached to it. = Components = -ROMFS components are placed in the ROM starting at 'offset' specified in +CBFS components are placed in the ROM starting at 'offset' specified in the master header and ending at the bootblock. Thus the total size available -for components in the ROM is (ROM size - bootblocksize - 'offset'). Each ROMFS +for components in the ROM is (ROM size - bootblocksize - 'offset'). Each CBFS component is to be aligned according to the 'align' value in the header. Thus, if a component of size 1052 is located at offset 0 with an 'align' value of 1024, the next component will be located at offset 2048. -Each ROMFS component will be indexed with a unique ASCII string name of +Each CBFS component will be indexed with a unique ASCII string name of unlimited size. -Each ROMFS component starts with a header: +Each CBFS component starts with a header: -struct ROMFS_file { +struct CBFS_file { char magic[8]; unsigned int len; unsigned int type; @@ -155,7 +155,7 @@ structure of the header: /--------\ <- start | Header | -|--------| <- sizeof(struct romfs_file) +|--------| <- sizeof(struct cbfs_file) | Name | |--------| <- 'offset' | Data | @@ -165,25 +165,25 @@ structure of the header: == Searching Alogrithm == To locate a specific component in the ROM, one starts at the 'offset' -specified in the ROMFS master header. For this example, the offset will +specified in the CBFS master header. For this example, the offset will be 0. From that offset, the code should search for the magic string on the component, jumping 'align' bytes each time. So, assuming that 'align' is 16, the code will search for the string 'LARCHIVE' at offset 0, 16, 32, etc. -If the offset ever exceeds the allowable range for ROMFS components, then no +If the offset ever exceeds the allowable range for CBFS components, then no component was found. Upon recognizing a component, the software then has to search for the specific name of the component. This is accomplished by comparing the desired name with the string on the component located at -offset + sizeof(struct romfs_file). If the string matches, then the component +offset + sizeof(struct cbfs_file). If the string matches, then the component has been located, otherwise the software should add 'offset' + 'len' to the offset and resume the search for the magic value. == Data Types == -The 'type' member of struct romfs_file is used to identify the content +The 'type' member of struct cbfs_file is used to identify the content of the component data, and is used by coreboot and other run-time entities to make decisions about how to handle the data. @@ -214,7 +214,7 @@ The following is the format of a stage component: The header is defined as: -struct romfs_stage { +struct cbfs_stage { unsigned int compression; unsigned long long entry; unsigned long long load; @@ -273,8 +273,8 @@ The following is the format of a stage component: The header is as follows: -struct romfs_payload { - struct romfs_payload_segment segments; +struct cbfs_payload { + struct cbfs_payload_segment segments; } The header contains a number of segments corresponding to the segments @@ -282,7 +282,7 @@ that need to be loaded for the payload. The following is the structure of each segment header: -struct romfs_payload_segment { +struct cbfs_payload_segment { unsigned int type; unsigned int compression; unsigned int offset; diff --git a/util/romtool/TODO b/util/cbfstool/TODO index 9889e90d78..0f8ed2718f 100644 --- a/util/romtool/TODO +++ b/util/cbfstool/TODO @@ -1,4 +1,4 @@ Add interactive mode -Add script mode (./romtool [ROM] -s script) +Add script mode (./cbfstool [ROM] -s script) Support compression for stages and payloads Add nrv2b diff --git a/util/romtool/add.c b/util/cbfstool/add.c index 3ffc74b966..642d8ce519 100644 --- a/util/romtool/add.c +++ b/util/cbfstool/add.c @@ -1,5 +1,5 @@ /* - * romtool + * cbfstool * * Copyright (C) 2008 Jordan Crouse <jordan@cosmicpenguin.net> * @@ -26,7 +26,7 @@ #include <sys/stat.h> #include <sys/mman.h> #include <sys/wait.h> -#include "romtool.h" +#include "cbfstool.h" #define MAX_PATH 255 @@ -221,7 +221,7 @@ void add_payload_usage(void) int add_handler(struct rom *rom, int argc, char **argv) { - unsigned int type = ROMFS_COMPONENT_NULL; + unsigned int type = CBFS_COMPONENT_NULL; if (argc < 2) { add_usage(); @@ -240,7 +240,7 @@ int add_handler(struct rom *rom, int argc, char **argv) type = strtoul(argv[2], 0, 0); } - if (type == ROMFS_COMPONENT_NULL) + if (type == CBFS_COMPONENT_NULL) WARN("No file type was given for %s - using default\n", argv[0]); @@ -250,18 +250,18 @@ int add_handler(struct rom *rom, int argc, char **argv) char *find_tool(char *tool) { static char toolpath[MAX_PATH]; - extern char romtool_bindir[]; + extern char cbfstool_bindir[]; snprintf(toolpath, MAX_PATH - 1, "tools/%s", tool); if (!access(toolpath, X_OK)) return toolpath; - snprintf(toolpath, MAX_PATH - 1, "%s/tools/%s", romtool_bindir, tool); + snprintf(toolpath, MAX_PATH - 1, "%s/tools/%s", cbfstool_bindir, tool); if (!access(toolpath, X_OK)) return toolpath; - snprintf(toolpath, MAX_PATH - 1, "%s/%s", romtool_bindir, tool); + snprintf(toolpath, MAX_PATH - 1, "%s/%s", cbfstool_bindir, tool); if (!access(toolpath, X_OK)) return toolpath; @@ -294,7 +294,7 @@ int add_payload_handler(struct rom *rom, int argc, char **argv) } return fork_tool_and_add(rom, find_tool("rom-mkpayload"), argv[0], - argv[1], ROMFS_COMPONENT_PAYLOAD, argc - 2, + argv[1], CBFS_COMPONENT_PAYLOAD, argc - 2, argc > 2 ? &argv[2] : NULL); } @@ -322,6 +322,6 @@ int add_stage_handler(struct rom *rom, int argc, char **argv) } return fork_tool_and_add(rom, find_tool("rom-mkstage"), argv[0], - argv[1], ROMFS_COMPONENT_STAGE, argc - 2, + argv[1], CBFS_COMPONENT_STAGE, argc - 2, argc > 2 ? &argv[2] : NULL); } diff --git a/util/romtool/bootblock.c b/util/cbfstool/bootblock.c index 4eaf16d1f4..11f362c1d2 100644 --- a/util/romtool/bootblock.c +++ b/util/cbfstool/bootblock.c @@ -1,5 +1,5 @@ /* - * romtool + * cbfstool * * Copyright (C) 2008 Jordan Crouse <jordan@cosmicpenguin.net> * @@ -20,7 +20,7 @@ #include <stdlib.h> #include <string.h> #include <unistd.h> -#include "romtool.h" +#include "cbfstool.h" void bootblock_usage(void) { diff --git a/util/romtool/romfs.h b/util/cbfstool/cbfs.h index d0a9b5f484..95159ebaa8 100644 --- a/util/romtool/romfs.h +++ b/util/cbfstool/cbfs.h @@ -1,5 +1,5 @@ /* - * romtool + * cbfstool * * Copyright (C) 2008 Jordan Crouse <jordan@cosmicpenguin.net> * @@ -17,30 +17,30 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA, 02110-1301 USA */ -#ifndef _ROMFS_H_ -#define _ROMFS_H_ +#ifndef _CBFS_H_ +#define _CBFS_H_ /** These are standard values for the known compression alogrithms that coreboot knows about for stages and payloads. Of course, other LAR users can use whatever values they want, as long as they understand them. */ -#define ROMFS_COMPRESS_NONE 0 -#define ROMFS_COMPRESS_LZMA 1 -#define ROMFS_COMPRESS_NRV2B 2 +#define CBFS_COMPRESS_NONE 0 +#define CBFS_COMPRESS_LZMA 1 +#define CBFS_COMPRESS_NRV2B 2 /** These are standard component types for well known components (i.e - those that coreboot needs to consume. Users are welcome to use any other value for their components */ -#define ROMFS_COMPONENT_STAGE 0x10 -#define ROMFS_COMPONENT_PAYLOAD 0x20 -#define ROMFS_COMPONENT_OPTIONROM 0x30 +#define CBFS_COMPONENT_STAGE 0x10 +#define CBFS_COMPONENT_PAYLOAD 0x20 +#define CBFS_COMPONENT_OPTIONROM 0x30 -#define ROMFS_COMPONENT_NULL 0xFFFFFFFF +#define CBFS_COMPONENT_NULL 0xFFFFFFFF -/** this is the master romfs header - it need to be +/** this is the master cbfs header - it need to be located somewhere in the bootblock. Where it actually lives is up to coreboot. A pointer to this header will live at 0xFFFFFFF4, so we can @@ -51,7 +51,7 @@ /* this is a version that gives the right answer in any endian-ness */ #define VERSION1 0x31313131 -struct romfs_header { +struct cbfs_header { unsigned int magic; unsigned int version; unsigned int romsize; @@ -61,7 +61,7 @@ struct romfs_header { unsigned int pad[2]; } __attribute__ ((packed)); -/** This is a component header - every entry in the ROMFS +/** This is a component header - every entry in the CBFS will have this header. This is how the component is arranged in the ROM: @@ -78,7 +78,7 @@ struct romfs_header { #define COMPONENT_MAGIC "LARCHIVE" -struct romfs_file { +struct cbfs_file { char magic[8]; unsigned int len; unsigned int type; @@ -94,7 +94,7 @@ struct romfs_file { /** This is the sub-header for stage components. Stages are loaded by coreboot during the normal boot process */ -struct romfs_stage { +struct cbfs_stage { unsigned int compression; /** Compression type */ unsigned long long entry; /** entry point */ unsigned long long load; /** Where to load in memory */ @@ -105,7 +105,7 @@ struct romfs_stage { /** this is the sub-header for payload components. Payloads are loaded by coreboot at the end of the boot process */ -struct romfs_payload_segment { +struct cbfs_payload_segment { unsigned int type; unsigned int compression; unsigned int offset; @@ -114,8 +114,8 @@ struct romfs_payload_segment { unsigned int mem_len; } __attribute__ ((packed)); -struct romfs_payload { - struct romfs_payload_segment segments; +struct cbfs_payload { + struct cbfs_payload_segment segments; }; #define PAYLOAD_SEGMENT_CODE 0x45444F43 @@ -124,6 +124,6 @@ struct romfs_payload { #define PAYLOAD_SEGMENT_PARAMS 0x41524150 #define PAYLOAD_SEGMENT_ENTRY 0x52544E45 -#define ROMFS_NAME(_c) (((unsigned char *) (_c)) + sizeof(struct romfs_file)) +#define CBFS_NAME(_c) (((unsigned char *) (_c)) + sizeof(struct cbfs_file)) #endif diff --git a/util/romtool/romtool.c b/util/cbfstool/cbfstool.c index 0d4c103ca1..b9915e3fac 100644 --- a/util/romtool/romtool.c +++ b/util/cbfstool/cbfstool.c @@ -1,5 +1,5 @@ /* - * romtool + * cbfstool * * Copyright (C) 2008 Jordan Crouse <jordan@cosmicpenguin.net> * @@ -18,9 +18,9 @@ */ /* v2 compat: First, assumes a 64K bootblock. - * romtool coreboot.rom create 0x80000 coreboot.strip - * romtool coreboot.rom add-payload /tmp/filo.elf payload - * romtool coreboot.rom print + * cbfstool coreboot.rom create 0x80000 coreboot.strip + * cbfstool coreboot.rom add-payload /tmp/filo.elf payload + * cbfstool coreboot.rom print */ @@ -28,7 +28,7 @@ #include <unistd.h> #include <libgen.h> #include <sys/mman.h> -#include "romtool.h" +#include "cbfstool.h" extern int create_handler(struct rom *, int, char **); extern int bootblock_handler(struct rom *, int, char **); @@ -66,13 +66,13 @@ struct { static struct rom rom; -char romtool_bindir[255]; +char cbfstool_bindir[255]; void show_help(void) { int i; - printf("romtool [OPTION] [[FILE] [COMMAND] [PARAMETERS]...\n"); + printf("cbfstool [OPTION] [[FILE] [COMMAND] [PARAMETERS]...\n"); printf("Apply COMMANDS with PARAMETERS to FILE. If no COMMAND is\n"); printf("given, run in interactive mode\n\n"); printf("OPTIONs:\n"); @@ -91,7 +91,7 @@ int main(int argc, char **argv) char *cmd; int ret = -1, i; - strncpy(romtool_bindir, dirname(argv[0]), 254); + strncpy(cbfstool_bindir, dirname(argv[0]), 254); while (1) { signed ch = getopt(argc, argv, "hC:"); diff --git a/util/romtool/romtool.h b/util/cbfstool/cbfstool.h index ab083a6c5e..43abb6cb17 100644 --- a/util/romtool/romtool.h +++ b/util/cbfstool/cbfstool.h @@ -1,5 +1,5 @@ /* - * romtool + * cbfstool * * Copyright (C) 2008 Jordan Crouse <jordan@cosmicpenguin.net> * @@ -22,7 +22,7 @@ #include <stdio.h> #include <arpa/inet.h> -#include "romfs.h" +#include "cbfs.h" /* Definitions */ @@ -36,7 +36,7 @@ struct rom { int size; int fssize; - struct romfs_header *header; + struct cbfs_header *header; }; /* Macros */ @@ -47,8 +47,8 @@ struct rom { #define ROM_WRITEL(_r, _o, _v) do { *((unsigned int *) ROM_PTR((_r), (_o))) = (_v); } while(0) #define ROM_READL(_r, _o) *((unsigned int *) (ROM_PTR((_r), (_o)))) -#define ERROR(err, args...) fprintf(stderr, "(romtool) E: " err, ##args) -#define WARN(err, args...) fprintf(stderr, "(romtool) W: " err, ##args) +#define ERROR(err, args...) fprintf(stderr, "(cbfstool) E: " err, ##args) +#define WARN(err, args...) fprintf(stderr, "(cbfstool) W: " err, ##args) #define VERBOSE(str, args...) printf(str, ##args) #define ALIGN(_v, _a) ( ( (_v) + ( (_a) - 1 ) ) & ~( (_a) - 1 ) ) @@ -66,9 +66,9 @@ int add_bootblock(struct rom *rom, const char *filename); /* fs.c */ -struct romfs_file *rom_find(struct rom *rom, unsigned int offset); -struct romfs_file *rom_find_first(struct rom *); -struct romfs_file *rom_find_next(struct rom *, struct romfs_file *); +struct cbfs_file *rom_find(struct rom *rom, unsigned int offset); +struct cbfs_file *rom_find_first(struct rom *); +struct cbfs_file *rom_find_next(struct rom *, struct cbfs_file *); int rom_add(struct rom *rom, const char *name, void *, int size, int type); int rom_remove(struct rom *rom, const char *name); unsigned int rom_used_space(struct rom *rom); diff --git a/util/romtool/create.c b/util/cbfstool/create.c index b98e13b919..23e7850952 100644 --- a/util/romtool/create.c +++ b/util/cbfstool/create.c @@ -1,5 +1,5 @@ /* - * romtool + * cbfstool * * Copyright (C) 2008 Jordan Crouse <jordan@cosmicpenguin.net> * @@ -20,7 +20,7 @@ #include <stdlib.h> #include <string.h> #include <unistd.h> -#include "romtool.h" +#include "cbfstool.h" void create_usage(void) { diff --git a/util/romtool/delete.c b/util/cbfstool/delete.c index 1189dc10f2..5185e83060 100644 --- a/util/romtool/delete.c +++ b/util/cbfstool/delete.c @@ -1,5 +1,5 @@ /* - * romtool + * cbfstool * * Copyright (C) 2008 Jordan Crouse <jordan@cosmicpenguin.net> * @@ -20,7 +20,7 @@ #include <ctype.h> #include <stdlib.h> #include <unistd.h> -#include "romtool.h" +#include "cbfstool.h" void delete_usage(void) { diff --git a/util/romtool/fs.c b/util/cbfstool/fs.c index 200bc6767c..c5e9892a8e 100644 --- a/util/romtool/fs.c +++ b/util/cbfstool/fs.c @@ -1,5 +1,5 @@ /* - * romtool + * cbfstool * * Copyright (C) 2008 Jordan Crouse <jordan@cosmicpenguin.net> * @@ -18,13 +18,13 @@ */ #include <string.h> -#include "romtool.h" +#include "cbfstool.h" -struct romfs_file *rom_find(struct rom *rom, unsigned int offset) +struct cbfs_file *rom_find(struct rom *rom, unsigned int offset) { while (offset < rom->fssize) { - struct romfs_file *c = - (struct romfs_file *)ROM_PTR(rom, offset); + struct cbfs_file *c = + (struct cbfs_file *)ROM_PTR(rom, offset); if (!strcmp(c->magic, COMPONENT_MAGIC)) return c; @@ -35,12 +35,12 @@ struct romfs_file *rom_find(struct rom *rom, unsigned int offset) return NULL; } -struct romfs_file *rom_find_first(struct rom *rom) +struct cbfs_file *rom_find_first(struct rom *rom) { return rom_find(rom, ntohl(rom->header->offset)); } -struct romfs_file *rom_find_next(struct rom *rom, struct romfs_file *prev) +struct cbfs_file *rom_find_next(struct rom *rom, struct cbfs_file *prev) { unsigned int offset = ROM_OFFSET(rom, prev); @@ -49,15 +49,15 @@ struct romfs_file *rom_find_next(struct rom *rom, struct romfs_file *prev) ntohl(rom->header->align))); } -struct romfs_file *rom_find_empty(struct rom *rom) +struct cbfs_file *rom_find_empty(struct rom *rom) { unsigned int offset = ntohl(rom->header->offset); unsigned int ret = ntohl(rom->header->offset); while (offset < rom->fssize) { - struct romfs_file *c = - (struct romfs_file *)ROM_PTR(rom, offset); + struct cbfs_file *c = + (struct cbfs_file *)ROM_PTR(rom, offset); if (!strcmp(c->magic, COMPONENT_MAGIC)) { offset += ALIGN(ntohl(c->offset) + ntohl(c->len), @@ -69,15 +69,15 @@ struct romfs_file *rom_find_empty(struct rom *rom) } return (ret < rom->fssize) ? - (struct romfs_file *)ROM_PTR(rom, ret) : NULL; + (struct cbfs_file *)ROM_PTR(rom, ret) : NULL; } -struct romfs_file *rom_find_by_name(struct rom *rom, const char *name) +struct cbfs_file *rom_find_by_name(struct rom *rom, const char *name) { - struct romfs_file *c = rom_find_first(rom); + struct cbfs_file *c = rom_find_first(rom); while (c) { - if (!strcmp((char *)ROMFS_NAME(c), name)) + if (!strcmp((char *)CBFS_NAME(c), name)) return c; c = rom_find_next(rom, c); @@ -88,7 +88,7 @@ struct romfs_file *rom_find_by_name(struct rom *rom, const char *name) unsigned int rom_used_space(struct rom *rom) { - struct romfs_file *c = rom_find_first(rom); + struct cbfs_file *c = rom_find_first(rom); unsigned int ret = 0; while (c) { @@ -101,8 +101,8 @@ unsigned int rom_used_space(struct rom *rom) int rom_remove(struct rom *rom, const char *name) { - struct romfs_file *c = rom_find_by_name(rom, name); - struct romfs_file *n; + struct cbfs_file *c = rom_find_by_name(rom, name); + struct cbfs_file *n; int clear; if (c == NULL) { @@ -126,7 +126,7 @@ int rom_remove(struct rom *rom, const char *name) int rom_add(struct rom *rom, const char *name, void *buffer, int size, int type) { - struct romfs_file *c = rom_find_empty(rom); + struct cbfs_file *c = rom_find_empty(rom); unsigned int offset; unsigned int csize; @@ -140,7 +140,7 @@ int rom_add(struct rom *rom, const char *name, void *buffer, int size, int type) return -1; } - csize = sizeof(struct romfs_file) + ALIGN(strlen(name), 16) + size; + csize = sizeof(struct cbfs_file) + ALIGN(strlen(name), 16) + size; offset = ROM_OFFSET(rom, c); @@ -154,14 +154,14 @@ int rom_add(struct rom *rom, const char *name, void *buffer, int size, int type) strcpy(c->magic, COMPONENT_MAGIC); - csize = sizeof(struct romfs_file) + ALIGN(strlen(name) + 1, 16); + csize = sizeof(struct cbfs_file) + ALIGN(strlen(name) + 1, 16); c->len = htonl(size); c->offset = htonl(csize); c->type = htonl(type); - memset(ROMFS_NAME(c), 0, ALIGN(strlen(name) + 1, 16)); - strcpy((char *)ROMFS_NAME(c), name); + memset(CBFS_NAME(c), 0, ALIGN(strlen(name) + 1, 16)); + strcpy((char *)CBFS_NAME(c), name); memcpy(((unsigned char *)c) + csize, buffer, size); return 0; diff --git a/util/romtool/print.c b/util/cbfstool/print.c index fb5d809135..7eb9ee452c 100644 --- a/util/romtool/print.c +++ b/util/cbfstool/print.c @@ -1,5 +1,5 @@ /* - * romtool + * cbfstool * * Copyright (C) 2008 Jordan Crouse <jordan@cosmicpenguin.net> * @@ -18,7 +18,7 @@ */ #include <string.h> -#include "romtool.h" +#include "cbfstool.h" void print_usage(void) { @@ -31,7 +31,7 @@ int print_handler(struct rom *rom, int argc, char **argv) ntohl(rom->header->bootblocksize), ntohl(rom->header->romsize), ntohl(rom->header->offset)); printf("Alignment: %d bytes\n\n", ntohl(rom->header->align)); - struct romfs_file *c = rom_find_first(rom); + struct cbfs_file *c = rom_find_first(rom); printf("%-30s Offset %-12s Size\n", "Name", "Type"); @@ -39,13 +39,13 @@ int print_handler(struct rom *rom, int argc, char **argv) char type[12]; switch (htonl(c->type)) { - case ROMFS_COMPONENT_STAGE: + case CBFS_COMPONENT_STAGE: strcpy(type, "stage"); break; - case ROMFS_COMPONENT_PAYLOAD: + case CBFS_COMPONENT_PAYLOAD: strcpy(type, "payload"); break; - case ROMFS_COMPONENT_OPTIONROM: + case CBFS_COMPONENT_OPTIONROM: strcpy(type, "optionrom"); break; default: @@ -53,7 +53,7 @@ int print_handler(struct rom *rom, int argc, char **argv) break; } - printf("%-30s 0x%-8x %-12s %d\n", ROMFS_NAME(c), + printf("%-30s 0x%-8x %-12s %d\n", CBFS_NAME(c), ROM_OFFSET(rom, c), type, htonl(c->len)); c = rom_find_next(rom, c); diff --git a/util/romtool/resize.c b/util/cbfstool/resize.c index f08501a02c..157515619c 100644 --- a/util/romtool/resize.c +++ b/util/cbfstool/resize.c @@ -1,5 +1,5 @@ /* - * romtool + * cbfstool * * Copyright (C) 2008 Jordan Crouse <jordan@cosmicpenguin.net> * @@ -23,7 +23,7 @@ #include <unistd.h> #include <sys/mman.h> -#include "romtool.h" +#include "cbfstool.h" void resize_usage(void) { @@ -89,7 +89,7 @@ int resize_handler(struct rom *rom, int argc, char **argv) /* We only have to rewrite the entries if the alignment changed */ if (align != ntohl(rom->header->align)) { - struct romfs_file *c; + struct cbfs_file *c; /* The first entry doesn't have to move */ @@ -97,7 +97,7 @@ int resize_handler(struct rom *rom, int argc, char **argv) offset = rom->header->offset; while (c) { - struct romfs_file *n = rom_find_next(rom, c); + struct cbfs_file *n = rom_find_next(rom, c); unsigned int next; if (n == NULL) @@ -113,7 +113,7 @@ int resize_handler(struct rom *rom, int argc, char **argv) memmove(ROM_PTR(rom, next), n, ntohl(n->offset) + ntohl(n->len)); - c = (struct romfs_file *)ROM_PTR(rom, next); + c = (struct cbfs_file *)ROM_PTR(rom, next); /* If the previous header wasn't overwritten by the change, corrupt the header so we don't accidently find it */ @@ -133,7 +133,7 @@ int resize_handler(struct rom *rom, int argc, char **argv) offset = ROM_READL(rom, size - 12); - rom->header = (struct romfs_header *) + rom->header = (struct cbfs_header *) ROM_PTR(rom, size - (0xFFFFFFFF - offset) - 1); /* Put the new values in the header */ diff --git a/util/romtool/tools/Makefile b/util/cbfstool/tools/Makefile index bcecf46636..bcecf46636 100644 --- a/util/romtool/tools/Makefile +++ b/util/cbfstool/tools/Makefile diff --git a/util/romtool/tools/common.c b/util/cbfstool/tools/common.c index d2aff462bf..377561bc52 100644 --- a/util/romtool/tools/common.c +++ b/util/cbfstool/tools/common.c @@ -1,5 +1,5 @@ /* - * romtool + * cbfstool * * Copyright (C) 2008 Jordan Crouse <jordan@cosmicpenguin.net> * diff --git a/util/romtool/tools/common.h b/util/cbfstool/tools/common.h index 58230c677f..146c828f6a 100644 --- a/util/romtool/tools/common.h +++ b/util/cbfstool/tools/common.h @@ -1,5 +1,5 @@ /* - * romtool + * cbfstool * * Copyright (C) 2008 Jordan Crouse <jordan@cosmicpenguin.net> * diff --git a/util/romtool/tools/compress.c b/util/cbfstool/tools/compress.c index d4cd152a1a..fb8fe82931 100644 --- a/util/romtool/tools/compress.c +++ b/util/cbfstool/tools/compress.c @@ -1,5 +1,5 @@ /* - * romtool + * cbfstool * * Copyright (C) 2008 Jordan Crouse <jordan@cosmicpenguin.net> * diff --git a/util/romtool/tools/elf.h b/util/cbfstool/tools/elf.h index bbdce6e83b..bbdce6e83b 100644 --- a/util/romtool/tools/elf.h +++ b/util/cbfstool/tools/elf.h diff --git a/util/romtool/tools/lzma/C/7zip/Common/InBuffer.h b/util/cbfstool/tools/lzma/C/7zip/Common/InBuffer.h index a59ecefacd..a59ecefacd 100644 --- a/util/romtool/tools/lzma/C/7zip/Common/InBuffer.h +++ b/util/cbfstool/tools/lzma/C/7zip/Common/InBuffer.h diff --git a/util/romtool/tools/lzma/C/7zip/Common/OutBuffer.cpp b/util/cbfstool/tools/lzma/C/7zip/Common/OutBuffer.cpp index 45da6d7f00..45da6d7f00 100644 --- a/util/romtool/tools/lzma/C/7zip/Common/OutBuffer.cpp +++ b/util/cbfstool/tools/lzma/C/7zip/Common/OutBuffer.cpp diff --git a/util/romtool/tools/lzma/C/7zip/Common/OutBuffer.h b/util/cbfstool/tools/lzma/C/7zip/Common/OutBuffer.h index 37eefbdfcd..37eefbdfcd 100644 --- a/util/romtool/tools/lzma/C/7zip/Common/OutBuffer.h +++ b/util/cbfstool/tools/lzma/C/7zip/Common/OutBuffer.h diff --git a/util/romtool/tools/lzma/C/7zip/Common/StdAfx.h b/util/cbfstool/tools/lzma/C/7zip/Common/StdAfx.h index d7d9211b09..d7d9211b09 100644 --- a/util/romtool/tools/lzma/C/7zip/Common/StdAfx.h +++ b/util/cbfstool/tools/lzma/C/7zip/Common/StdAfx.h diff --git a/util/romtool/tools/lzma/C/7zip/Common/StreamUtils.cpp b/util/cbfstool/tools/lzma/C/7zip/Common/StreamUtils.cpp index 712a78585a..712a78585a 100644 --- a/util/romtool/tools/lzma/C/7zip/Common/StreamUtils.cpp +++ b/util/cbfstool/tools/lzma/C/7zip/Common/StreamUtils.cpp diff --git a/util/romtool/tools/lzma/C/7zip/Common/StreamUtils.h b/util/cbfstool/tools/lzma/C/7zip/Common/StreamUtils.h index c8cd8cef1a..c8cd8cef1a 100644 --- a/util/romtool/tools/lzma/C/7zip/Common/StreamUtils.h +++ b/util/cbfstool/tools/lzma/C/7zip/Common/StreamUtils.h diff --git a/util/romtool/tools/lzma/C/7zip/Compress/LZ/BinTree/BinTree.h b/util/cbfstool/tools/lzma/C/7zip/Compress/LZ/BinTree/BinTree.h index d464d3b59c..d464d3b59c 100644 --- a/util/romtool/tools/lzma/C/7zip/Compress/LZ/BinTree/BinTree.h +++ b/util/cbfstool/tools/lzma/C/7zip/Compress/LZ/BinTree/BinTree.h diff --git a/util/romtool/tools/lzma/C/7zip/Compress/LZ/BinTree/BinTree2.h b/util/cbfstool/tools/lzma/C/7zip/Compress/LZ/BinTree/BinTree2.h index c5b3939e47..c5b3939e47 100644 --- a/util/romtool/tools/lzma/C/7zip/Compress/LZ/BinTree/BinTree2.h +++ b/util/cbfstool/tools/lzma/C/7zip/Compress/LZ/BinTree/BinTree2.h diff --git a/util/romtool/tools/lzma/C/7zip/Compress/LZ/BinTree/BinTree3.h b/util/cbfstool/tools/lzma/C/7zip/Compress/LZ/BinTree/BinTree3.h index 74eb73e293..74eb73e293 100644 --- a/util/romtool/tools/lzma/C/7zip/Compress/LZ/BinTree/BinTree3.h +++ b/util/cbfstool/tools/lzma/C/7zip/Compress/LZ/BinTree/BinTree3.h diff --git a/util/romtool/tools/lzma/C/7zip/Compress/LZ/BinTree/BinTree4.h b/util/cbfstool/tools/lzma/C/7zip/Compress/LZ/BinTree/BinTree4.h index 62fc242aac..62fc242aac 100644 --- a/util/romtool/tools/lzma/C/7zip/Compress/LZ/BinTree/BinTree4.h +++ b/util/cbfstool/tools/lzma/C/7zip/Compress/LZ/BinTree/BinTree4.h diff --git a/util/romtool/tools/lzma/C/7zip/Compress/LZ/BinTree/BinTreeMain.h b/util/cbfstool/tools/lzma/C/7zip/Compress/LZ/BinTree/BinTreeMain.h index 61d1121043..61d1121043 100644 --- a/util/romtool/tools/lzma/C/7zip/Compress/LZ/BinTree/BinTreeMain.h +++ b/util/cbfstool/tools/lzma/C/7zip/Compress/LZ/BinTree/BinTreeMain.h diff --git a/util/romtool/tools/lzma/C/7zip/Compress/LZ/HashChain/HC4.h b/util/cbfstool/tools/lzma/C/7zip/Compress/LZ/HashChain/HC4.h index 949863be5e..949863be5e 100644 --- a/util/romtool/tools/lzma/C/7zip/Compress/LZ/HashChain/HC4.h +++ b/util/cbfstool/tools/lzma/C/7zip/Compress/LZ/HashChain/HC4.h diff --git a/util/romtool/tools/lzma/C/7zip/Compress/LZ/HashChain/HCMain.h b/util/cbfstool/tools/lzma/C/7zip/Compress/LZ/HashChain/HCMain.h index fafce39797..fafce39797 100644 --- a/util/romtool/tools/lzma/C/7zip/Compress/LZ/HashChain/HCMain.h +++ b/util/cbfstool/tools/lzma/C/7zip/Compress/LZ/HashChain/HCMain.h diff --git a/util/romtool/tools/lzma/C/7zip/Compress/LZ/IMatchFinder.h b/util/cbfstool/tools/lzma/C/7zip/Compress/LZ/IMatchFinder.h index 4bbc14f35a..4bbc14f35a 100644 --- a/util/romtool/tools/lzma/C/7zip/Compress/LZ/IMatchFinder.h +++ b/util/cbfstool/tools/lzma/C/7zip/Compress/LZ/IMatchFinder.h diff --git a/util/romtool/tools/lzma/C/7zip/Compress/LZ/LZInWindow.cpp b/util/cbfstool/tools/lzma/C/7zip/Compress/LZ/LZInWindow.cpp index a0f791173a..a0f791173a 100644 --- a/util/romtool/tools/lzma/C/7zip/Compress/LZ/LZInWindow.cpp +++ b/util/cbfstool/tools/lzma/C/7zip/Compress/LZ/LZInWindow.cpp diff --git a/util/romtool/tools/lzma/C/7zip/Compress/LZ/LZInWindow.h b/util/cbfstool/tools/lzma/C/7zip/Compress/LZ/LZInWindow.h index 87cb8e94fa..87cb8e94fa 100644 --- a/util/romtool/tools/lzma/C/7zip/Compress/LZ/LZInWindow.h +++ b/util/cbfstool/tools/lzma/C/7zip/Compress/LZ/LZInWindow.h diff --git a/util/romtool/tools/lzma/C/7zip/Compress/LZ/StdAfx.h b/util/cbfstool/tools/lzma/C/7zip/Compress/LZ/StdAfx.h index 3de038a4ff..3de038a4ff 100644 --- a/util/romtool/tools/lzma/C/7zip/Compress/LZ/StdAfx.h +++ b/util/cbfstool/tools/lzma/C/7zip/Compress/LZ/StdAfx.h diff --git a/util/romtool/tools/lzma/C/7zip/Compress/LZMA/LZMA.h b/util/cbfstool/tools/lzma/C/7zip/Compress/LZMA/LZMA.h index d53296ee70..d53296ee70 100644 --- a/util/romtool/tools/lzma/C/7zip/Compress/LZMA/LZMA.h +++ b/util/cbfstool/tools/lzma/C/7zip/Compress/LZMA/LZMA.h diff --git a/util/romtool/tools/lzma/C/7zip/Compress/LZMA/LZMAEncoder.cpp b/util/cbfstool/tools/lzma/C/7zip/Compress/LZMA/LZMAEncoder.cpp index b6a2f7d591..b6a2f7d591 100644 --- a/util/romtool/tools/lzma/C/7zip/Compress/LZMA/LZMAEncoder.cpp +++ b/util/cbfstool/tools/lzma/C/7zip/Compress/LZMA/LZMAEncoder.cpp diff --git a/util/romtool/tools/lzma/C/7zip/Compress/LZMA/LZMAEncoder.h b/util/cbfstool/tools/lzma/C/7zip/Compress/LZMA/LZMAEncoder.h index 55ac80c07c..55ac80c07c 100644 --- a/util/romtool/tools/lzma/C/7zip/Compress/LZMA/LZMAEncoder.h +++ b/util/cbfstool/tools/lzma/C/7zip/Compress/LZMA/LZMAEncoder.h diff --git a/util/romtool/tools/lzma/C/7zip/Compress/LZMA/StdAfx.h b/util/cbfstool/tools/lzma/C/7zip/Compress/LZMA/StdAfx.h index 83fdd22d58..83fdd22d58 100644 --- a/util/romtool/tools/lzma/C/7zip/Compress/LZMA/StdAfx.h +++ b/util/cbfstool/tools/lzma/C/7zip/Compress/LZMA/StdAfx.h diff --git a/util/romtool/tools/lzma/C/7zip/Compress/RangeCoder/RangeCoder.h b/util/cbfstool/tools/lzma/C/7zip/Compress/RangeCoder/RangeCoder.h index 9828bc4b94..9828bc4b94 100644 --- a/util/romtool/tools/lzma/C/7zip/Compress/RangeCoder/RangeCoder.h +++ b/util/cbfstool/tools/lzma/C/7zip/Compress/RangeCoder/RangeCoder.h diff --git a/util/romtool/tools/lzma/C/7zip/Compress/RangeCoder/RangeCoderBit.cpp b/util/cbfstool/tools/lzma/C/7zip/Compress/RangeCoder/RangeCoderBit.cpp index 8d273c8f93..8d273c8f93 100644 --- a/util/romtool/tools/lzma/C/7zip/Compress/RangeCoder/RangeCoderBit.cpp +++ b/util/cbfstool/tools/lzma/C/7zip/Compress/RangeCoder/RangeCoderBit.cpp diff --git a/util/romtool/tools/lzma/C/7zip/Compress/RangeCoder/RangeCoderBit.h b/util/cbfstool/tools/lzma/C/7zip/Compress/RangeCoder/RangeCoderBit.h index 64538e6879..64538e6879 100644 --- a/util/romtool/tools/lzma/C/7zip/Compress/RangeCoder/RangeCoderBit.h +++ b/util/cbfstool/tools/lzma/C/7zip/Compress/RangeCoder/RangeCoderBit.h diff --git a/util/romtool/tools/lzma/C/7zip/Compress/RangeCoder/RangeCoderBitTree.h b/util/cbfstool/tools/lzma/C/7zip/Compress/RangeCoder/RangeCoderBitTree.h index 1fa023f3b8..1fa023f3b8 100644 --- a/util/romtool/tools/lzma/C/7zip/Compress/RangeCoder/RangeCoderBitTree.h +++ b/util/cbfstool/tools/lzma/C/7zip/Compress/RangeCoder/RangeCoderBitTree.h diff --git a/util/romtool/tools/lzma/C/7zip/Compress/RangeCoder/RangeCoderOpt.h b/util/cbfstool/tools/lzma/C/7zip/Compress/RangeCoder/RangeCoderOpt.h index 829fc83d77..829fc83d77 100644 --- a/util/romtool/tools/lzma/C/7zip/Compress/RangeCoder/RangeCoderOpt.h +++ b/util/cbfstool/tools/lzma/C/7zip/Compress/RangeCoder/RangeCoderOpt.h diff --git a/util/romtool/tools/lzma/C/7zip/Compress/RangeCoder/StdAfx.h b/util/cbfstool/tools/lzma/C/7zip/Compress/RangeCoder/StdAfx.h index 21c2fd780c..21c2fd780c 100644 --- a/util/romtool/tools/lzma/C/7zip/Compress/RangeCoder/StdAfx.h +++ b/util/cbfstool/tools/lzma/C/7zip/Compress/RangeCoder/StdAfx.h diff --git a/util/romtool/tools/lzma/C/7zip/Decompress/LzmaDecode.c b/util/cbfstool/tools/lzma/C/7zip/Decompress/LzmaDecode.c index 21bf40bde0..21bf40bde0 100644 --- a/util/romtool/tools/lzma/C/7zip/Decompress/LzmaDecode.c +++ b/util/cbfstool/tools/lzma/C/7zip/Decompress/LzmaDecode.c diff --git a/util/romtool/tools/lzma/C/7zip/Decompress/LzmaDecode.h b/util/cbfstool/tools/lzma/C/7zip/Decompress/LzmaDecode.h index 213062af12..213062af12 100644 --- a/util/romtool/tools/lzma/C/7zip/Decompress/LzmaDecode.h +++ b/util/cbfstool/tools/lzma/C/7zip/Decompress/LzmaDecode.h diff --git a/util/romtool/tools/lzma/C/7zip/ICoder.h b/util/cbfstool/tools/lzma/C/7zip/ICoder.h index 508dac3fd0..508dac3fd0 100644 --- a/util/romtool/tools/lzma/C/7zip/ICoder.h +++ b/util/cbfstool/tools/lzma/C/7zip/ICoder.h diff --git a/util/romtool/tools/lzma/C/7zip/IStream.h b/util/cbfstool/tools/lzma/C/7zip/IStream.h index d92b89aa70..d92b89aa70 100644 --- a/util/romtool/tools/lzma/C/7zip/IStream.h +++ b/util/cbfstool/tools/lzma/C/7zip/IStream.h diff --git a/util/romtool/tools/lzma/C/Common/Alloc.cpp b/util/cbfstool/tools/lzma/C/Common/Alloc.cpp index dcb331ee9f..dcb331ee9f 100644 --- a/util/romtool/tools/lzma/C/Common/Alloc.cpp +++ b/util/cbfstool/tools/lzma/C/Common/Alloc.cpp diff --git a/util/romtool/tools/lzma/C/Common/Alloc.h b/util/cbfstool/tools/lzma/C/Common/Alloc.h index 2ae3891de6..2ae3891de6 100644 --- a/util/romtool/tools/lzma/C/Common/Alloc.h +++ b/util/cbfstool/tools/lzma/C/Common/Alloc.h diff --git a/util/romtool/tools/lzma/C/Common/CRC.cpp b/util/cbfstool/tools/lzma/C/Common/CRC.cpp index 92bc009c2f..92bc009c2f 100644 --- a/util/romtool/tools/lzma/C/Common/CRC.cpp +++ b/util/cbfstool/tools/lzma/C/Common/CRC.cpp diff --git a/util/romtool/tools/lzma/C/Common/CRC.h b/util/cbfstool/tools/lzma/C/Common/CRC.h index c9d43d0055..c9d43d0055 100644 --- a/util/romtool/tools/lzma/C/Common/CRC.h +++ b/util/cbfstool/tools/lzma/C/Common/CRC.h diff --git a/util/romtool/tools/lzma/C/Common/Defs.h b/util/cbfstool/tools/lzma/C/Common/Defs.h index 69b8ecea82..69b8ecea82 100644 --- a/util/romtool/tools/lzma/C/Common/Defs.h +++ b/util/cbfstool/tools/lzma/C/Common/Defs.h diff --git a/util/romtool/tools/lzma/C/Common/MyCom.h b/util/cbfstool/tools/lzma/C/Common/MyCom.h index 8476b57282..8476b57282 100644 --- a/util/romtool/tools/lzma/C/Common/MyCom.h +++ b/util/cbfstool/tools/lzma/C/Common/MyCom.h diff --git a/util/romtool/tools/lzma/C/Common/MyGuidDef.h b/util/cbfstool/tools/lzma/C/Common/MyGuidDef.h index 889ea417b0..889ea417b0 100644 --- a/util/romtool/tools/lzma/C/Common/MyGuidDef.h +++ b/util/cbfstool/tools/lzma/C/Common/MyGuidDef.h diff --git a/util/romtool/tools/lzma/C/Common/MyInitGuid.h b/util/cbfstool/tools/lzma/C/Common/MyInitGuid.h index 53b0f03428..53b0f03428 100644 --- a/util/romtool/tools/lzma/C/Common/MyInitGuid.h +++ b/util/cbfstool/tools/lzma/C/Common/MyInitGuid.h diff --git a/util/romtool/tools/lzma/C/Common/MyUnknown.h b/util/cbfstool/tools/lzma/C/Common/MyUnknown.h index 6cd32caddb..6cd32caddb 100644 --- a/util/romtool/tools/lzma/C/Common/MyUnknown.h +++ b/util/cbfstool/tools/lzma/C/Common/MyUnknown.h diff --git a/util/romtool/tools/lzma/C/Common/MyWindows.h b/util/cbfstool/tools/lzma/C/Common/MyWindows.h index 2929be7c30..2929be7c30 100644 --- a/util/romtool/tools/lzma/C/Common/MyWindows.h +++ b/util/cbfstool/tools/lzma/C/Common/MyWindows.h diff --git a/util/romtool/tools/lzma/C/Common/NewHandler.h b/util/cbfstool/tools/lzma/C/Common/NewHandler.h index 4c1727f824..4c1727f824 100644 --- a/util/romtool/tools/lzma/C/Common/NewHandler.h +++ b/util/cbfstool/tools/lzma/C/Common/NewHandler.h diff --git a/util/romtool/tools/lzma/C/Common/StdAfx.h b/util/cbfstool/tools/lzma/C/Common/StdAfx.h index 2547611bd7..2547611bd7 100644 --- a/util/romtool/tools/lzma/C/Common/StdAfx.h +++ b/util/cbfstool/tools/lzma/C/Common/StdAfx.h diff --git a/util/romtool/tools/lzma/C/Common/Types.h b/util/cbfstool/tools/lzma/C/Common/Types.h index 52d07081e8..52d07081e8 100644 --- a/util/romtool/tools/lzma/C/Common/Types.h +++ b/util/cbfstool/tools/lzma/C/Common/Types.h diff --git a/util/romtool/tools/lzma/C/LGPL.txt b/util/cbfstool/tools/lzma/C/LGPL.txt index f3926a6155..f3926a6155 100644 --- a/util/romtool/tools/lzma/C/LGPL.txt +++ b/util/cbfstool/tools/lzma/C/LGPL.txt diff --git a/util/romtool/tools/lzma/C/ORIGIN b/util/cbfstool/tools/lzma/C/ORIGIN index d1fbb7706d..d631056762 100644 --- a/util/romtool/tools/lzma/C/ORIGIN +++ b/util/cbfstool/tools/lzma/C/ORIGIN @@ -1,3 +1,3 @@ The contents of this directory are extracted from the official LZMA SDK, version lzma442.tar.bz2 , -for the use in mkcromfs. +for the use in mkccbfs. diff --git a/util/romtool/tools/lzma/Makefile b/util/cbfstool/tools/lzma/Makefile index 9ac4ca2ff6..9ac4ca2ff6 100644 --- a/util/romtool/tools/lzma/Makefile +++ b/util/cbfstool/tools/lzma/Makefile diff --git a/util/romtool/tools/lzma/minilzma.cc b/util/cbfstool/tools/lzma/minilzma.cc index 7610910a19..7610910a19 100644 --- a/util/romtool/tools/lzma/minilzma.cc +++ b/util/cbfstool/tools/lzma/minilzma.cc diff --git a/util/romtool/tools/rom-mkpayload.c b/util/cbfstool/tools/rom-mkpayload.c index 190e53a9c8..4466cc1254 100644 --- a/util/romtool/tools/rom-mkpayload.c +++ b/util/cbfstool/tools/rom-mkpayload.c @@ -28,7 +28,7 @@ #include <arpa/inet.h> #include "common.h" -#include "../romfs.h" +#include "../cbfs.h" int parse_elf(unsigned char *input, unsigned char **output, int algo, void (*compress) (char *, int, char *, int *)) @@ -43,7 +43,7 @@ int parse_elf(unsigned char *input, unsigned char **output, int algo, int segments = 1; int isize = 0, osize = 0; int doffset = 0; - struct romfs_payload_segment *segs; + struct cbfs_payload_segment *segs; int i; ehdr = (Elf32_Ehdr *) input; @@ -93,14 +93,14 @@ int parse_elf(unsigned char *input, unsigned char **output, int algo, /* Allocate a block of memory to store the data in */ sptr = - calloc((segments * sizeof(struct romfs_payload_segment)) + isize, + calloc((segments * sizeof(struct cbfs_payload_segment)) + isize, 1); - doffset = (segments * sizeof(struct romfs_payload_segment)); + doffset = (segments * sizeof(struct cbfs_payload_segment)); if (sptr == NULL) goto err; - segs = (struct romfs_payload_segment *)sptr; + segs = (struct cbfs_payload_segment *)sptr; segments = 0; for (i = 0; i < ehdr->e_shnum; i++) { @@ -182,7 +182,7 @@ int parse_elf(unsigned char *input, unsigned char **output, int algo, *output = sptr; - return (segments * sizeof(struct romfs_payload_segment)) + osize; + return (segments * sizeof(struct cbfs_payload_segment)) + osize; err: return -1; @@ -218,10 +218,10 @@ int main(int argc, char **argv) output = optarg; break; case 'l': - algo = ROMFS_COMPRESS_LZMA; + algo = CBFS_COMPRESS_LZMA; break; case 'n': - algo = ROMFS_COMPRESS_NONE; + algo = CBFS_COMPRESS_NONE; break; default: //usage(); @@ -245,10 +245,10 @@ int main(int argc, char **argv) } switch (algo) { - case ROMFS_COMPRESS_NONE: + case CBFS_COMPRESS_NONE: compress = none_compress; break; - case ROMFS_COMPRESS_LZMA: + case CBFS_COMPRESS_LZMA: compress = lzma_compress; break; } diff --git a/util/romtool/tools/rom-mkstage.c b/util/cbfstool/tools/rom-mkstage.c index 7145d9d402..ff43e774fc 100644 --- a/util/romtool/tools/rom-mkstage.c +++ b/util/cbfstool/tools/rom-mkstage.c @@ -27,7 +27,7 @@ #include <sys/stat.h> #include "common.h" -#include "../romfs.h" +#include "../cbfs.h" int parse_elf(unsigned char *input, unsigned char **output, int mode, void (*compress) (char *, int, char *, int *)) @@ -40,7 +40,7 @@ int parse_elf(unsigned char *input, unsigned char **output, int headers; int i; - struct romfs_stage *stage; + struct cbfs_stage *stage; unsigned int data_start, data_end, mem_end; headers = ehdr->e_phnum; @@ -107,14 +107,14 @@ int parse_elf(unsigned char *input, unsigned char **output, } /* Now make the output buffer */ - out = calloc(sizeof(struct romfs_stage) + data_end - data_start, 1); + out = calloc(sizeof(struct cbfs_stage) + data_end - data_start, 1); if (out == NULL) { fprintf(stderr, "E: Unable to allocate memory: %m\n"); return -1; } - stage = (struct romfs_stage *)out; + stage = (struct cbfs_stage *)out; stage->load = data_start; stage->memlen = mem_end - data_start; @@ -122,18 +122,18 @@ int parse_elf(unsigned char *input, unsigned char **output, stage->entry = ehdr->e_entry; compress(buffer, data_end - data_start, - (char *)(out + sizeof(struct romfs_stage)), + (char *)(out + sizeof(struct cbfs_stage)), (int *)&stage->len); *output = out; - return sizeof(struct romfs_stage) + stage->len; + return sizeof(struct cbfs_stage) + stage->len; } int main(int argc, char **argv) { void (*compress) (char *, int, char *, int *); - int algo = ROMFS_COMPRESS_LZMA; + int algo = CBFS_COMPRESS_LZMA; char *output = NULL; char *input = NULL; @@ -160,10 +160,10 @@ int main(int argc, char **argv) output = optarg; break; case 'l': - algo = ROMFS_COMPRESS_LZMA; + algo = CBFS_COMPRESS_LZMA; break; case 'n': - algo = ROMFS_COMPRESS_NONE; + algo = CBFS_COMPRESS_NONE; break; default: //usage(); @@ -185,10 +185,10 @@ int main(int argc, char **argv) } switch (algo) { - case ROMFS_COMPRESS_NONE: + case CBFS_COMPRESS_NONE: compress = none_compress; break; - case ROMFS_COMPRESS_LZMA: + case CBFS_COMPRESS_LZMA: compress = lzma_compress; break; } diff --git a/util/romtool/types.c b/util/cbfstool/types.c index 6e36809764..88b4ea70b9 100644 --- a/util/romtool/types.c +++ b/util/cbfstool/types.c @@ -1,5 +1,5 @@ /* - * romtool + * cbfstool * * Copyright (C) 2008 Jordan Crouse <jordan@cosmicpenguin.net> * @@ -18,7 +18,7 @@ */ #include <string.h> -#include "romtool.h" +#include "cbfstool.h" static const struct { char *type; diff --git a/util/romtool/util.c b/util/cbfstool/util.c index 03479c5095..51905a6d60 100644 --- a/util/romtool/util.c +++ b/util/cbfstool/util.c @@ -1,5 +1,5 @@ /* - * romtool + * cbfstool * * Copyright (C) 2008 Jordan Crouse <jordan@cosmicpenguin.net> * @@ -23,7 +23,7 @@ #include <fcntl.h> #include <sys/stat.h> #include <sys/mman.h> -#include "romtool.h" +#include "cbfstool.h" int get_size(const char *size) { @@ -127,7 +127,7 @@ int open_rom(struct rom *rom, const char *filename) offset = ROM_READL(rom, s.st_size - 4); - rom->header = (struct romfs_header *) + rom->header = (struct cbfs_header *) ROM_PTR(rom, s.st_size - (0xFFFFFFFF - offset) - 1); if (ntohl(rom->header->magic) != HEADER_MAGIC) { @@ -205,11 +205,11 @@ int create_rom(struct rom *rom, const unsigned char *filename, memset(rom->ptr + rom->size - 16, 0, 16); ROM_WRITEL(rom, rom->size - 4, - 0xFFFFFFF0 - sizeof(struct romfs_header)); + 0xFFFFFFF0 - sizeof(struct cbfs_header)); /* This is a pointer to the header for easy access */ - rom->header = (struct romfs_header *) - ROM_PTR(rom, rom->size - 16 - sizeof(struct romfs_header)); + rom->header = (struct cbfs_header *) + ROM_PTR(rom, rom->size - 16 - sizeof(struct cbfs_header)); rom->header->magic = htonl(HEADER_MAGIC); rom->header->romsize = htonl(romsize); @@ -226,7 +226,7 @@ int add_bootblock(struct rom *rom, const char *filename) //unsigned int offset; int fd = size_and_open(filename, &size); int ret; - struct romfs_header tmp; + struct cbfs_header tmp; if (fd == -1) return -1; @@ -238,7 +238,7 @@ int add_bootblock(struct rom *rom, const char *filename) } /* Copy the current header into a temporary buffer */ - memcpy(&tmp, rom->header, sizeof(struct romfs_header)); + memcpy(&tmp, rom->header, sizeof(struct cbfs_header)); /* Copy the bootblock into place at the end of the file */ @@ -254,22 +254,22 @@ int add_bootblock(struct rom *rom, const char *filename) /* FIXME: This should point to a location defined by coreboot */ ROM_WRITEL(rom, rom->size - 4, - 0xFFFFFFF0 - sizeof(struct romfs_header)); + 0xFFFFFFF0 - sizeof(struct cbfs_header)); /* This is a pointer to the header for easy access */ - rom->header = (struct romfs_header *) - ROM_PTR(rom, rom->size - 16 - sizeof(struct romfs_header)); + rom->header = (struct cbfs_header *) + ROM_PTR(rom, rom->size - 16 - sizeof(struct cbfs_header)); #if 0 /* Figure out the new location for the header */ offset = ROM_READL(rom, rom->size - 4); - rom->header = (struct romfs_header *) + rom->header = (struct cbfs_header *) ROM_PTR(rom, offset - (0xFFFFFFFF - rom->size)); #endif /* Replace the LAR header */ - memcpy(rom->header, &tmp, sizeof(struct romfs_header)); + memcpy(rom->header, &tmp, sizeof(struct cbfs_header)); return 0; } diff --git a/util/romtool/EXAMPLE b/util/romtool/EXAMPLE deleted file mode 100644 index 6d5e91710a..0000000000 --- a/util/romtool/EXAMPLE +++ /dev/null @@ -1,8 +0,0 @@ - rm coreboot.rom; -./romtool coreboot.rom create 0x80000 0x10000 /tmp/coreboot.strip -./romtool coreboot.rom add-payload /tmp/filo.elf normal/payload l -./romtool coreboot.rom print -#./romtool coreboot.rom add-stage /tmp/filo.elf normal/payload - -./romtool coreboot.rom print -cp coreboot.rom /home/rminnich/qemutest/ |