summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Drewry <drewry@google.com>2015-11-04 16:29:30 -0800
committerWill Drewry <drewry@google.com>2015-11-04 16:37:11 -0800
commitc692b5001f067c325b0a5d7860a73826e2298e40 (patch)
tree8972d57246b5166a450d2a8d57926208795bc69f
parenta7ea72b23084eb31f1ff73c7f873f40bac93ec6e (diff)
downloadexample-ledflasher-c692b5001f067c325b0a5d7860a73826e2298e40.tar.gz
example-ledflasher: convert to using cfgtree.mk
This change converts ledflasher to using the cfgtree.mk-based product definition changes. It depends on the cfgtree change and changes to both crash_reporter and brillo_config to pull in those two variables where expected. This path may now be copied verbatim for out of tree use. The only missing convenience piece is the envsetup.sh which a call to brunch product envsetup --generate will fix. BUG=25343470 TEST=full in-tree build in progress. an out of tree validating build will follow. Change-Id: Iab912c4684a7e3a70c58431ae50c2a5c4f9bf953
-rw-r--r--config/brand1
-rw-r--r--config/brillo/crash_server2
-rw-r--r--config/brillo/product_id3
-rw-r--r--config/copy_files3
-rw-r--r--config/device1
-rw-r--r--config/manufacturer1
-rw-r--r--config/name1
-rw-r--r--config/packages2
-rw-r--r--ledflasher.mk44
9 files changed, 38 insertions, 20 deletions
diff --git a/config/brand b/config/brand
new file mode 100644
index 0000000..871feda
--- /dev/null
+++ b/config/brand
@@ -0,0 +1 @@
+Brillo
diff --git a/config/brillo/crash_server b/config/brillo/crash_server
new file mode 100644
index 0000000..171d033
--- /dev/null
+++ b/config/brillo/crash_server
@@ -0,0 +1,2 @@
+# Set the crash server URL.
+https://clients2.google.com/bc/report
diff --git a/config/brillo/product_id b/config/brillo/product_id
new file mode 100644
index 0000000..f74933b
--- /dev/null
+++ b/config/brillo/product_id
@@ -0,0 +1,3 @@
+# Set the product_id, which is used by the backends to route
+# metrics/crash reports to the right customer.
+developer-boards:brillo-starter-board-qualcomm
diff --git a/config/copy_files b/config/copy_files
new file mode 100644
index 0000000..7f120f1
--- /dev/null
+++ b/config/copy_files
@@ -0,0 +1,3 @@
+# Format:
+# path-in-product-dir:path-to-install-in-device
+weaved.conf:system/etc/weaved/weaved.conf
diff --git a/config/device b/config/device
new file mode 100644
index 0000000..5db86e2
--- /dev/null
+++ b/config/device
@@ -0,0 +1 @@
+dragonboard
diff --git a/config/manufacturer b/config/manufacturer
new file mode 100644
index 0000000..cb42911
--- /dev/null
+++ b/config/manufacturer
@@ -0,0 +1 @@
+google
diff --git a/config/name b/config/name
new file mode 100644
index 0000000..dd3ed88
--- /dev/null
+++ b/config/name
@@ -0,0 +1 @@
+ledflasher
diff --git a/config/packages b/config/packages
new file mode 100644
index 0000000..b100a3b
--- /dev/null
+++ b/config/packages
@@ -0,0 +1,2 @@
+ledflasher
+ledservice
diff --git a/ledflasher.mk b/ledflasher.mk
index f23c166..a1f8f34 100644
--- a/ledflasher.mk
+++ b/ledflasher.mk
@@ -14,26 +14,30 @@
# limitations under the License.
#
-$(call inherit-product, device/generic/brillo/brillo_base.mk)
-
-PRODUCT_NAME := ledflasher
-PRODUCT_BRAND := Brillo
-
-PRODUCT_DEVICE := dragonboard
-
-PRODUCT_PACKAGES += \
- ledflasher \
- ledservice \
-
-# Install LED Flasher config file for weaved.
-PRODUCT_COPY_FILES += \
- $(LOCAL_PATH)/weaved.conf:system/etc/weaved/weaved.conf
+#
+# Note:
+# This file configures the product. It follows the default format
+# generated by brunch (tools/bdk/brunch). Any changes here should
+# be kept in sync with brunch's templates.
+#
+CFGTREE_ROOT := $(LOCAL_PATH)
+include device/generic/brillo/brillo_base.mk
+
+PRODUCT_NAME := $(call get_product_name_from_file)
+ifneq ($(PRODUCT_NAME),$(call cfgtree-get,name))
+ $(error config/name, <name>.mk, and AndroidProducts.mk must all be updated together.)
+endif
+PRODUCT_BRAND := $(call cfgtree-get,brand)
+PRODUCT_DEVICE := $(call cfgtree-get,device)
+PRODUCT_MANUFACTURER := $(call cfgtree-get,manufacturer)
+PRODUCT_PACKAGES += $(call cfgtree-get-if-exists,packages)
+# Populate PRODUCT_COPY_FILES from disk but avoid requiring the use of
+# $(LOCAL_PATH) by prepending it here.
+PRODUCT_COPY_FILES += $(addprefix $(LOCAL_PATH)/,$(call cfgtree-get-if-exists,copy_files))
+
+# Expect any required sepolicies in the sepolicy path.
BOARD_SEPOLICY_DIRS := $(BOARD_SEPOLICY_DIRS) $(LOCAL_PATH)/sepolicy
-# Set the product_id, which is used by the backends to route
-# metrics/crash reports to the right customer.
-BRILLO_PRODUCT_ID := developer-boards:brillo-starter-board-qualcomm
-
-# Set the crash server URL.
-BRILLO_CRASH_SERVER := https://clients2.google.com/bc/report
+# Add any extra Android product.mk directive in extras.mk
+-include $(LOCAL_PATH)/extras.mk