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 |
Ying Wang | 5748ee9 | 2013-07-23 18:03:37 -0700 | [diff] [blame] | 5 | include $(CLEAR_VARS) |
| 6 | |
| 7 | LOCAL_MODULE := init.rc |
| 8 | LOCAL_SRC_FILES := $(LOCAL_MODULE) |
| 9 | LOCAL_MODULE_CLASS := ETC |
| 10 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) |
| 11 | |
| 12 | include $(BUILD_PREBUILT) |
Evgenii Stepanov | 0d2dde5 | 2015-08-07 17:04:37 -0700 | [diff] [blame] | 13 | |
| 14 | ####################################### |
Mark Salyzyn | 7864e36 | 2016-01-28 09:32:53 -0800 | [diff] [blame] | 15 | # init-debug.rc |
| 16 | include $(CLEAR_VARS) |
| 17 | |
| 18 | LOCAL_MODULE := init-debug.rc |
| 19 | LOCAL_SRC_FILES := $(LOCAL_MODULE) |
| 20 | LOCAL_MODULE_CLASS := ETC |
| 21 | LOCAL_MODULE_TAGS := debug |
| 22 | LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/init |
| 23 | |
| 24 | include $(BUILD_PREBUILT) |
| 25 | |
| 26 | ####################################### |
Evgenii Stepanov | 0d2dde5 | 2015-08-07 17:04:37 -0700 | [diff] [blame] | 27 | # asan.options |
Ivan Krasin | 5039d8c | 2015-09-18 11:59:46 -0700 | [diff] [blame] | 28 | ifneq ($(filter address,$(SANITIZE_TARGET)),) |
Evgenii Stepanov | 0d2dde5 | 2015-08-07 17:04:37 -0700 | [diff] [blame] | 29 | include $(CLEAR_VARS) |
| 30 | |
| 31 | LOCAL_MODULE := asan.options |
| 32 | LOCAL_MODULE_CLASS := ETC |
| 33 | LOCAL_SRC_FILES := $(LOCAL_MODULE) |
| 34 | LOCAL_MODULE_PATH := $(TARGET_OUT) |
| 35 | |
| 36 | include $(BUILD_PREBUILT) |
| 37 | endif |
| 38 | |
Ying Wang | 5748ee9 | 2013-07-23 18:03:37 -0700 | [diff] [blame] | 39 | ####################################### |
| 40 | # init.environ.rc |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 41 | |
Ying Wang | 5748ee9 | 2013-07-23 18:03:37 -0700 | [diff] [blame] | 42 | include $(CLEAR_VARS) |
| 43 | LOCAL_MODULE_CLASS := ETC |
| 44 | LOCAL_MODULE := init.environ.rc |
| 45 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) |
Colin Cross | 44b65d0 | 2010-04-20 14:32:50 -0700 | [diff] [blame] | 46 | |
Evgenii Stepanov | 0d2dde5 | 2015-08-07 17:04:37 -0700 | [diff] [blame] | 47 | EXPORT_GLOBAL_ASAN_OPTIONS := |
Ivan Krasin | 5039d8c | 2015-09-18 11:59:46 -0700 | [diff] [blame] | 48 | ifneq ($(filter address,$(SANITIZE_TARGET)),) |
Evgenii Stepanov | 0d2dde5 | 2015-08-07 17:04:37 -0700 | [diff] [blame] | 49 | EXPORT_GLOBAL_ASAN_OPTIONS := export ASAN_OPTIONS include=/system/asan.options |
| 50 | LOCAL_REQUIRED_MODULES := asan.options |
| 51 | endif |
Ying Wang | 5748ee9 | 2013-07-23 18:03:37 -0700 | [diff] [blame] | 52 | # Put it here instead of in init.rc module definition, |
| 53 | # because init.rc is conditionally included. |
| 54 | # |
Daniel Rosenberg | 595003a | 2015-07-28 15:14:39 -0700 | [diff] [blame] | 55 | # create some directories (some are mount points) and symlinks |
Daniel Rosenberg | 52b5915 | 2015-10-28 13:13:37 -0700 | [diff] [blame] | 56 | LOCAL_POST_INSTALL_CMD := mkdir -p $(addprefix $(TARGET_ROOT_OUT)/, \ |
| 57 | sbin dev proc sys system data oem acct cache config storage mnt root $(BOARD_ROOT_EXTRA_FOLDERS)); \ |
Daniel Rosenberg | 595003a | 2015-07-28 15:14:39 -0700 | [diff] [blame] | 58 | ln -sf /system/etc $(TARGET_ROOT_OUT)/etc; \ |
| 59 | ln -sf /sys/kernel/debug $(TARGET_ROOT_OUT)/d; \ |
| 60 | ln -sf /storage/self/primary $(TARGET_ROOT_OUT)/sdcard |
| 61 | ifdef BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE |
Daniel Rosenberg | 52b5915 | 2015-10-28 13:13:37 -0700 | [diff] [blame] | 62 | LOCAL_POST_INSTALL_CMD += ; mkdir -p $(TARGET_ROOT_OUT)/vendor |
Junichi Uekawa | 07b6996 | 2015-11-12 07:49:47 +0900 | [diff] [blame] | 63 | else |
| 64 | LOCAL_POST_INSTALL_CMD += ; ln -sf /system/vendor $(TARGET_ROOT_OUT)/vendor |
Daniel Rosenberg | 595003a | 2015-07-28 15:14:39 -0700 | [diff] [blame] | 65 | endif |
Daniel Rosenberg | 52b5915 | 2015-10-28 13:13:37 -0700 | [diff] [blame] | 66 | ifdef BOARD_ROOT_EXTRA_SYMLINKS |
| 67 | # BOARD_ROOT_EXTRA_SYMLINKS is a list of <target>:<link_name>. |
| 68 | LOCAL_POST_INSTALL_CMD += $(foreach s, $(BOARD_ROOT_EXTRA_SYMLINKS),\ |
| 69 | $(eval p := $(subst :,$(space),$(s)))\ |
| 70 | ; mkdir -p $(dir $(TARGET_ROOT_OUT)/$(word 2,$(p))) \ |
| 71 | ; ln -sf $(word 1,$(p)) $(TARGET_ROOT_OUT)/$(word 2,$(p))) |
| 72 | endif |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 73 | |
Ying Wang | 5748ee9 | 2013-07-23 18:03:37 -0700 | [diff] [blame] | 74 | include $(BUILD_SYSTEM)/base_rules.mk |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 75 | |
Ying Wang | 7011a85 | 2014-06-14 09:11:02 -0700 | [diff] [blame] | 76 | # Regenerate init.environ.rc if PRODUCT_BOOTCLASSPATH has changed. |
Narayan Kamath | 1fabc35 | 2014-08-05 15:42:34 +0100 | [diff] [blame] | 77 | 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] | 78 | bcp_dep := $(intermediates)/$(bcp_md5).bcp.dep |
| 79 | $(bcp_dep) : |
| 80 | $(hide) mkdir -p $(dir $@) && rm -rf $(dir $@)*.bcp.dep && touch $@ |
| 81 | |
| 82 | $(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/init.environ.rc.in $(bcp_dep) |
Ying Wang | 5748ee9 | 2013-07-23 18:03:37 -0700 | [diff] [blame] | 83 | @echo "Generate: $< -> $@" |
| 84 | @mkdir -p $(dir $@) |
| 85 | $(hide) sed -e 's?%BOOTCLASSPATH%?$(PRODUCT_BOOTCLASSPATH)?g' $< >$@ |
Narayan Kamath | 1fabc35 | 2014-08-05 15:42:34 +0100 | [diff] [blame] | 86 | $(hide) sed -i -e 's?%SYSTEMSERVERCLASSPATH%?$(PRODUCT_SYSTEM_SERVER_CLASSPATH)?g' $@ |
Evgenii Stepanov | 1cbe3d9 | 2015-06-12 15:42:20 -0700 | [diff] [blame] | 87 | $(hide) sed -i -e 's?%EXPORT_GLOBAL_ASAN_OPTIONS%?$(EXPORT_GLOBAL_ASAN_OPTIONS)?g' $@ |
Ying Wang | 5748ee9 | 2013-07-23 18:03:37 -0700 | [diff] [blame] | 88 | |
Ying Wang | 7011a85 | 2014-06-14 09:11:02 -0700 | [diff] [blame] | 89 | bcp_md5 := |
| 90 | bcp_dep := |
Ying Wang | 5748ee9 | 2013-07-23 18:03:37 -0700 | [diff] [blame] | 91 | ####################################### |