summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHung-Te Lin <hungte@chromium.org>2012-08-17 18:07:46 +0800
committerGerrit <chrome-bot@google.com>2012-08-17 20:02:15 -0700
commit7ce91cd2f93eac4022f075ba13fec5b3a6cdde33 (patch)
treeccee0740be96b5d32efeee7f6b8713042cd4d745
parent5f5f086e38dcd7bab59fe1b4903024281b604879 (diff)
downloadvboot-7ce91cd2f93eac4022f075ba13fec5b3a6cdde33.tar.gz
newbitmaps: Change build targets from x86/arm to "profiles".
The difference of firmware bitmaps won't rely on platform (x86/arm) in future; instead, things will differ by rescaling & message contents. To support that, we need to change build target from "platform" to "profiles". To build all platforms, run "make" in top leve (or "make all" in images). To debug (en locale without rescaling), run "make" in images folder. To debug a specific profile, run "make $PROFILE" in images folder. BRANCH=none BUG=chrome-os-partner:11078, chrome-os-partner:12790 TEST=make # all profiles generated in images/out_*/*.bin Change-Id: Iaabf160b1b2bc844d230188eb593daa8a597d378 Reviewed-on: https://gerrit.chromium.org/gerrit/30683 Commit-Ready: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Hung-Te Lin <hungte@chromium.org> Tested-by: Hung-Te Lin <hungte@chromium.org>
-rw-r--r--scripts/newbitmaps/Makefile17
-rw-r--r--scripts/newbitmaps/README3
-rw-r--r--scripts/newbitmaps/bmpblock_x86.binbin288133 -> 0 bytes
-rw-r--r--scripts/newbitmaps/images/Makefile32
-rwxr-xr-xscripts/newbitmaps/images/build_images62
5 files changed, 63 insertions, 51 deletions
diff --git a/scripts/newbitmaps/Makefile b/scripts/newbitmaps/Makefile
index d9840ab1..7a4a526b 100644
--- a/scripts/newbitmaps/Makefile
+++ b/scripts/newbitmaps/Makefile
@@ -1,8 +1,8 @@
-# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
+# 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 both x86 and arm. You
+# 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
@@ -13,7 +13,7 @@ ALL_LOCALES=en es_419 pt_BR en_GB fr es pt_PT ca it de \
# Here are the launch locales for Stumpy/Lumpy (issue 6595), same ordering.
LOCALES=en es_419 pt_BR en_GB fr es it de nl da no sv ko ja
-default: outside_chroot strings x86 arm clean
+default: outside_chroot strings images
outside_chroot:
@if [ -e /etc/debian_chroot ]; then \
@@ -26,16 +26,11 @@ outside_chroot:
strings:
$(MAKE) -C strings
-x86:
- $(MAKE) -C images $@ LOCALES="$(LOCALES)"
- cp -f images/out_$@/bmpblock.bin bmpblock_$@.bin
-
-arm:
- $(MAKE) -C images $@ LOCALES="$(LOCALES)"
- cp -f images/out_$@/bmpblock.bin bmpblock_$@.bin
+images:
+ $(MAKE) -C images LOCALES="$(LOCALES)" all
clean:
$(MAKE) -C strings clean
$(MAKE) -C images clean
-.PHONY: outside_chroot strings x86 arm clean
+.PHONY: outside_chroot strings images clean
diff --git a/scripts/newbitmaps/README b/scripts/newbitmaps/README
index 1720063d..0d8a6b49 100644
--- a/scripts/newbitmaps/README
+++ b/scripts/newbitmaps/README
@@ -108,8 +108,7 @@ regenerated:
cd scripts/newbitmaps
make
-This should generate both x86 and ARM versions of the BIOS bmpblock file,
-although ARM may not be 100% correct just yet.
+This should generate BIOS bmpblock file for all platforms.
You can use the gbb_utility to modify your BIOS to contain this new set of
diff --git a/scripts/newbitmaps/bmpblock_x86.bin b/scripts/newbitmaps/bmpblock_x86.bin
deleted file mode 100644
index 18a9c2c3..00000000
--- a/scripts/newbitmaps/bmpblock_x86.bin
+++ /dev/null
Binary files differ
diff --git a/scripts/newbitmaps/images/Makefile b/scripts/newbitmaps/images/Makefile
index 9757cbf3..ab0eede8 100644
--- a/scripts/newbitmaps/images/Makefile
+++ b/scripts/newbitmaps/images/Makefile
@@ -10,38 +10,18 @@
# ImageMagick is much to complex to bother installing into the chroot just for
# this occasional need.
-TARGETS=x86 arm
+TARGETS=std s800 s1024 s1024usb2
# To generate all locales, make from top level.
LOCALES=en
-default: outside_chroot
- @echo "Specify a target to build for:"
- @echo " ${TARGETS}"
+default: std
-# TODO(hungte) It's now not easy to have bmpblk_utility outside
-# chroot... We need some better way to do this.
-outside_chroot:
- @if [ -e /etc/debian_chroot ]; then \
- echo "ImageMagick is too complex to build 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
+all: $(TARGETS)
-${TARGETS}:: outside_chroot
-
-x86::
+$(TARGETS):
LOCALES="$(LOCALES)" ./build_images "$@"
- cd "out_$@" && ../make_default_yaml $(LOCALES)
- cd "out_$@" && bmpblk_utility -c DEFAULT.yaml bmpblock.bin
- ls -l "out_$@"/bmpblock.bin
-
-
-arm::
- LOCALES="$(LOCALES)" ./build_images "$@"
- cd "out_$@" && ../make_default_yaml $(LOCALES)
- cd "out_$@" && bmpblk_utility -c DEFAULT.yaml bmpblock.bin
- ls -l "out_$@"/bmpblock.bin
clean:
rm -rf out_*
+
+.PHONY: $(TARGETS) clean all default
diff --git a/scripts/newbitmaps/images/build_images b/scripts/newbitmaps/images/build_images
index 5a74e03c..0c04b9eb 100755
--- a/scripts/newbitmaps/images/build_images
+++ b/scripts/newbitmaps/images/build_images
@@ -11,6 +11,9 @@ BACKGROUND_COLOR=white
# The only file that uses different scaling parameter.
BACKGROUND_IMAGE=Background_white.png
+# Output file name.
+BMPBLK_OUTPUT="bmpblock.bin"
+
die() {
echo "ERROR: $*" >&2
exit 1
@@ -60,31 +63,46 @@ convert_to_bmp3() {
main() {
local profile="$1"
local output="out_$1"
- local scale_param="" background_scale_param=""
+ local scale_param="" background_scale_param="" replace_files=""
local base locale X
# Currently we use image resources originally designed for 1366x768, and
# re-scale to different aspects on demand.
case "$profile" in
- x86 )
- # The image size with x86 UEFI BIOS (also applies to coreboot) is always
- # 800x600, which is stretched to fill the entire screen. With previous
- # devices the physical screen size was either 1280x800 (16:10) or 1366x768
- # (16:9). There's not a lot of difference between those, so let's just
- # assume 16:9 for future platforms to make things simpler.
+ std )
+ # Standard: profile with all default values.
+ true
+ ;;
+
+ 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!"
;;
- arm )
- # On ARM platforms, we need to provide a bitmap with full size.
- # TODO(hungte) Support more profiles, ex 1280x800.
- true
+
+ s1024 )
+ # Similar to s800, using VESA graphics mode 1024x768 (0x0117).
+ scale_param="-scale 75%x100%"
+ background_scale_param="-scale 1024x768!"
+ ;;
+
+ s1024usb2 )
+ # 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"
;;
+
+ # TODO(hungte) Add 1280x1024 (0x11A) profiles.
+
* )
die "Sorry, unknown profile $profile."
esac
# Prepare output folder
+ rm -rf "$output"
mkdir -p "$output"
# Prepare images in current folder
@@ -106,6 +124,7 @@ main() {
for X in $base/*.png; do
convert_to_bmp3 "$X" "$output" "$scale_param" ""
done
+
echo "Preparing localized messages... $LOCALES"
base="../strings/localized_text"
if [ -z "$LOCALES" ]; then
@@ -124,12 +143,31 @@ main() {
done
done
- # Prepare fonts
+ if [ -n "$replace_files" ]; then
+ echo "Replacing files..."
+ echo "$replace_files" | 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"
for X in $base/*.png; do
convert_to_bmp3 "$X" "$output/font" "$scale_param" ""
done
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