mirror of
https://github.com/drasko/codezero.git
synced 2026-07-18 05:05:24 +02:00
Added generation of .container informative file for bare containers
This commit is contained in:
@@ -34,7 +34,7 @@ class BareContGenerator:
|
|||||||
|
|
||||||
self.build_script_name = 'SConstruct'
|
self.build_script_name = 'SConstruct'
|
||||||
self.build_readme_name = 'build.readme'
|
self.build_readme_name = 'build.readme'
|
||||||
self.build_desc_name = 'cont.desc'
|
self.build_desc_name = '.container'
|
||||||
|
|
||||||
self.build_script_out = None
|
self.build_script_out = None
|
||||||
self.build_readme_out = None
|
self.build_readme_out = None
|
||||||
@@ -46,11 +46,23 @@ class BareContGenerator:
|
|||||||
shutil.copytree(self.EXAMPLE_PROJ_SRC_DIR, self.CONT_SRC_DIR)
|
shutil.copytree(self.EXAMPLE_PROJ_SRC_DIR, self.CONT_SRC_DIR)
|
||||||
|
|
||||||
def copy_bare_build_desc(self, config, cont):
|
def copy_bare_build_desc(self, config, cont):
|
||||||
with open(self.build_desc_in) as fin:
|
id_header = '[Container ID]\n'
|
||||||
str = fin.read()
|
type_header = '\n[Container Type]\n'
|
||||||
with open(self.build_desc_out, 'w+') as fout:
|
name_header = '\n[Container Name]\n'
|
||||||
# Make any manipulations here
|
lma_header = '\n[Container LMA]\n'
|
||||||
fout.write(str)
|
vma_header = '\n[Container VMA]\n'
|
||||||
|
|
||||||
|
with open(self.build_desc_out, 'w+') as fout:
|
||||||
|
fout.write(id_header)
|
||||||
|
fout.write('\t' + str(cont.id) + '\n')
|
||||||
|
fout.write(type_header)
|
||||||
|
fout.write('\t' + cont.type + '\n')
|
||||||
|
fout.write(name_header)
|
||||||
|
fout.write('\t' + cont.name + '\n')
|
||||||
|
fout.write(lma_header)
|
||||||
|
fout.write('\t' + cont.lma_start + ' - ' + cont.lma_end + '\n')
|
||||||
|
fout.write(vma_header)
|
||||||
|
fout.write('\t' + cont.vma_start + ' - ' + cont.vma_end + '\n')
|
||||||
|
|
||||||
def copy_bare_build_readme(self, config, cont):
|
def copy_bare_build_readme(self, config, cont):
|
||||||
with open(self.build_readme_in) as fin:
|
with open(self.build_readme_in) as fin:
|
||||||
|
|||||||
@@ -21,15 +21,12 @@ file for your reference, and it can be optionally removed.
|
|||||||
.
|
.
|
||||||
|-- SConstruct
|
|-- SConstruct
|
||||||
|-- build.readme
|
|-- build.readme
|
||||||
|-- container.desc
|
|-- .container
|
||||||
|-- include
|
|-- include
|
||||||
| `-- linker.lds.example
|
| `-- linker.lds.example
|
||||||
|-- main.c
|
|-- main.c
|
||||||
`-- src
|
`-- src
|
||||||
|-- test.c
|
|-- test.c
|
||||||
|-- test1.c
|
|
||||||
|-- test2.c
|
|
||||||
`-- test3.c
|
|
||||||
|
|
||||||
In the above directory tree:
|
In the above directory tree:
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
[Container Name]
|
||||||
|
|
||||||
|
[Container LMA]
|
||||||
|
|
||||||
|
[Container VMA]
|
||||||
|
|
||||||
|
[Container Type]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user