The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 1 | LOCAL_PATH:= $(call my-dir) |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 2 | |
Ying Wang | 5748ee9 | 2013-07-23 18:03:37 -0700 | [diff] [blame] | 3 | ####################################### |
| 4 | # init.rc |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 5 | # Only copy init.rc if the target doesn't have its own. |
| 6 | ifneq ($(TARGET_PROVIDES_INIT_RC),true) |
Ying Wang | 5748ee9 | 2013-07-23 18:03:37 -0700 | [diff] [blame] | 7 | include $(CLEAR_VARS) |
| 8 | |
| 9 | LOCAL_MODULE := init.rc |
| 10 | LOCAL_SRC_FILES := $(LOCAL_MODULE) |
| 11 | LOCAL_MODULE_CLASS := ETC |
| 12 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) |
| 13 | |
| 14 | include $(BUILD_PREBUILT) |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 15 | endif |
Ying Wang | 5748ee9 | 2013-07-23 18:03:37 -0700 | [diff] [blame] | 16 | ####################################### |
| 17 | # init.environ.rc |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 18 | |
Ying Wang | 5748ee9 | 2013-07-23 18:03:37 -0700 | [diff] [blame] | 19 | include $(CLEAR_VARS) |
| 20 | LOCAL_MODULE_CLASS := ETC |
| 21 | LOCAL_MODULE := init.environ.rc |
| 22 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) |
Colin Cross | 44b65d0 | 2010-04-20 14:32:50 -0700 | [diff] [blame] | 23 | |
Ying Wang | 5748ee9 | 2013-07-23 18:03:37 -0700 | [diff] [blame] | 24 | # Put it here instead of in init.rc module definition, |
| 25 | # because init.rc is conditionally included. |
| 26 | # |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 27 | # create some directories (some are mount points) |
Ying Wang | 5748ee9 | 2013-07-23 18:03:37 -0700 | [diff] [blame] | 28 | LOCAL_POST_INSTALL_CMD := mkdir -p $(addprefix $(TARGET_ROOT_OUT)/, \ |
| 29 | sbin dev proc sys system data) |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 30 | |
Ying Wang | 5748ee9 | 2013-07-23 18:03:37 -0700 | [diff] [blame] | 31 | include $(BUILD_SYSTEM)/base_rules.mk |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 32 | |
Ying Wang | 7011a85 | 2014-06-14 09:11:02 -0700 | [diff] [blame] | 33 | # Regenerate init.environ.rc if PRODUCT_BOOTCLASSPATH has changed. |
Narayan Kamath | 1fabc35 | 2014-08-05 15:42:34 +0100 | [diff] [blame] | 34 | bcp_md5 := $(word 1, $(shell echo $(PRODUCT_BOOTCLASSPATH) $(PRODUCT_SYSTEM_SERVER_CLASSPATH) | $(MD5SUM))) |
Ying Wang | 7011a85 | 2014-06-14 09:11:02 -0700 | [diff] [blame] | 35 | bcp_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 Wang | 5748ee9 | 2013-07-23 18:03:37 -0700 | [diff] [blame] | 40 | @echo "Generate: $< -> $@" |
| 41 | @mkdir -p $(dir $@) |
| 42 | $(hide) sed -e 's?%BOOTCLASSPATH%?$(PRODUCT_BOOTCLASSPATH)?g' $< >$@ |
Narayan Kamath | 1fabc35 | 2014-08-05 15:42:34 +0100 | [diff] [blame] | 43 | $(hide) sed -i -e 's?%SYSTEMSERVERCLASSPATH%?$(PRODUCT_SYSTEM_SERVER_CLASSPATH)?g' $@ |
Ying Wang | 5748ee9 | 2013-07-23 18:03:37 -0700 | [diff] [blame] | 44 | |
Ying Wang | 7011a85 | 2014-06-14 09:11:02 -0700 | [diff] [blame] | 45 | bcp_md5 := |
| 46 | bcp_dep := |
Ying Wang | 5748ee9 | 2013-07-23 18:03:37 -0700 | [diff] [blame] | 47 | ####################################### |