mirror of
https://github.com/fail0verflow/switch-coreboot.git
synced 2025-05-04 01:39:18 -04:00
Add include to config.g
Usage: include path path can be relative to the current directory or absolute starting at /src. I tested it with: include /config/absolute.lb include relative.lb in /src/northbridge/amd/amdk8/Config.lb which included /src/northbridge/amd/amdk8/relatvie.lb /src/config/absolute.lb Signed-off-by: Myles Watson <mylesgw@gmail.com> Acked-by: Ronald G. Minnich <rminnich@gmail.com> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4131 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
parent
0346c22de6
commit
d1be3ba633
1 changed files with 18 additions and 0 deletions
|
@ -1514,6 +1514,20 @@ def dodir(path, file):
|
||||||
doconfigfile(fullpath, path, file, 'cfgfile')
|
doconfigfile(fullpath, path, file, 'cfgfile')
|
||||||
dirstack.pop()
|
dirstack.pop()
|
||||||
|
|
||||||
|
def dofile(path):
|
||||||
|
"""dofile is a simple include for single files"""
|
||||||
|
# if the first char is '/', it is relative to treetop,
|
||||||
|
# else relative to curdir
|
||||||
|
# os.path.join screws up if the name starts with '/', sigh.
|
||||||
|
if (path[0] == '/'):
|
||||||
|
fullpath = os.path.join(treetop, 'src')
|
||||||
|
path = re.sub('^/*', '', path)
|
||||||
|
else:
|
||||||
|
fullpath = dirstack.tos()
|
||||||
|
print "INCLUDE %s" %path
|
||||||
|
debug.info(debug.statement, "DOFILE: path %s, fullpath %s" % (path, fullpath))
|
||||||
|
doconfigfile(fullpath, '', path, 'cfgfile')
|
||||||
|
|
||||||
def lookup(name):
|
def lookup(name):
|
||||||
global curimage
|
global curimage
|
||||||
return getoption(name, curimage)
|
return getoption(name, curimage)
|
||||||
|
@ -1638,6 +1652,7 @@ parser Config:
|
||||||
token INIT: 'init'
|
token INIT: 'init'
|
||||||
token INITOBJECT: 'initobject'
|
token INITOBJECT: 'initobject'
|
||||||
token INITINCLUDE: 'initinclude'
|
token INITINCLUDE: 'initinclude'
|
||||||
|
token INCLUDE: 'include'
|
||||||
token IO: 'io'
|
token IO: 'io'
|
||||||
token IRQ: 'irq'
|
token IRQ: 'irq'
|
||||||
token LDSCRIPT: 'ldscript'
|
token LDSCRIPT: 'ldscript'
|
||||||
|
@ -1841,6 +1856,8 @@ parser Config:
|
||||||
HEX_NUM {{ cluster = int(HEX_NUM, 16) }}
|
HEX_NUM {{ cluster = int(HEX_NUM, 16) }}
|
||||||
{{ if (C): partstack.tos().addapic_clusterpath(cluster) }}
|
{{ if (C): partstack.tos().addapic_clusterpath(cluster) }}
|
||||||
|
|
||||||
|
rule include<<C>>: INCLUDE DIRPATH {{ dofile(DIRPATH) }}
|
||||||
|
|
||||||
rule cpu<<C>>: CPU {{ if (C): devicepart('cpu') }}
|
rule cpu<<C>>: CPU {{ if (C): devicepart('cpu') }}
|
||||||
HEX_NUM {{ id = int(HEX_NUM, 16) }}
|
HEX_NUM {{ id = int(HEX_NUM, 16) }}
|
||||||
{{ if (C): partstack.tos().addcpupath(id) }}
|
{{ if (C): partstack.tos().addcpupath(id) }}
|
||||||
|
@ -1886,6 +1903,7 @@ parser Config:
|
||||||
| iif<<C>> {{ return iif }}
|
| iif<<C>> {{ return iif }}
|
||||||
| init<<C>> {{ return init }}
|
| init<<C>> {{ return init }}
|
||||||
| initinclude<<C>> {{ return initinclude }}
|
| initinclude<<C>> {{ return initinclude }}
|
||||||
|
| include<<C>> {{ return include }}
|
||||||
| initobject<<C>> {{ return initobject }}
|
| initobject<<C>> {{ return initobject }}
|
||||||
| ldscript<<C>> {{ return ldscript}}
|
| ldscript<<C>> {{ return ldscript}}
|
||||||
| mainboardinit<<C>> {{ return mainboardinit }}
|
| mainboardinit<<C>> {{ return mainboardinit }}
|
||||||
|
|
Loading…
Add table
Reference in a new issue