diff options
Diffstat (limited to 'scripts/newbitmaps/images/build_images')
-rwxr-xr-x | scripts/newbitmaps/images/build_images | 62 |
1 files changed, 50 insertions, 12 deletions
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 |