From e2c2f1f2b1478436d7ba8e1ae5ca84d1f7b47b06 Mon Sep 17 00:00:00 2001 From: Amit Mahajan Date: Fri, 20 Nov 2009 00:19:51 +0530 Subject: [PATCH] Building baremetal containers in build directory --- conts/baremetal/baremetal0/SConstruct | 2 +- conts/baremetal/baremetal1/SConstruct | 2 +- conts/baremetal/baremetal2/SConstruct | 2 +- conts/baremetal/baremetal3/SConstruct | 2 +- scripts/baremetal/baremetal_generator.py | 5 ++--- scripts/conts/containers.py | 7 ++++--- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/conts/baremetal/baremetal0/SConstruct b/conts/baremetal/baremetal0/SConstruct index 67600e7..d546ae1 100644 --- a/conts/baremetal/baremetal0/SConstruct +++ b/conts/baremetal/baremetal0/SConstruct @@ -7,7 +7,7 @@ import os, shelve, sys from os.path import * -PROJRELROOT = '../..' +PROJRELROOT = '../../..' sys.path.append(PROJRELROOT) diff --git a/conts/baremetal/baremetal1/SConstruct b/conts/baremetal/baremetal1/SConstruct index d855e61..159ed3a 100644 --- a/conts/baremetal/baremetal1/SConstruct +++ b/conts/baremetal/baremetal1/SConstruct @@ -7,7 +7,7 @@ import os, shelve, sys from os.path import * -PROJRELROOT = '../..' +PROJRELROOT = '../../..' sys.path.append(PROJRELROOT) diff --git a/conts/baremetal/baremetal2/SConstruct b/conts/baremetal/baremetal2/SConstruct index 63134bb..48674b4 100644 --- a/conts/baremetal/baremetal2/SConstruct +++ b/conts/baremetal/baremetal2/SConstruct @@ -7,7 +7,7 @@ import os, shelve, sys from os.path import * -PROJRELROOT = '../..' +PROJRELROOT = '../../..' sys.path.append(PROJRELROOT) diff --git a/conts/baremetal/baremetal3/SConstruct b/conts/baremetal/baremetal3/SConstruct index 5e5a317..b695949 100644 --- a/conts/baremetal/baremetal3/SConstruct +++ b/conts/baremetal/baremetal3/SConstruct @@ -7,7 +7,7 @@ import os, shelve, sys from os.path import * -PROJRELROOT = '../..' +PROJRELROOT = '../../..' sys.path.append(PROJRELROOT) diff --git a/scripts/baremetal/baremetal_generator.py b/scripts/baremetal/baremetal_generator.py index 2702720..921aa45 100755 --- a/scripts/baremetal/baremetal_generator.py +++ b/scripts/baremetal/baremetal_generator.py @@ -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 diff --git a/scripts/conts/containers.py b/scripts/conts/containers.py index ae79ca0..95a5f5f 100755 --- a/scripts/conts/containers.py +++ b/scripts/conts/containers.py @@ -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)