summaryrefslogtreecommitdiff
path: root/brillo_config
diff options
context:
space:
mode:
authorSen Jiang <senj@google.com>2017-02-21 17:16:35 -0800
committerSen Jiang <senj@google.com>2017-03-07 17:38:15 -0800
commit4e37d79fc30d331834a547c1d95d9b99c82c49c7 (patch)
treef3325234a3afa319156f676221a6c00616bd8bc6 /brillo_config
parent8e9eabe7f4c4c114babdb7e2af259bc1fc0eb3c4 (diff)
downloadextras-4e37d79fc30d331834a547c1d95d9b99c82c49c7.tar.gz
Separate system_version and product_version.
system_version will be at /etc/os-release.d/system_version, no symlink. product_version still at oem partition, but now has only one number. Bug: 35364984 Test: m droid dist oem_image custom_images -j Change-Id: If0f357d29c8dd0cec1ff4999a3c42b0362a45c01 (cherry picked from commit 9b173cccb8bdb750d4cf7855e5379ceee5ba030f)
Diffstat (limited to 'brillo_config')
-rw-r--r--brillo_config/Android.mk45
1 files changed, 36 insertions, 9 deletions
diff --git a/brillo_config/Android.mk b/brillo_config/Android.mk
index b4d8c932..7c1dd6c2 100644
--- a/brillo_config/Android.mk
+++ b/brillo_config/Android.mk
@@ -43,20 +43,49 @@ 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
+# The version is set to 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.
ifeq ($(BRILLO_PRODUCT_VERSION),)
# Load from file first
BRILLO_PRODUCT_VERSION := $(call cfgtree-get-if-exists,brillo/product_version)
endif
-# If the version is still empty, override it with 0.0.0
+# If the version is still empty, override it with 0
ifeq ($(BRILLO_PRODUCT_VERSION),)
-BRILLO_PRODUCT_VERSION := "0.0.0"
+BRILLO_PRODUCT_VERSION := "0"
endif
-ifeq ($(shell echo $(BRILLO_PRODUCT_VERSION) | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$$'),)
+ifeq ($(shell echo $(BRILLO_PRODUCT_VERSION) | grep -E '^[0-9]+$$'),)
$(error Invalid BRILLO_PRODUCT_VERSION "$(BRILLO_PRODUCT_VERSION)", must be \
- three numbers separated by dots. Example: "1.2.0")
+ a single number. Example: "1")
+endif
+
+$(LOCAL_BUILT_MODULE):
+ $(hide) mkdir -p $(dir $@)
+ echo $(BRILLO_PRODUCT_VERSION) > $@
+ $(hide) mkdir -p $(TARGET_OUT_ETC)/$(OSRELEASED_DIRECTORY)
+ ln -sf /oem/$(OSRELEASED_DIRECTORY)/product_version $(TARGET_OUT_ETC)/$(OSRELEASED_DIRECTORY)
+
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := system_version
+LOCAL_MODULE_CLASS := ETC
+LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/$(OSRELEASED_DIRECTORY)
+include $(BUILD_SYSTEM)/base_rules.mk
+
+# The version is set to 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.
+ifeq ($(BRILLO_SYSTEM_VERSION),)
+# Load from file first
+BRILLO_SYSTEM_VERSION := $(call cfgtree-get-if-exists,brillo/system_version)
+endif
+# If the version is still empty, override it with 0.0
+ifeq ($(BRILLO_SYSTEM_VERSION),)
+BRILLO_SYSTEM_VERSION := "0.0"
+endif
+ifeq ($(shell echo $(BRILLO_SYSTEM_VERSION) | grep -E '^[0-9]+\.[0-9]+$$'),)
+$(error Invalid BRILLO_SYSTEM_VERSION "$(BRILLO_SYSTEM_VERSION)", must be \
+ two numbers separated by dots. Example: "1.2")
endif
# Append BUILD_NUMBER if it is a number or a build timestamp otherwise.
@@ -67,11 +96,9 @@ endif
$(LOCAL_BUILT_MODULE):
$(hide) mkdir -p $(dir $@)
ifeq ($(shell echo $(BUILD_NUMBER) | grep -E '[^0-9]'),)
- echo $(BRILLO_PRODUCT_VERSION).$(BUILD_NUMBER) > $@
+ echo $(BRILLO_SYSTEM_VERSION).$(BUILD_NUMBER) > $@
else
- echo $(BRILLO_PRODUCT_VERSION).$(BUILD_DATETIME) > $@
+ echo $(BRILLO_SYSTEM_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