On Fri, Apr 17, 2009 at 11:15 AM, Stefan Reinauer <[email protected]> wrote:
> Myles Watson schrieb:
>>
>> On Fri, Apr 17, 2009 at 10:28 AM, ron minnich <[email protected]> wrote:
>>
>>>
>>> On Fri, Apr 17, 2009 at 9:25 AM, Myles Watson <[email protected]> wrote:
>>>
>>>
>>>>
>>>> Not really. I guess I couldn't tell from Carl-Daniel's request what
>>>> exactly he wanted. I thought this would be enough to let him make
>>>> something work. I admit it was quick and dirty. It could be easily
>>>> changed to take a path instead of a string.
>>>>
>>>
>>> Since you are up to speed on the config tool, and know how to improve
>>> it :-), I'd like to request a general purpose include command instead
>>> (or see if there is already one in there I forgot about :-)
>>>
>>
>> I didn't find one when I looked. I think it would be hard to make one
>> that worked in targets/*/*/Config.lb files and src/.../Config.lb
>> files, but I guess no one has asked for that.
>>
>> How general are you thinking? I'm probably willing to do this:
>>
>> include acpi.lb
>>
>> include /acpi.lb
>>
>> Where acpi.lb includes from the current directory and /acpi.lb
>> includes from /src/acpi.lb
>>
>
> Whats wrong with the "dir" command?
>
> Especially since we're working on getting rid of Config.lb in favor of
> Kconfig..
I think the idea was a little more flexibility. If it is going away
soon it should be fine to let cleanups happen. Hopefully they'll
speed up the conversion to Kconfig when it happens.
This include is very simple and related to the dir command.
Implemented with relative and absolute paths.
Signed-off-by: Myles Watson <[email protected]>
Thanks,
Myles
Myles
Index: util/newconfig/config.g
===================================================================
--- util/newconfig/config.g (revision 4128)
+++ util/newconfig/config.g (working copy)
@@ -1514,6 +1514,20 @@
doconfigfile(fullpath, path, file, 'cfgfile')
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):
global curimage
return getoption(name, curimage)
@@ -1638,6 +1652,7 @@
token INIT: 'init'
token INITOBJECT: 'initobject'
token INITINCLUDE: 'initinclude'
+ token INCLUDE: 'include'
token IO: 'io'
token IRQ: 'irq'
token LDSCRIPT: 'ldscript'
@@ -1841,6 +1856,8 @@
HEX_NUM {{ cluster = int(HEX_NUM, 16) }}
{{ if (C): partstack.tos().addapic_clusterpath(cluster) }}
+ rule include<<C>>: INCLUDE DIRPATH {{ dofile(DIRPATH) }}
+
rule cpu<<C>>: CPU {{ if (C): devicepart('cpu') }}
HEX_NUM {{ id = int(HEX_NUM, 16) }}
{{ if (C): partstack.tos().addcpupath(id) }}
@@ -1886,6 +1903,7 @@
| iif<<C>> {{ return iif }}
| init<<C>> {{ return init }}
| initinclude<<C>> {{ return initinclude }}
+ | include<<C>> {{ return include }}
| initobject<<C>> {{ return initobject }}
| ldscript<<C>> {{ return ldscript}}
| mainboardinit<<C>> {{ return mainboardinit }}
--
coreboot mailing list: [email protected]
http://www.coreboot.org/mailman/listinfo/coreboot