blob: 3ecb1db829ae15e02a0219b43f81dbcc71e83ea7 [file] [log] [blame]
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -08001LOCAL_PATH:= $(call my-dir)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -08002
Ying Wang5748ee92013-07-23 18:03:37 -07003#######################################
4# init.rc
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -08005# Only copy init.rc if the target doesn't have its own.
6ifneq ($(TARGET_PROVIDES_INIT_RC),true)
Ying Wang5748ee92013-07-23 18:03:37 -07007include $(CLEAR_VARS)
8
9LOCAL_MODULE := init.rc
10LOCAL_SRC_FILES := $(LOCAL_MODULE)
11LOCAL_MODULE_CLASS := ETC
12LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
13
14include $(BUILD_PREBUILT)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080015endif
Ying Wang5748ee92013-07-23 18:03:37 -070016#######################################
17# init.environ.rc
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080018
Ying Wang5748ee92013-07-23 18:03:37 -070019include $(CLEAR_VARS)
20LOCAL_MODULE_CLASS := ETC
21LOCAL_MODULE := init.environ.rc
22LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
Colin Cross44b65d02010-04-20 14:32:50 -070023
Ying Wang5748ee92013-07-23 18:03:37 -070024# Put it here instead of in init.rc module definition,
25# because init.rc is conditionally included.
26#
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080027# create some directories (some are mount points)
Ying Wang5748ee92013-07-23 18:03:37 -070028LOCAL_POST_INSTALL_CMD := mkdir -p $(addprefix $(TARGET_ROOT_OUT)/, \
29 sbin dev proc sys system data)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080030
Ying Wang5748ee92013-07-23 18:03:37 -070031include $(BUILD_SYSTEM)/base_rules.mk
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080032
Ying Wang7011a852014-06-14 09:11:02 -070033# Regenerate init.environ.rc if PRODUCT_BOOTCLASSPATH has changed.
Narayan Kamath1fabc352014-08-05 15:42:34 +010034bcp_md5 := $(word 1, $(shell echo $(PRODUCT_BOOTCLASSPATH) $(PRODUCT_SYSTEM_SERVER_CLASSPATH) | $(MD5SUM)))
Ying Wang7011a852014-06-14 09:11:02 -070035bcp_dep := $(intermediates)/$(bcp_md5).bcp.dep
36$(bcp_dep) :
37 $(hide) mkdir -p $(dir $@) && rm -rf $(dir $@)*.bcp.dep && touch $@
38
39$(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/init.environ.rc.in $(bcp_dep)
Ying Wang5748ee92013-07-23 18:03:37 -070040 @echo "Generate: $< -> $@"
41 @mkdir -p $(dir $@)
42 $(hide) sed -e 's?%BOOTCLASSPATH%?$(PRODUCT_BOOTCLASSPATH)?g' $< >$@
Narayan Kamath1fabc352014-08-05 15:42:34 +010043 $(hide) sed -i -e 's?%SYSTEMSERVERCLASSPATH%?$(PRODUCT_SYSTEM_SERVER_CLASSPATH)?g' $@
Ying Wang5748ee92013-07-23 18:03:37 -070044
Ying Wang7011a852014-06-14 09:11:02 -070045bcp_md5 :=
46bcp_dep :=
Ying Wang5748ee92013-07-23 18:03:37 -070047#######################################