diff options
author | Ronald G. Minnich <rminnich@gmail.com> | 2003-09-25 23:03:18 +0000 |
---|---|---|
committer | Ronald G. Minnich <rminnich@gmail.com> | 2003-09-25 23:03:18 +0000 |
commit | 10941401e8c040ade7456b0f49ab21c6306791fd (patch) | |
tree | 69f13cfbb09e6b46208ee066da622f07a4912f3e /util/newconfig | |
parent | 3ff7bdaad7afa8f926eb8e1b6151d34cd467dbb0 (diff) |
allow default settings in the mainboard file
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1137 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util/newconfig')
-rw-r--r-- | util/newconfig/config.g | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/util/newconfig/config.g b/util/newconfig/config.g index 4b8a27f096..6ff9c8a97a 100644 --- a/util/newconfig/config.g +++ b/util/newconfig/config.g @@ -1135,7 +1135,10 @@ def part(type, path, file, name): if (type == 'cpu'): cpudir(path) else: - doconfigfile(srcdir, partdir, file) + if (type == 'mainboard'): + doconfigfile(srcdir, partdir, file, 'mainboard_cfgfile') + else: + doconfigfile(srcdir, partdir, file, 'cfgfile') def partpop(): global dirstack, partstack @@ -1163,7 +1166,7 @@ def dodir(path, file): fullpath = dirstack.tos() debug.info(debug.statement, "DODIR: path %s, fullpath %s" % (path, fullpath)) dirstack.push(os.path.join(fullpath, path)) - doconfigfile(fullpath, path, file) + doconfigfile(fullpath, path, file, 'cfgfile') dirstack.pop() def lookup(name): @@ -1195,12 +1198,12 @@ def setarch(my_arch): setoption('ARCH', my_arch) part('arch', my_arch, 'Config.lb', 0) -def doconfigfile(path, confdir, file): +def doconfigfile(path, confdir, file, rule): rname = os.path.join(confdir, file) loc.push(rname) fullpath = os.path.join(path, rname) fp = safe_open(fullpath, 'r') - if (not parse('cfgfile', fp.read())): + if (not parse(rule, fp.read())): fatal("Could not parse file") exitiferrors() loc.pop() @@ -1482,6 +1485,12 @@ parser Config: rule cfgfile: (uses<<1>>)* (stmt<<1>>)* EOF {{ return 1 }} + #mainboard config files are special, in that they can also have + # default values. + rule mainboard_cfgfile: (uses<<1>>)* + (defstmts<<1>>)* + (stmt<<1>>)* + EOF {{ return 1 }} rule usesid<<C>>: ID {{ if (C): usesoption(ID) }} |