Change GBB bmpblock to version 1.1, supporting direct HWID rendering.

With version 1.0, the BIOS displays its screens using composited images, but
we still have to create a new bmp image for every HWID. Version 1.1 lets us
render the ASCII HWID string directly, so the BIOS screens don't need
modification just because the HWID changes.

In the yaml file, we just replace the hwid image with a magic string, like
so:

  bmpblock: 1.1

  [...]

  screens:
    en_remove:
      - [  0,   0, remove_bg]
      - [256, 534, en_model_text]
      - [314, 534, $HWID]
      - [192, 479, url]
      - [195, 453, en_remove_text]

This change modifies the bmpblk_utility to accept and generate both 1.0 and
1.1 versions. It also updates the supporting scripts (most of which aren't
needed anymore) and adds a new DEFAULT.yaml file which can be used as the
basis for all locales.

BUG=chrome-os-partner:3264
TEST=none (manual)

Change-Id: I012349393848393928282
Reviewed-on: http://gerrit.chromium.org/gerrit/378
Tested-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
This commit is contained in:
Bill Richardson
2011-05-05 15:12:10 -07:00
parent c3574086a8
commit 54e95825b3
13 changed files with 2205 additions and 680 deletions

View File

@@ -14,10 +14,11 @@ class BmpBlock(object):
It has a few special attributes to specify which part we're focusing on.
"""
def __init__(self, filename=None):
def __init__(self, libdir, filename=None):
self.yaml = None
self.filename = None
self.current_screen = None
self.libdir = libdir
self.filename = filename # always set, so we can reload
if filename:
self.LoadFile(filename)
@@ -45,9 +46,9 @@ class BmpBlock(object):
"""Raise an error if the specified dict is not a valid BmpBlock structure"""
assert isinstance(thing, dict)
assert thing["bmpblock"] == 1.0
assert thing["bmpblock"] == 1.0 or thing["bmpblock"] == 1.1
seen_images = {}
seen_images = {"$HWID":1, "$HWID.rtol":2}
seen_screens = {}
images = thing["images"]
@@ -56,6 +57,10 @@ class BmpBlock(object):
# image values should all be filenames (ie, strings)
for val in images.values():
assert val and isinstance(val, types.StringTypes)
if not "$HWID" in images:
images["$HWID"] = os.path.join(self.libdir,'current_hwid.bmp')
if not "$HWID.rtol" in images:
images["$HWID.rtol"] = os.path.join(self.libdir, 'current_hwid.bmp')
screens = thing["screens"]
assert isinstance(screens, dict)