diff options
Diffstat (limited to 'scripts/newbitmaps/images')
19 files changed, 0 insertions, 784 deletions
diff --git a/scripts/newbitmaps/images/Background_white.png b/scripts/newbitmaps/images/Background_white.png Binary files differdeleted file mode 100644 index 4d9c4b61..00000000 --- a/scripts/newbitmaps/images/Background_white.png +++ /dev/null diff --git a/scripts/newbitmaps/images/Makefile b/scripts/newbitmaps/images/Makefile deleted file mode 100644 index 93b0dd0b..00000000 --- a/scripts/newbitmaps/images/Makefile +++ /dev/null @@ -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 diff --git a/scripts/newbitmaps/images/arrow_left.png b/scripts/newbitmaps/images/arrow_left.png Binary files differdeleted file mode 100644 index 4818facf..00000000 --- a/scripts/newbitmaps/images/arrow_left.png +++ /dev/null diff --git a/scripts/newbitmaps/images/arrow_right.png b/scripts/newbitmaps/images/arrow_right.png Binary files differdeleted file mode 100644 index 1f4c0adc..00000000 --- a/scripts/newbitmaps/images/arrow_right.png +++ /dev/null diff --git a/scripts/newbitmaps/images/assets/BadSD.png b/scripts/newbitmaps/images/assets/BadSD.png Binary files differdeleted file mode 100644 index 6e903570..00000000 --- a/scripts/newbitmaps/images/assets/BadSD.png +++ /dev/null diff --git a/scripts/newbitmaps/images/assets/BadUSB.png b/scripts/newbitmaps/images/assets/BadUSB.png Binary files differdeleted file mode 100644 index aa21a450..00000000 --- a/scripts/newbitmaps/images/assets/BadUSB.png +++ /dev/null diff --git a/scripts/newbitmaps/images/assets/RemoveDevices.png b/scripts/newbitmaps/images/assets/RemoveDevices.png Binary files differdeleted file mode 100644 index cbd85552..00000000 --- a/scripts/newbitmaps/images/assets/RemoveDevices.png +++ /dev/null diff --git a/scripts/newbitmaps/images/assets/RemoveSD.png b/scripts/newbitmaps/images/assets/RemoveSD.png Binary files differdeleted file mode 100644 index 5bd91f59..00000000 --- a/scripts/newbitmaps/images/assets/RemoveSD.png +++ /dev/null diff --git a/scripts/newbitmaps/images/assets/RemoveUSB.png b/scripts/newbitmaps/images/assets/RemoveUSB.png Binary files differdeleted file mode 100644 index 28b8c8a1..00000000 --- a/scripts/newbitmaps/images/assets/RemoveUSB.png +++ /dev/null diff --git a/scripts/newbitmaps/images/assets/VerificationOff.png b/scripts/newbitmaps/images/assets/VerificationOff.png Binary files differdeleted file mode 100644 index 7b5124d3..00000000 --- a/scripts/newbitmaps/images/assets/VerificationOff.png +++ /dev/null diff --git a/scripts/newbitmaps/images/assets/VerificationOn.png b/scripts/newbitmaps/images/assets/VerificationOn.png Binary files differdeleted file mode 100644 index 85102d4d..00000000 --- a/scripts/newbitmaps/images/assets/VerificationOn.png +++ /dev/null diff --git a/scripts/newbitmaps/images/assets/Warning.png b/scripts/newbitmaps/images/assets/Warning.png Binary files differdeleted file mode 100644 index caabacd5..00000000 --- a/scripts/newbitmaps/images/assets/Warning.png +++ /dev/null diff --git a/scripts/newbitmaps/images/build_images b/scripts/newbitmaps/images/build_images deleted file mode 100755 index 35f2c813..00000000 --- a/scripts/newbitmaps/images/build_images +++ /dev/null @@ -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 "$@" - diff --git a/scripts/newbitmaps/images/chrome_logo.png b/scripts/newbitmaps/images/chrome_logo.png Binary files differdeleted file mode 100644 index e5251f24..00000000 --- a/scripts/newbitmaps/images/chrome_logo.png +++ /dev/null diff --git a/scripts/newbitmaps/images/convert_to_bmp3.py b/scripts/newbitmaps/images/convert_to_bmp3.py deleted file mode 100755 index f5afd33d..00000000 --- a/scripts/newbitmaps/images/convert_to_bmp3.py +++ /dev/null @@ -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) diff --git a/scripts/newbitmaps/images/divider_btm.png b/scripts/newbitmaps/images/divider_btm.png Binary files differdeleted file mode 100644 index 0d3e4065..00000000 --- a/scripts/newbitmaps/images/divider_btm.png +++ /dev/null diff --git a/scripts/newbitmaps/images/divider_top.png b/scripts/newbitmaps/images/divider_top.png Binary files differdeleted file mode 100644 index f037966c..00000000 --- a/scripts/newbitmaps/images/divider_top.png +++ /dev/null diff --git a/scripts/newbitmaps/images/dummy.png b/scripts/newbitmaps/images/dummy.png Binary files differdeleted file mode 100644 index 6404db59..00000000 --- a/scripts/newbitmaps/images/dummy.png +++ /dev/null diff --git a/scripts/newbitmaps/images/make_default_yaml b/scripts/newbitmaps/images/make_default_yaml deleted file mode 100755 index 38b01e41..00000000 --- a/scripts/newbitmaps/images/make_default_yaml +++ /dev/null @@ -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 "" |