summaryrefslogtreecommitdiff
path: root/rootdir/Android.mk
diff options
context:
space:
mode:
authorYing Wang <wangying@google.com>2013-07-23 18:03:37 -0700
committerYing Wang <wangying@google.com>2013-07-24 12:11:47 -0700
commit5748ee972de22e3a53bd3ef7d998ed15ea726a69 (patch)
tree7917827ccc17b9069399f7541488213a1eea32fb /rootdir/Android.mk
parent87bc464a9f62f026fd841d3b54cfb1a5d57d83a3 (diff)
Generate init.environ.rc by populating BOOTCLASSPATH
- BOOTCLASSPATH now is derived from PRODUCT_BOOT_JARS, which is a product configuration variable set up by the core build system. - Moved files from the legacy ALL_PREBUILT to PRODUCT_COPY_FILES in build/target/product/embedded.mk. Bug: 9990214 Change-Id: I98bac36c1ca8c779dda572a0a5e0a22b7e4c4a7a
Diffstat (limited to 'rootdir/Android.mk')
-rw-r--r--rootdir/Android.mk75
1 files changed, 29 insertions, 46 deletions
diff --git a/rootdir/Android.mk b/rootdir/Android.mk
index 3417f54f3..2c1608442 100644
--- a/rootdir/Android.mk
+++ b/rootdir/Android.mk
@@ -1,55 +1,38 @@
LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-# files that live under /system/etc/...
-
-copy_from := \
- etc/hosts
-
-
-copy_to := $(addprefix $(TARGET_OUT)/,$(copy_from))
-copy_from := $(addprefix $(LOCAL_PATH)/,$(copy_from))
-
-$(copy_to) : PRIVATE_MODULE := system_etcdir
-$(copy_to) : $(TARGET_OUT)/% : $(LOCAL_PATH)/% | $(ACP)
- $(transform-prebuilt-to-target)
-
-ALL_PREBUILT += $(copy_to)
-
-
-# files that live under /...
+#######################################
+# init.rc
# Only copy init.rc if the target doesn't have its own.
ifneq ($(TARGET_PROVIDES_INIT_RC),true)
-file := $(TARGET_ROOT_OUT)/init.rc
-$(file) : $(LOCAL_PATH)/init.rc | $(ACP)
- $(transform-prebuilt-to-target)
-ALL_PREBUILT += $(file)
-$(INSTALLED_RAMDISK_TARGET): $(file)
-endif
+include $(CLEAR_VARS)
-file := $(TARGET_ROOT_OUT)/ueventd.rc
-$(file) : $(LOCAL_PATH)/ueventd.rc | $(ACP)
- $(transform-prebuilt-to-target)
-ALL_PREBUILT += $(file)
-$(INSTALLED_RAMDISK_TARGET): $(file)
+LOCAL_MODULE := init.rc
+LOCAL_SRC_FILES := $(LOCAL_MODULE)
+LOCAL_MODULE_CLASS := ETC
+LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
-# init.usb.rc is handled by build/target/product/core.rc
+include $(BUILD_PREBUILT)
+endif
+#######################################
+# init.environ.rc
+include $(CLEAR_VARS)
+LOCAL_MODULE_CLASS := ETC
+LOCAL_MODULE := init.environ.rc
+LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
+# Put it here instead of in init.rc module definition,
+# because init.rc is conditionally included.
+#
# create some directories (some are mount points)
-DIRS := $(addprefix $(TARGET_ROOT_OUT)/, \
- sbin \
- dev \
- proc \
- sys \
- system \
- data \
- ) \
- $(TARGET_OUT_DATA)
-
-$(DIRS):
- @echo Directory: $@
- @mkdir -p $@
-
-ALL_PREBUILT += $(DIRS)
+LOCAL_POST_INSTALL_CMD := mkdir -p $(addprefix $(TARGET_ROOT_OUT)/, \
+ sbin dev proc sys system data)
+
+include $(BUILD_SYSTEM)/base_rules.mk
+
+$(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/init.environ.rc.in
+ @echo "Generate: $< -> $@"
+ @mkdir -p $(dir $@)
+ $(hide) sed -e 's?%BOOTCLASSPATH%?$(PRODUCT_BOOTCLASSPATH)?g' $< >$@
+
+#######################################