newbitmaps: Move files to new location (bmpblk).
BUG=none TEST=none BRANCH=none Change-Id: I4a5ecedd4dd8e2ef866793edd825f4d5716402bf Reviewed-on: https://gerrit.chromium.org/gerrit/38097 Tested-by: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Bill Richardson <wfrichar@chromium.org> Commit-Ready: Hung-Te Lin <hungte@chromium.org>
@@ -1,42 +0,0 @@
|
||||
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
# This will regenerate the BIOS bitmap images for all platforms. You
|
||||
# shouldn't need to do this, though.
|
||||
|
||||
# These are all the known locales, sorted more-or-less geograpically
|
||||
ALL_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
|
||||
|
||||
# Here are the launch locales for Stumpy/Lumpy (issue 6595), same ordering.
|
||||
LOCALES=en es_419 pt_BR fr es it de nl da no sv ko ja
|
||||
|
||||
# Added more locales for future (crosbug.com/p/12846).
|
||||
LOCALES+= id th
|
||||
|
||||
# More locales (crosbug.com/p/11969)
|
||||
LOCALES+= ar ms zh_CN zh_TW
|
||||
|
||||
default: outside_chroot strings images
|
||||
|
||||
outside_chroot:
|
||||
@if [ -e /etc/debian_chroot ]; then \
|
||||
echo "PIL color quantization is broken inside the chroot."; \
|
||||
echo "You must be outside the chroot to do this"; \
|
||||
echo "(and you probably shouldn't be doing it anyway)."; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
strings:
|
||||
$(MAKE) -C strings
|
||||
|
||||
images:
|
||||
$(MAKE) -C images LOCALES="$(LOCALES)" all
|
||||
|
||||
clean:
|
||||
$(MAKE) -C strings clean
|
||||
$(MAKE) -C images clean
|
||||
|
||||
.PHONY: outside_chroot strings images clean
|
||||
@@ -1,181 +1,2 @@
|
||||
This directory contains the sources for the new-style BIOS bitmaps, and a
|
||||
simple (and ugly) tool to view the configuration file that describes how
|
||||
each screen is displayed.
|
||||
Firmware bitmaps genereation is now moved to ~/trunk/src/platform/bmpblk.
|
||||
|
||||
Note:
|
||||
|
||||
Due to continuing improvements and tweaks, there have been several different
|
||||
formats used for the BIOS bitmaps.
|
||||
|
||||
Because the bitmap images and display code is part of the Read-Only BIOS,
|
||||
back-porting any new bitmaps to older devices is not possible.
|
||||
|
||||
|
||||
Old-style, unversioned bitmaps. Used in Mario / Cr-48.
|
||||
|
||||
In the Cr-48 BIOS there are four BIOS screens that may be presented to the
|
||||
user. Each contains a graphic, a URL, and some informative text. The screens
|
||||
are single bitmap images, hardcoded in read-only BIOS (because they have to
|
||||
display even when the R/W BIOS and SSD are both completely erased). They can
|
||||
be replaced at manufacturing time, but creating the screens is difficult.
|
||||
The format is a compressed EFI firmware volume that is generated when the
|
||||
BIOS is compiled. The result is an opaque blob that cannot be viewed or
|
||||
edited with linux-based tools.
|
||||
|
||||
|
||||
Version 1.0, new-style bitmaps. Used in Alex / Samsung Series 5.
|
||||
|
||||
The BIOS continues to display the same basic screens, but it uses a
|
||||
different format internally (which we call the bmpblock). Each screen has
|
||||
separate bitmaps for the basic graphic, the URL, and the informative text,
|
||||
and the screen is displayed by rendering each component in order. This
|
||||
allows us to modify and replace any bitmap (most frequently the HWID), using
|
||||
standard command-line linux tools such as imagemagick. Compositing each
|
||||
screen in this way also means that we can easily provide localized BIOS
|
||||
screens or custom messages. The BIOS rotates through the localizations by
|
||||
pressing the arrow keys when any screen is displayed.
|
||||
|
||||
|
||||
Version 1.1. Used in ZGB / Acer AC700.
|
||||
|
||||
This is essentially the same as version 1.0, except that the ASCII HWID
|
||||
string can be rendered directly by the BIOS instead of as a bitmap. In the
|
||||
screen description, the magic image name "$HWID" (or "$HWID.rtol" for a
|
||||
right-justified placement) indicates that the ASCII HWID value should be
|
||||
displayed at the given coordinates instead of a bitmap image. This means
|
||||
that we only need to generate one bmpblock for all locales, since the ASCII
|
||||
HWID string can be changed at the factory using "gbb_utility". The
|
||||
last-displayed locale is stored in nvram, so it's sticky across reboots. The
|
||||
factory process sets the default locale to the appropriate region.
|
||||
|
||||
|
||||
Version 1.2. Used by any BIOS that uses "vboot_api.h" (ARM, Stumpy, etc.)
|
||||
|
||||
The "vboot wrapper" is a refactoring of the vboot_reference library to
|
||||
isolate our verified boot stuff from the underlying BIOS. Among other
|
||||
things, it places the burden of displaying the ASCII HWID value on the
|
||||
vboot_reference library, which means the bmpblock must contain a "font" to
|
||||
translate the ASCII characters in the HWID into graphical images. The yaml
|
||||
file must now specify a font file for the $HWID (and $HWID.rtol, if used)
|
||||
image name. For example:
|
||||
|
||||
bmpblock: 1.2
|
||||
images:
|
||||
$HWID: font.bin # THIS IS NOW REQUIRED WHEN USING $HWID
|
||||
screens:
|
||||
scr_0_0:
|
||||
- [ 0, 0, $HWID]
|
||||
localizations:
|
||||
- [ scr_0_0, scr_0_0, scr_0_0, scr_0_0 ]
|
||||
locale_index:
|
||||
en
|
||||
|
||||
The old v1.1 bmpblock will be accepted by the vboot wrapper, but a $HWID
|
||||
screen without a corresponding font should be silently ignored.
|
||||
|
||||
|
||||
Version 2.0. Used by BIOS with complex composition (Kiev, Link, Snow, etc.)
|
||||
|
||||
The max number of components in one screen has increased from 8 to 16, makes
|
||||
bitmap block structure incompatible with previous versions.
|
||||
|
||||
|
||||
|
||||
--------------------------------------------
|
||||
Instructions for manually rebuilding things:
|
||||
|
||||
|
||||
Some libraries and programs (ex, PIL, pango-view) used in generating image files
|
||||
need fonts set properly or specific version (ex, PIL is broken inside chroot),
|
||||
and simpler to do OUTSIDE of the chroot.
|
||||
|
||||
On Ubuntu, you need to install following packages:
|
||||
|
||||
sudo apt-get install libpango1.0-dev python-imaging
|
||||
|
||||
And you probably want to make sure all required fonts are installed:
|
||||
|
||||
sudo apt-get install fonts-nanum fonts-ipafont-gothic ttf-indic-fonts \
|
||||
fonts-droid
|
||||
|
||||
If you want to use the "bitmap viewer" utility, add these packages:
|
||||
|
||||
sudo apt-get install python-yaml python-wxgtk2.8
|
||||
|
||||
We also need some utilities from ChromiumOS source tree. You need to install
|
||||
dependency libraries for them:
|
||||
|
||||
sudo apt-get install libtspi-dev uuid-dev libyaml-dev liblzml-dev
|
||||
|
||||
Now, time to build the utilities in vboot_reference outside of the chroot:
|
||||
|
||||
cd src/platform/vboot_reference
|
||||
make
|
||||
|
||||
Once you've built vboot_reference you'll find the executables in
|
||||
./build/utility/bmpblk*. Put these somewhere in your $PATH.
|
||||
|
||||
Now you should be able to just run "make" and everything will be
|
||||
regenerated:
|
||||
|
||||
cd scripts/newbitmaps
|
||||
make
|
||||
|
||||
This should generate BIOS bmpblock file for all platforms cross all locales,
|
||||
which takes a long time.
|
||||
|
||||
If you simply want to build a en-US x standard resolution, do:
|
||||
|
||||
cd scripts/newbitmaps
|
||||
make strings # You can do this only one time unless mofidication was made.
|
||||
cd images
|
||||
make # Builds only "STD" profile and only few seconds.
|
||||
|
||||
You can 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:
|
||||
|
||||
flashrom -p internal:bus=spi -r bios.bin
|
||||
|
||||
Put the new bmpblock in the copy of the BIOS:
|
||||
|
||||
gbb_utility -s -b bmpblock.bin bios.bin
|
||||
|
||||
Reflash the BIOS with the new content
|
||||
|
||||
flashrom -p internal:bus=spi -w bios.bin
|
||||
|
||||
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
|
||||
|
||||
bmpblk_utility -y 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
|
||||
config.yaml file to see what it looks like. There's not (yet) a single tool
|
||||
that directly displays the raw binary.
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
#!/usr/bin/python -tt
|
||||
# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
"""Quick-and-dirty viewer for bmpblock yaml files"""
|
||||
import os
|
||||
import sys
|
||||
import wx
|
||||
|
||||
from lib import bmpblock
|
||||
from lib import pixcontrol
|
||||
from lib import pixdisplay
|
||||
|
||||
|
||||
class MyApp(wx.App):
|
||||
|
||||
def OnInit(self):
|
||||
progname = os.path.basename(sys.argv[0])
|
||||
progdir = os.path.abspath(os.path.dirname(sys.argv[0]))
|
||||
self._bmpblock = bmpblock.BmpBlock(os.path.join(progdir, 'lib'),
|
||||
sys.argv[1])
|
||||
self._mainframe = pixcontrol.Frame(self._bmpblock, progname)
|
||||
self._mainframe.Show()
|
||||
self.SetTopWindow(self._mainframe)
|
||||
self._imgframe = pixdisplay.Frame(self._bmpblock, sys.argv[1])
|
||||
self._imgframe.Show()
|
||||
return True
|
||||
|
||||
def main():
|
||||
if len(sys.argv) != 2:
|
||||
print "You must specify a config.yaml file to view"
|
||||
sys.exit(1)
|
||||
MyApp(False).MainLoop()
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,17 +0,0 @@
|
||||
# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
OUTPUT=bmpblock.bin
|
||||
|
||||
all:
|
||||
for X in *.png; do \
|
||||
python -c "import Image; \
|
||||
Image.open('$$X').convert('P').save('$${X/png/bmp}')"; \
|
||||
done
|
||||
bmpblk_utility -c config.yaml $(OUTPUT)
|
||||
|
||||
clean:
|
||||
rm -rf $(OUTPUT) *.bmp
|
||||
|
||||
.PHONY: all clean
|
||||
@@ -1,72 +0,0 @@
|
||||
# This is the source for the unofficial BIOS bitmaps that are found in
|
||||
# src/third_party/chromiumos-overlay/sys-boot/chromeos-bootimage/files/ The
|
||||
# original sources are lost in the mists of time, so most of this is simply
|
||||
# unpacked from the binary.
|
||||
|
||||
bmpblock: 2.0
|
||||
compression: 2
|
||||
images:
|
||||
$HWID: font.bin
|
||||
UNOFFICIAL: unofficial.bmp
|
||||
EN_LAN: en_language.bmp
|
||||
GB_LAN: gb_language.bmp
|
||||
DEV: dev.bmp
|
||||
INSERT: insert.bmp
|
||||
REMOVE: remove.bmp
|
||||
YUCK: yuck.bmp
|
||||
TODEV: todev.bmp
|
||||
TONORM: tonorm.bmp
|
||||
WAIT: wait.bmp
|
||||
TONORM_CONFIRM: tonorm_confirm.bmp
|
||||
screens:
|
||||
scr_en_dev:
|
||||
- [0, 0, UNOFFICIAL]
|
||||
- [200, 250, DEV]
|
||||
- [500, 175, EN_LAN]
|
||||
- [100, 175, $HWID]
|
||||
scr_gb_dev:
|
||||
- [0, 0, UNOFFICIAL]
|
||||
- [200, 250, DEV]
|
||||
- [500, 175, GB_LAN]
|
||||
- [100, 175, $HWID]
|
||||
scr_en_insert:
|
||||
- [0, 0, UNOFFICIAL]
|
||||
- [125, 311, INSERT]
|
||||
- [500, 175, EN_LAN]
|
||||
- [100, 175, $HWID]
|
||||
scr_gb_insert:
|
||||
- [0, 0, UNOFFICIAL]
|
||||
- [125, 311, INSERT]
|
||||
- [500, 175, GB_LAN]
|
||||
- [100, 175, $HWID]
|
||||
scr_en_remove:
|
||||
- [0, 0, UNOFFICIAL]
|
||||
- [137, 368, REMOVE]
|
||||
- [100, 175, $HWID]
|
||||
scr_en_yuck:
|
||||
- [0, 0, UNOFFICIAL]
|
||||
- [240, 261, YUCK]
|
||||
- [100, 175, $HWID]
|
||||
scr_en_todev:
|
||||
- [0, 0, UNOFFICIAL]
|
||||
- [305, 348, TODEV]
|
||||
- [100, 175, $HWID]
|
||||
scr_en_tonorm:
|
||||
- [0, 0, UNOFFICIAL]
|
||||
- [221, 372, TONORM]
|
||||
- [100, 175, $HWID]
|
||||
scr_en_wait:
|
||||
- [0, 0, UNOFFICIAL]
|
||||
- [221, 372, WAIT]
|
||||
- [100, 175, $HWID]
|
||||
scr_en_tonorm_confirm:
|
||||
- [0, 0, UNOFFICIAL]
|
||||
- [221, 372, TONORM_CONFIRM]
|
||||
- [100, 175, $HWID]
|
||||
|
||||
localizations:
|
||||
- [ scr_en_dev, scr_en_remove, scr_en_yuck, scr_en_insert, scr_en_todev, scr_en_tonorm, scr_en_wait, scr_en_tonorm_confirm ]
|
||||
- [ scr_gb_dev, scr_en_remove, scr_en_yuck, scr_gb_insert, scr_en_todev, scr_en_tonorm, scr_en_wait, scr_en_tonorm_confirm ]
|
||||
locale_index:
|
||||
- en
|
||||
- en_GB
|
||||
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 8.6 KiB |
|
Before Width: | Height: | Size: 7.5 KiB |
|
Before Width: | Height: | Size: 6.5 KiB |
|
Before Width: | Height: | Size: 6.9 KiB |
|
Before Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 7.4 KiB |
|
Before Width: | Height: | Size: 2.8 KiB |
@@ -1,29 +0,0 @@
|
||||
# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
# This makefile lets you MANUALLY create a set of images and the corresponding
|
||||
# DEFAUL.yaml file for a particular platform. It should NOT be run
|
||||
# automatically, but only when the master images have changed following review
|
||||
# by the localization team. Additionally, it needs to be run outside of the
|
||||
# chroot, since it uses ImageMagick to transform the master images, and
|
||||
# ImageMagick is much to complex to bother installing into the chroot just for
|
||||
# this occasional need.
|
||||
|
||||
TARGETS=std n1366usb n1366sdusb2 s800 s1024 s1024usb s1024usb2 s1024sdusb2
|
||||
TARGETS+=s1280a8x5 s1280x850a8x5
|
||||
|
||||
# To generate all locales, make from top level.
|
||||
LOCALES=en
|
||||
|
||||
default: std
|
||||
|
||||
all: $(TARGETS)
|
||||
|
||||
$(TARGETS):
|
||||
LOCALES="$(LOCALES)" ./build_images "$@"
|
||||
|
||||
clean:
|
||||
rm -rf out_*
|
||||
|
||||
.PHONY: $(TARGETS) clean all default
|
||||
|
Before Width: | Height: | Size: 262 B |
|
Before Width: | Height: | Size: 260 B |
|
Before Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
@@ -1,191 +0,0 @@
|
||||
#!/bin/sh
|
||||
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
# Prepares image resources into output folder.
|
||||
|
||||
# Composition settings
|
||||
BACKGROUND_COLOR=white
|
||||
|
||||
# The only file that uses different scaling parameter.
|
||||
BACKGROUND_IMAGE=Background_white.png
|
||||
|
||||
# Output file name.
|
||||
BMPBLK_OUTPUT="bmpblock.bin"
|
||||
|
||||
SCRIPT_BASE="$(dirname $(readlink -f "$0"))"
|
||||
|
||||
die() {
|
||||
echo "ERROR: $*" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
convert_to_bmp3() {
|
||||
local folder="$1"
|
||||
local param="$2"
|
||||
shift
|
||||
shift
|
||||
|
||||
# convert_to_bmp3.py takes '--scale' while ImageMagic takes '-scale'.
|
||||
[ -n "$param" ] && param="-$param"
|
||||
|
||||
$SCRIPT_BASE/convert_to_bmp3.py $param --outdir "$folder" "$@"
|
||||
}
|
||||
|
||||
main() {
|
||||
local profile="$1"
|
||||
local output="out_$1"
|
||||
local scale_param="" background_scale_param="" replace_files=""
|
||||
local base locale X
|
||||
|
||||
# TODO(hungte) Derive and calculate profile params automatically.
|
||||
|
||||
# Currently we use image resources originally designed for 1366x768, and
|
||||
# re-scale to different aspects on demand.
|
||||
case "$profile" in
|
||||
std )
|
||||
# Standard: profile with all default values.
|
||||
true
|
||||
;;
|
||||
|
||||
# Native profiles
|
||||
|
||||
n1366 )
|
||||
# "Native 1366x768" resolution.
|
||||
background_scale_param="-scale 1366x768!"
|
||||
;;
|
||||
|
||||
n1366usb )
|
||||
# Similar to n1366, and can only boot recovery by USB.
|
||||
background_scale_param="-scale 1366x768!"
|
||||
replace_files="insert=insert_usb BadSD=dummy RemoveDevices=RemoveUSB"
|
||||
;;
|
||||
|
||||
n1366sdusb2 )
|
||||
# Similar to n1366, and can only boot recovery by SD card or USB2.
|
||||
background_scale_param="-scale 1366x768!"
|
||||
replace_files="insert=insert_sd_usb2"
|
||||
;;
|
||||
|
||||
# Stretched profiles
|
||||
|
||||
s800 )
|
||||
# "Streched 800x600". Designed for x86 UEFI BIOS (and coreboot), which
|
||||
# always puts display into VESA 800x600 16-bit mode (0x0114), and is
|
||||
# stretched to fill the entire screen.
|
||||
scale_param="-scale 59%x78%"
|
||||
background_scale_param="-scale 800x600!"
|
||||
;;
|
||||
|
||||
s1024 )
|
||||
# Similar to s800, using VESA graphics mode 1024x768 (0x0117).
|
||||
scale_param="-scale 75%x100%"
|
||||
background_scale_param="-scale 1024x768!"
|
||||
;;
|
||||
|
||||
s1024usb )
|
||||
# Similar to s1024, and can only boot recovery by USB2. (No card reader,
|
||||
# not not able to recover from card reader.)
|
||||
scale_param="-scale 75%x100%"
|
||||
background_scale_param="-scale 1024x768!"
|
||||
replace_files="insert=insert_usb BadSD=dummy RemoveDevices=RemoveUSB"
|
||||
;;
|
||||
|
||||
s1024usb2 )
|
||||
# Similar to s1024, and can only boot recovery by USB2.
|
||||
scale_param="-scale 75%x100%"
|
||||
background_scale_param="-scale 1024x768!"
|
||||
replace_files="insert=insert_usb2 BadSD=dummy RemoveDevices=RemoveUSB"
|
||||
;;
|
||||
|
||||
s1024sdusb2 )
|
||||
# Similar to s1024, and can only boot recovery by SD card or USB2.
|
||||
scale_param="-scale 75%x100%"
|
||||
background_scale_param="-scale 1024x768!"
|
||||
replace_files="insert=insert_sd_usb2"
|
||||
;;
|
||||
|
||||
s1280a8x5 )
|
||||
# Similar to s1024, using VESA graphics mode 1280x1024 (0x011A), and
|
||||
# adjusted for aspect ratio 8x5 panels.
|
||||
background_scale_param="-scale 1280x1024!"
|
||||
scale_param="-scale 94%x119%" # 119% = 133% * (1.6 / 1.78)
|
||||
;;
|
||||
|
||||
s1280x850a8x5 )
|
||||
# Similar to s1280a8x5, using graphics mode 1280x850.
|
||||
background_scale_param="-scale 1280x850!"
|
||||
scale_param="-scale 94%x99%" # 99% = 110% * (1.6 / 1.78)
|
||||
;;
|
||||
|
||||
* )
|
||||
die "Sorry, unknown profile $profile."
|
||||
esac
|
||||
|
||||
# Prepare output folder
|
||||
rm -rf "$output"
|
||||
mkdir -p "$output"
|
||||
|
||||
# Prepare images in current folder
|
||||
# TODO(hungte) Deprecate arrow*.bmp by markup ◀ and ▶, and
|
||||
# Url.bmp by <span foreground="blue">http://</span>.
|
||||
for X in *.png assets/*.png; do
|
||||
if [ "$X" = "$BACKGROUND_IMAGE" ]; then
|
||||
convert_to_bmp3 "$output" "$background_scale_param" "$X"
|
||||
else
|
||||
convert_to_bmp3 "$output" "$scale_param" "$X"
|
||||
fi
|
||||
done
|
||||
|
||||
# Prepares strings and localized images. All these images were rendered by
|
||||
# pango-view and should not have transparency, so we specify flatten="" to
|
||||
# speed up.
|
||||
echo "Preparing common strings..."
|
||||
base="../strings"
|
||||
convert_to_bmp3 "$output" "$scale_param" $base/*.png
|
||||
|
||||
echo "Preparing localized messages... $LOCALES"
|
||||
base="../strings/localized_text"
|
||||
if [ -z "$LOCALES" ]; then
|
||||
# Collect all locales
|
||||
for X in $(cd $base; ls); do
|
||||
if [ -d "$base/$X" ]; then
|
||||
LOCALES="${LOCALES}${X} "
|
||||
fi
|
||||
done
|
||||
echo "Found locales: $LOCALES"
|
||||
fi
|
||||
for locale in $LOCALES; do
|
||||
# Prepare all locales.
|
||||
convert_to_bmp3 "$output/locale/$locale" "$scale_param" $base/$locale/*.png
|
||||
done
|
||||
|
||||
if [ -n "$replace_files" ]; then
|
||||
echo "Replacing files..."
|
||||
echo "$replace_files" | tr ' ' '\n' | while read X; do
|
||||
local Xdest="${X%%=*}" Xsrc="${X##*=}" Xfile=""
|
||||
echo " $Xsrc => $Xdest"
|
||||
for Xfile in $(find "$output" -name "$Xsrc.bmp"); do
|
||||
echo " * $Xfile"
|
||||
mv "$Xfile" "$(dirname "$Xfile")/$Xdest.bmp"
|
||||
done
|
||||
done
|
||||
fi
|
||||
|
||||
echo "Preparing fonts..."
|
||||
base="../strings/font"
|
||||
convert_to_bmp3 "$output/font" "$scale_param" $base/*.png
|
||||
bmpblk_font --outfile "$output/hwid_fonts.bin" "$output"/font/*.bmp
|
||||
|
||||
# Create YAML file.
|
||||
(cd "$output" && ../make_default_yaml $LOCALES)
|
||||
|
||||
# Compile bitmap block file.
|
||||
(cd "$output" && bmpblk_utility -c DEFAULT.yaml $BMPBLK_OUTPUT)
|
||||
ls -l "$output/$BMPBLK_OUTPUT"
|
||||
}
|
||||
|
||||
set -e
|
||||
main "$@"
|
||||
|
||||
|
Before Width: | Height: | Size: 2.6 KiB |
@@ -1,85 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
import getopt
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
|
||||
import Image
|
||||
|
||||
|
||||
BACKGROUND_COLOR = (255, 255, 255)
|
||||
DEFAULT_OUTPUT_EXT = '.bmp'
|
||||
|
||||
|
||||
def parse_scale_factor(pattern, original_size):
|
||||
# Format: w%xh%, or wxh!
|
||||
factor = re.findall(r'^([0-9]+)%x([0-9]+)%$', pattern)
|
||||
if factor:
|
||||
w, h = factor[0]
|
||||
return (int(int(w) / 100.0 * original_size[0]),
|
||||
int(int(h) / 100.0 * original_size[1]))
|
||||
|
||||
factor = re.findall(r'^([0-9]+)x([0-9]+)!?$', pattern)
|
||||
if factor:
|
||||
return map(int, factor[0])
|
||||
|
||||
raise Exception('Unknown scaling parameter: %s', pattern)
|
||||
|
||||
|
||||
def convert_to_bmp(input_file, scale, outdir, background=BACKGROUND_COLOR):
|
||||
source = Image.open(input_file)
|
||||
output_file = os.path.join(
|
||||
outdir,
|
||||
os.path.basename(input_file).rpartition('.')[0] + DEFAULT_OUTPUT_EXT)
|
||||
|
||||
# Process alpha channel and transparency.
|
||||
if source.mode == 'RGBA':
|
||||
target = Image.new('RGB', source.size, background)
|
||||
source.load() # required for source.split()
|
||||
mask = source.split()[-1]
|
||||
target.paste(source, mask=mask)
|
||||
elif (source.mode == 'P') and ('transparency' in source.info):
|
||||
exit('Sorry, PNG with RGBA palette is not supported.')
|
||||
elif source.mode != 'RGB':
|
||||
target = source.convert('RGB')
|
||||
else:
|
||||
target = source
|
||||
|
||||
# Process scaling
|
||||
if scale:
|
||||
new_size = parse_scale_factor(scale, source.size)
|
||||
target = target.resize(new_size, Image.BICUBIC)
|
||||
|
||||
# Export and downsample color space.
|
||||
target.convert('P', dither=None, palette=Image.ADAPTIVE).save(output_file)
|
||||
|
||||
|
||||
def main(argv):
|
||||
scale_param = ''
|
||||
outdir = ''
|
||||
try:
|
||||
opts, args = getopt.getopt(argv[1:], '', ('scale=', 'outdir='))
|
||||
for key, value in opts:
|
||||
if key == '--scale':
|
||||
scale_param = value
|
||||
elif key == '--outdir':
|
||||
outdir = value
|
||||
if len(args) < 1:
|
||||
raise Exception('need more param')
|
||||
except:
|
||||
exit('Usage: ' + argv[0] +
|
||||
' [--scale WxH!|--scale W%xH%] [--outdir DIR] files(s)...')
|
||||
|
||||
if outdir and not os.path.isdir(outdir):
|
||||
os.makedirs(outdir)
|
||||
|
||||
for source_file in args:
|
||||
convert_to_bmp(source_file, scale_param, outdir)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main(sys.argv)
|
||||
|
Before Width: | Height: | Size: 114 B |
|
Before Width: | Height: | Size: 244 B |
|
Before Width: | Height: | Size: 79 B |
@@ -1,479 +0,0 @@
|
||||
#!/bin/bash -eu
|
||||
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
#
|
||||
# Generate a new DEFAULT.yaml file using hwid_placeholder.bmp as a placeholder.
|
||||
# To speed up more, invoke this script by dash instead of bash.
|
||||
#
|
||||
yaml_file="DEFAULT.yaml"
|
||||
|
||||
# I'm sorting the locales in more-or-less geographical order. Right should move
|
||||
# east, left should move west. Of course we'll start in the US. :-)
|
||||
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="./locale"
|
||||
|
||||
# These render right-to-left
|
||||
rtol="ar fa iw"
|
||||
|
||||
# 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=5
|
||||
|
||||
# Globals used to specify location images are inserted.
|
||||
cur_x=0
|
||||
cur_y=0
|
||||
|
||||
reset_pos() {
|
||||
cur_x=0
|
||||
cur_y=0
|
||||
}
|
||||
|
||||
move_pos_up() {
|
||||
cur_y=$((cur_y - $1))
|
||||
}
|
||||
|
||||
move_pos_down() {
|
||||
cur_y=$((cur_y + $1))
|
||||
}
|
||||
|
||||
move_pos_left() {
|
||||
cur_x=$((cur_x - $1))
|
||||
}
|
||||
|
||||
move_pos_right() {
|
||||
cur_x=$((cur_x + $1))
|
||||
}
|
||||
|
||||
# Move insert location to the vertical midline of a specified image.
|
||||
# Example: set_centered_y_percent 'some_image' 80
|
||||
# Sets insert point to the center of an image specified by a variable name,
|
||||
# 80% towards the bottom. Assumes image was inserted at 0,0 so only good
|
||||
# for the background image.
|
||||
set_centered_y_percent() {
|
||||
cur_x=$(($(get_width $1) / 2))
|
||||
cur_y=$(($(get_height $1) * $2 / 100))
|
||||
}
|
||||
|
||||
# Define and cache image information. This function can't be executed inside
|
||||
# sub-shell.
|
||||
define_image() {
|
||||
local image_name="$1"
|
||||
local file_name="$2"
|
||||
local script="import Image;s = Image.open('$file_name').size;print s[0],s[1]"
|
||||
local image_size="$(python -c "$script")"
|
||||
local w="${image_size%% *}"
|
||||
local h="${image_size##* }"
|
||||
eval "export cache_w_$image_name=$w"
|
||||
eval "export cache_h_$image_name=$h"
|
||||
eval "export $image_name=$file_name"
|
||||
# For Yaml format registration -- indent with two leading space.
|
||||
echo " $image_name: $file_name"
|
||||
}
|
||||
|
||||
# Return width of an image (must be already processed by define_image).
|
||||
get_width() {
|
||||
eval echo "\$cache_w_$1"
|
||||
}
|
||||
|
||||
# Return the width of a list of images.
|
||||
total_width() {
|
||||
local width=$((0 - xpad))
|
||||
for filename in "$@"; do
|
||||
width=$((width + $(get_width ${filename}) + xpad))
|
||||
done
|
||||
echo $width
|
||||
}
|
||||
|
||||
# Return height of an image (must be already processed by define_image).
|
||||
get_height() {
|
||||
eval echo "\$cache_h_$1"
|
||||
}
|
||||
|
||||
# Returns the max height of a list of images.
|
||||
get_max_height() {
|
||||
local max_height=0
|
||||
local height
|
||||
for filename in $@; do
|
||||
height="$(get_height ${filename})"
|
||||
[ $max_height -gt $height ] || max_height=$height
|
||||
done
|
||||
echo $max_height
|
||||
}
|
||||
|
||||
# Guess the locale based on the filename, set a global "newlocales" list
|
||||
# accordingly.
|
||||
guess_locale() {
|
||||
local lc
|
||||
local islc
|
||||
local matches
|
||||
islc=
|
||||
|
||||
matches=0
|
||||
for lc in $locales; do
|
||||
case "$1" in
|
||||
*[_-]${lc}_* )
|
||||
matches=$((matches + 1))
|
||||
islc=$lc
|
||||
;;
|
||||
esac
|
||||
done
|
||||
if [ "$matches" != 1 ]; then
|
||||
islc='en'
|
||||
fi
|
||||
|
||||
local newlist
|
||||
newlist="$islc"
|
||||
for lc in $locales; do
|
||||
if [ "$lc" != "$islc" ]; then
|
||||
newlist="$newlist $lc"
|
||||
fi
|
||||
done
|
||||
|
||||
newlocales=$newlist
|
||||
}
|
||||
|
||||
# Add a list of images at provided location.
|
||||
# Images of different heights are added centered on the tallest image.
|
||||
add_images() {
|
||||
local x="$1"
|
||||
local y="$2"
|
||||
shift
|
||||
shift
|
||||
local files="$*"
|
||||
local max_height="$(get_max_height $files)"
|
||||
|
||||
for fname in $files; do
|
||||
tmp_y=$((y + (max_height - $(get_height $fname)) / 2))
|
||||
if [ "$fname" = "th_model_text" ]; then
|
||||
tmp_y=$((y - 9))
|
||||
fi
|
||||
echo " - [$x, $tmp_y, $fname]" >> "$yaml_file"
|
||||
x=$((x + $(get_width $fname) + xpad))
|
||||
done
|
||||
}
|
||||
|
||||
add_centered_below() {
|
||||
local images="$*"
|
||||
local width
|
||||
local height
|
||||
local x
|
||||
|
||||
width=$(total_width $images)
|
||||
x=$((cur_x - width / 2))
|
||||
|
||||
add_images $x $cur_y $images
|
||||
}
|
||||
|
||||
# This adds a list of images and updates the insert location
|
||||
# below the new images with a padding of $ypad.
|
||||
insert_centered_below() {
|
||||
local images="$*"
|
||||
local width
|
||||
local height
|
||||
local x
|
||||
|
||||
width=$(total_width $images)
|
||||
x=$((cur_x - width / 2))
|
||||
|
||||
add_images $x $cur_y $images
|
||||
|
||||
height=$(get_max_height $images)
|
||||
move_pos_down $((height + ypad))
|
||||
}
|
||||
|
||||
add_right_above() {
|
||||
local images="$*"
|
||||
local height
|
||||
local x
|
||||
local y
|
||||
|
||||
height=$(get_max_height $images)
|
||||
y=$((cur_y - height))
|
||||
|
||||
add_images $cur_x $y $images
|
||||
}
|
||||
|
||||
add_right_below() {
|
||||
add_images $cur_x $cur_y $@
|
||||
}
|
||||
|
||||
add_left_above() {
|
||||
local images="$*"
|
||||
local width
|
||||
local height
|
||||
local x
|
||||
local y
|
||||
|
||||
height=$(get_max_height $images)
|
||||
y=$((cur_y - height))
|
||||
|
||||
width=$(total_width $images)
|
||||
x=$((cur_x - width))
|
||||
|
||||
add_images $x $y $images
|
||||
}
|
||||
|
||||
add_centered() {
|
||||
local images="$*"
|
||||
local width
|
||||
local height
|
||||
local x
|
||||
local y
|
||||
|
||||
height=$(get_max_height $images)
|
||||
y=$((cur_y - height / 2))
|
||||
|
||||
width=$(total_width $images)
|
||||
x=$((cur_x - width / 2))
|
||||
|
||||
add_images $x $y $images
|
||||
}
|
||||
|
||||
add_header() {
|
||||
local lc="$1"
|
||||
set_centered_y_percent "white_bg" 17
|
||||
add_centered_below "divider_top"
|
||||
move_pos_left $(($(get_width "divider_top") / 2 ))
|
||||
move_pos_up $ypad
|
||||
add_right_above "chrome_logo"
|
||||
move_pos_right $(get_width "divider_top")
|
||||
if [ -n "$lc" ]; then
|
||||
add_left_above "arrow_left" "${lc}_language_text" "arrow_right"
|
||||
fi
|
||||
}
|
||||
|
||||
add_footer_with_url() {
|
||||
local lc=$1
|
||||
local old_xpad="$xpad"
|
||||
set_centered_y_percent "white_bg" 80
|
||||
insert_centered_below "divider_btm"
|
||||
# Temporarily change padding to zero because both help_*_text and url
|
||||
# have margins.
|
||||
xpad="0"
|
||||
insert_centered_below "${lc}_help_left_text" "url" "${lc}_help_right_text"
|
||||
if echo "$rtol" | grep -q -w "$lc" ; then
|
||||
insert_centered_below 'hwid' "${lc}_model_text"
|
||||
else
|
||||
insert_centered_below "${lc}_model_text" 'hwid'
|
||||
fi
|
||||
echo "" >> "$yaml_file"
|
||||
xpad="$old_xpad"
|
||||
}
|
||||
|
||||
add_footer_without_url() {
|
||||
local lc=$1
|
||||
set_centered_y_percent "white_bg" 80
|
||||
insert_centered_below "divider_btm"
|
||||
# For some locales like th, we need to prevent text overlapping divider.
|
||||
# Doubling with ypad seems like a good idea.
|
||||
move_pos_down $ypad
|
||||
if echo "$rtol" | grep -q -w "$lc" ; then
|
||||
insert_centered_below 'hwid' "${lc}_model_text"
|
||||
else
|
||||
insert_centered_below "${lc}_model_text" 'hwid'
|
||||
fi
|
||||
echo "" >> "$yaml_file"
|
||||
}
|
||||
|
||||
# TODO(hungte) Remove the unnecessary hwid_*.bmp loop below.
|
||||
# Generate a new yaml file for each specified hwid_*.bmp file.
|
||||
for hwid_bmp in hwid_placeholder.bmp; do
|
||||
echo "$yaml_file"
|
||||
|
||||
# List the images. The major difference is the HWID.
|
||||
cat >"$yaml_file" <<EOF1
|
||||
bmpblock: 2.0
|
||||
|
||||
compression: 2
|
||||
|
||||
images:
|
||||
|
||||
# We must specify a font blob to use to render the HWID
|
||||
\$HWID: hwid_fonts.bin
|
||||
EOF1
|
||||
|
||||
# Global variables matching the yaml definitions
|
||||
{
|
||||
define_image url Url.bmp
|
||||
define_image arrow_left arrow_left.bmp
|
||||
define_image arrow_right arrow_right.bmp
|
||||
define_image chrome_logo chrome_logo.bmp
|
||||
define_image divider_btm divider_btm.bmp
|
||||
define_image divider_top divider_top.bmp
|
||||
define_image white_bg Background_white.bmp
|
||||
define_image asset_BadSD BadSD.bmp
|
||||
define_image asset_BadUSB BadUSB.bmp
|
||||
define_image asset_RemoveDevices RemoveDevices.bmp
|
||||
define_image asset_VerificationOff VerificationOff.bmp
|
||||
define_image asset_VerificationOn VerificationOn.bmp
|
||||
define_image asset_Warning Warning.bmp
|
||||
} >>"$yaml_file"
|
||||
|
||||
# A virtual entry that is not really included in Yaml file.
|
||||
define_image hwid "$hwid_bmp" >/dev/null
|
||||
|
||||
# Enumerate the bitmaps for each locale-specific string.
|
||||
for lc in $locales; do
|
||||
define_image ${lc}_model_text ${localedir}/$lc/model.bmp
|
||||
define_image ${lc}_devmode_text ${localedir}/$lc/devmode.bmp
|
||||
define_image ${lc}_remove_text ${localedir}/$lc/remove.bmp
|
||||
define_image ${lc}_yuck_text ${localedir}/$lc/yuck.bmp
|
||||
define_image ${lc}_insert_text ${localedir}/$lc/insert.bmp
|
||||
define_image ${lc}_language_text ${localedir}/$lc/language.bmp
|
||||
define_image ${lc}_help_left_text ${localedir}/$lc/for_help_left.bmp
|
||||
define_image ${lc}_help_right_text ${localedir}/$lc/for_help_right.bmp
|
||||
define_image ${lc}_todev_text ${localedir}/$lc/todev.bmp
|
||||
define_image ${lc}_tonorm_text ${localedir}/$lc/tonorm.bmp
|
||||
define_image ${lc}_verif_off_text ${localedir}/$lc/verif_off.bmp
|
||||
define_image ${lc}_verif_on_text ${localedir}/$lc/verif_on.bmp
|
||||
define_image ${lc}_reboot_erase_text ${localedir}/$lc/reboot_erase.bmp
|
||||
define_image ${lc}_update_text ${localedir}/$lc/update.bmp
|
||||
done >>"$yaml_file"
|
||||
|
||||
# List the screens. We need to composite four screens for each locale.
|
||||
echo "screens:" >> "$yaml_file"
|
||||
|
||||
for lc in $locales; do
|
||||
echo -n " $lc"
|
||||
|
||||
# Dev Screen
|
||||
echo " ${lc}_devel:" >> "$yaml_file"
|
||||
reset_pos
|
||||
add_right_below "white_bg"
|
||||
add_header ${lc}
|
||||
set_centered_y_percent "white_bg" 30
|
||||
insert_centered_below "asset_VerificationOff"
|
||||
insert_centered_below "${lc}_verif_off_text"
|
||||
insert_centered_below "${lc}_devmode_text"
|
||||
add_footer_without_url ${lc}
|
||||
|
||||
# Remove Screen
|
||||
echo " ${lc}_remove:" >> "$yaml_file"
|
||||
reset_pos
|
||||
add_right_below "white_bg"
|
||||
add_header ${lc}
|
||||
set_centered_y_percent "white_bg" 25
|
||||
add_centered_below "${lc}_remove_text"
|
||||
set_centered_y_percent "white_bg" 50
|
||||
add_centered "asset_RemoveDevices"
|
||||
add_footer_with_url ${lc}
|
||||
|
||||
# Yuck Screen
|
||||
echo " ${lc}_yuck:" >> "$yaml_file"
|
||||
reset_pos
|
||||
add_right_below "white_bg"
|
||||
add_header ${lc}
|
||||
set_centered_y_percent "white_bg" 25
|
||||
add_centered_below "${lc}_yuck_text"
|
||||
set_centered_y_percent "white_bg" 50
|
||||
add_centered "asset_BadSD" "asset_BadUSB"
|
||||
add_footer_with_url ${lc}
|
||||
|
||||
# Insert Screen
|
||||
echo " ${lc}_insert:" >> "$yaml_file"
|
||||
reset_pos
|
||||
add_right_below "white_bg"
|
||||
add_header ${lc}
|
||||
set_centered_y_percent "white_bg" 30
|
||||
insert_centered_below "asset_Warning"
|
||||
insert_centered_below "${lc}_insert_text"
|
||||
add_footer_with_url ${lc}
|
||||
|
||||
# ToDeveloper Screen
|
||||
echo " ${lc}_todev:" >> "$yaml_file"
|
||||
reset_pos
|
||||
add_right_below "white_bg"
|
||||
add_header ${lc}
|
||||
set_centered_y_percent "white_bg" 45
|
||||
add_centered "${lc}_todev_text"
|
||||
add_footer_without_url ${lc}
|
||||
|
||||
# ToNormal Screen
|
||||
echo " ${lc}_tonorm:" >> "$yaml_file"
|
||||
reset_pos
|
||||
add_right_below "white_bg"
|
||||
add_header ${lc}
|
||||
set_centered_y_percent "white_bg" 30
|
||||
insert_centered_below "asset_VerificationOff"
|
||||
insert_centered_below "${lc}_verif_off_text"
|
||||
insert_centered_below "${lc}_tonorm_text"
|
||||
add_footer_without_url ${lc}
|
||||
|
||||
# Update (WAIT) Screen
|
||||
echo " ${lc}_update:" >> "$yaml_file"
|
||||
reset_pos
|
||||
add_right_below "white_bg"
|
||||
# Currently WAIT screen does not accept any keyboard input, so we don't
|
||||
# display language on menubar.
|
||||
add_header ""
|
||||
set_centered_y_percent "white_bg" 50
|
||||
add_centered "${lc}_update_text"
|
||||
add_footer_without_url ${lc}
|
||||
|
||||
# ToNormalConfirm Screen
|
||||
echo " ${lc}_tonorm_confirm:" >> "$yaml_file"
|
||||
reset_pos
|
||||
add_right_below "white_bg"
|
||||
add_header ""
|
||||
set_centered_y_percent "white_bg" 30
|
||||
insert_centered_below "asset_VerificationOn"
|
||||
insert_centered_below "${lc}_verif_on_text"
|
||||
insert_centered_below "${lc}_reboot_erase_text"
|
||||
add_footer_without_url ${lc}
|
||||
|
||||
done
|
||||
|
||||
# Finally list the localizations.
|
||||
|
||||
cat >>"$yaml_file" <<EOF2
|
||||
localizations:
|
||||
|
||||
# This determines the order in which the localizations appear. The first
|
||||
# one is the default.
|
||||
|
||||
EOF2
|
||||
|
||||
# Let's try to use the native one first, if we can.
|
||||
guess_locale "$yaml_file"
|
||||
|
||||
for lc in $newlocales; do
|
||||
screen_list="${lc}_devel, ${lc}_remove, ${lc}_yuck, ${lc}_insert"
|
||||
# todev/tonorm/update are supported only by newer firmware.
|
||||
screen_list="${screen_list}, ${lc}_todev, ${lc}_tonorm, ${lc}_update"
|
||||
screen_list="${screen_list}, ${lc}_tonorm_confirm"
|
||||
echo " - [ $screen_list ]" >>"$yaml_file"
|
||||
done
|
||||
|
||||
cat >>"$yaml_file" <<EOF3
|
||||
|
||||
locale_index:
|
||||
|
||||
# List the locale names in order so we can choose the default at the factory
|
||||
|
||||
EOF3
|
||||
|
||||
for lc in $newlocales; do
|
||||
echo " - ${lc}" >> "$yaml_file"
|
||||
done
|
||||
|
||||
done
|
||||
|
||||
# Now replace the 'hwid' string with '$HWID'.
|
||||
sed -i 's/\bhwid\b/\$HWID/g' "$yaml_file"
|
||||
|
||||
echo ""
|
||||
@@ -1,6 +0,0 @@
|
||||
# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
import bmpblock
|
||||
import pixcontrol
|
||||
import pixdisplay
|
||||
@@ -1,120 +0,0 @@
|
||||
#!/usr/bin/python -tt
|
||||
# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
"""A BmpBlock class"""
|
||||
|
||||
import os
|
||||
import types
|
||||
import yaml
|
||||
|
||||
class BmpBlock(object):
|
||||
"""A wrapper for the config.yaml file.
|
||||
It has a few special attributes to specify which part we're focusing on.
|
||||
"""
|
||||
|
||||
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)
|
||||
|
||||
def LoadFile(self, filename):
|
||||
"""Load the specified yaml file and verify that it's a valid BmpBlock"""
|
||||
print "Loading", filename
|
||||
with open(filename, 'rb') as f:
|
||||
stuff = yaml.safe_load(f)
|
||||
# FIXME: This is pretty lame. We should be able to find images using a
|
||||
# default directory path instead of using chdir.
|
||||
if os.path.dirname(filename):
|
||||
os.chdir(os.path.dirname(filename))
|
||||
if self.IsValidSyntax(stuff):
|
||||
self.yaml = stuff
|
||||
self.current_screen = sorted(self.yaml["screens"].keys())[0]
|
||||
|
||||
def Reload(self):
|
||||
tmp = self.current_screen
|
||||
self.LoadFile(self.filename)
|
||||
if tmp in self.yaml["screens"]:
|
||||
self.current_screen = tmp
|
||||
|
||||
def IsValidSyntax(self, thing):
|
||||
"""Raise an error if the specified dict is not a valid BmpBlock structure"""
|
||||
|
||||
assert isinstance(thing, dict)
|
||||
|
||||
seen_images = {"$HWID":1, "$HWID.rtol":2}
|
||||
seen_screens = {}
|
||||
|
||||
images = thing["images"]
|
||||
assert isinstance(images, dict)
|
||||
assert len(images) > 0
|
||||
# image values should all be filenames (ie, strings)
|
||||
for val in images.values():
|
||||
assert val and isinstance(val, types.StringTypes)
|
||||
# don't worry about fonts. eventually we'll have graphical mocks on host.
|
||||
if "$HWID" in images:
|
||||
print "WARNING: ignoring $HWID font blob"
|
||||
if "$HWID.rtol" in images:
|
||||
print "WARNING: ignoring $HWID.rtol font blob"
|
||||
# TODO(hungte) Replace this by rendering with font block.
|
||||
images["$HWID"] = 'hwid_placeholder.bmp'
|
||||
images["$HWID.rtol"] = 'hwid_placeholder.bmp'
|
||||
|
||||
screens = thing["screens"]
|
||||
assert isinstance(screens, dict)
|
||||
assert screens
|
||||
# screen values should all be lists of 3-tuples
|
||||
for scrname, imglist in screens.items():
|
||||
assert len(imglist) <= 16
|
||||
for img in imglist:
|
||||
assert 3 == len(img)
|
||||
# must have defined all referenced bitmaps
|
||||
x,y,i = img
|
||||
assert i in images
|
||||
seen_images[i] = True
|
||||
|
||||
localizations = thing["localizations"]
|
||||
assert hasattr(localizations, '__iter__')
|
||||
assert localizations
|
||||
# localizations should all be lists with the same number of screens
|
||||
len0 = len(localizations[0])
|
||||
assert len0
|
||||
for elt in localizations:
|
||||
assert len0 == len(elt)
|
||||
# we must have defined all referenced screens
|
||||
for scr in elt:
|
||||
assert scr in screens
|
||||
seen_screens[scr] = True
|
||||
|
||||
for unused_img in [x for x in images if x not in seen_images]:
|
||||
print " Unused image:", unused_img
|
||||
for unused_scr in [x for x in screens if x not in seen_screens]:
|
||||
print " Unused screen:", unused_scr
|
||||
|
||||
return True
|
||||
|
||||
def RegisterScreenDisplayObject(self, displayer):
|
||||
"""Register an object with a .Redisplay() function to display updates."""
|
||||
self.displayer = displayer
|
||||
|
||||
|
||||
def Redisplay(self):
|
||||
"""Redisplay contents."""
|
||||
if self.displayer:
|
||||
if self.current_screen:
|
||||
sc = self.yaml['screens'][self.current_screen]
|
||||
slist = [(x,y,self.yaml['images'][z]) for x,y,z in sc]
|
||||
self.displayer.DisplayScreen(self.current_screen, slist)
|
||||
|
||||
def Saveit(self):
|
||||
"""Save current screen to file."""
|
||||
if self.displayer:
|
||||
if self.current_screen:
|
||||
sc = self.yaml['screens'][self.current_screen]
|
||||
slist = [(x,y,self.yaml['images'][z]) for x,y,z in sc]
|
||||
self.displayer.SaveScreen(self.current_screen, slist)
|
||||
@@ -1,121 +0,0 @@
|
||||
#!/usr/bin/python -tt
|
||||
# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
"""Edit buttons for bmpblock object"""
|
||||
|
||||
import wx
|
||||
|
||||
class Frame(wx.Frame):
|
||||
|
||||
def __init__(self, bmpblock=None, title=None):
|
||||
wx.Frame.__init__(self, None, wx.ID_ANY, title, size=(200,400))
|
||||
menuFile = wx.Menu()
|
||||
m_about = menuFile.Append(wx.ID_ANY, "About...\tCtrl+A")
|
||||
menuFile.AppendSeparator()
|
||||
m_reload = menuFile.Append(wx.ID_ANY, "Reload\tCtrl+R")
|
||||
m_snapshot = menuFile.Append(wx.ID_ANY, "Save snapshot")
|
||||
m_snapshotall = menuFile.Append(wx.ID_ANY, "Save snapshot of all screens")
|
||||
m_quit = menuFile.Append(wx.ID_ANY, "Quit\tCtrl+Q")
|
||||
menuBar = wx.MenuBar()
|
||||
menuBar.Append(menuFile, "&File")
|
||||
self.SetMenuBar(menuBar)
|
||||
self.CreateStatusBar()
|
||||
self.Bind(wx.EVT_MENU, self.OnAbout, m_about)
|
||||
self.Bind(wx.EVT_MENU, self.OnReload, m_reload)
|
||||
self.Bind(wx.EVT_MENU, self.OnSaveit, m_snapshot)
|
||||
self.Bind(wx.EVT_MENU, self.OnSaveAll, m_snapshotall)
|
||||
self.Bind(wx.EVT_MENU, self.OnQuit, m_quit)
|
||||
self.Bind(wx.EVT_CLOSE, self.OnQuit)
|
||||
|
||||
acctbl = wx.AcceleratorTable([
|
||||
(wx.ACCEL_CTRL, ord('A'), m_about.GetId()),
|
||||
(wx.ACCEL_CTRL, ord('R'), m_reload.GetId()),
|
||||
(wx.ACCEL_CTRL, ord('Q'), m_quit.GetId())
|
||||
])
|
||||
|
||||
self.SetAcceleratorTable(acctbl)
|
||||
|
||||
# create UI components
|
||||
panel = wx.Panel(self)
|
||||
button_reload = wx.Button(panel, label="Reload File")
|
||||
self.screenlist = wx.ListBox(panel, wx.ID_ANY)
|
||||
|
||||
# connect events
|
||||
self.Bind(wx.EVT_BUTTON, self.OnReload, button_reload)
|
||||
self.Bind(wx.EVT_LISTBOX, self.OnSelected, self.screenlist)
|
||||
self.Bind(wx.EVT_IDLE, self.OnIdle)
|
||||
|
||||
# place the componenents
|
||||
sizer = wx.BoxSizer(wx.VERTICAL)
|
||||
sizer.Add(button_reload)
|
||||
sizer.Add(wx.StaticText(panel, wx.ID_ANY, "Screens"))
|
||||
sizer.Add(self.screenlist, 1, wx.EXPAND)
|
||||
|
||||
panel.SetSizer(sizer)
|
||||
panel.Fit()
|
||||
|
||||
# now, what are we looking at?
|
||||
self.bmpblock = bmpblock
|
||||
self.UpdateControls()
|
||||
self.do_update = True
|
||||
self.screenlist.SetFocus()
|
||||
|
||||
def OnAbout(self, event):
|
||||
"""Display basic information about this application."""
|
||||
msg = ("Yes, all this does right now is display the screens from the config"
|
||||
" file. You still have to edit, save, and reload in order to see any"
|
||||
" changes. Learning python and wxpython is my 20% project (actually"
|
||||
" it's more like 5%). Feel free to improve things.\n\t-- bill")
|
||||
wx.MessageBox(msg, "About", wx.OK | wx.ICON_INFORMATION, self)
|
||||
|
||||
def OnQuit(self, event):
|
||||
"""Close all application windows and quit."""
|
||||
wx.GetApp().ExitMainLoop()
|
||||
|
||||
def OnReload(self, event):
|
||||
"""Tell the model object to refresh the view that the user sees.
|
||||
FIXME: The model itself should know to do this without being told.
|
||||
"""
|
||||
self.bmpblock.Reload()
|
||||
self.do_update = True;
|
||||
self.UpdateControls()
|
||||
|
||||
def OnSaveit(self, event):
|
||||
"""Tell the model object to save the view that the user sees."""
|
||||
self.bmpblock.Saveit()
|
||||
|
||||
def OnSelected(self, event):
|
||||
"""User may have picked one of the pulldowns."""
|
||||
if event.IsSelection():
|
||||
self.bmpblock.current_screen = event.GetString()
|
||||
self.do_update = True
|
||||
event.Skip()
|
||||
|
||||
def UpdateControls(self):
|
||||
"""Reload all the buttons with the current model information."""
|
||||
screens = self.bmpblock.yaml["screens"]
|
||||
self.screenlist.Clear()
|
||||
self.screenlist.AppendItems(sorted(screens.keys()))
|
||||
current = self.bmpblock.current_screen
|
||||
self.screenlist.SetStringSelection(current)
|
||||
self.SetStatusText(self.bmpblock.filename)
|
||||
|
||||
def OnIdle(self, event=None):
|
||||
"""What to do, what to do..."""
|
||||
if self.do_update:
|
||||
# FIXME: The model should know when to do this itself, right?
|
||||
self.bmpblock.Redisplay()
|
||||
self.do_update = False
|
||||
|
||||
def OnSaveAll(self, event=None):
|
||||
"""Save snapshots of all screens"""
|
||||
start = self.bmpblock.current_screen
|
||||
thinglist = self.screenlist.GetItems()
|
||||
for thing in thinglist:
|
||||
self.bmpblock.current_screen = thing
|
||||
self.bmpblock.Redisplay()
|
||||
self.bmpblock.Saveit()
|
||||
self.bmpblock.current_screen = start
|
||||
self.do_update = True
|
||||
@@ -1,84 +0,0 @@
|
||||
#!/usr/bin/python -tt
|
||||
# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
"""Display for bmpblock object."""
|
||||
import wx
|
||||
|
||||
class MyPanel(wx.Panel):
|
||||
|
||||
def __init__(self, parent):
|
||||
wx.Panel.__init__(self, parent, wx.ID_ANY)
|
||||
self.Bind(wx.EVT_PAINT, self.OnPaint)
|
||||
self.parent = parent
|
||||
self.imglist = ()
|
||||
|
||||
def OnPaint(self, evt=None):
|
||||
if (evt):
|
||||
dc = wx.PaintDC(self)
|
||||
else:
|
||||
dc = wx.ClientDC(self)
|
||||
|
||||
done_first = False
|
||||
# The first image in the sequence may be used by the BIOS to set the
|
||||
# display resolution. Regardless, it should match the desired or default
|
||||
# resolution so that any previous screens get cleared.
|
||||
for x, y, filename in self.imglist:
|
||||
img = wx.Image(filename, wx.BITMAP_TYPE_ANY)
|
||||
if (not done_first):
|
||||
size = img.GetSize()
|
||||
self.SetMinSize(size)
|
||||
self.SetSize(size)
|
||||
self.Fit()
|
||||
w,h = self.parent.GetBestSize()
|
||||
self.parent.SetDimensions(-1, -1, w, h, wx.SIZE_AUTO)
|
||||
done_first = True
|
||||
bmp = img.ConvertToBitmap()
|
||||
dc.DrawBitmap(bmp, x, y)
|
||||
|
||||
def OnSave(self, name):
|
||||
"""Draw the current image sequence into a file."""
|
||||
dc = wx.MemoryDC()
|
||||
done_first = False
|
||||
for x, y, filename in self.imglist:
|
||||
img = wx.Image(filename, wx.BITMAP_TYPE_ANY)
|
||||
if (not done_first):
|
||||
w,h = img.GetSize()
|
||||
base = wx.EmptyBitmap(w,h)
|
||||
dc.SelectObject(base)
|
||||
done_first = True
|
||||
bmp = img.ConvertToBitmap()
|
||||
dc.DrawBitmap(bmp, x, y)
|
||||
new = wx.ImageFromBitmap(base)
|
||||
outfile = name + '.png'
|
||||
new.SaveFile(outfile, wx.BITMAP_TYPE_PNG)
|
||||
print "wrote", outfile
|
||||
|
||||
|
||||
class Frame(wx.Frame):
|
||||
|
||||
def __init__(self, bmpblock=None, title=None):
|
||||
wx.Frame.__init__(self, None, wx.ID_ANY, title=title)
|
||||
self.CreateStatusBar()
|
||||
self.SetStatusText(title)
|
||||
self.Bind(wx.EVT_CLOSE, self.OnQuit)
|
||||
|
||||
self.bmpblock = bmpblock
|
||||
if self.bmpblock:
|
||||
self.bmpblock.RegisterScreenDisplayObject(self)
|
||||
|
||||
self.p = MyPanel(self)
|
||||
|
||||
|
||||
def OnQuit(self, event):
|
||||
wx.GetApp().ExitMainLoop()
|
||||
|
||||
def DisplayScreen(self, name, imglist):
|
||||
self.SetStatusText(name)
|
||||
self.p.imglist = imglist
|
||||
self.p.OnPaint()
|
||||
|
||||
def SaveScreen(self, name, imglist):
|
||||
self.p.imglist = imglist
|
||||
self.p.OnSave(name)
|
||||
@@ -1,11 +0,0 @@
|
||||
This directory contains bitmap image sources used to create already shipping
|
||||
systems. We don't expect to need these again, unless there's some emergency
|
||||
needed by the factory flow that requires a change to the read-only BIOS
|
||||
screens.
|
||||
|
||||
* To build new Alex bitmaps, check out "chromeos/autotest-private-x86-alex"
|
||||
on branch "0.11.241.B", and see the tools in
|
||||
client/site_tests/hardware_Components/utils.
|
||||
|
||||
Reference: https://gerrit-int.chromium.org/#/c/23243/
|
||||
|
||||
@@ -1,132 +0,0 @@
|
||||
#!/bin/bash -e
|
||||
# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
#
|
||||
# This adds text to our non-labeled recovery images.
|
||||
#
|
||||
# The source images should be 1366x800, with the expectation they'll be cropped
|
||||
# to <screen geometry>, which is 1366x768 or 1280x800, have 2 lines of text
|
||||
# overlayed at the bottom, and then be resized to 800x600 if on x86, otherwise
|
||||
# same as <screen geometry>. On x86, resizing to 800x600 because the BIOS can
|
||||
# then display them stretched to the full screen size.
|
||||
#
|
||||
|
||||
|
||||
# Require three args
|
||||
if [ $# -ne "3" -o \( "$3" != "x86" -a "$3" != "arm" \) ]; then
|
||||
echo "Usage: $(basename $0) <HWID> <screen geometry> <x86/arm>" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
HWID=$1
|
||||
geom_crop=$2
|
||||
geom_final='800x600!'
|
||||
flag_final=
|
||||
# If arm, make the final geometry as screen size and use 8bpp rle format.
|
||||
if [ $3 = "arm" ]; then
|
||||
geom_final=$2
|
||||
flag_final="-colors 256 -compress rle"
|
||||
fi
|
||||
|
||||
nicename=${HWID// /_}
|
||||
|
||||
# Default URL
|
||||
URL='http://google.com/chromeos/recovery'
|
||||
|
||||
# Image parameters
|
||||
geom_orig='1366x800'
|
||||
bluecolor='#9ccaec'
|
||||
bluefont="Helvetica-Narrow"
|
||||
bluepointsize=30
|
||||
whitefont="Helvetica-Narrow"
|
||||
whitepointsize=48
|
||||
|
||||
|
||||
# Temporary files
|
||||
tmpdir=$(mktemp -d /tmp/tmp.bmp.XXXXXX)
|
||||
trap "rm -rf $tmpdir" EXIT
|
||||
img_orig="${tmpdir}/img_orig.bmp"
|
||||
img_crop="${tmpdir}/img_crop.bmp"
|
||||
img_txt="${tmpdir}/img_txt.bmp"
|
||||
label_file="${tmpdir}/label.txt"
|
||||
label_img="${tmpdir}/label.bmp"
|
||||
|
||||
# Output directories
|
||||
thisdir=$(readlink -e $(dirname $0))
|
||||
outdir="out_${nicename}"
|
||||
[ -d "$outdir" ] || mkdir -p "$outdir"
|
||||
|
||||
function find_background_color {
|
||||
src_img=$1
|
||||
convert "$src_img" -crop '1x1+10+10!' txt:- | \
|
||||
perl -n -e 'print "$1" if m/(#[0-9a-f]+)/i;'
|
||||
}
|
||||
|
||||
function process_one_file {
|
||||
src_img=$1
|
||||
|
||||
# Figure out the filenames to use
|
||||
txt_file=${src_img%*.gif}.txt
|
||||
root=$(basename "$src_img")
|
||||
root=${root%*.*}
|
||||
# one more layer of heirarchy to match BIOS source tree
|
||||
dst_dir="${outdir}/${root}"
|
||||
[ -d "$dst_dir" ] || mkdir -p "$dst_dir"
|
||||
dst_img="${dst_dir}/${root}.bmp"
|
||||
echo "processing $root ..."
|
||||
|
||||
# First, make sure we start with the right-size original
|
||||
bg=$(find_background_color "$src_img")
|
||||
convert "$src_img" -background "$bg" \
|
||||
-gravity center -extent $geom_orig "$img_orig"
|
||||
|
||||
# Now crop that to the two target sizes
|
||||
convert "$img_orig" -gravity Center \
|
||||
-crop "$geom_crop"+0+0 +repage "$img_crop"
|
||||
|
||||
# Add the labels in
|
||||
if [ -r "$txt_file" ]; then
|
||||
# The only way to change font and color in multiline text is to split each
|
||||
# line into a separate image and then composite them together. Ugh.
|
||||
# First, split each input line into a separate file.
|
||||
"${thisdir}/makelines.sh" -u "$URL" -m "$HWID" -d "$tmpdir" "$txt_file"
|
||||
# Convert each line file into an image file.
|
||||
for txtfile in ${tmpdir}/linetxt_*; do
|
||||
case "$txtfile" in
|
||||
*.txt)
|
||||
convert \
|
||||
-background "$bg" -fill "$bluecolor" \
|
||||
-font "$bluefont" -pointsize "$bluepointsize" \
|
||||
-bordercolor "$bg" -border 0x1 \
|
||||
label:'@'"$txtfile" "${txtfile%.*}".bmp
|
||||
;;
|
||||
*.TXT)
|
||||
convert \
|
||||
-background "$bg" -fill "white" \
|
||||
-font "$whitefont" -pointsize "$whitepointsize" \
|
||||
-bordercolor "$bg" -border 0x10 \
|
||||
label:'@'"$txtfile" "${txtfile%.*}".bmp
|
||||
;;
|
||||
esac
|
||||
done
|
||||
# Now bash them all together to make one image.
|
||||
convert -background "$bg" -gravity center ${tmpdir}/linetxt_*.bmp \
|
||||
label:'\n\n\n\n' -append "$label_img"
|
||||
# Finally, layer the label image on top of the original.
|
||||
composite "$label_img" -gravity south "$img_crop" "$img_txt"
|
||||
else
|
||||
mv "$img_crop" "$img_txt"
|
||||
fi
|
||||
|
||||
# Now scale the result to the final size
|
||||
convert "$img_txt" -scale "$geom_final" -alpha off $flag_final "$dst_img"
|
||||
}
|
||||
|
||||
|
||||
# Do it.
|
||||
for file in ${thisdir}/originals/*.gif; do
|
||||
process_one_file "$file"
|
||||
done
|
||||
|
||||
# Zip up the bitmaps
|
||||
(cd "$outdir" && zip -qr "${geom_crop}.zip" *)
|
||||
@@ -1,44 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
use strict;
|
||||
our $opt_u = 'http://www.chromium.org';
|
||||
our $opt_m = 'Unsupported Prototype 0000';
|
||||
our $opt_d = '.';
|
||||
|
||||
use File::Basename;
|
||||
my $progdir = dirname($0);
|
||||
my $prog = basename($0);
|
||||
|
||||
use Getopt::Std;
|
||||
my $usage = "
|
||||
Usage: $prog
|
||||
|
||||
";
|
||||
getopts('u:m:d:') or die $usage;
|
||||
|
||||
my @old = glob("$opt_d/linetxt_*");
|
||||
unlink(@old) if @old;
|
||||
|
||||
$/ = undef;
|
||||
$_ = <>;
|
||||
s/\s+$//gs;
|
||||
|
||||
my $count = 1;
|
||||
foreach (split(/\n/, $_))
|
||||
{
|
||||
s/^\s+//;
|
||||
s/\s+$//;
|
||||
s/\$URL/$opt_u/g;
|
||||
s/\$MODEL/$opt_m/g;
|
||||
$_ = ' ' unless $_;
|
||||
my $big = s/^\$BIG:\s*//;
|
||||
my $filename = sprintf('%s/linetxt_%02d.%s', $opt_d, $count++,
|
||||
$big ? 'TXT' : 'txt');
|
||||
# print "$filename: ($_)\n"; next;
|
||||
open(OUT, ">$filename") || die "$0 can't write $filename: $!\n";
|
||||
print OUT "$_";
|
||||
close(OUT);
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 18 KiB |
@@ -1,2 +0,0 @@
|
||||
Chrome OS verification is turned off.
|
||||
Press space to begin recovery.
|
||||
|
Before Width: | Height: | Size: 17 KiB |
@@ -1,3 +0,0 @@
|
||||
Please remove all USB and SD devices to begin recovery.
|
||||
$BIG: $URL
|
||||
Model: $MODEL
|
||||
|
Before Width: | Height: | Size: 16 KiB |
@@ -1,4 +0,0 @@
|
||||
Chrome OS is missing or damaged.
|
||||
Please connect a recovery device.
|
||||
$BIG: $URL
|
||||
Model: $MODEL
|
||||
|
Before Width: | Height: | Size: 15 KiB |
@@ -1,3 +0,0 @@
|
||||
The device you inserted does not contain Chrome OS. Try another?
|
||||
$BIG: $URL
|
||||
Model: $MODEL
|
||||
@@ -1,68 +0,0 @@
|
||||
#!/bin/bash -e
|
||||
# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
#
|
||||
# This script searches the directory tree passed in as the parameter for
|
||||
# bmp_*.fv files, figures out the FWID strings from files' names, verifies the
|
||||
# FWIDs' integrity (by recalculating the CRC included in the FWID string) and
|
||||
# then rebuilds the bitmaps with the appropriate text and target specific
|
||||
# geometry.
|
||||
#
|
||||
|
||||
|
||||
# Given a string "<prefix>_<el1>_<el2>_.._<eln>_<suffix>" print string
|
||||
# '<el1> <el2> .. <eln>', i.e. <prefix>_ and _<suffix> dropped and underscores
|
||||
# replaced with spaces.
|
||||
get_elements() {
|
||||
echo $1 | awk 'BEGIN {FS="_"}; {
|
||||
x = 2;
|
||||
do {
|
||||
printf "%s ", $x;
|
||||
x += 1
|
||||
} while (x < (NF - 1))
|
||||
printf "%s", $(NF-1);
|
||||
}'
|
||||
}
|
||||
|
||||
# Concatenate input parameters into a space separated string, calculate the
|
||||
# string's CRC32 and print the last four hex digits of the crc.
|
||||
signer() {
|
||||
python -c "import sys,zlib;
|
||||
me=' '.join(sys.argv[1:]);
|
||||
print ('%04u'%(zlib.crc32(me)&0xffffffffL))[-4:]" $1
|
||||
}
|
||||
|
||||
|
||||
if [ "$#" != "1" -o ! -d "$1" ]; then
|
||||
echo "One parameter is required, the path to the chromeos release tree" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
tree=$(readlink -f $1)
|
||||
cd $(dirname "$0")
|
||||
for f in $(find "${tree}" -type f -name 'bmp_*_[0-9]*.fv'); do
|
||||
filename=$(basename "$f")
|
||||
elements="$(get_elements $filename)"
|
||||
signature=$(signer "${elements}")
|
||||
|
||||
# Rebuild file name to verify CRC.
|
||||
comp_name=bmp_${elements// /_}_${signature}.fv
|
||||
if [ "${filename}" != "${comp_name}" ]; then
|
||||
echo "skipping ${filename} (crc mismatch with ${comp_name})"
|
||||
continue
|
||||
fi
|
||||
echo "Processing ${filename}"
|
||||
case "${elements}" in
|
||||
(*ACER*) geometry='1366x768'
|
||||
;;
|
||||
(*MARIO*) geometry='1280x800'
|
||||
;;
|
||||
(*) echo "skipping ${filename}, unknown target geometry"
|
||||
echo
|
||||
continue
|
||||
;;
|
||||
esac
|
||||
./make_bmp_images.sh "${elements} ${signature}" "${geometry}" "x86"
|
||||
echo
|
||||
done
|
||||
|
Before Width: | Height: | Size: 1.4 MiB |
|
Before Width: | Height: | Size: 1.4 MiB |
|
Before Width: | Height: | Size: 1.4 MiB |
|
Before Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 1.4 MiB |
@@ -1,225 +0,0 @@
|
||||
bmpblock: 1.1
|
||||
|
||||
compression: 1
|
||||
|
||||
images:
|
||||
|
||||
# This URL never changes
|
||||
url: URL.bmp
|
||||
|
||||
# The background images are from the UI people
|
||||
devmode_bg: Devmode.bmp
|
||||
remove_bg: Remove.bmp
|
||||
yuck_bg: Yuck.bmp
|
||||
insert_bg: Insert.bmp
|
||||
|
||||
# The following strings must be approved by the localization people
|
||||
en_model_text: ./localized_bitmaps/en/model.bmp
|
||||
en_devmode_text: ./localized_bitmaps/en/devmode.bmp
|
||||
en_remove_text: ./localized_bitmaps/en/remove.bmp
|
||||
en_yuck_text: ./localized_bitmaps/en/yuck.bmp
|
||||
en_insert_text: ./localized_bitmaps/en/insert.bmp
|
||||
|
||||
fr_model_text: ./localized_bitmaps/fr/model.bmp
|
||||
fr_devmode_text: ./localized_bitmaps/fr/devmode.bmp
|
||||
fr_remove_text: ./localized_bitmaps/fr/remove.bmp
|
||||
fr_yuck_text: ./localized_bitmaps/fr/yuck.bmp
|
||||
fr_insert_text: ./localized_bitmaps/fr/insert.bmp
|
||||
|
||||
es_model_text: ./localized_bitmaps/es/model.bmp
|
||||
es_devmode_text: ./localized_bitmaps/es/devmode.bmp
|
||||
es_remove_text: ./localized_bitmaps/es/remove.bmp
|
||||
es_yuck_text: ./localized_bitmaps/es/yuck.bmp
|
||||
es_insert_text: ./localized_bitmaps/es/insert.bmp
|
||||
|
||||
it_model_text: ./localized_bitmaps/it/model.bmp
|
||||
it_devmode_text: ./localized_bitmaps/it/devmode.bmp
|
||||
it_remove_text: ./localized_bitmaps/it/remove.bmp
|
||||
it_yuck_text: ./localized_bitmaps/it/yuck.bmp
|
||||
it_insert_text: ./localized_bitmaps/it/insert.bmp
|
||||
|
||||
de_model_text: ./localized_bitmaps/de/model.bmp
|
||||
de_devmode_text: ./localized_bitmaps/de/devmode.bmp
|
||||
de_remove_text: ./localized_bitmaps/de/remove.bmp
|
||||
de_yuck_text: ./localized_bitmaps/de/yuck.bmp
|
||||
de_insert_text: ./localized_bitmaps/de/insert.bmp
|
||||
|
||||
nl_model_text: ./localized_bitmaps/nl/model.bmp
|
||||
nl_devmode_text: ./localized_bitmaps/nl/devmode.bmp
|
||||
nl_remove_text: ./localized_bitmaps/nl/remove.bmp
|
||||
nl_yuck_text: ./localized_bitmaps/nl/yuck.bmp
|
||||
nl_insert_text: ./localized_bitmaps/nl/insert.bmp
|
||||
|
||||
screens:
|
||||
en_devel:
|
||||
- [ 0, 0, devmode_bg]
|
||||
- [272, 516, en_devmode_text]
|
||||
|
||||
en_remove:
|
||||
- [ 0, 0, remove_bg]
|
||||
- [256, 534, en_model_text]
|
||||
- [314, 534, $HWID]
|
||||
- [192, 479, url]
|
||||
- [195, 453, en_remove_text]
|
||||
|
||||
en_yuck:
|
||||
- [ 0, 0, yuck_bg]
|
||||
- [256, 534, en_model_text]
|
||||
- [314, 534, $HWID]
|
||||
- [192, 479, url]
|
||||
- [160, 453, en_yuck_text]
|
||||
|
||||
en_insert:
|
||||
- [ 0, 0, insert_bg]
|
||||
- [256, 534, en_model_text]
|
||||
- [314, 534, $HWID]
|
||||
- [192, 479, url]
|
||||
- [273, 435, en_insert_text]
|
||||
|
||||
fr_devel:
|
||||
- [ 0, 0, devmode_bg]
|
||||
- [141, 516, fr_devmode_text]
|
||||
|
||||
fr_remove:
|
||||
- [ 0, 0, remove_bg]
|
||||
- [249, 534, fr_model_text]
|
||||
- [321, 534, $HWID]
|
||||
- [192, 479, url]
|
||||
- [68, 453, fr_remove_text]
|
||||
|
||||
fr_yuck:
|
||||
- [ 0, 0, yuck_bg]
|
||||
- [249, 534, fr_model_text]
|
||||
- [321, 534, $HWID]
|
||||
- [192, 479, url]
|
||||
- [66, 453, fr_yuck_text]
|
||||
|
||||
fr_insert:
|
||||
- [ 0, 0, insert_bg]
|
||||
- [249, 534, fr_model_text]
|
||||
- [321, 534, $HWID]
|
||||
- [192, 479, url]
|
||||
- [215, 435, fr_insert_text]
|
||||
|
||||
es_devel:
|
||||
- [ 0, 0, devmode_bg]
|
||||
- [212, 516, es_devmode_text]
|
||||
|
||||
es_remove:
|
||||
- [ 0, 0, remove_bg]
|
||||
- [252, 534, es_model_text]
|
||||
- [319, 534, $HWID]
|
||||
- [192, 479, url]
|
||||
- [166, 453, es_remove_text]
|
||||
|
||||
es_yuck:
|
||||
- [ 0, 0, yuck_bg]
|
||||
- [252, 534, es_model_text]
|
||||
- [319, 534, $HWID]
|
||||
- [192, 479, url]
|
||||
- [147, 453, es_yuck_text]
|
||||
|
||||
es_insert:
|
||||
- [ 0, 0, insert_bg]
|
||||
- [252, 534, es_model_text]
|
||||
- [319, 534, $HWID]
|
||||
- [192, 479, url]
|
||||
- [239, 435, es_insert_text]
|
||||
|
||||
it_devel:
|
||||
- [ 0, 0, devmode_bg]
|
||||
- [229, 516, it_devmode_text]
|
||||
|
||||
it_remove:
|
||||
- [ 0, 0, remove_bg]
|
||||
- [250, 534, it_model_text]
|
||||
- [320, 534, $HWID]
|
||||
- [192, 479, url]
|
||||
- [200, 453, it_remove_text]
|
||||
|
||||
it_yuck:
|
||||
- [ 0, 0, yuck_bg]
|
||||
- [250, 534, it_model_text]
|
||||
- [320, 534, $HWID]
|
||||
- [192, 479, url]
|
||||
- [168, 453, it_yuck_text]
|
||||
|
||||
it_insert:
|
||||
- [ 0, 0, insert_bg]
|
||||
- [250, 534, it_model_text]
|
||||
- [320, 534, $HWID]
|
||||
- [192, 479, url]
|
||||
- [241, 435, it_insert_text]
|
||||
|
||||
de_devel:
|
||||
- [ 0, 0, devmode_bg]
|
||||
- [181, 516, de_devmode_text]
|
||||
|
||||
de_remove:
|
||||
- [ 0, 0, remove_bg]
|
||||
- [255, 534, de_model_text]
|
||||
- [316, 534, $HWID]
|
||||
- [192, 479, url]
|
||||
- [140, 453, de_remove_text]
|
||||
|
||||
de_yuck:
|
||||
- [ 0, 0, yuck_bg]
|
||||
- [255, 534, de_model_text]
|
||||
- [316, 534, $HWID]
|
||||
- [192, 479, url]
|
||||
- [134, 453, de_yuck_text]
|
||||
|
||||
de_insert:
|
||||
- [ 0, 0, insert_bg]
|
||||
- [255, 534, de_model_text]
|
||||
- [316, 534, $HWID]
|
||||
- [192, 479, url]
|
||||
- [212, 435, de_insert_text]
|
||||
|
||||
nl_devel:
|
||||
- [ 0, 0, devmode_bg]
|
||||
- [222, 516, nl_devmode_text]
|
||||
|
||||
nl_remove:
|
||||
- [ 0, 0, remove_bg]
|
||||
- [256, 534, nl_model_text]
|
||||
- [314, 534, $HWID]
|
||||
- [192, 479, url]
|
||||
- [170, 453, nl_remove_text]
|
||||
|
||||
nl_yuck:
|
||||
- [ 0, 0, yuck_bg]
|
||||
- [256, 534, nl_model_text]
|
||||
- [314, 534, $HWID]
|
||||
- [192, 479, url]
|
||||
- [58, 453, nl_yuck_text]
|
||||
|
||||
nl_insert:
|
||||
- [ 0, 0, insert_bg]
|
||||
- [256, 534, nl_model_text]
|
||||
- [314, 534, $HWID]
|
||||
- [192, 479, url]
|
||||
- [259, 435, nl_insert_text]
|
||||
|
||||
localizations:
|
||||
|
||||
# This determines the order in which the localizations appear. The first
|
||||
# one is the default.
|
||||
|
||||
- [ en_devel, en_remove, en_yuck, en_insert ]
|
||||
- [ fr_devel, fr_remove, fr_yuck, fr_insert ]
|
||||
- [ es_devel, es_remove, es_yuck, es_insert ]
|
||||
- [ it_devel, it_remove, it_yuck, it_insert ]
|
||||
- [ de_devel, de_remove, de_yuck, de_insert ]
|
||||
- [ nl_devel, nl_remove, nl_yuck, nl_insert ]
|
||||
|
||||
locale_index:
|
||||
|
||||
# This list MUST match the order and number of the localizations above.
|
||||
|
||||
- en
|
||||
- fr
|
||||
- es
|
||||
- it
|
||||
- de
|
||||
- nl
|
||||
|
Before Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 9.4 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 41 KiB |
|
Before Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 2.0 KiB |