├── .github
└── workflows
│ └── actions_recovery.yml
├── README.md
├── build
└── core
│ ├── android-7.1
│ └── product_config.mk
│ ├── android-8.1
│ └── product_config.mk
│ └── android-9.0
│ └── product_config.mk
├── config.json
├── demo.jpg
└── device.xml
/.github/workflows/actions_recovery.yml:
--------------------------------------------------------------------------------
1 | name: rec-building
2 |
3 | on:
4 | watch:
5 | types: [started]
6 |
7 | jobs:
8 | build:
9 | if: github.event.repository.owner.id == github.event.sender.id
10 | runs-on: ubuntu-18.04
11 |
12 | steps:
13 | - name: Checkout
14 | uses: actions/checkout@main
15 |
16 | - name: Clean Up
17 | run: |
18 | docker rmi `docker images -q`
19 | sudo rm -rf /usr/share/dotnet /etc/mysql /etc/php /etc/sudo apt/sources.list.d
20 | sudo apt -y purge azure-cli ghc* zulu* hhvm llvm* firefox google* dotnet* powershell openjdk* mysql* php*
21 | sudo apt update
22 | sudo apt -y autoremove --purge
23 | sudo apt clean
24 |
25 | - name: Update packages
26 | run: |
27 | sudo apt update
28 | sudo apt full-upgrade
29 |
30 | - name: Install required packages
31 | run: sudo apt install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev tree lib32z-dev libgl1-mesa-dev libxml2-utils xsltproc unzip jq
32 |
33 | - name: Get variables
34 | run: |
35 | echo "::set-output name=twrp_url::$(jq -r '.twrp_url' config.json)"
36 | echo "::set-output name=twrp_branch::$(jq -r '.twrp_branch' config.json)"
37 | echo "::set-output name=git_username::$(jq -r '.git_username' config.json)"
38 | echo "::set-output name=git_email::$(jq -r '.git_email' config.json)"
39 | echo "::set-output name=use_own_dt::$(jq -r '.use_own_dt' config.json)"
40 | echo "::set-output name=dt_url::$(jq -r '.dt_url' config.json)"
41 | echo "::set-output name=dt_remote::$(jq -r '.dt_remote' config.json)"
42 | echo "::set-output name=dt_branch::$(jq -r '.dt_branch' config.json)"
43 | echo "::set-output name=dt_path::$(jq -r '.dt_path' config.json)"
44 | echo "::set-output name=device_code::$(jq -r '.device_code' config.json)"
45 | echo "::set-output name=fix_product::$(jq -r '.fix_product' config.json)"
46 | echo "::set-output name=fix_misscom::$(jq -r '.fix_misscom' config.json)"
47 | echo "::set-output name=fix_busybox::$(jq -r '.fix_busybox' config.json)"
48 | echo "::set-output name=fix_branch::$(jq -r '.fix_branch' config.json)"
49 | echo "::set-output name=date::$(date +%F)"
50 | id: var
51 |
52 | - name: Install Repo
53 | run: |
54 | mkdir ~/bin
55 | curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
56 | chmod a+x ~/bin/repo
57 |
58 | - name: Initialize Repair Manifest
59 | run: git clone https://github.com/TeamWin/buildtree_manifests.git repair/
60 |
61 | - name: Initialize a Repo client
62 | run: |
63 | PATH=~/bin:$PATH
64 | mkdir workspace
65 | cd workspace
66 | echo "::set-output name=pwd::$(pwd)"
67 | git config --global user.name "${{ steps.var.outputs.git_username }}"
68 | git config --global user.email "${{ steps.var.outputs.git_email }}"
69 | repo init --depth=1 -u ${{ steps.var.outputs.twrp_url }} -b ${{ steps.var.outputs.twrp_branch }}
70 | mkdir .repo/local_manifests
71 | id: pwd
72 |
73 | - name: Fix the bug of missing common
74 | if: steps.var.outputs.fix_misscom == 'true'
75 | run: cp repair/omni-9.0/qcom.xml workspace/.repo/local_manifests/
76 |
77 | - name: Fix busybox bug
78 | if: steps.var.outputs.fix_busybox == 'true'
79 | run: cp repair/omni-9.0/busybox.xml workspace/.repo/local_manifests/
80 |
81 | - name: Clone your own device tree
82 | if: steps.var.outputs.use_own_dt == 'true'
83 | run: |
84 | sed -i 's!dt_url!${{ steps.var.outputs.dt_url }}!g' device.xml
85 | sed -i 's!dt_path!${{ steps.var.outputs.dt_path }}!g' device.xml
86 | sed -i 's!dt_remote!${{ steps.var.outputs.dt_remote }}!g' device.xml
87 | sed -i 's!dt_branch!${{ steps.var.outputs.dt_branch }}!g' device.xml
88 | cp device.xml workspace/.repo/local_manifests/
89 |
90 | - name: Repo sync
91 | run: |
92 | PATH=~/bin:$PATH
93 | cd workspace
94 | repo sync -c -j$(nproc --all) --force-sync --no-clone-bundle --no-tags
95 | ls -al
96 |
97 | - name: Fix cannot locate product
98 | if: steps.var.outputs.fix_product == 'true'
99 | run: |
100 | cd ${{ steps.pwd.outputs.pwd }}/build/core
101 | rm -rf product_config.mk
102 | sed -i 's!device_code!${{ steps.var.outputs.device_code }}!g' ${{ steps.pwd.outputs.pwd }}/../build/core/${{ steps.var.outputs.fix_branch }}/product_config.mk
103 | cp ${{ steps.pwd.outputs.pwd }}/../build/core/${{ steps.var.outputs.fix_branch }}/product_config.mk ${{ steps.pwd.outputs.pwd }}/build/core/product_config.mk
104 |
105 | - name: Start Building
106 | run: |
107 | PATH=~/bin:$PATH
108 | cd ${{ steps.pwd.outputs.pwd }}
109 | tree device
110 | export ALLOW_MISSING_DEPENDENCIES=true
111 | source build/envsetup.sh
112 | lunch omni_${{ steps.var.outputs.device_code }}-eng
113 | mka recoveryimage -j$(nproc --all)
114 |
115 | - name: Upload REC
116 | uses: softprops/action-gh-release@v1
117 | with:
118 | files: workspace/out/target/product/${{ steps.var.outputs.device_code }}/recovery.img
119 | name: ${{ steps.var.outputs.date }} ${{ steps.var.outputs.device_code }} by ${{ steps.var.outputs.git_username }}
120 | tag_name: ${{ github.run_id }}
121 | body: Android Third-Party Recovery built by ${{ steps.var.outputs.git_username }}
122 | env:
123 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
124 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
利用Github Actions编译REC
2 |
3 |
8 |
9 | ---
10 |
11 |
12 | A Github Action to build Recovery
13 |
14 |
15 |
20 |
21 |
22 |
23 | 由于编译时间较长,建议把[.github/workflows/actions_recovery.yml](.github/workflows/actions_recovery.yml)
末尾上传处的`${{ secrets.GITHUB_TOKEN }}`改成自己的[Personal Access Token](https://github.com/settings/tokens)
24 |
25 | 注意保护自己的Personal Access Token,将它放入仓库[Settings](../../settings)里的[Secrets](../../settings/secrets)里后用`${{ secrets.YOUR_TOKEN_NAME }}`来替换`${{ secrets.GITHUB_TOKEN }}`
26 |
27 | 比如我的secret名字叫做work.则使用`${{ secrets.work }}`
28 |
29 | ## 配置
30 |
31 | 配置文件是[config.json](config.json)
32 |
33 | | 名称 | 类型 | 描述 |
34 | | ------------------ | ------- | ------------------------------------------------------------ |
35 | | `twrp_url` | String | Recovery Manifest地址 |
36 | | `twrp_branch` | String | Recovery Manifest分支 |
37 | | `git_username` | String | 您使用Git的用户名 |
38 | | `git_email` | String | 您使用Git的邮箱(Github可使用`Github ID+Github用户名@users.noreply.github.com`) |
39 | | `use_own_dt` | Boolean | 指示是否使用个人设备树(此项为`true`后以下三项起效) |
40 | | `dt_url` | String | 您使用的设备树的地址(格式:`USER/REPO`) |
41 | | `dt_branch` | String | 您使用的设备树的分支 |
42 | | `dt_remote` | String | 您使用设备树的存储库(如`github/gitlab`) |
43 | | `dt_path` | String | 指示设备树本地保存位置(示例`device/huawei/kiwi`) |
44 | | `device_code` | String | 您将要编译机型的机型代号 |
45 | | `fix_product` | Boolean | 指示是否修复无法找到设备的问题 |
46 | | `fix_branch` | String | 指示修复以上问题所使用的分支 |
47 | | `fix_misscom` | Boolean | 指示是否修复缺少`device/qcom/common`的问题 |
48 | | `fix_busybox` | Boolean | 指示是否修复缺少`busybox`的问题 |
49 |
50 | ## 开始
51 |
52 | Fork此仓库后,点击右上角Star就会开始
53 |
54 | ## 编译结果
55 | 可以在[Release](../../releases)下载
56 |
--------------------------------------------------------------------------------
/build/core/android-7.1/product_config.mk:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2008 The Android Open Source Project
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | #
16 |
17 | # ---------------------------------------------------------------
18 | # Generic functions
19 | # TODO: Move these to definitions.make once we're able to include
20 | # definitions.make before config.make.
21 |
22 | ###########################################################
23 | ## Return non-empty if $(1) is a C identifier; i.e., if it
24 | ## matches /^[a-zA-Z_][a-zA-Z0-9_]*$/. We do this by first
25 | ## making sure that it isn't empty and doesn't start with
26 | ## a digit, then by removing each valid character. If the
27 | ## final result is empty, then it was a valid C identifier.
28 | ##
29 | ## $(1): word to check
30 | ###########################################################
31 |
32 | _ici_digits := 0 1 2 3 4 5 6 7 8 9
33 | _ici_alphaunderscore := \
34 | a b c d e f g h i j k l m n o p q r s t u v w x y z \
35 | A B C D E F G H I J K L M N O P Q R S T U V W X Y Z _
36 | define is-c-identifier
37 | $(strip \
38 | $(if $(1), \
39 | $(if $(filter $(addsuffix %,$(_ici_digits)),$(1)), \
40 | , \
41 | $(eval w := $(1)) \
42 | $(foreach c,$(_ici_digits) $(_ici_alphaunderscore), \
43 | $(eval w := $(subst $(c),,$(w))) \
44 | ) \
45 | $(if $(w),,TRUE) \
46 | $(eval w :=) \
47 | ) \
48 | ) \
49 | )
50 | endef
51 |
52 | # TODO: push this into the combo files; unfortunately, we don't even
53 | # know HOST_OS at this point.
54 | trysed := $(shell echo a | sed -E -e 's/a/b/' 2>/dev/null)
55 | ifeq ($(trysed),b)
56 | SED_EXTENDED := sed -E
57 | else
58 | trysed := $(shell echo c | sed -r -e 's/c/d/' 2>/dev/null)
59 | ifeq ($(trysed),d)
60 | SED_EXTENDED := sed -r
61 | else
62 | $(error Unknown sed version)
63 | endif
64 | endif
65 |
66 | ###########################################################
67 | ## List all of the files in a subdirectory in a format
68 | ## suitable for PRODUCT_COPY_FILES and
69 | ## PRODUCT_SDK_ADDON_COPY_FILES
70 | ##
71 | ## $(1): Glob to match file name
72 | ## $(2): Source directory
73 | ## $(3): Target base directory
74 | ###########################################################
75 |
76 | define find-copy-subdir-files
77 | $(sort $(shell find $(2) -name "$(1)" -type f | $(SED_EXTENDED) "s:($(2)/?(.*)):\\1\\:$(3)/\\2:" | sed "s://:/:g"))
78 | endef
79 |
80 | # ---------------------------------------------------------------
81 |
82 | # These are the valid values of TARGET_BUILD_VARIANT. Also, if anything else is passed
83 | # as the variant in the PRODUCT-$TARGET_BUILD_PRODUCT-$TARGET_BUILD_VARIANT form,
84 | # it will be treated as a goal, and the eng variant will be used.
85 | INTERNAL_VALID_VARIANTS := user userdebug eng
86 |
87 | # ---------------------------------------------------------------
88 | # Provide "PRODUCT--" targets, which lets you build
89 | # a particular configuration without needing to set up the environment.
90 | #
91 | product_goals := $(strip $(filter PRODUCT-%,$(MAKECMDGOALS)))
92 | ifdef product_goals
93 | # Scrape the product and build names out of the goal,
94 | # which should be of the form PRODUCT--.
95 | #
96 | ifneq ($(words $(product_goals)),1)
97 | $(error Only one PRODUCT-* goal may be specified; saw "$(product_goals)")
98 | endif
99 | goal_name := $(product_goals)
100 | product_goals := $(patsubst PRODUCT-%,%,$(product_goals))
101 | product_goals := $(subst -, ,$(product_goals))
102 | ifneq ($(words $(product_goals)),2)
103 | $(error Bad PRODUCT-* goal "$(goal_name)")
104 | endif
105 |
106 | # The product they want
107 | TARGET_PRODUCT := $(word 1,$(product_goals))
108 |
109 | # The variant they want
110 | TARGET_BUILD_VARIANT := $(word 2,$(product_goals))
111 |
112 | ifeq ($(TARGET_BUILD_VARIANT),tests)
113 | $(error "tests" has been deprecated as a build variant. Use it as a build goal instead.)
114 | endif
115 |
116 | # The build server wants to do make PRODUCT-dream-installclean
117 | # which really means TARGET_PRODUCT=dream make installclean.
118 | ifneq ($(filter-out $(INTERNAL_VALID_VARIANTS),$(TARGET_BUILD_VARIANT)),)
119 | MAKECMDGOALS := $(MAKECMDGOALS) $(TARGET_BUILD_VARIANT)
120 | TARGET_BUILD_VARIANT := userdebug
121 | default_goal_substitution :=
122 | else
123 | default_goal_substitution := $(DEFAULT_GOAL)
124 | endif
125 |
126 | # Replace the PRODUCT-* goal with the build goal that it refers to.
127 | # Note that this will ensure that it appears in the same relative
128 | # position, in case it matters.
129 | #
130 | # Note that modifying this will not affect the goals that make will
131 | # attempt to build, but it's important because we inspect this value
132 | # in certain situations (like for "make sdk").
133 | #
134 | MAKECMDGOALS := $(patsubst $(goal_name),$(default_goal_substitution),$(MAKECMDGOALS))
135 |
136 | # Define a rule for the PRODUCT-* goal, and make it depend on the
137 | # patched-up command-line goals as well as any other goals that we
138 | # want to force.
139 | #
140 | .PHONY: $(goal_name)
141 | $(goal_name): $(MAKECMDGOALS)
142 | endif
143 | # else: Use the value set in the environment or buildspec.mk.
144 |
145 | # ---------------------------------------------------------------
146 | # Provide "APP-" targets, which lets you build
147 | # an unbundled app.
148 | #
149 | unbundled_goals := $(strip $(filter APP-%,$(MAKECMDGOALS)))
150 | ifdef unbundled_goals
151 | ifneq ($(words $(unbundled_goals)),1)
152 | $(error Only one APP-* goal may be specified; saw "$(unbundled_goals)")
153 | endif
154 | TARGET_BUILD_APPS := $(strip $(subst -, ,$(patsubst APP-%,%,$(unbundled_goals))))
155 | ifneq ($(filter $(DEFAULT_GOAL),$(MAKECMDGOALS)),)
156 | MAKECMDGOALS := $(patsubst $(unbundled_goals),,$(MAKECMDGOALS))
157 | else
158 | MAKECMDGOALS := $(patsubst $(unbundled_goals),$(DEFAULT_GOAL),$(MAKECMDGOALS))
159 | endif
160 |
161 | .PHONY: $(unbundled_goals)
162 | $(unbundled_goals): $(MAKECMDGOALS)
163 | endif # unbundled_goals
164 |
165 | # Default to building dalvikvm on hosts that support it...
166 | ifeq ($(HOST_OS),linux)
167 | # ... or if the if the option is already set
168 | ifeq ($(WITH_HOST_DALVIK),)
169 | WITH_HOST_DALVIK := true
170 | endif
171 | endif
172 |
173 | # ---------------------------------------------------------------
174 | # Include the product definitions.
175 | # We need to do this to translate TARGET_PRODUCT into its
176 | # underlying TARGET_DEVICE before we start defining any rules.
177 | #
178 | include $(BUILD_SYSTEM)/node_fns.mk
179 | include $(BUILD_SYSTEM)/product.mk
180 | include $(BUILD_SYSTEM)/device.mk
181 |
182 | ifneq ($(strip $(TARGET_BUILD_APPS)),)
183 | # An unbundled app build needs only the core product makefiles.
184 | all_product_configs := $(call get-product-makefiles,\
185 | $(SRC_TARGET_DIR)/product/AndroidProducts.mk)
186 | else
187 | # Read in all of the product definitions specified by the AndroidProducts.mk
188 | # files in the tree.
189 | all_product_configs := $(get-all-product-makefiles)
190 | endif
191 |
192 | # Find the product config makefile for the current product.
193 | # all_product_configs consists items like:
194 | # :
195 | # or just in case the product name is the
196 | # same as the base filename of the product config makefile.
197 | current_product_makefile :=
198 | all_product_makefiles :=
199 | $(foreach f, $(all_product_configs),\
200 | $(eval _cpm_words := $(subst :,$(space),$(f)))\
201 | $(eval _cpm_word1 := $(word 1,$(_cpm_words)))\
202 | $(eval _cpm_word2 := $(word 2,$(_cpm_words)))\
203 | $(if $(_cpm_word2),\
204 | $(eval all_product_makefiles += $(_cpm_word2))\
205 | $(if $(filter $(TARGET_PRODUCT),$(_cpm_word1)),\
206 | $(eval current_product_makefile += $(_cpm_word2)),),\
207 | $(eval all_product_makefiles += $(f))\
208 | $(if $(filter $(TARGET_PRODUCT),$(basename $(notdir $(f)))),\
209 | $(eval current_product_makefile += $(f)),)))
210 | _cpm_words :=
211 | _cpm_word1 :=
212 | _cpm_word2 :=
213 | current_product_makefile := $(strip $(current_product_makefile))
214 | all_product_makefiles := $(strip $(all_product_makefiles))
215 |
216 | load_all_product_makefiles :=
217 | ifneq (,$(filter product-graph, $(MAKECMDGOALS)))
218 | ifeq ($(ANDROID_PRODUCT_GRAPH),--all)
219 | load_all_product_makefiles := true
220 | endif
221 | endif
222 | ifneq (,$(filter dump-products,$(MAKECMDGOALS)))
223 | ifeq ($(ANDROID_DUMP_PRODUCTS),all)
224 | load_all_product_makefiles := true
225 | endif
226 | endif
227 |
228 | ifeq ($(load_all_product_makefiles),true)
229 | # Import all product makefiles.
230 | $(call import-products, $(all_product_makefiles))
231 | else
232 | $(call import-products, $(current_product_makefile))
233 | endif # Import all or just the current product makefile
234 |
235 | # Sanity check
236 | $(check-all-products)
237 |
238 | ifneq ($(filter dump-products, $(MAKECMDGOALS)),)
239 | $(dump-products)
240 | $(error done)
241 | endif
242 |
243 | # Convert a short name like "sooner" into the path to the product
244 | # file defining that product.
245 | #
246 | current_product_makefile :=
247 | all_product_makefiles :=
248 | all_product_configs :=
249 |
250 |
251 | #############################################################################
252 |
253 | # A list of module names of BOOTCLASSPATH (jar files)
254 | PRODUCT_BOOT_JARS := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_BOOT_JARS))
255 | PRODUCT_SYSTEM_SERVER_JARS := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SYSTEM_SERVER_JARS))
256 |
257 | # Find the device that this product maps to.
258 | TARGET_DEVICE := device_code
259 |
260 | # Figure out which resoure configuration options to use for this
261 | # product.
262 | PRODUCT_LOCALES := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_LOCALES))
263 | # TODO: also keep track of things like "port", "land" in product files.
264 |
265 | # If CUSTOM_LOCALES contains any locales not already included
266 | # in PRODUCT_LOCALES, add them to PRODUCT_LOCALES.
267 | extra_locales := $(filter-out $(PRODUCT_LOCALES),$(CUSTOM_LOCALES))
268 | ifneq (,$(extra_locales))
269 | ifneq ($(CALLED_FROM_SETUP),true)
270 | # Don't spam stdout, because envsetup.sh may be scraping values from it.
271 | $(info Adding CUSTOM_LOCALES [$(extra_locales)] to PRODUCT_LOCALES [$(PRODUCT_LOCALES)])
272 | endif
273 | PRODUCT_LOCALES += $(extra_locales)
274 | extra_locales :=
275 | endif
276 |
277 | # Add PRODUCT_LOCALES to PRODUCT_AAPT_CONFIG
278 | PRODUCT_AAPT_CONFIG := $(strip $(PRODUCT_LOCALES) $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_AAPT_CONFIG))
279 | PRODUCT_AAPT_PREF_CONFIG := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_AAPT_PREF_CONFIG))
280 | PRODUCT_AAPT_PREBUILT_DPI := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_AAPT_PREBUILT_DPI))
281 |
282 | # Keep a copy of the space-separated config
283 | PRODUCT_AAPT_CONFIG_SP := $(PRODUCT_AAPT_CONFIG)
284 |
285 | # Convert spaces to commas.
286 | PRODUCT_AAPT_CONFIG := \
287 | $(subst $(space),$(comma),$(strip $(PRODUCT_AAPT_CONFIG)))
288 |
289 | # product-scoped aapt flags
290 | PRODUCT_AAPT_FLAGS :=
291 | PRODUCT_AAPT2_CFLAGS :=
292 | ifneq ($(filter en_XA ar_XB,$(PRODUCT_LOCALES)),)
293 | # Force generating resources for pseudo-locales.
294 | PRODUCT_AAPT2_CFLAGS += --pseudo-localize
295 | PRODUCT_AAPT_FLAGS += --pseudo-localize
296 | endif
297 |
298 | PRODUCT_BRAND := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_BRAND))
299 |
300 | PRODUCT_MODEL := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_MODEL))
301 | ifndef PRODUCT_MODEL
302 | PRODUCT_MODEL := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_NAME))
303 | endif
304 |
305 | PRODUCT_MANUFACTURER := \
306 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_MANUFACTURER))
307 | ifndef PRODUCT_MANUFACTURER
308 | PRODUCT_MANUFACTURER := unknown
309 | endif
310 |
311 | ifeq ($(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_CHARACTERISTICS),)
312 | TARGET_AAPT_CHARACTERISTICS := default
313 | else
314 | TARGET_AAPT_CHARACTERISTICS := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_CHARACTERISTICS))
315 | endif
316 |
317 | PRODUCT_DEFAULT_WIFI_CHANNELS := \
318 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEFAULT_WIFI_CHANNELS))
319 |
320 | PRODUCT_DEFAULT_DEV_CERTIFICATE := \
321 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEFAULT_DEV_CERTIFICATE))
322 | ifdef PRODUCT_DEFAULT_DEV_CERTIFICATE
323 | ifneq (1,$(words $(PRODUCT_DEFAULT_DEV_CERTIFICATE)))
324 | $(error PRODUCT_DEFAULT_DEV_CERTIFICATE='$(PRODUCT_DEFAULT_DEV_CERTIFICATE)', \
325 | only 1 certificate is allowed.)
326 | endif
327 | endif
328 |
329 | # A list of words like :[:].
330 | # The file at the source path should be copied to the destination path
331 | # when building this product. is relative to
332 | # $(PRODUCT_OUT), so it should look like, e.g., "system/etc/file.xml".
333 | # The rules for these copy steps are defined in build/core/Makefile.
334 | # The optional : is used to indicate the owner of a vendor file.
335 | PRODUCT_COPY_FILES := \
336 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_COPY_FILES))
337 |
338 | # A list of property assignments, like "key = value", with zero or more
339 | # whitespace characters on either side of the '='.
340 | PRODUCT_PROPERTY_OVERRIDES := \
341 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PROPERTY_OVERRIDES))
342 |
343 | PRODUCT_SHIPPING_API_LEVEL := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SHIPPING_API_LEVEL))
344 | ifdef PRODUCT_SHIPPING_API_LEVEL
345 | ADDITIONAL_BUILD_PROPERTIES += \
346 | ro.product.first_api_level=$(PRODUCT_SHIPPING_API_LEVEL)
347 | endif
348 |
349 | # A list of property assignments, like "key = value", with zero or more
350 | # whitespace characters on either side of the '='.
351 | # used for adding properties to default.prop
352 | PRODUCT_DEFAULT_PROPERTY_OVERRIDES := \
353 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEFAULT_PROPERTY_OVERRIDES))
354 |
355 | PRODUCT_BUILD_PROP_OVERRIDES := \
356 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_BUILD_PROP_OVERRIDES))
357 |
358 | # Should we use the default resources or add any product specific overlays
359 | PRODUCT_PACKAGE_OVERLAYS := \
360 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGE_OVERLAYS))
361 | DEVICE_PACKAGE_OVERLAYS := \
362 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).DEVICE_PACKAGE_OVERLAYS))
363 |
364 | # The list of product-specific kernel header dirs
365 | PRODUCT_VENDOR_KERNEL_HEADERS := \
366 | $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_VENDOR_KERNEL_HEADERS)
367 |
368 | # Add the product-defined properties to the build properties.
369 | ADDITIONAL_BUILD_PROPERTIES := \
370 | $(ADDITIONAL_BUILD_PROPERTIES) \
371 | $(PRODUCT_PROPERTY_OVERRIDES)
372 |
373 | # The OTA key(s) specified by the product config, if any. The names
374 | # of these keys are stored in the target-files zip so that post-build
375 | # signing tools can substitute them for the test key embedded by
376 | # default.
377 | PRODUCT_OTA_PUBLIC_KEYS := $(sort \
378 | $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_OTA_PUBLIC_KEYS))
379 |
380 | PRODUCT_EXTRA_RECOVERY_KEYS := $(sort \
381 | $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_EXTRA_RECOVERY_KEYS))
382 |
383 | PRODUCT_DEX_PREOPT_DEFAULT_FLAGS := \
384 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEX_PREOPT_DEFAULT_FLAGS))
385 | PRODUCT_DEX_PREOPT_BOOT_FLAGS := \
386 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEX_PREOPT_BOOT_FLAGS))
387 | # Resolve and setup per-module dex-preopt configs.
388 | PRODUCT_DEX_PREOPT_MODULE_CONFIGS := \
389 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEX_PREOPT_MODULE_CONFIGS))
390 | # If a module has multiple setups, the first takes precedence.
391 | _pdpmc_modules :=
392 | $(foreach c,$(PRODUCT_DEX_PREOPT_MODULE_CONFIGS),\
393 | $(eval m := $(firstword $(subst =,$(space),$(c))))\
394 | $(if $(filter $(_pdpmc_modules),$(m)),,\
395 | $(eval _pdpmc_modules += $(m))\
396 | $(eval cf := $(patsubst $(m)=%,%,$(c)))\
397 | $(eval cf := $(subst $(_PDPMC_SP_PLACE_HOLDER),$(space),$(cf)))\
398 | $(eval DEXPREOPT.$(TARGET_PRODUCT).$(m).CONFIG := $(cf))))
399 | _pdpmc_modules :=
400 |
401 | # Resolve and setup per-module sanitizer configs.
402 | PRODUCT_SANITIZER_MODULE_CONFIGS := \
403 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SANITIZER_MODULE_CONFIGS))
404 | # If a module has multiple setups, the first takes precedence.
405 | _psmc_modules :=
406 | $(foreach c,$(PRODUCT_SANITIZER_MODULE_CONFIGS),\
407 | $(eval m := $(firstword $(subst =,$(space),$(c))))\
408 | $(if $(filter $(_psmc_modules),$(m)),,\
409 | $(eval _psmc_modules += $(m))\
410 | $(eval cf := $(patsubst $(m)=%,%,$(c)))\
411 | $(eval cf := $(subst $(_PSMC_SP_PLACE_HOLDER),$(space),$(cf)))\
412 | $(eval SANITIZER.$(TARGET_PRODUCT).$(m).CONFIG := $(cf))))
413 | _psmc_modules :=
414 |
--------------------------------------------------------------------------------
/build/core/android-8.1/product_config.mk:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2008 The Android Open Source Project
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | #
16 |
17 | # ---------------------------------------------------------------
18 | # Generic functions
19 | # TODO: Move these to definitions.make once we're able to include
20 | # definitions.make before config.make.
21 |
22 | ###########################################################
23 | ## Return non-empty if $(1) is a C identifier; i.e., if it
24 | ## matches /^[a-zA-Z_][a-zA-Z0-9_]*$/. We do this by first
25 | ## making sure that it isn't empty and doesn't start with
26 | ## a digit, then by removing each valid character. If the
27 | ## final result is empty, then it was a valid C identifier.
28 | ##
29 | ## $(1): word to check
30 | ###########################################################
31 |
32 | _ici_digits := 0 1 2 3 4 5 6 7 8 9
33 | _ici_alphaunderscore := \
34 | a b c d e f g h i j k l m n o p q r s t u v w x y z \
35 | A B C D E F G H I J K L M N O P Q R S T U V W X Y Z _
36 | define is-c-identifier
37 | $(strip \
38 | $(if $(1), \
39 | $(if $(filter $(addsuffix %,$(_ici_digits)),$(1)), \
40 | , \
41 | $(eval w := $(1)) \
42 | $(foreach c,$(_ici_digits) $(_ici_alphaunderscore), \
43 | $(eval w := $(subst $(c),,$(w))) \
44 | ) \
45 | $(if $(w),,TRUE) \
46 | $(eval w :=) \
47 | ) \
48 | ) \
49 | )
50 | endef
51 |
52 | # TODO: push this into the combo files; unfortunately, we don't even
53 | # know HOST_OS at this point.
54 | trysed := $(shell echo a | sed -E -e 's/a/b/' 2>/dev/null)
55 | ifeq ($(trysed),b)
56 | SED_EXTENDED := sed -E
57 | else
58 | trysed := $(shell echo c | sed -r -e 's/c/d/' 2>/dev/null)
59 | ifeq ($(trysed),d)
60 | SED_EXTENDED := sed -r
61 | else
62 | $(error Unknown sed version)
63 | endif
64 | endif
65 |
66 | ###########################################################
67 | ## List all of the files in a subdirectory in a format
68 | ## suitable for PRODUCT_COPY_FILES and
69 | ## PRODUCT_SDK_ADDON_COPY_FILES
70 | ##
71 | ## $(1): Glob to match file name
72 | ## $(2): Source directory
73 | ## $(3): Target base directory
74 | ###########################################################
75 |
76 | define find-copy-subdir-files
77 | $(sort $(shell find $(2) -name "$(1)" -type f | $(SED_EXTENDED) "s:($(2)/?(.*)):\\1\\:$(3)/\\2:" | sed "s://:/:g"))
78 | endef
79 |
80 | # ---------------------------------------------------------------
81 |
82 | # These are the valid values of TARGET_BUILD_VARIANT. Also, if anything else is passed
83 | # as the variant in the PRODUCT-$TARGET_BUILD_PRODUCT-$TARGET_BUILD_VARIANT form,
84 | # it will be treated as a goal, and the eng variant will be used.
85 | INTERNAL_VALID_VARIANTS := user userdebug eng
86 |
87 | # ---------------------------------------------------------------
88 | # Provide "PRODUCT--" targets, which lets you build
89 | # a particular configuration without needing to set up the environment.
90 | #
91 | ifndef KATI
92 | product_goals := $(strip $(filter PRODUCT-%,$(MAKECMDGOALS)))
93 | ifdef product_goals
94 | # Scrape the product and build names out of the goal,
95 | # which should be of the form PRODUCT--.
96 | #
97 | ifneq ($(words $(product_goals)),1)
98 | $(error Only one PRODUCT-* goal may be specified; saw "$(product_goals)")
99 | endif
100 | goal_name := $(product_goals)
101 | product_goals := $(patsubst PRODUCT-%,%,$(product_goals))
102 | product_goals := $(subst -, ,$(product_goals))
103 | ifneq ($(words $(product_goals)),2)
104 | $(error Bad PRODUCT-* goal "$(goal_name)")
105 | endif
106 |
107 | # The product they want
108 | TARGET_PRODUCT := $(word 1,$(product_goals))
109 |
110 | # The variant they want
111 | TARGET_BUILD_VARIANT := $(word 2,$(product_goals))
112 |
113 | ifeq ($(TARGET_BUILD_VARIANT),tests)
114 | $(error "tests" has been deprecated as a build variant. Use it as a build goal instead.)
115 | endif
116 |
117 | # The build server wants to do make PRODUCT-dream-sdk
118 | # which really means TARGET_PRODUCT=dream make sdk.
119 | ifneq ($(filter-out $(INTERNAL_VALID_VARIANTS),$(TARGET_BUILD_VARIANT)),)
120 | override MAKECMDGOALS := $(MAKECMDGOALS) $(TARGET_BUILD_VARIANT)
121 | TARGET_BUILD_VARIANT := userdebug
122 | default_goal_substitution :=
123 | else
124 | default_goal_substitution := droid
125 | endif
126 |
127 | # Replace the PRODUCT-* goal with the build goal that it refers to.
128 | # Note that this will ensure that it appears in the same relative
129 | # position, in case it matters.
130 | override MAKECMDGOALS := $(patsubst $(goal_name),$(default_goal_substitution),$(MAKECMDGOALS))
131 | endif
132 | endif # !KATI
133 | # else: Use the value set in the environment or buildspec.mk.
134 |
135 | # ---------------------------------------------------------------
136 | # Provide "APP-" targets, which lets you build
137 | # an unbundled app.
138 | #
139 | ifndef KATI
140 | unbundled_goals := $(strip $(filter APP-%,$(MAKECMDGOALS)))
141 | ifdef unbundled_goals
142 | ifneq ($(words $(unbundled_goals)),1)
143 | $(error Only one APP-* goal may be specified; saw "$(unbundled_goals)")
144 | endif
145 | TARGET_BUILD_APPS := $(strip $(subst -, ,$(patsubst APP-%,%,$(unbundled_goals))))
146 | ifneq ($(filter droid,$(MAKECMDGOALS)),)
147 | override MAKECMDGOALS := $(patsubst $(unbundled_goals),,$(MAKECMDGOALS))
148 | else
149 | override MAKECMDGOALS := $(patsubst $(unbundled_goals),droid,$(MAKECMDGOALS))
150 | endif
151 | endif # unbundled_goals
152 | endif
153 |
154 | # Default to building dalvikvm on hosts that support it...
155 | ifeq ($(HOST_OS),linux)
156 | # ... or if the if the option is already set
157 | ifeq ($(WITH_HOST_DALVIK),)
158 | WITH_HOST_DALVIK := true
159 | endif
160 | endif
161 |
162 | # ---------------------------------------------------------------
163 | # Include the product definitions.
164 | # We need to do this to translate TARGET_PRODUCT into its
165 | # underlying TARGET_DEVICE before we start defining any rules.
166 | #
167 | include $(BUILD_SYSTEM)/node_fns.mk
168 | include $(BUILD_SYSTEM)/product.mk
169 | include $(BUILD_SYSTEM)/device.mk
170 |
171 | ifneq ($(strip $(TARGET_BUILD_APPS)),)
172 | # An unbundled app build needs only the core product makefiles.
173 | all_product_configs := $(call get-product-makefiles,\
174 | $(SRC_TARGET_DIR)/product/AndroidProducts.mk)
175 | else
176 | # Read in all of the product definitions specified by the AndroidProducts.mk
177 | # files in the tree.
178 | all_product_configs := $(get-all-product-makefiles)
179 | endif
180 |
181 | all_named_products :=
182 |
183 | # Find the product config makefile for the current product.
184 | # all_product_configs consists items like:
185 | # :
186 | # or just in case the product name is the
187 | # same as the base filename of the product config makefile.
188 | current_product_makefile :=
189 | all_product_makefiles :=
190 | $(foreach f, $(all_product_configs),\
191 | $(eval _cpm_words := $(subst :,$(space),$(f)))\
192 | $(eval _cpm_word1 := $(word 1,$(_cpm_words)))\
193 | $(eval _cpm_word2 := $(word 2,$(_cpm_words)))\
194 | $(if $(_cpm_word2),\
195 | $(eval all_product_makefiles += $(_cpm_word2))\
196 | $(eval all_named_products += $(_cpm_word1))\
197 | $(if $(filter $(TARGET_PRODUCT),$(_cpm_word1)),\
198 | $(eval current_product_makefile += $(_cpm_word2)),),\
199 | $(eval all_product_makefiles += $(f))\
200 | $(eval all_named_products += $(basename $(notdir $(f))))\
201 | $(if $(filter $(TARGET_PRODUCT),$(basename $(notdir $(f)))),\
202 | $(eval current_product_makefile += $(f)),)))
203 | _cpm_words :=
204 | _cpm_word1 :=
205 | _cpm_word2 :=
206 | current_product_makefile := $(strip $(current_product_makefile))
207 | all_product_makefiles := $(strip $(all_product_makefiles))
208 |
209 | load_all_product_makefiles :=
210 | ifneq (,$(filter product-graph, $(MAKECMDGOALS)))
211 | ifeq ($(ANDROID_PRODUCT_GRAPH),--all)
212 | load_all_product_makefiles := true
213 | endif
214 | endif
215 | ifneq (,$(filter dump-products,$(MAKECMDGOALS)))
216 | ifeq ($(ANDROID_DUMP_PRODUCTS),all)
217 | load_all_product_makefiles := true
218 | endif
219 | endif
220 |
221 | ifeq ($(load_all_product_makefiles),true)
222 | # Import all product makefiles.
223 | $(call import-products, $(all_product_makefiles))
224 | else
225 | $(call import-products, $(current_product_makefile))
226 | endif # Import all or just the current product makefile
227 |
228 | # Sanity check
229 | $(check-all-products)
230 |
231 | ifneq ($(filter dump-products, $(MAKECMDGOALS)),)
232 | $(dump-products)
233 | $(error done)
234 | endif
235 |
236 | # Convert a short name like "sooner" into the path to the product
237 | # file defining that product.
238 | #
239 | current_product_makefile :=
240 | all_product_makefiles :=
241 | all_product_configs :=
242 |
243 |
244 | #############################################################################
245 |
246 | # A list of module names of BOOTCLASSPATH (jar files)
247 | PRODUCT_BOOT_JARS := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_BOOT_JARS))
248 | PRODUCT_SYSTEM_SERVER_JARS := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SYSTEM_SERVER_JARS))
249 | PRODUCT_SYSTEM_SERVER_APPS := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SYSTEM_SERVER_APPS))
250 | PRODUCT_DEXPREOPT_SPEED_APPS := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEXPREOPT_SPEED_APPS))
251 |
252 | # All of the apps that we force preopt, this overrides WITH_DEXPREOPT.
253 | PRODUCT_ALWAYS_PREOPT_EXTRACTED_APK := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_ALWAYS_PREOPT_EXTRACTED_APK))
254 |
255 | # Find the device that this product maps to.
256 | TARGET_DEVICE := device_code
257 |
258 | # Figure out which resoure configuration options to use for this
259 | # product.
260 | PRODUCT_LOCALES := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_LOCALES))
261 | # TODO: also keep track of things like "port", "land" in product files.
262 |
263 | # If CUSTOM_LOCALES contains any locales not already included
264 | # in PRODUCT_LOCALES, add them to PRODUCT_LOCALES.
265 | extra_locales := $(filter-out $(PRODUCT_LOCALES),$(CUSTOM_LOCALES))
266 | ifneq (,$(extra_locales))
267 | ifneq ($(CALLED_FROM_SETUP),true)
268 | # Don't spam stdout, because envsetup.sh may be scraping values from it.
269 | $(info Adding CUSTOM_LOCALES [$(extra_locales)] to PRODUCT_LOCALES [$(PRODUCT_LOCALES)])
270 | endif
271 | PRODUCT_LOCALES += $(extra_locales)
272 | extra_locales :=
273 | endif
274 |
275 | # Add PRODUCT_LOCALES to PRODUCT_AAPT_CONFIG
276 | PRODUCT_AAPT_CONFIG := $(strip $(PRODUCT_LOCALES) $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_AAPT_CONFIG))
277 | PRODUCT_AAPT_PREF_CONFIG := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_AAPT_PREF_CONFIG))
278 | PRODUCT_AAPT_PREBUILT_DPI := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_AAPT_PREBUILT_DPI))
279 |
280 | # Keep a copy of the space-separated config
281 | PRODUCT_AAPT_CONFIG_SP := $(PRODUCT_AAPT_CONFIG)
282 |
283 | # Convert spaces to commas.
284 | PRODUCT_AAPT_CONFIG := \
285 | $(subst $(space),$(comma),$(strip $(PRODUCT_AAPT_CONFIG)))
286 |
287 | # product-scoped aapt flags
288 | PRODUCT_AAPT_FLAGS :=
289 | PRODUCT_AAPT2_CFLAGS :=
290 | ifneq ($(filter en_XA ar_XB,$(PRODUCT_LOCALES)),)
291 | # Force generating resources for pseudo-locales.
292 | PRODUCT_AAPT2_CFLAGS += --pseudo-localize
293 | PRODUCT_AAPT_FLAGS += --pseudo-localize
294 | endif
295 |
296 | PRODUCT_BRAND := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_BRAND))
297 |
298 | PRODUCT_MODEL := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_MODEL))
299 | ifndef PRODUCT_MODEL
300 | PRODUCT_MODEL := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_NAME))
301 | endif
302 |
303 | PRODUCT_MANUFACTURER := \
304 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_MANUFACTURER))
305 | ifndef PRODUCT_MANUFACTURER
306 | PRODUCT_MANUFACTURER := unknown
307 | endif
308 |
309 | ifeq ($(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_CHARACTERISTICS),)
310 | TARGET_AAPT_CHARACTERISTICS := default
311 | else
312 | TARGET_AAPT_CHARACTERISTICS := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_CHARACTERISTICS))
313 | endif
314 |
315 | PRODUCT_DEFAULT_WIFI_CHANNELS := \
316 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEFAULT_WIFI_CHANNELS))
317 |
318 | PRODUCT_DEFAULT_DEV_CERTIFICATE := \
319 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEFAULT_DEV_CERTIFICATE))
320 | ifdef PRODUCT_DEFAULT_DEV_CERTIFICATE
321 | ifneq (1,$(words $(PRODUCT_DEFAULT_DEV_CERTIFICATE)))
322 | $(error PRODUCT_DEFAULT_DEV_CERTIFICATE='$(PRODUCT_DEFAULT_DEV_CERTIFICATE)', \
323 | only 1 certificate is allowed.)
324 | endif
325 | endif
326 |
327 | # A list of words like :[:].
328 | # The file at the source path should be copied to the destination path
329 | # when building this product. is relative to
330 | # $(PRODUCT_OUT), so it should look like, e.g., "system/etc/file.xml".
331 | # The rules for these copy steps are defined in build/core/Makefile.
332 | # The optional : is used to indicate the owner of a vendor file.
333 | PRODUCT_COPY_FILES := \
334 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_COPY_FILES))
335 |
336 | # A list of property assignments, like "key = value", with zero or more
337 | # whitespace characters on either side of the '='.
338 | PRODUCT_PROPERTY_OVERRIDES := \
339 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PROPERTY_OVERRIDES))
340 | .KATI_READONLY := PRODUCT_PROPERTY_OVERRIDES
341 |
342 | PRODUCT_SHIPPING_API_LEVEL := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SHIPPING_API_LEVEL))
343 |
344 | # A list of property assignments, like "key = value", with zero or more
345 | # whitespace characters on either side of the '='.
346 | # used for adding properties to default.prop
347 | PRODUCT_DEFAULT_PROPERTY_OVERRIDES := \
348 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEFAULT_PROPERTY_OVERRIDES))
349 | .KATI_READONLY := PRODUCT_DEFAULT_PROPERTY_OVERRIDES
350 |
351 | # A list of property assignments, like "key = value", with zero or more
352 | # whitespace characters on either side of the '='.
353 | # used for overriding properties in build.prop
354 | PRODUCT_BUILD_PROP_OVERRIDES := \
355 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_BUILD_PROP_OVERRIDES))
356 | .KATI_READONLY := PRODUCT_BUILD_PROP_OVERRIDES
357 |
358 | # A list of property assignments, like "key = value", with zero or more
359 | # whitespace characters on either side of the '='.
360 | # used for adding properties to default.prop of system partition
361 | PRODUCT_SYSTEM_DEFAULT_PROPERTIES := \
362 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SYSTEM_DEFAULT_PROPERTIES))
363 | .KATI_READONLY := PRODUCT_SYSTEM_DEFAULT_PROPERTIES
364 |
365 | # Should we use the default resources or add any product specific overlays
366 | PRODUCT_PACKAGE_OVERLAYS := \
367 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGE_OVERLAYS))
368 | DEVICE_PACKAGE_OVERLAYS := \
369 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).DEVICE_PACKAGE_OVERLAYS))
370 |
371 | # The list of product-specific kernel header dirs
372 | PRODUCT_VENDOR_KERNEL_HEADERS := \
373 | $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_VENDOR_KERNEL_HEADERS)
374 |
375 | # The OTA key(s) specified by the product config, if any. The names
376 | # of these keys are stored in the target-files zip so that post-build
377 | # signing tools can substitute them for the test key embedded by
378 | # default.
379 | PRODUCT_OTA_PUBLIC_KEYS := $(sort \
380 | $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_OTA_PUBLIC_KEYS))
381 |
382 | PRODUCT_EXTRA_RECOVERY_KEYS := $(sort \
383 | $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_EXTRA_RECOVERY_KEYS))
384 |
385 | PRODUCT_DEX_PREOPT_DEFAULT_FLAGS := \
386 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEX_PREOPT_DEFAULT_FLAGS))
387 | PRODUCT_DEX_PREOPT_BOOT_FLAGS := \
388 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEX_PREOPT_BOOT_FLAGS))
389 | PRODUCT_DEX_PREOPT_PROFILE_DIR := \
390 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEX_PREOPT_PROFILE_DIR))
391 |
392 | # Boot image options.
393 | PRODUCT_USE_PROFILE_FOR_BOOT_IMAGE := \
394 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_USE_PROFILE_FOR_BOOT_IMAGE))
395 | PRODUCT_DEX_PREOPT_BOOT_IMAGE_PROFILE_LOCATION := \
396 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEX_PREOPT_BOOT_IMAGE_PROFILE_LOCATION))
397 |
398 | PRODUCT_SYSTEM_SERVER_COMPILER_FILTER := \
399 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SYSTEM_SERVER_COMPILER_FILTER))
400 | PRODUCT_SYSTEM_SERVER_DEBUG_INFO := \
401 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SYSTEM_SERVER_DEBUG_INFO))
402 |
403 | # Resolve and setup per-module dex-preopt configs.
404 | PRODUCT_DEX_PREOPT_MODULE_CONFIGS := \
405 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEX_PREOPT_MODULE_CONFIGS))
406 | # If a module has multiple setups, the first takes precedence.
407 | _pdpmc_modules :=
408 | $(foreach c,$(PRODUCT_DEX_PREOPT_MODULE_CONFIGS),\
409 | $(eval m := $(firstword $(subst =,$(space),$(c))))\
410 | $(if $(filter $(_pdpmc_modules),$(m)),,\
411 | $(eval _pdpmc_modules += $(m))\
412 | $(eval cf := $(patsubst $(m)=%,%,$(c)))\
413 | $(eval cf := $(subst $(_PDPMC_SP_PLACE_HOLDER),$(space),$(cf)))\
414 | $(eval DEXPREOPT.$(TARGET_PRODUCT).$(m).CONFIG := $(cf))))
415 | _pdpmc_modules :=
416 |
417 | # Resolve and setup per-module sanitizer configs.
418 | PRODUCT_SANITIZER_MODULE_CONFIGS := \
419 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SANITIZER_MODULE_CONFIGS))
420 | # If a module has multiple setups, the first takes precedence.
421 | _psmc_modules :=
422 | $(foreach c,$(PRODUCT_SANITIZER_MODULE_CONFIGS),\
423 | $(eval m := $(firstword $(subst =,$(space),$(c))))\
424 | $(if $(filter $(_psmc_modules),$(m)),,\
425 | $(eval _psmc_modules += $(m))\
426 | $(eval cf := $(patsubst $(m)=%,%,$(c)))\
427 | $(eval cf := $(subst $(_PSMC_SP_PLACE_HOLDER),$(space),$(cf)))\
428 | $(eval SANITIZER.$(TARGET_PRODUCT).$(m).CONFIG := $(cf))))
429 | _psmc_modules :=
430 |
431 | # Whether the product wants to ship libartd. For rules and meaning, see art/Android.mk.
432 | PRODUCT_ART_TARGET_INCLUDE_DEBUG_BUILD := \
433 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_ART_TARGET_INCLUDE_DEBUG_BUILD))
434 |
435 | # Make this art variable visible to soong_config.mk.
436 | PRODUCT_ART_USE_READ_BARRIER := \
437 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_ART_USE_READ_BARRIER))
438 |
439 | # Whether the product is an Android Things variant.
440 | PRODUCT_IOT := \
441 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_IOT))
442 |
443 | # Resource overlay list which must be excluded from enforcing RRO.
444 | PRODUCT_ENFORCE_RRO_EXCLUDED_OVERLAYS := \
445 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_ENFORCE_RRO_EXCLUDED_OVERLAYS))
446 |
447 | # Package list to apply enforcing RRO.
448 | PRODUCT_ENFORCE_RRO_TARGETS := \
449 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_ENFORCE_RRO_TARGETS))
450 |
451 | # Add reserved headroom to a system image.
452 | PRODUCT_SYSTEM_HEADROOM := \
453 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SYSTEM_HEADROOM))
454 |
455 | # Whether to save disk space by minimizing java debug info
456 | PRODUCT_MINIMIZE_JAVA_DEBUG_INFO := \
457 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_MINIMIZE_JAVA_DEBUG_INFO))
458 |
459 | # Whether any paths are excluded from sanitization when SANITIZE_TARGET=integer_overflow
460 | PRODUCT_INTEGER_OVERFLOW_EXCLUDE_PATHS := \
461 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_INTEGER_OVERFLOW_EXCLUDE_PATHS))
462 |
--------------------------------------------------------------------------------
/build/core/android-9.0/product_config.mk:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2008 The Android Open Source Project
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | #
16 |
17 | # ---------------------------------------------------------------
18 | # Generic functions
19 | # TODO: Move these to definitions.make once we're able to include
20 | # definitions.make before config.make.
21 |
22 | ###########################################################
23 | ## Return non-empty if $(1) is a C identifier; i.e., if it
24 | ## matches /^[a-zA-Z_][a-zA-Z0-9_]*$/. We do this by first
25 | ## making sure that it isn't empty and doesn't start with
26 | ## a digit, then by removing each valid character. If the
27 | ## final result is empty, then it was a valid C identifier.
28 | ##
29 | ## $(1): word to check
30 | ###########################################################
31 |
32 | _ici_digits := 0 1 2 3 4 5 6 7 8 9
33 | _ici_alphaunderscore := \
34 | a b c d e f g h i j k l m n o p q r s t u v w x y z \
35 | A B C D E F G H I J K L M N O P Q R S T U V W X Y Z _
36 | define is-c-identifier
37 | $(strip \
38 | $(if $(1), \
39 | $(if $(filter $(addsuffix %,$(_ici_digits)),$(1)), \
40 | , \
41 | $(eval w := $(1)) \
42 | $(foreach c,$(_ici_digits) $(_ici_alphaunderscore), \
43 | $(eval w := $(subst $(c),,$(w))) \
44 | ) \
45 | $(if $(w),,TRUE) \
46 | $(eval w :=) \
47 | ) \
48 | ) \
49 | )
50 | endef
51 |
52 | # TODO: push this into the combo files; unfortunately, we don't even
53 | # know HOST_OS at this point.
54 | trysed := $(shell echo a | sed -E -e 's/a/b/' 2>/dev/null)
55 | ifeq ($(trysed),b)
56 | SED_EXTENDED := sed -E
57 | else
58 | trysed := $(shell echo c | sed -r -e 's/c/d/' 2>/dev/null)
59 | ifeq ($(trysed),d)
60 | SED_EXTENDED := sed -r
61 | else
62 | $(error Unknown sed version)
63 | endif
64 | endif
65 |
66 | ###########################################################
67 | ## List all of the files in a subdirectory in a format
68 | ## suitable for PRODUCT_COPY_FILES and
69 | ## PRODUCT_SDK_ADDON_COPY_FILES
70 | ##
71 | ## $(1): Glob to match file name
72 | ## $(2): Source directory
73 | ## $(3): Target base directory
74 | ###########################################################
75 |
76 | define find-copy-subdir-files
77 | $(sort $(shell find $(2) -name "$(1)" -type f | $(SED_EXTENDED) "s:($(2)/?(.*)):\\1\\:$(3)/\\2:" | sed "s://:/:g"))
78 | endef
79 |
80 | # ---------------------------------------------------------------
81 |
82 | # These are the valid values of TARGET_BUILD_VARIANT. Also, if anything else is passed
83 | # as the variant in the PRODUCT-$TARGET_BUILD_PRODUCT-$TARGET_BUILD_VARIANT form,
84 | # it will be treated as a goal, and the eng variant will be used.
85 | INTERNAL_VALID_VARIANTS := user userdebug eng
86 |
87 | # ---------------------------------------------------------------
88 | # Provide "PRODUCT--" targets, which lets you build
89 | # a particular configuration without needing to set up the environment.
90 | #
91 | ifeq ($(CALLED_FROM_SETUP),true)
92 | product_goals := $(strip $(filter PRODUCT-%,$(MAKECMDGOALS)))
93 | ifdef product_goals
94 | # Scrape the product and build names out of the goal,
95 | # which should be of the form PRODUCT--.
96 | #
97 | ifneq ($(words $(product_goals)),1)
98 | $(error Only one PRODUCT-* goal may be specified; saw "$(product_goals)")
99 | endif
100 | goal_name := $(product_goals)
101 | product_goals := $(patsubst PRODUCT-%,%,$(product_goals))
102 | product_goals := $(subst -, ,$(product_goals))
103 | ifneq ($(words $(product_goals)),2)
104 | $(error Bad PRODUCT-* goal "$(goal_name)")
105 | endif
106 |
107 | # The product they want
108 | TARGET_PRODUCT := $(word 1,$(product_goals))
109 |
110 | # The variant they want
111 | TARGET_BUILD_VARIANT := $(word 2,$(product_goals))
112 |
113 | ifeq ($(TARGET_BUILD_VARIANT),tests)
114 | $(error "tests" has been deprecated as a build variant. Use it as a build goal instead.)
115 | endif
116 |
117 | # The build server wants to do make PRODUCT-dream-sdk
118 | # which really means TARGET_PRODUCT=dream make sdk.
119 | ifneq ($(filter-out $(INTERNAL_VALID_VARIANTS),$(TARGET_BUILD_VARIANT)),)
120 | override MAKECMDGOALS := $(MAKECMDGOALS) $(TARGET_BUILD_VARIANT)
121 | TARGET_BUILD_VARIANT := userdebug
122 | default_goal_substitution :=
123 | else
124 | default_goal_substitution := droid
125 | endif
126 |
127 | # Replace the PRODUCT-* goal with the build goal that it refers to.
128 | # Note that this will ensure that it appears in the same relative
129 | # position, in case it matters.
130 | override MAKECMDGOALS := $(patsubst $(goal_name),$(default_goal_substitution),$(MAKECMDGOALS))
131 | endif
132 | endif # CALLED_FROM_SETUP
133 | # else: Use the value set in the environment or buildspec.mk.
134 |
135 | # ---------------------------------------------------------------
136 | # Provide "APP-" targets, which lets you build
137 | # an unbundled app.
138 | #
139 | ifeq ($(CALLED_FROM_SETUP),true)
140 | unbundled_goals := $(strip $(filter APP-%,$(MAKECMDGOALS)))
141 | ifdef unbundled_goals
142 | ifneq ($(words $(unbundled_goals)),1)
143 | $(error Only one APP-* goal may be specified; saw "$(unbundled_goals)")
144 | endif
145 | TARGET_BUILD_APPS := $(strip $(subst -, ,$(patsubst APP-%,%,$(unbundled_goals))))
146 | ifneq ($(filter droid,$(MAKECMDGOALS)),)
147 | override MAKECMDGOALS := $(patsubst $(unbundled_goals),,$(MAKECMDGOALS))
148 | else
149 | override MAKECMDGOALS := $(patsubst $(unbundled_goals),droid,$(MAKECMDGOALS))
150 | endif
151 | endif # unbundled_goals
152 | endif
153 |
154 | # Now that we've parsed APP-* and PRODUCT-*, mark these as readonly
155 | TARGET_BUILD_APPS ?=
156 | .KATI_READONLY := \
157 | TARGET_PRODUCT \
158 | TARGET_BUILD_VARIANT \
159 | TARGET_BUILD_APPS
160 |
161 | # Default to building dalvikvm on hosts that support it...
162 | ifeq ($(HOST_OS),linux)
163 | # ... or if the if the option is already set
164 | ifeq ($(WITH_HOST_DALVIK),)
165 | WITH_HOST_DALVIK := true
166 | endif
167 | endif
168 |
169 | # ---------------------------------------------------------------
170 | # Include the product definitions.
171 | # We need to do this to translate TARGET_PRODUCT into its
172 | # underlying TARGET_DEVICE before we start defining any rules.
173 | #
174 | include $(BUILD_SYSTEM)/node_fns.mk
175 | include $(BUILD_SYSTEM)/product.mk
176 | include $(BUILD_SYSTEM)/device.mk
177 |
178 | ifneq ($(strip $(TARGET_BUILD_APPS)),)
179 | # An unbundled app build needs only the core product makefiles.
180 | all_product_configs := $(call get-product-makefiles,\
181 | $(SRC_TARGET_DIR)/product/AndroidProducts.mk)
182 | else
183 | # Read in all of the product definitions specified by the AndroidProducts.mk
184 | # files in the tree.
185 | all_product_configs := $(get-all-product-makefiles)
186 | endif
187 |
188 | all_named_products :=
189 |
190 | # Find the product config makefile for the current product.
191 | # all_product_configs consists items like:
192 | # :
193 | # or just in case the product name is the
194 | # same as the base filename of the product config makefile.
195 | current_product_makefile :=
196 | all_product_makefiles :=
197 | $(foreach f, $(all_product_configs),\
198 | $(eval _cpm_words := $(subst :,$(space),$(f)))\
199 | $(eval _cpm_word1 := $(word 1,$(_cpm_words)))\
200 | $(eval _cpm_word2 := $(word 2,$(_cpm_words)))\
201 | $(if $(_cpm_word2),\
202 | $(eval all_product_makefiles += $(_cpm_word2))\
203 | $(eval all_named_products += $(_cpm_word1))\
204 | $(if $(filter $(TARGET_PRODUCT),$(_cpm_word1)),\
205 | $(eval current_product_makefile += $(_cpm_word2)),),\
206 | $(eval all_product_makefiles += $(f))\
207 | $(eval all_named_products += $(basename $(notdir $(f))))\
208 | $(if $(filter $(TARGET_PRODUCT),$(basename $(notdir $(f)))),\
209 | $(eval current_product_makefile += $(f)),)))
210 | _cpm_words :=
211 | _cpm_word1 :=
212 | _cpm_word2 :=
213 | current_product_makefile := $(strip $(current_product_makefile))
214 | all_product_makefiles := $(strip $(all_product_makefiles))
215 |
216 | load_all_product_makefiles :=
217 | ifneq (,$(filter product-graph, $(MAKECMDGOALS)))
218 | ifeq ($(ANDROID_PRODUCT_GRAPH),--all)
219 | load_all_product_makefiles := true
220 | endif
221 | endif
222 | ifneq (,$(filter dump-products,$(MAKECMDGOALS)))
223 | ifeq ($(ANDROID_DUMP_PRODUCTS),all)
224 | load_all_product_makefiles := true
225 | endif
226 | endif
227 |
228 | ifeq ($(load_all_product_makefiles),true)
229 | # Import all product makefiles.
230 | $(call import-products, $(all_product_makefiles))
231 | else
232 | $(call import-products, $(current_product_makefile))
233 | endif # Import all or just the current product makefile
234 |
235 | # Sanity check
236 | $(check-all-products)
237 |
238 | ifneq ($(filter dump-products, $(MAKECMDGOALS)),)
239 | $(dump-products)
240 | $(error done)
241 | endif
242 |
243 | # Convert a short name like "sooner" into the path to the product
244 | # file defining that product.
245 | #
246 | current_product_makefile :=
247 | all_product_makefiles :=
248 | all_product_configs :=
249 |
250 |
251 | #############################################################################
252 |
253 | # A list of module names of BOOTCLASSPATH (jar files)
254 | PRODUCT_BOOT_JARS := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_BOOT_JARS))
255 | PRODUCT_SYSTEM_SERVER_JARS := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SYSTEM_SERVER_JARS))
256 | PRODUCT_SYSTEM_SERVER_APPS := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SYSTEM_SERVER_APPS))
257 | PRODUCT_DEXPREOPT_SPEED_APPS := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEXPREOPT_SPEED_APPS))
258 | PRODUCT_LOADED_BY_PRIVILEGED_MODULES := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_LOADED_BY_PRIVILEGED_MODULES))
259 |
260 | # All of the apps that we force preopt, this overrides WITH_DEXPREOPT.
261 | PRODUCT_ALWAYS_PREOPT_EXTRACTED_APK := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_ALWAYS_PREOPT_EXTRACTED_APK))
262 |
263 | # Find the device that this product maps to.
264 | TARGET_DEVICE := device_code
265 |
266 | # Figure out which resoure configuration options to use for this
267 | # product.
268 | PRODUCT_LOCALES := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_LOCALES))
269 | # TODO: also keep track of things like "port", "land" in product files.
270 |
271 | # If CUSTOM_LOCALES contains any locales not already included
272 | # in PRODUCT_LOCALES, add them to PRODUCT_LOCALES.
273 | extra_locales := $(filter-out $(PRODUCT_LOCALES),$(CUSTOM_LOCALES))
274 | ifneq (,$(extra_locales))
275 | ifneq ($(CALLED_FROM_SETUP),true)
276 | # Don't spam stdout, because envsetup.sh may be scraping values from it.
277 | $(info Adding CUSTOM_LOCALES [$(extra_locales)] to PRODUCT_LOCALES [$(PRODUCT_LOCALES)])
278 | endif
279 | PRODUCT_LOCALES += $(extra_locales)
280 | extra_locales :=
281 | endif
282 |
283 | # Add PRODUCT_LOCALES to PRODUCT_AAPT_CONFIG
284 | PRODUCT_AAPT_CONFIG := $(strip $(PRODUCT_LOCALES) $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_AAPT_CONFIG))
285 | PRODUCT_AAPT_PREF_CONFIG := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_AAPT_PREF_CONFIG))
286 | PRODUCT_AAPT_PREBUILT_DPI := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_AAPT_PREBUILT_DPI))
287 |
288 | # Keep a copy of the space-separated config
289 | PRODUCT_AAPT_CONFIG_SP := $(PRODUCT_AAPT_CONFIG)
290 |
291 | # Convert spaces to commas.
292 | PRODUCT_AAPT_CONFIG := \
293 | $(subst $(space),$(comma),$(strip $(PRODUCT_AAPT_CONFIG)))
294 |
295 | PRODUCT_BRAND := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_BRAND))
296 |
297 | PRODUCT_MODEL := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_MODEL))
298 | ifndef PRODUCT_MODEL
299 | PRODUCT_MODEL := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_NAME))
300 | endif
301 |
302 | PRODUCT_MANUFACTURER := \
303 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_MANUFACTURER))
304 | ifndef PRODUCT_MANUFACTURER
305 | PRODUCT_MANUFACTURER := unknown
306 | endif
307 |
308 | ifeq ($(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_CHARACTERISTICS),)
309 | TARGET_AAPT_CHARACTERISTICS := default
310 | else
311 | TARGET_AAPT_CHARACTERISTICS := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_CHARACTERISTICS))
312 | endif
313 |
314 | PRODUCT_DEFAULT_WIFI_CHANNELS := \
315 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEFAULT_WIFI_CHANNELS))
316 |
317 | PRODUCT_DEFAULT_DEV_CERTIFICATE := \
318 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEFAULT_DEV_CERTIFICATE))
319 | ifdef PRODUCT_DEFAULT_DEV_CERTIFICATE
320 | ifneq (1,$(words $(PRODUCT_DEFAULT_DEV_CERTIFICATE)))
321 | $(error PRODUCT_DEFAULT_DEV_CERTIFICATE='$(PRODUCT_DEFAULT_DEV_CERTIFICATE)', \
322 | only 1 certificate is allowed.)
323 | endif
324 | endif
325 |
326 | # A list of words like :[:].
327 | # The file at the source path should be copied to the destination path
328 | # when building this product. is relative to
329 | # $(PRODUCT_OUT), so it should look like, e.g., "system/etc/file.xml".
330 | # The rules for these copy steps are defined in build/make/core/Makefile.
331 | # The optional : is used to indicate the owner of a vendor file.
332 | PRODUCT_COPY_FILES := \
333 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_COPY_FILES))
334 |
335 | # A list of property assignments, like "key = value", with zero or more
336 | # whitespace characters on either side of the '='.
337 | PRODUCT_PROPERTY_OVERRIDES := \
338 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PROPERTY_OVERRIDES))
339 | .KATI_READONLY := PRODUCT_PROPERTY_OVERRIDES
340 |
341 | PRODUCT_SHIPPING_API_LEVEL := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SHIPPING_API_LEVEL))
342 |
343 | # A list of property assignments, like "key = value", with zero or more
344 | # whitespace characters on either side of the '='.
345 | # used for adding properties to default.prop
346 | PRODUCT_DEFAULT_PROPERTY_OVERRIDES := \
347 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEFAULT_PROPERTY_OVERRIDES))
348 | .KATI_READONLY := PRODUCT_DEFAULT_PROPERTY_OVERRIDES
349 |
350 | # A list of property assignments, like "key = value", with zero or more
351 | # whitespace characters on either side of the '='.
352 | # used for adding properties to default.prop of system partition
353 | PRODUCT_SYSTEM_DEFAULT_PROPERTIES := \
354 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SYSTEM_DEFAULT_PROPERTIES))
355 | .KATI_READONLY := PRODUCT_SYSTEM_DEFAULT_PROPERTIES
356 |
357 | # A list of property assignments, like "key = value", with zero or more
358 | # whitespace characters on either side of the '='.
359 | # used for adding properties to build.prop of product partition
360 | PRODUCT_PRODUCT_PROPERTIES := \
361 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PRODUCT_PROPERTIES))
362 | .KATI_READONLY := PRODUCT_PRODUCT_PROPERTIES
363 |
364 | # used for overriding properties in build.prop
365 | PRODUCT_BUILD_PROP_OVERRIDES := \
366 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_BUILD_PROP_OVERRIDES))
367 | .KATI_READONLY := PRODUCT_BUILD_PROP_OVERRIDES
368 |
369 | # Should we use the default resources or add any product specific overlays
370 | PRODUCT_PACKAGE_OVERLAYS := \
371 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGE_OVERLAYS))
372 | DEVICE_PACKAGE_OVERLAYS := \
373 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).DEVICE_PACKAGE_OVERLAYS))
374 |
375 | # The list of product-specific kernel header dirs
376 | PRODUCT_VENDOR_KERNEL_HEADERS := \
377 | $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_VENDOR_KERNEL_HEADERS)
378 |
379 | # The OTA key(s) specified by the product config, if any. The names
380 | # of these keys are stored in the target-files zip so that post-build
381 | # signing tools can substitute them for the test key embedded by
382 | # default.
383 | PRODUCT_OTA_PUBLIC_KEYS := $(sort \
384 | $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_OTA_PUBLIC_KEYS))
385 |
386 | PRODUCT_EXTRA_RECOVERY_KEYS := $(sort \
387 | $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_EXTRA_RECOVERY_KEYS))
388 |
389 | PRODUCT_DEX_PREOPT_DEFAULT_COMPILER_FILTER := \
390 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEX_PREOPT_DEFAULT_COMPILER_FILTER))
391 | PRODUCT_DEX_PREOPT_DEFAULT_FLAGS := \
392 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEX_PREOPT_DEFAULT_FLAGS))
393 | PRODUCT_DEX_PREOPT_GENERATE_DM_FILES := \
394 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEX_PREOPT_GENERATE_DM_FILES))
395 | PRODUCT_DEX_PREOPT_BOOT_FLAGS := \
396 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEX_PREOPT_BOOT_FLAGS))
397 | PRODUCT_DEX_PREOPT_PROFILE_DIR := \
398 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEX_PREOPT_PROFILE_DIR))
399 |
400 | # Boot image options.
401 | PRODUCT_USE_PROFILE_FOR_BOOT_IMAGE := \
402 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_USE_PROFILE_FOR_BOOT_IMAGE))
403 | PRODUCT_DEX_PREOPT_BOOT_IMAGE_PROFILE_LOCATION := \
404 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEX_PREOPT_BOOT_IMAGE_PROFILE_LOCATION))
405 |
406 | PRODUCT_SYSTEM_SERVER_COMPILER_FILTER := \
407 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SYSTEM_SERVER_COMPILER_FILTER))
408 | PRODUCT_SYSTEM_SERVER_DEBUG_INFO := \
409 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SYSTEM_SERVER_DEBUG_INFO))
410 | PRODUCT_OTHER_JAVA_DEBUG_INFO := \
411 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_OTHER_JAVA_DEBUG_INFO))
412 |
413 | # Resolve and setup per-module dex-preopt configs.
414 | PRODUCT_DEX_PREOPT_MODULE_CONFIGS := \
415 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEX_PREOPT_MODULE_CONFIGS))
416 | # If a module has multiple setups, the first takes precedence.
417 | _pdpmc_modules :=
418 | $(foreach c,$(PRODUCT_DEX_PREOPT_MODULE_CONFIGS),\
419 | $(eval m := $(firstword $(subst =,$(space),$(c))))\
420 | $(if $(filter $(_pdpmc_modules),$(m)),,\
421 | $(eval _pdpmc_modules += $(m))\
422 | $(eval cf := $(patsubst $(m)=%,%,$(c)))\
423 | $(eval cf := $(subst $(_PDPMC_SP_PLACE_HOLDER),$(space),$(cf)))\
424 | $(eval DEXPREOPT.$(TARGET_PRODUCT).$(m).CONFIG := $(cf))))
425 | _pdpmc_modules :=
426 |
427 | # Resolve and setup per-module sanitizer configs.
428 | PRODUCT_SANITIZER_MODULE_CONFIGS := \
429 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SANITIZER_MODULE_CONFIGS))
430 | # If a module has multiple setups, the first takes precedence.
431 | _psmc_modules :=
432 | $(foreach c,$(PRODUCT_SANITIZER_MODULE_CONFIGS),\
433 | $(eval m := $(firstword $(subst =,$(space),$(c))))\
434 | $(if $(filter $(_psmc_modules),$(m)),,\
435 | $(eval _psmc_modules += $(m))\
436 | $(eval cf := $(patsubst $(m)=%,%,$(c)))\
437 | $(eval cf := $(subst $(_PSMC_SP_PLACE_HOLDER),$(space),$(cf)))\
438 | $(eval SANITIZER.$(TARGET_PRODUCT).$(m).CONFIG := $(cf))))
439 | _psmc_modules :=
440 |
441 | # Whether the product wants to ship libartd. For rules and meaning, see art/Android.mk.
442 | PRODUCT_ART_TARGET_INCLUDE_DEBUG_BUILD := \
443 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_ART_TARGET_INCLUDE_DEBUG_BUILD))
444 |
445 | # Make this art variable visible to soong_config.mk.
446 | PRODUCT_ART_USE_READ_BARRIER := \
447 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_ART_USE_READ_BARRIER))
448 |
449 | # Whether the product is an Android Things variant.
450 | PRODUCT_IOT := \
451 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_IOT))
452 |
453 | # Resource overlay list which must be excluded from enforcing RRO.
454 | PRODUCT_ENFORCE_RRO_EXCLUDED_OVERLAYS := \
455 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_ENFORCE_RRO_EXCLUDED_OVERLAYS))
456 |
457 | # Package list to apply enforcing RRO.
458 | PRODUCT_ENFORCE_RRO_TARGETS := \
459 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_ENFORCE_RRO_TARGETS))
460 |
461 | # Add reserved headroom to a system image.
462 | PRODUCT_SYSTEM_HEADROOM := \
463 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SYSTEM_HEADROOM))
464 |
465 | # Whether to save disk space by minimizing java debug info
466 | PRODUCT_MINIMIZE_JAVA_DEBUG_INFO := \
467 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_MINIMIZE_JAVA_DEBUG_INFO))
468 |
469 | # Whether any paths are excluded from sanitization when SANITIZE_TARGET=integer_overflow
470 | PRODUCT_INTEGER_OVERFLOW_EXCLUDE_PATHS := \
471 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_INTEGER_OVERFLOW_EXCLUDE_PATHS))
472 |
473 | # ADB keys for debuggable builds
474 | PRODUCT_ADB_KEYS :=
475 | ifneq ($(filter eng userdebug,$(TARGET_BUILD_VARIANT)),)
476 | PRODUCT_ADB_KEYS := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_ADB_KEYS))
477 | endif
478 | ifneq ($(filter-out 0 1,$(words $(PRODUCT_ADB_KEYS))),)
479 | $(error Only one file may be in PRODUCT_ADB_KEYS: $(PRODUCT_ADB_KEYS))
480 | endif
481 | .KATI_READONLY := PRODUCT_ADB_KEYS
482 |
483 | # Whether any paths are excluded from sanitization when SANITIZE_TARGET=cfi
484 | PRODUCT_CFI_EXCLUDE_PATHS := \
485 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_CFI_EXCLUDE_PATHS))
486 |
487 | # Whether any paths should have CFI enabled for components
488 | PRODUCT_CFI_INCLUDE_PATHS := \
489 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_CFI_INCLUDE_PATHS))
490 |
491 | # which Soong namespaces to export to Make
492 | PRODUCT_SOONG_NAMESPACES := \
493 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SOONG_NAMESPACES))
494 |
495 | # A flag to override PRODUCT_COMPATIBLE_PROPERTY
496 | PRODUCT_COMPATIBLE_PROPERTY_OVERRIDE := \
497 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_COMPATIBLE_PROPERTY_OVERRIDE))
498 |
499 | # Whether the whitelist of actionable compatible properties should be disabled or not
500 | PRODUCT_ACTIONABLE_COMPATIBLE_PROPERTY_DISABLE := \
501 | $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_ACTIONABLE_COMPATIBLE_PROPERTY_DISABLE))
502 |
--------------------------------------------------------------------------------
/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "twrp_url": "https://github.com/minimal-manifest-twrp/platform_manifest_twrp_omni",
3 | "twrp_branch": "twrp-9.0",
4 | "git_username": "Pinkdoge",
5 | "git_email": "42758990+Pinkdoge@users.noreply.github.com",
6 | "use_own_dt": true,
7 | "dt_url": "pinkdoge/twrp_device_huawei_kiwi",
8 | "dt_branch": "android-9.0",
9 | "dt_remote": "github",
10 | "dt_path": "device/huawei/kiwi",
11 | "device_code": "kiwi",
12 | "fix_product": true,
13 | "fix_misscom": true,
14 | "fix_busybox": false,
15 | "fix_branch": "android-9.0"
16 | }
17 |
--------------------------------------------------------------------------------
/demo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pinkdoge/actions_build_recovery/7ac39f171066c8865a4677f72690458fd67ec044/demo.jpg
--------------------------------------------------------------------------------
/device.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------