add filename to buildrom
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1117 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
parent
ed10c390ad
commit
e27b08d41c
|
@ -428,10 +428,17 @@ class romimage:
|
||||||
|
|
||||||
class buildrom:
|
class buildrom:
|
||||||
"""A buildrom statement"""
|
"""A buildrom statement"""
|
||||||
def __init__ (self, size, roms):
|
def __init__ (self, filename, size, roms):
|
||||||
|
self.name = filename
|
||||||
self.size = size
|
self.size = size
|
||||||
self.roms = roms
|
self.roms = roms
|
||||||
|
|
||||||
|
def __len__ (self):
|
||||||
|
return len(self.roms)
|
||||||
|
|
||||||
|
def __getitem__(self,i):
|
||||||
|
return self.roms[i]
|
||||||
|
|
||||||
class initinclude:
|
class initinclude:
|
||||||
"""include file for initialization code"""
|
"""include file for initialization code"""
|
||||||
def __init__ (self, str, path):
|
def __init__ (self, str, path):
|
||||||
|
@ -1073,10 +1080,10 @@ def mainboard(path):
|
||||||
curimage.setroot(partstack.tos())
|
curimage.setroot(partstack.tos())
|
||||||
partpop()
|
partpop()
|
||||||
|
|
||||||
def addbuildrom(size, roms):
|
def addbuildrom(filename, size, roms):
|
||||||
global buildroms
|
global buildroms
|
||||||
print "Build ROM size %d" % size
|
print "Build ROM size %d" % size
|
||||||
b = buildrom(size, roms)
|
b = buildrom(filename, size, roms)
|
||||||
buildroms.append(b)
|
buildroms.append(b)
|
||||||
|
|
||||||
def addinitobject(object_name):
|
def addinitobject(object_name):
|
||||||
|
@ -1518,7 +1525,7 @@ parser Config:
|
||||||
( STR {{ s = s + "," + STR }}
|
( STR {{ s = s + "," + STR }}
|
||||||
)* {{ return eval(s + ')') }}
|
)* {{ return eval(s + ')') }}
|
||||||
|
|
||||||
rule buildrom: BUILDROM expr roms {{ addbuildrom(expr, roms) }}
|
rule buildrom: BUILDROM DIRPATH expr roms {{ addbuildrom(DIRPATH, expr, roms) }}
|
||||||
|
|
||||||
rule romstmts: romimage
|
rule romstmts: romimage
|
||||||
| buildrom
|
| buildrom
|
||||||
|
@ -1781,7 +1788,7 @@ def writemakefile(path):
|
||||||
file.write("all: ")
|
file.write("all: ")
|
||||||
for i in romimages.keys():
|
for i in romimages.keys():
|
||||||
file.write("%s-rom " % i)
|
file.write("%s-rom " % i)
|
||||||
file.write("\n\n")
|
file.write("buildroms\n\n")
|
||||||
for i, o in romimages.items():
|
for i, o in romimages.items():
|
||||||
file.write("%s-rom:\n" % o.getname())
|
file.write("%s-rom:\n" % o.getname())
|
||||||
file.write("\tif (cd %s; \\\n" % o.getname())
|
file.write("\tif (cd %s; \\\n" % o.getname())
|
||||||
|
@ -1794,6 +1801,15 @@ def writemakefile(path):
|
||||||
for i, o in romimages.items():
|
for i, o in romimages.items():
|
||||||
file.write("%s-clean:\n" % o.getname())
|
file.write("%s-clean:\n" % o.getname())
|
||||||
file.write("\t(cd %s; make clean)\n" % o.getname())
|
file.write("\t(cd %s; make clean)\n" % o.getname())
|
||||||
|
|
||||||
|
file.write("\nbuildroms:\n")
|
||||||
|
for i in range(len(buildroms)):
|
||||||
|
file.write("\tcat ");
|
||||||
|
for j in range(len(buildroms[i])):
|
||||||
|
file.write("%s/linuxbios.rom " % buildroms[i][j] )
|
||||||
|
file.write("> %s\n" % buildroms[i].name);
|
||||||
|
file.write("\n\n")
|
||||||
|
|
||||||
file.close()
|
file.close()
|
||||||
|
|
||||||
def writeinitincludes(image):
|
def writeinitincludes(image):
|
||||||
|
|
Loading…
Reference in New Issue