am 491055df: Merge "Import OEM build properties, if defined."

* commit '491055df99d9d3ebf9006f073a54292ef7724ec5':
  Import OEM build properties, if defined.
This commit is contained in:
Jeff Sharkey 2014-04-09 15:46:26 +00:00 committed by Android Git Automerger
commit 5d7f3c6d60
3 changed files with 23 additions and 3 deletions

View file

@ -167,10 +167,17 @@ system_prop_file := $(TARGET_SYSTEM_PROP)
else
system_prop_file := $(wildcard $(TARGET_DEVICE_DIR)/system.prop)
endif
$(INSTALLED_BUILD_PROP_TARGET): $(BUILDINFO_SH) $(INTERNAL_BUILD_ID_MAKEFILE) $(BUILD_SYSTEM)/version_defaults.mk $(system_prop_file)
@echo Target buildinfo: $@
@mkdir -p $(dir $@)
$(hide) echo > $@
ifneq ($(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_OEM_PROPERTIES),)
$(hide) echo "#" >> $@; \
echo "# PRODUCT_OEM_PROPERTIES" >> $@; \
echo "#" >> $@; )
$(hide) $(foreach prop,$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_OEM_PROPERTIES), \
echo "import /oem/oem.prop $(prop)" >> $@;)
endif
$(hide) TARGET_BUILD_TYPE="$(TARGET_BUILD_VARIANT)" \
TARGET_DEVICE="$(TARGET_DEVICE)" \
PRODUCT_NAME="$(TARGET_PRODUCT)" \
@ -197,7 +204,7 @@ $(INSTALLED_BUILD_PROP_TARGET): $(BUILDINFO_SH) $(INTERNAL_BUILD_ID_MAKEFILE) $(
TARGET_CPU_ABI="$(TARGET_CPU_ABI)" \
TARGET_CPU_ABI2="$(TARGET_CPU_ABI2)" \
TARGET_AAPT_CHARACTERISTICS="$(TARGET_AAPT_CHARACTERISTICS)" \
bash $(BUILDINFO_SH) > $@
bash $(BUILDINFO_SH) >> $@
$(hide) $(foreach file,$(system_prop_file), \
if [ -f "$(file)" ]; then \
echo "#" >> $@; \
@ -213,7 +220,7 @@ $(INSTALLED_BUILD_PROP_TARGET): $(BUILDINFO_SH) $(INTERNAL_BUILD_ID_MAKEFILE) $(
echo "#" >> $@; )
$(hide) $(foreach line,$(ADDITIONAL_BUILD_PROPERTIES), \
echo "$(line)" >> $@;)
$(hide) build/tools/post_process_props.py $@
$(hide) build/tools/post_process_props.py $@ $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SYSTEM_PROPERTY_BLACKLIST)
build_desc :=

View file

@ -101,6 +101,8 @@ _product_var_list := \
PRODUCT_BOOT_JARS \
PRODUCT_DEX_PREOPT_IMAGE_IN_DATA \
PRODUCT_SUPPORTS_VERITY \
PRODUCT_OEM_PROPERTIES \
PRODUCT_SYSTEM_PROPERTY_BLACKLIST \
PRODUCT_VERITY_PARTITION \
PRODUCT_VERITY_SIGNING_KEY

View file

@ -16,6 +16,9 @@
import sys
# Usage: post_process_props.py file.prop [blacklist_key, ...]
# Blacklisted keys are removed from the property file, if present
# See PROP_VALUE_MAX system_properties.h.
# PROP_VALUE_MAX in system_properties.h includes the termination NUL,
# so we decrease it by 1 here.
@ -101,6 +104,10 @@ class PropFile:
return
self.lines.append(key + value)
def delete(self, name):
key = name + "="
self.lines = [ line for line in self.lines if not line.startswith(key) ]
def write(self, f):
f.write("\n".join(self.lines))
f.write("\n")
@ -124,6 +131,10 @@ def main(argv):
if not validate(properties):
sys.exit(1)
# Drop any blacklisted keys
for key in argv[2:]:
properties.delete(key)
f = open(filename, 'w+')
properties.write(f)
f.close()