blob: fe2be48265555c0fabe1a379c1af0ec4f8268532 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
|
# 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=x86 arm
BASE_IMAGES=Devmode.bmp Insert.bmp Remove.bmp Yuck.bmp
OTHER_IMAGES=Url.bmp hwid_unknown.bmp
FONTS=hwid_fonts.bin
default: outside_chroot
@echo "Specify a target to build for:"
@echo " ${TARGETS}"
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
${TARGETS}:: outside_chroot
# The image size with UEFI BIOS 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.
_x86_max="800x600!"
_x86_scale="59%x78%"
_arm_max="800x600!"
_arm_scale="59%x78%"
x86::
# create output directories
mkdir -p "out_$@"
for i in localized_images/*; do \
mkdir -p "out_$@/$$i"; \
done
# copy stuff we need
cp "${FONTS}" "out_$@"
# scale the background pictures exactly
for i in ${BASE_IMAGES}; do \
convert $$i -scale "${_x86_max}" "out_$@/$$i"; \
done
# scale the localized string images using percentages
for i in ${OTHER_IMAGES} localized_images/*/*.bmp; do \
convert $$i -scale "${_x86_scale}" "out_$@/$$i"; \
done
# produce the new yaml
cd "out_$@" && ../make_default_yaml
# Note: hand-edit the new DEFAULT.yaml to select the shipping locales,
# then use bmpblk_utility to create the binary.
arm::
# create output directories
mkdir -p "out_$@"
for i in localized_images/*; do \
mkdir -p "out_$@/$$i"; \
done
# copy stuff we need
cp "${FONTS}" "out_$@"
convert ${BASE_IMAGES} -append \
-colors 256 -unique-colors "out_$@/base_cmap.png"
convert localized_images/*/*.bmp -append \
-colors 256 -unique-colors "out_$@/loc_cmap.png"
# scale the background pictures exactly
for i in ${BASE_IMAGES}; do \
convert $$i -scale "${_arm_max}" \
-remap "out_$@/base_cmap.png" "out_$@/$$i"; \
done
# scale the localized string images using percentages
for i in ${OTHER_IMAGES} localized_images/*/*.bmp; do \
convert $$i -scale "${_arm_scale}" \
-remap "out_$@/loc_cmap.png" "out_$@/$$i"; \
done
# produce the new yaml
cd "out_$@" && ../make_default_yaml
# Note: hand-edit the new DEFAULT.yaml to select the shipping locales,
# then use bmpblk_utility to create the binary.
clean:
rm -rf out_*
|