diff options
-rw-r--r-- | scripts/newbitmaps/Makefile | 17 | ||||
-rw-r--r-- | scripts/newbitmaps/README | 3 | ||||
-rw-r--r-- | scripts/newbitmaps/bmpblock_x86.bin | bin | 288133 -> 0 bytes | |||
-rw-r--r-- | scripts/newbitmaps/images/Makefile | 32 | ||||
-rwxr-xr-x | scripts/newbitmaps/images/build_images | 62 |
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 Binary files differdeleted file mode 100644 index 18a9c2c3..00000000 --- a/scripts/newbitmaps/bmpblock_x86.bin +++ /dev/null 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 |