summaryrefslogtreecommitdiff
path: root/brillo_config
diff options
context:
space:
mode:
authorSen Jiang <senj@google.com>2016-11-03 16:24:14 -0700
committerAlex Deymo <deymo@google.com>2017-03-02 22:35:40 -0800
commitb6cfdd3ffbaa48a1006b6ce6e4f129ceffa287b8 (patch)
tree6050a86f5f0029b1b00121985d428ec37718d914 /brillo_config
parent0e82c84abaa3a6368d17545d9f9e494f462c95cd (diff)
downloadextras-b6cfdd3ffbaa48a1006b6ce6e4f129ceffa287b8.tar.gz
Put product_id and product_version to OEM partition.
Also create symlinks for each entry in /etc/os-release.d to its corresponding location in /oem/os-release.d. Test: m installclean && m droid oem_image dist Bug: 32555385 Bug: 33211225 Bug: 35804180 (cherry picked from commit 8de8ac139aa289f22f5326af2805a64c0b6bd410) (cherry picked from commit 4c6f2be8720829eaf8681bcf584f1064e735fa7c)
Diffstat (limited to 'brillo_config')
-rw-r--r--brillo_config/Android.mk18
1 files changed, 11 insertions, 7 deletions
diff --git a/brillo_config/Android.mk b/brillo_config/Android.mk
index 8946e784..b4d8c932 100644
--- a/brillo_config/Android.mk
+++ b/brillo_config/Android.mk
@@ -20,8 +20,8 @@ ifdef OSRELEASED_DIRECTORY
include $(CLEAR_VARS)
LOCAL_MODULE := product_id
-LOCAL_MODULE_CLASS := ETC
-LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/$(OSRELEASED_DIRECTORY)
+LOCAL_MODULE_CLASS := FAKE
+LOCAL_MODULE_PATH := $(TARGET_OUT_OEM)/$(OSRELEASED_DIRECTORY)
include $(BUILD_SYSTEM)/base_rules.mk
# Attempt to populate the product id from a file in the product path.
@@ -31,16 +31,18 @@ LOADED_BRILLO_PRODUCT_ID := $(call cfgtree-get-if-exists,brillo/product_id)
# interaction will not work if this is not set correctly.
$(LOCAL_BUILT_MODULE): BRILLO_PRODUCT_ID ?= "$(LOADED_BRILLO_PRODUCT_ID)"
$(LOCAL_BUILT_MODULE):
- $(hide)mkdir -p $(dir $@)
+ $(hide) mkdir -p $(dir $@)
echo $(BRILLO_PRODUCT_ID) > $@
+ $(hide) mkdir -p $(TARGET_OUT_ETC)/$(OSRELEASED_DIRECTORY)
+ ln -sf /oem/$(OSRELEASED_DIRECTORY)/product_id $(TARGET_OUT_ETC)/$(OSRELEASED_DIRECTORY)
+
include $(CLEAR_VARS)
LOCAL_MODULE := product_version
-LOCAL_MODULE_CLASS := ETC
-LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/$(OSRELEASED_DIRECTORY)
+LOCAL_MODULE_CLASS := FAKE
+LOCAL_MODULE_PATH := $(TARGET_OUT_OEM)/$(OSRELEASED_DIRECTORY)
include $(BUILD_SYSTEM)/base_rules.mk
-
# The version is set to 0.0.0 if the user did not set the actual version and
# a version cannot be loaded from the product cfgtree.
# This allows us to have a valid version number while being easy to filter.
@@ -63,11 +65,13 @@ endif
# If you don' want this to change at every build, you can define BUILD_NUMBER in
# your product makefile and increase it manually.
$(LOCAL_BUILT_MODULE):
- $(hide)mkdir -p $(dir $@)
+ $(hide) mkdir -p $(dir $@)
ifeq ($(shell echo $(BUILD_NUMBER) | grep -E '[^0-9]'),)
echo $(BRILLO_PRODUCT_VERSION).$(BUILD_NUMBER) > $@
else
echo $(BRILLO_PRODUCT_VERSION).$(BUILD_DATETIME) > $@
endif
+ $(hide) mkdir -p $(TARGET_OUT_ETC)/$(OSRELEASED_DIRECTORY)
+ ln -sf /oem/$(OSRELEASED_DIRECTORY)/product_version $(TARGET_OUT_ETC)/$(OSRELEASED_DIRECTORY)
endif