Building baremetal containers in build directory

This commit is contained in:
Amit Mahajan
2009-11-20 00:19:51 +05:30
parent 8a7b9dbcdf
commit e2c2f1f2b1
6 changed files with 10 additions and 10 deletions

View File

@@ -7,7 +7,7 @@
import os, shelve, sys import os, shelve, sys
from os.path import * from os.path import *
PROJRELROOT = '../..' PROJRELROOT = '../../..'
sys.path.append(PROJRELROOT) sys.path.append(PROJRELROOT)

View File

@@ -7,7 +7,7 @@
import os, shelve, sys import os, shelve, sys
from os.path import * from os.path import *
PROJRELROOT = '../..' PROJRELROOT = '../../..'
sys.path.append(PROJRELROOT) sys.path.append(PROJRELROOT)

View File

@@ -7,7 +7,7 @@
import os, shelve, sys import os, shelve, sys
from os.path import * from os.path import *
PROJRELROOT = '../..' PROJRELROOT = '../../..'
sys.path.append(PROJRELROOT) sys.path.append(PROJRELROOT)

View File

@@ -7,7 +7,7 @@
import os, shelve, sys import os, shelve, sys
from os.path import * from os.path import *
PROJRELROOT = '../..' PROJRELROOT = '../../..'
sys.path.append(PROJRELROOT) sys.path.append(PROJRELROOT)

View File

@@ -22,7 +22,6 @@ from config.lib import *
class BaremetalContGenerator: class BaremetalContGenerator:
def __init__(self): def __init__(self):
self.CONT_SRC_DIR = '' # Set when container is selected 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.BAREMETAL_PROJ_SRC_DIR = join(PROJROOT, 'conts/baremetal')
self.main_builder_name = 'build.py' self.main_builder_name = 'build.py'
@@ -114,7 +113,7 @@ class BaremetalContGenerator:
for cont in config.containers: for cont in config.containers:
if cont.type == "baremetal": if cont.type == "baremetal":
# Determine container directory name. # 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_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.build_desc_out = join(self.CONT_SRC_DIR, self.build_desc_name)
self.linker_lds_out = join(join(self.CONT_SRC_DIR, 'include'), \ 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_out = join(join(self.CONT_SRC_DIR, 'include'), \
self.container_h_name) 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) self.create_baremetal_sources(config, cont)
else: else:
# Don't create new sources but update configuration # Don't create new sources but update configuration

View File

@@ -83,15 +83,16 @@ def build_posix_container(config, projpaths, container):
def build_default_container(config, projpaths, container): def build_default_container(config, projpaths, container):
images = [] images = []
cwd = os.getcwd() cwd = os.getcwd()
projdir = join(join(PROJROOT, 'conts'), container.name) projdir = join(join(BUILDDIR, 'cont') + str(container.id), \
container.name)
os.chdir(projdir) os.chdir(projdir)
os.system("scons") os.system("scons")
os.path.walk(projdir, glob_by_walk, ['*.elf', images]) os.path.walk(projdir, glob_by_walk, ['*.elf', images])
# Calculate and store size of pager # 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 = \ 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) container_packer = DefaultContainerPacker(container, images)
return container_packer.pack_container(config) return container_packer.pack_container(config)