# BUILD_OVERRIDES on Pure AOSP builds



## doug piston (Jun 10, 2011)

I quickly grew tired of having to open up my zip and manually edit my build.prop to support the correct build.fingerprint and other edits to get market apps and wallet to work correctly. I searched and searched and noticed everyone was using BUILD_OVERRIDES

```
<br />
# Overrides<br />
PRODUCT_BUILD_PROP_OVERRIDES += \<br />
  PRODUCT_NAME=mysid \<br />
  BUILD_ID=ICL53F \<br />
  BUILD_DISPLAY_ID=IML74K \<br />
	  BUILD_FINGERPRINT="google/mysid/toro:4.0.2/ICL53F/235179:user/release-keys" \<br />
	  PRIVATE_BUILD_DESC="mysid-user 4.0.2 ICL53F 235179 release-keys"<br />
```
So I added the same thing to my full_toro.mk just to have it not accept my override. After many "face meet desk" moments I stumbled upon the answer. I needed to tell the build tools to look for and use BUILD_OVERRIDES.

You'll need to modify 3 .mk files and in total add about 5-7 lines of code. If you use gedit make sure you use line numbers and if you're like me and use nano use the "-c" switch. Example nano -c file.mk. Line numbers will make this easier

First we will need to cd to /build/core

```
<br />
[email protected]:~/android/build/core$<br />
```
You are going to want to edit product.mk, product_config.mk, and Makefile. You'll only be adding lines so here we go. First off product.mk

Use your text editor and open it up scroll to where you see "_product_var_list := \" and add "PRODUCT_BUILD_PROP_OVERRIDES \" under it

```
<br />
_product_var_list := \<br />
	PRODUCT_BUILD_PROP_OVERRIDES \<br />
	PRODUCT_NAME \<br />
```
Save and exit. Next product_config.mk. This one the line numbers are helpful. Scroll to line 300 and you'll see


```
<br />
# Should we use the default resources or add any product specific overlays<br />
PRODUCT_PACKAGE_OVERLAYS := \<br />
	$(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGE_OVERLAYS))<br />
```
Add this just below it


```
<br />
PRODUCT_BUILD_PROP_OVERRIDES := \<br />
		$(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_BUILD_PROP_OVERRIDES))<br />
```
Save and exit. Finally the Makefile. Line 171 right below it add


```
<br />
$(PRODUCT_BUILD_PROP_OVERRIDES) \<br />
```
Should look like this when done


```
<br />
TARGET_CPU_ABI="$(TARGET_CPU_ABI)" \<br />
						TARGET_CPU_ABI2="$(TARGET_CPU_ABI2)" \<br />
						TARGET_AAPT_CHARACTERISTICS="$(TARGET_AAPT_CHARACTERISTICS)" \<br />
						$(PRODUCT_BUILD_PROP_OVERRIDES) \<br />
				bash $(BUILDINFO_SH) > [email protected]<br />
```
After this BUILD_OVERRIDES should work for you.

Thanks to CM and birdman for their GIT's where I found these edits. I know it looks complicated but look and the mentioned files and you'll see it isn't as scary as it looks.


----------



## nocoast (Oct 17, 2011)

thank you very much I'm going to be dealing with this in the next day


----------



## nocoast (Oct 17, 2011)

and by the way this works amazing!


----------



## jaronow (Jan 15, 2012)

mad thanks for the edits to make this work


----------

