mirror of
https://github.com/drasko/codezero.git
synced 2026-01-12 02:43:15 +01:00
Building baremetal containers in build directory
This commit is contained in:
@@ -22,7 +22,6 @@ from config.lib import *
|
||||
class BaremetalContGenerator:
|
||||
def __init__(self):
|
||||
self.CONT_SRC_DIR = '' # Set when container is selected
|
||||
self.BAREMETAL_SRC_BASEDIR = join(PROJROOT, 'conts')
|
||||
self.BAREMETAL_PROJ_SRC_DIR = join(PROJROOT, 'conts/baremetal')
|
||||
|
||||
self.main_builder_name = 'build.py'
|
||||
@@ -114,7 +113,7 @@ class BaremetalContGenerator:
|
||||
for cont in config.containers:
|
||||
if cont.type == "baremetal":
|
||||
# Determine container directory name.
|
||||
self.CONT_SRC_DIR = join(self.BAREMETAL_SRC_BASEDIR, cont.dirname.lower())
|
||||
self.CONT_SRC_DIR = join(join(BUILDDIR, 'cont') + str(cont.id), cont.name)
|
||||
self.build_readme_out = join(self.CONT_SRC_DIR, self.build_readme_name)
|
||||
self.build_desc_out = join(self.CONT_SRC_DIR, self.build_desc_name)
|
||||
self.linker_lds_out = join(join(self.CONT_SRC_DIR, 'include'), \
|
||||
@@ -122,7 +121,7 @@ class BaremetalContGenerator:
|
||||
self.container_h_out = join(join(self.CONT_SRC_DIR, 'include'), \
|
||||
self.container_h_name)
|
||||
|
||||
if not os.path.exists(join(self.BAREMETAL_SRC_BASEDIR, cont.dirname)):
|
||||
if not os.path.exists(self.CONT_SRC_DIR):
|
||||
self.create_baremetal_sources(config, cont)
|
||||
else:
|
||||
# Don't create new sources but update configuration
|
||||
|
||||
@@ -83,15 +83,16 @@ def build_posix_container(config, projpaths, container):
|
||||
def build_default_container(config, projpaths, container):
|
||||
images = []
|
||||
cwd = os.getcwd()
|
||||
projdir = join(join(PROJROOT, 'conts'), container.name)
|
||||
projdir = join(join(BUILDDIR, 'cont') + str(container.id), \
|
||||
container.name)
|
||||
os.chdir(projdir)
|
||||
os.system("scons")
|
||||
os.path.walk(projdir, glob_by_walk, ['*.elf', images])
|
||||
|
||||
# Calculate and store size of pager
|
||||
pager_binary = "conts/" + container.name + "/main.elf"
|
||||
pager_binary = join("cont" + str(container.id), container.name) + "/main.elf"
|
||||
config.containers[container.id].pager_size = \
|
||||
conv_hex(elf_binary_size(join(PROJROOT, pager_binary)))
|
||||
conv_hex(elf_binary_size(join(BUILDDIR, pager_binary)))
|
||||
|
||||
container_packer = DefaultContainerPacker(container, images)
|
||||
return container_packer.pack_container(config)
|
||||
|
||||
Reference in New Issue
Block a user