mirror of
https://github.com/drasko/codezero.git
synced 2026-01-12 10:53:16 +01:00
configuration_retrieve pending work done
This commit is contained in:
@@ -24,12 +24,12 @@ from packall import *
|
||||
|
||||
def build_linux_container(config, projpaths, container):
|
||||
linux_builder = LinuxBuilder(projpaths, container)
|
||||
linux_builder.build_linux()
|
||||
linux_builder.build_linux(config)
|
||||
|
||||
rootfs_builder = RootfsBuilder(projpaths, container)
|
||||
rootfs_builder.build_rootfs()
|
||||
rootfs_builder.build_rootfs(config)
|
||||
atags_builder = AtagsBuilder(projpaths, container)
|
||||
atags_builder.build_atags()
|
||||
atags_builder.build_atags(config)
|
||||
|
||||
# Calculate and store size of pager
|
||||
pager_binary = \
|
||||
@@ -40,7 +40,7 @@ def build_linux_container(config, projpaths, container):
|
||||
linux_container_packer = \
|
||||
LinuxContainerPacker(container, linux_builder, \
|
||||
rootfs_builder, atags_builder)
|
||||
return linux_container_packer.pack_container()
|
||||
return linux_container_packer.pack_container(config)
|
||||
|
||||
def glob_by_walk(arg, dirname, names):
|
||||
ext, imglist = arg
|
||||
@@ -75,7 +75,7 @@ def build_posix_container(config, projpaths, container):
|
||||
conv_hex(elf_binary_size(join(BUILDDIR, pager_binary)))
|
||||
|
||||
container_packer = DefaultContainerPacker(container, images)
|
||||
return container_packer.pack_container()
|
||||
return container_packer.pack_container(config)
|
||||
|
||||
# We simply use SCons to figure all this out from container.id
|
||||
# Builds the test container.
|
||||
@@ -93,7 +93,7 @@ def build_test_container(config, projpaths, container):
|
||||
# TODO: Need to Calculate and store size of pager
|
||||
|
||||
container_packer = DefaultContainerPacker(container, images)
|
||||
return container_packer.pack_container()
|
||||
return container_packer.pack_container(config)
|
||||
|
||||
# This simply calls SCons on a given container, and collects
|
||||
# all images with .elf extension, instead of using whole classes
|
||||
@@ -112,7 +112,7 @@ def build_default_container(config, projpaths, container):
|
||||
conv_hex(elf_binary_size(join(PROJROOT, pager_binary)))
|
||||
|
||||
container_packer = DefaultContainerPacker(container, images)
|
||||
return container_packer.pack_container()
|
||||
return container_packer.pack_container(config)
|
||||
|
||||
def build_all_containers():
|
||||
config = configuration_retrieve()
|
||||
@@ -134,7 +134,7 @@ def build_all_containers():
|
||||
configuration_save(config)
|
||||
all_cont_packer = AllContainerPacker(cont_images, config.containers)
|
||||
|
||||
return all_cont_packer.pack_all()
|
||||
return all_cont_packer.pack_all(config)
|
||||
|
||||
if __name__ == "__main__":
|
||||
build_all_containers()
|
||||
|
||||
@@ -91,16 +91,10 @@ class LinuxContainerPacker:
|
||||
f.write(file_body)
|
||||
f.close()
|
||||
|
||||
def pack_container(self):
|
||||
# TODO: Need to sort this, we cannot call it in global space
|
||||
# as configuration file is not presnt in beginning
|
||||
config = configuration_retrieve()
|
||||
|
||||
self.generate_container_lds([self.kernel_image_in, \
|
||||
self.rootfs_elf_in, \
|
||||
def pack_container(self, config):
|
||||
self.generate_container_lds([self.kernel_image_in, self.rootfs_elf_in, \
|
||||
self.atags_elf_in])
|
||||
self.generate_container_assembler([self.kernel_image_in, \
|
||||
self.rootfs_elf_in, \
|
||||
self.generate_container_assembler([self.kernel_image_in, self.rootfs_elf_in, \
|
||||
self.atags_elf_in])
|
||||
os.system(config.user_toolchain + "gcc " + "-nostdlib -o %s -T%s %s" \
|
||||
% (self.container_elf_out, self.container_lds_out, \
|
||||
@@ -158,11 +152,7 @@ class DefaultContainerPacker:
|
||||
f.write(file_body)
|
||||
f.close()
|
||||
|
||||
def pack_container(self):
|
||||
# TODO: Need to sort this, we cannot call it in global space
|
||||
# as configuration file is not presnt in beginning
|
||||
config = configuration_retrieve()
|
||||
|
||||
def pack_container(self, config):
|
||||
self.generate_container_lds(self.images_in)
|
||||
self.generate_container_assembler(self.images_in)
|
||||
os.system(config.user_toolchain + "gcc " + "-nostdlib -o %s -T%s %s" \
|
||||
|
||||
@@ -76,11 +76,7 @@ class AllContainerPacker:
|
||||
file_body += containers_lds_end
|
||||
f.write(file_body)
|
||||
|
||||
def pack_all(self):
|
||||
# TODO: Need to sort this, we cannot call it in global space
|
||||
# as configuration file is not presnt in beginning
|
||||
config = configuration_retrieve()
|
||||
|
||||
def pack_all(self, config):
|
||||
self.generate_container_lds(self.containers_lds_out)
|
||||
self.generate_container_S(self.containers_S_out)
|
||||
os.system(config.user_toolchain + "gcc " + "-nostdlib -o %s -T%s %s" \
|
||||
|
||||
Reference in New Issue
Block a user