binman: Rename TYPE_STAGE to TYPE_LEGACY_STAGE
In preparation for changing how stages are stored, rename the existing stage tag. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -118,7 +118,7 @@ static int do_cbfs_ls(struct cmd_tbl *cmdtp, int flag, int argc,
|
|||||||
case CBFS_TYPE_CBFSHEADER:
|
case CBFS_TYPE_CBFSHEADER:
|
||||||
type_name = "cbfs header";
|
type_name = "cbfs header";
|
||||||
break;
|
break;
|
||||||
case CBFS_TYPE_STAGE:
|
case CBFS_TYPE_LEGACY_STAGE:
|
||||||
type_name = "stage";
|
type_name = "stage";
|
||||||
break;
|
break;
|
||||||
case CBFS_TYPE_PAYLOAD:
|
case CBFS_TYPE_PAYLOAD:
|
||||||
|
@@ -22,7 +22,7 @@ enum cbfs_result {
|
|||||||
enum cbfs_filetype {
|
enum cbfs_filetype {
|
||||||
CBFS_TYPE_BOOTBLOCK = 0x01,
|
CBFS_TYPE_BOOTBLOCK = 0x01,
|
||||||
CBFS_TYPE_CBFSHEADER = 0x02,
|
CBFS_TYPE_CBFSHEADER = 0x02,
|
||||||
CBFS_TYPE_STAGE = 0x10,
|
CBFS_TYPE_LEGACY_STAGE = 0x10,
|
||||||
CBFS_TYPE_PAYLOAD = 0x20,
|
CBFS_TYPE_PAYLOAD = 0x20,
|
||||||
CBFS_TYPE_SELF = CBFS_TYPE_PAYLOAD,
|
CBFS_TYPE_SELF = CBFS_TYPE_PAYLOAD,
|
||||||
|
|
||||||
|
@@ -96,7 +96,7 @@ ARCH_NAMES = {
|
|||||||
|
|
||||||
# File types. Only supported ones are included here
|
# File types. Only supported ones are included here
|
||||||
TYPE_CBFSHEADER = 0x02 # Master header, HEADER_FORMAT
|
TYPE_CBFSHEADER = 0x02 # Master header, HEADER_FORMAT
|
||||||
TYPE_STAGE = 0x10 # Stage, holding an executable, see STAGE_FORMAT
|
TYPE_LEGACY_STAGE = 0x10 # Stage, holding an executable
|
||||||
TYPE_RAW = 0x50 # Raw file, possibly compressed
|
TYPE_RAW = 0x50 # Raw file, possibly compressed
|
||||||
TYPE_EMPTY = 0xffffffff # Empty data
|
TYPE_EMPTY = 0xffffffff # Empty data
|
||||||
|
|
||||||
@@ -265,7 +265,7 @@ class CbfsFile(object):
|
|||||||
Returns:
|
Returns:
|
||||||
CbfsFile object containing the file information
|
CbfsFile object containing the file information
|
||||||
"""
|
"""
|
||||||
cfile = CbfsFile(name, TYPE_STAGE, data, cbfs_offset)
|
cfile = CbfsFile(name, TYPE_LEGACY_STAGE, data, cbfs_offset)
|
||||||
cfile.base_address = base_address
|
cfile.base_address = base_address
|
||||||
return cfile
|
return cfile
|
||||||
|
|
||||||
@@ -326,7 +326,7 @@ class CbfsFile(object):
|
|||||||
"""
|
"""
|
||||||
name = _pack_string(self.name)
|
name = _pack_string(self.name)
|
||||||
hdr_len = len(name) + FILE_HEADER_LEN
|
hdr_len = len(name) + FILE_HEADER_LEN
|
||||||
if self.ftype == TYPE_STAGE:
|
if self.ftype == TYPE_LEGACY_STAGE:
|
||||||
pass
|
pass
|
||||||
elif self.ftype == TYPE_RAW:
|
elif self.ftype == TYPE_RAW:
|
||||||
if self.compress:
|
if self.compress:
|
||||||
@@ -354,7 +354,7 @@ class CbfsFile(object):
|
|||||||
attr = b''
|
attr = b''
|
||||||
pad = b''
|
pad = b''
|
||||||
data = self.data
|
data = self.data
|
||||||
if self.ftype == TYPE_STAGE:
|
if self.ftype == TYPE_LEGACY_STAGE:
|
||||||
elf_data = elf.DecodeElf(data, self.base_address)
|
elf_data = elf.DecodeElf(data, self.base_address)
|
||||||
content = struct.pack(STAGE_FORMAT, self.compress,
|
content = struct.pack(STAGE_FORMAT, self.compress,
|
||||||
elf_data.entry, elf_data.load,
|
elf_data.entry, elf_data.load,
|
||||||
@@ -639,7 +639,7 @@ class CbfsReader(object):
|
|||||||
files: Ordered list of CbfsFile objects
|
files: Ordered list of CbfsFile objects
|
||||||
align: Alignment to use for files, typically ENTRT_ALIGN
|
align: Alignment to use for files, typically ENTRT_ALIGN
|
||||||
stage_base_address: Base address to use when mapping ELF files into the
|
stage_base_address: Base address to use when mapping ELF files into the
|
||||||
CBFS for TYPE_STAGE files. If this is larger than the code address
|
CBFS for TYPE_LEGACY_STAGE files. If this is larger than the code address
|
||||||
of the ELF file, then data at the start of the ELF file will not
|
of the ELF file, then data at the start of the ELF file will not
|
||||||
appear in the CBFS. Currently there are no tests for behaviour as
|
appear in the CBFS. Currently there are no tests for behaviour as
|
||||||
documentation is sparse
|
documentation is sparse
|
||||||
@@ -750,7 +750,7 @@ class CbfsReader(object):
|
|||||||
fd.seek(cbfs_offset, io.SEEK_SET)
|
fd.seek(cbfs_offset, io.SEEK_SET)
|
||||||
if ftype == TYPE_CBFSHEADER:
|
if ftype == TYPE_CBFSHEADER:
|
||||||
self._read_header(fd)
|
self._read_header(fd)
|
||||||
elif ftype == TYPE_STAGE:
|
elif ftype == TYPE_LEGACY_STAGE:
|
||||||
data = fd.read(STAGE_LEN)
|
data = fd.read(STAGE_LEN)
|
||||||
cfile = CbfsFile.stage(self.stage_base_address, name, b'',
|
cfile = CbfsFile.stage(self.stage_base_address, name, b'',
|
||||||
cbfs_offset)
|
cbfs_offset)
|
||||||
|
@@ -490,7 +490,8 @@ class TestCbfs(unittest.TestCase):
|
|||||||
load = 0xfef20000
|
load = 0xfef20000
|
||||||
entry = load + 2
|
entry = load + 2
|
||||||
|
|
||||||
cfile = self._check_uboot(cbfs, cbfs_util.TYPE_STAGE, offset=0x20,
|
cfile = self._check_uboot(cbfs, cbfs_util.TYPE_LEGACY_STAGE,
|
||||||
|
offset=0x20,
|
||||||
data=U_BOOT_DATA + U_BOOT_DTB_DATA)
|
data=U_BOOT_DATA + U_BOOT_DTB_DATA)
|
||||||
|
|
||||||
self.assertEqual(entry, cfile.entry)
|
self.assertEqual(entry, cfile.entry)
|
||||||
|
Reference in New Issue
Block a user