summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@chromium.org>2011-08-25 11:01:48 -0700
committerBill Richardson <wfrichar@chromium.org>2011-08-25 12:58:15 -0700
commita36ee8740ec26d333ec9480f8124b67ad7aaa6d4 (patch)
treea11a0d2934b82c84a426b792cee181b77dd5cc6f
parentaeb8632258f240c9350716bdfe149d1f3c5c54a1 (diff)
downloadvboot-a36ee8740ec26d333ec9480f8124b67ad7aaa6d4.tar.gz
Scale the HWID font to match the rest of the text.
BUG=chromium-os:18631 TEST=manual Boot to recovery mode screen. HWID should be the same size and shape as the rest of the text. Change-Id: Iee0b0611c1319a304d911b710dd7f35ef999a1eb Reviewed-on: http://gerrit.chromium.org/gerrit/6667 Reviewed-by: Randall Spangler <rspangler@chromium.org> Tested-by: Bill Richardson <wfrichar@chromium.org>
-rw-r--r--scripts/newbitmaps/README106
-rwxr-xr-xscripts/newbitmaps/fonts/make_ascii_bmps.py2
-rw-r--r--scripts/newbitmaps/images/Makefile36
-rw-r--r--scripts/newbitmaps/images/hwid_fonts.binbin66136 -> 58196 bytes
-rwxr-xr-xscripts/newbitmaps/images/make_default_yaml13
-rwxr-xr-xscripts/newbitmaps/lib/bmpblock.py1
6 files changed, 105 insertions, 53 deletions
diff --git a/scripts/newbitmaps/README b/scripts/newbitmaps/README
index 728d42f2..d6050777 100644
--- a/scripts/newbitmaps/README
+++ b/scripts/newbitmaps/README
@@ -71,56 +71,85 @@ image name. For example:
en
The old v1.1 bmpblock will be accepted by the vboot wrapper, but a $HWID
-screen without a corresponding font will be silently ignored.
+screen without a corresponding font should be silently ignored.
-Instructions:
+--------------------------------------------
+Instructions for manually rebuilding things:
-The bmpblk_utility reads a config file and produces a binary bmpblock. The
-config file lists the individual bitmaps and describes where to place each
-one when displaying each screen. The bmpblock is then written into the BIOS
-image with the gbb_utility. The bitmap_viewer program lets you view the
-composited screens as described by the config file.
+We do most of the image manipulation using ImageMagick, which is much easier
+and simpler to do OUTSIDE of the chroot. So the first step is to just build
+vboot_reference outside of the chroot.
-* First, get the bitmap_viewer working. This is best done OUTSIDE of the
- chroot. Test it by changing to the scripts/newbitmaps/images/16x9_generic
- directory and running "../../bitmap_viewer DEFAULT.yaml". You may
- need to install some additional packages. For example, on Ubuntu you'll
- probably need to install the "python-yaml" and "python-wxgtk2.8" packages.
+ cd src/platform/vboot_reference
+ make
-* Now make changes to the DEFAULT.yaml config file, and use bitmap_viewer to
- see how the layout looks. Hit Ctrl-R in the small window to reload the
- config file without restarting.
+You'll probably need to install several additional packages to make this
+work. In addition, scripts/newbitmaps/bitmap_viewer is a python script that
+may require some packages of its own. Test it by changing to the
+scripts/newbitmaps/images directory and running
-* The bitmap_viewer tool can display images in several different formats,
- but the BIOS is very limited (and may differ between x86 and ARM). For
- x86, ensure that you're using the proper format by converting any new
- bitmaps with a command like this:
+ ../bitmap_viewer DEFAULT.yaml
- convert IN.bmp -colors 256 -compress none -alpha off OUT.bmp
+On Ubuntu you may find you need libtspi-dev, uuid-dev, imagemagick,
+python-yaml, and python-wxgtk2.8, among others.
-* When you have the screens tweaked to your satisfaction, generate the
- binary bmpblock to embed into the BIOS.
- bmpblk_utility -c DEFAULT.yaml bmpblock.bin
+Once you've built vboot_reference you'll find the executables in
+./build/utility/ (and ./build/cgpt/cgpt, if you want it). Put these
+somewhere in your $PATH.
-* Use the gbb_utility to modify the BIOS to contain this new set of bitmaps.
- NOTE: These commands are run (as root) on the device under test!
+Create the font file:
- NOTE: This will only work if the BIOS write-protection is disabled!
+ cd scripts/newbitmaps/fonts
+ ./make_ascii_bmps.py
+ bmpblk_font --outfile ../images/hwid_fonts.bin outdir/*
- Copy our new bmpblock over.
+Create and examine the localized images:
+
+For x86:
+
+ cd scripts/newbitmaps/images
+ make x86
+ cd out_x86
+ ../../bitmap_viewer DEFAULT.yaml
+ bmpblock_utility -c DEFAULT.yaml bmpblock.bin
+
+For arm:
+
+ cd scripts/newbitmaps/images
+ make arm
+ cd out_arm
+ ../../bitmap_viewer DEFAULT.yaml
+ bmpblock_utility -c DEFAULT.yaml bmpblock.bin
+
+
+Now use the gbb_utility to modify your BIOS to contain this new set of
+bitmaps:
+
+ gbb_utility -s -b PATH/TO/YOUR/bmpblock.bin OLDBIOS.bin NEWBIOS.bin
+
+
+
+You can do that last step on the chromebook device itself, provided that the
+BIOS write-protection is disabled. gbb_utility should be in the rootfs:
+
+ Become root:
+
+ sudo bash
+
+ Copy your new bmpblock over:
cd /mnt/stateful_partition
scp USER@SOMEHOST:/SOMEPATH/bmpblock.bin .
- Get a copy of the current BIOS.
+ Get a copy of the current BIOS:
flashrom -p internal:bus=spi -r bios.bin
- Put the new bmpblock in the copy of the BIOS
+ Put the new bmpblock in the copy of the BIOS:
gbb_utility -s -b bmpblock.bin bios.bin
@@ -128,19 +157,20 @@ composited screens as described by the config file.
flashrom -p internal:bus=spi -w bios.bin
-* Reboot. You should see your new bitmaps appear whenever the BIOS screens
+ Reboot. You should see your new bitmaps appear whenever the BIOS screens
are displayed. If you have more than one localization, you should be able
to cycle among them with the arrow keys.
-* If you want to examine a binary bmpblock that you've pulled from a BIOS
- image, the bmpblk_utility has options to display or unpack the binary.
- bmpblk_utility bmpblock.bin
+If you want to examine a binary bmpblock that you've pulled from a BIOS
+image, the bmpblk_utility has options to display or unpack the binary.
+
+ bmpblk_utility bmpblock.bin
- bmpblk_utility -y bmpblock.bin
+ bmpblk_utility -y bmpblock.bin
- bmpblk_utility -x -d /SOME/SCRATCH/DIR bmpblock.bin
+ bmpblk_utility -x -d /SOME/SCRATCH/DIR bmpblock.bin
- Once you've unpacked it you can use the bitmap_viewer on the unpacked yaml
- file to see what it looks like. There's not (yet) a single tool that
- directly displays the raw binary.
+Once you've unpacked it you can use the bitmap_viewer on the unpacked
+config.yaml file to see what it looks like. There's not (yet) a single tool
+that directly displays the raw binary.
diff --git a/scripts/newbitmaps/fonts/make_ascii_bmps.py b/scripts/newbitmaps/fonts/make_ascii_bmps.py
index df6083e1..1c626d56 100755
--- a/scripts/newbitmaps/fonts/make_ascii_bmps.py
+++ b/scripts/newbitmaps/fonts/make_ascii_bmps.py
@@ -70,6 +70,8 @@ def main():
'-border', '0x3',
'-gravity', 'Center',
'-pointsize', options.size,
+ '-resize', '120%x100', # Yes, magic.
+ '-scale', '59%x78%', # Here, too.
'label:%s' % ascii,
'-remap', gradient_file,
'-compress', 'none',
diff --git a/scripts/newbitmaps/images/Makefile b/scripts/newbitmaps/images/Makefile
index fe2be482..2c8571af 100644
--- a/scripts/newbitmaps/images/Makefile
+++ b/scripts/newbitmaps/images/Makefile
@@ -12,6 +12,9 @@
TARGETS=x86 arm
+DEFAULT_LOCALES=en fr es it de nl
+
+
BASE_IMAGES=Devmode.bmp Insert.bmp Remove.bmp Yuck.bmp
OTHER_IMAGES=Url.bmp hwid_unknown.bmp
FONTS=hwid_fonts.bin
@@ -48,18 +51,20 @@ x86::
done
# copy stuff we need
cp "${FONTS}" "out_$@"
- # scale the background pictures exactly
- for i in ${BASE_IMAGES}; do \
+ # scale the background pictures exactly...
+ @for i in ${BASE_IMAGES}; do \
+ echo " out_$@/$$i"; \
convert $$i -scale "${_x86_max}" "out_$@/$$i"; \
done
- # scale the localized string images using percentages
- for i in ${OTHER_IMAGES} localized_images/*/*.bmp; do \
+ # scale the localized string images using percentages...
+ @for i in ${OTHER_IMAGES} localized_images/*/*.bmp; do \
+ echo " out_$@/$$i"; \
convert $$i -scale "${_x86_scale}" "out_$@/$$i"; \
done
# produce the new yaml
- cd "out_$@" && ../make_default_yaml
- # Note: hand-edit the new DEFAULT.yaml to select the shipping locales,
- # then use bmpblk_utility to create the binary.
+ cd "out_$@" && ../make_default_yaml ${DEFAULT_LOCALES}
+ # Note: manually use bmpblk_utility to create the binary from out_$@
+
arm::
@@ -74,20 +79,23 @@ arm::
-colors 256 -unique-colors "out_$@/base_cmap.png"
convert localized_images/*/*.bmp -append \
-colors 256 -unique-colors "out_$@/loc_cmap.png"
- # scale the background pictures exactly
- for i in ${BASE_IMAGES}; do \
+ # scale the background pictures exactly...
+ @for i in ${BASE_IMAGES}; do \
+ echo " out_$@/$$i"; \
convert $$i -scale "${_arm_max}" \
-remap "out_$@/base_cmap.png" "out_$@/$$i"; \
done
- # scale the localized string images using percentages
- for i in ${OTHER_IMAGES} localized_images/*/*.bmp; do \
+ # scale the localized string images using percentages...
+ @for i in ${OTHER_IMAGES} localized_images/*/*.bmp; do \
+ echo " out_$@/$$i"; \
convert $$i -scale "${_arm_scale}" \
-remap "out_$@/loc_cmap.png" "out_$@/$$i"; \
done
# produce the new yaml
- cd "out_$@" && ../make_default_yaml
- # Note: hand-edit the new DEFAULT.yaml to select the shipping locales,
- # then use bmpblk_utility to create the binary.
+ cd "out_$@" && ../make_default_yaml ${DEFAULT_LOCALES}
+ perl -i -p -e 's/^compression:.*/compression: 2/;' "out_$@/DEFAULT.yaml"
+ # Note: manually use bmpblk_utility to create the binary from out_$@
+
diff --git a/scripts/newbitmaps/images/hwid_fonts.bin b/scripts/newbitmaps/images/hwid_fonts.bin
index ecdfaef6..b2832fd8 100644
--- a/scripts/newbitmaps/images/hwid_fonts.bin
+++ b/scripts/newbitmaps/images/hwid_fonts.bin
Binary files differ
diff --git a/scripts/newbitmaps/images/make_default_yaml b/scripts/newbitmaps/images/make_default_yaml
index 88c540e8..6bd1ffff 100755
--- a/scripts/newbitmaps/images/make_default_yaml
+++ b/scripts/newbitmaps/images/make_default_yaml
@@ -12,6 +12,19 @@ yaml_file="DEFAULT.yaml"
locales="en es_419 pt_BR en_GB fr es pt_PT ca it de el nl da no sv fi et lv lt ru pl cs sk hu sl sr hr bg ro uk tr iw ar fa hi th vi id fil zh_CN zh_TW ko ja"
localedir="./localized_images"
+# Accept optional args which are the locales to emit. Default is all of 'em.
+if [ -n "$*" ]; then
+ # Make sure all the args actually match
+ for arg in "$@"; do
+ if [ ! -d "$localedir/$arg" ]; then
+ echo "$0: locale \"$arg\" is unknown" 1>&2
+ exit 1
+ fi
+ done
+ locales="$*"
+fi
+
+
# Arbitrary padding
ypad=5
xpad=10
diff --git a/scripts/newbitmaps/lib/bmpblock.py b/scripts/newbitmaps/lib/bmpblock.py
index 539159bc..bcad981c 100755
--- a/scripts/newbitmaps/lib/bmpblock.py
+++ b/scripts/newbitmaps/lib/bmpblock.py
@@ -46,7 +46,6 @@ 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 or thing["bmpblock"] == 1.1
seen_images = {"$HWID":1, "$HWID.rtol":2}
seen_screens = {}