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)),) |
Andreas Gampe | 8ccc1ad | 2016-06-22 20:05:59 -0700 | [diff] [blame] | 29 | |
Evgenii Stepanov | 0d2dde5 | 2015-08-07 17:04:37 -0700 | [diff] [blame] | 30 | include $(CLEAR_VARS) |
| 31 | |
| 32 | LOCAL_MODULE := asan.options |
| 33 | LOCAL_MODULE_CLASS := ETC |
| 34 | LOCAL_SRC_FILES := $(LOCAL_MODULE) |
| 35 | LOCAL_MODULE_PATH := $(TARGET_OUT) |
| 36 | |
| 37 | include $(BUILD_PREBUILT) |
Andreas Gampe | 8ccc1ad | 2016-06-22 20:05:59 -0700 | [diff] [blame] | 38 | |
| 39 | # Modules for asan.options.X files. |
| 40 | |
| 41 | ASAN_OPTIONS_FILES := |
| 42 | |
| 43 | define create-asan-options-module |
| 44 | include $$(CLEAR_VARS) |
| 45 | LOCAL_MODULE := asan.options.$(1) |
| 46 | ASAN_OPTIONS_FILES += asan.options.$(1) |
| 47 | LOCAL_MODULE_CLASS := ETC |
| 48 | # The asan.options.off.template tries to turn off as much of ASAN as is possible. |
| 49 | LOCAL_SRC_FILES := asan.options.off.template |
| 50 | LOCAL_MODULE_PATH := $(TARGET_OUT) |
| 51 | include $$(BUILD_PREBUILT) |
| 52 | endef |
| 53 | |
| 54 | # Pretty comprehensive set of native services. This list is helpful if all that's to be checked is an |
| 55 | # app. |
| 56 | ifeq ($(SANITIZE_LITE),true) |
| 57 | SANITIZE_ASAN_OPTIONS_FOR := \ |
| 58 | adbd \ |
| 59 | ATFWD-daemon \ |
| 60 | audioserver \ |
| 61 | bridgemgrd \ |
| 62 | cameraserver \ |
| 63 | cnd \ |
| 64 | debuggerd \ |
| 65 | debuggerd64 \ |
| 66 | dex2oat \ |
| 67 | drmserver \ |
| 68 | fingerprintd \ |
| 69 | gatekeeperd \ |
| 70 | installd \ |
| 71 | keystore \ |
| 72 | lmkd \ |
| 73 | logcat \ |
| 74 | logd \ |
| 75 | lowi-server \ |
| 76 | media.codec \ |
| 77 | mediadrmserver \ |
| 78 | media.extractor \ |
| 79 | mediaserver \ |
| 80 | mm-qcamera-daemon \ |
| 81 | mpdecision \ |
| 82 | netmgrd \ |
| 83 | perfd \ |
| 84 | perfprofd \ |
| 85 | qmuxd \ |
| 86 | qseecomd \ |
| 87 | rild \ |
| 88 | sdcard \ |
| 89 | servicemanager \ |
| 90 | slim_daemon \ |
| 91 | surfaceflinger \ |
| 92 | thermal-engine \ |
| 93 | time_daemon \ |
| 94 | update_engine \ |
| 95 | vold \ |
| 96 | wpa_supplicant \ |
| 97 | zip |
| 98 | endif |
| 99 | |
| 100 | ifneq ($(SANITIZE_ASAN_OPTIONS_FOR),) |
| 101 | $(foreach binary, $(SANITIZE_ASAN_OPTIONS_FOR), $(eval $(call create-asan-options-module,$(binary)))) |
| 102 | endif |
| 103 | |
Evgenii Stepanov | 0d2dde5 | 2015-08-07 17:04:37 -0700 | [diff] [blame] | 104 | endif |
| 105 | |
Ying Wang | 5748ee9 | 2013-07-23 18:03:37 -0700 | [diff] [blame] | 106 | ####################################### |
| 107 | # init.environ.rc |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 108 | |
Ying Wang | 5748ee9 | 2013-07-23 18:03:37 -0700 | [diff] [blame] | 109 | include $(CLEAR_VARS) |
| 110 | LOCAL_MODULE_CLASS := ETC |
| 111 | LOCAL_MODULE := init.environ.rc |
| 112 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) |
Colin Cross | 44b65d0 | 2010-04-20 14:32:50 -0700 | [diff] [blame] | 113 | |
Evgenii Stepanov | 0d2dde5 | 2015-08-07 17:04:37 -0700 | [diff] [blame] | 114 | EXPORT_GLOBAL_ASAN_OPTIONS := |
Ivan Krasin | 5039d8c | 2015-09-18 11:59:46 -0700 | [diff] [blame] | 115 | ifneq ($(filter address,$(SANITIZE_TARGET)),) |
Evgenii Stepanov | 0d2dde5 | 2015-08-07 17:04:37 -0700 | [diff] [blame] | 116 | EXPORT_GLOBAL_ASAN_OPTIONS := export ASAN_OPTIONS include=/system/asan.options |
Andreas Gampe | 8ccc1ad | 2016-06-22 20:05:59 -0700 | [diff] [blame] | 117 | LOCAL_REQUIRED_MODULES := asan.options $(ASAN_OPTIONS_FILES) |
Evgenii Stepanov | 0d2dde5 | 2015-08-07 17:04:37 -0700 | [diff] [blame] | 118 | endif |
Ying Wang | 5748ee9 | 2013-07-23 18:03:37 -0700 | [diff] [blame] | 119 | # Put it here instead of in init.rc module definition, |
| 120 | # because init.rc is conditionally included. |
| 121 | # |
Daniel Rosenberg | 595003a | 2015-07-28 15:14:39 -0700 | [diff] [blame] | 122 | # create some directories (some are mount points) and symlinks |
Daniel Rosenberg | 52b5915 | 2015-10-28 13:13:37 -0700 | [diff] [blame] | 123 | LOCAL_POST_INSTALL_CMD := mkdir -p $(addprefix $(TARGET_ROOT_OUT)/, \ |
Patrick Tjin | c6535a3 | 2016-05-13 14:22:14 -0700 | [diff] [blame] | 124 | sbin dev proc sys system data oem acct config storage mnt root $(BOARD_ROOT_EXTRA_FOLDERS)); \ |
Daniel Rosenberg | 595003a | 2015-07-28 15:14:39 -0700 | [diff] [blame] | 125 | ln -sf /system/etc $(TARGET_ROOT_OUT)/etc; \ |
Nick Kralevich | c4084c6 | 2016-11-19 12:09:33 -0800 | [diff] [blame] | 126 | ln -sf /data/user_de/0/com.android.shell/files/bugreports $(TARGET_ROOT_OUT)/bugreports; \ |
Daniel Rosenberg | 595003a | 2015-07-28 15:14:39 -0700 | [diff] [blame] | 127 | ln -sf /sys/kernel/debug $(TARGET_ROOT_OUT)/d; \ |
| 128 | ln -sf /storage/self/primary $(TARGET_ROOT_OUT)/sdcard |
Dan Willemsen | 0790431 | 2016-07-08 18:08:51 -0700 | [diff] [blame] | 129 | ifdef BOARD_USES_VENDORIMAGE |
Daniel Rosenberg | 52b5915 | 2015-10-28 13:13:37 -0700 | [diff] [blame] | 130 | LOCAL_POST_INSTALL_CMD += ; mkdir -p $(TARGET_ROOT_OUT)/vendor |
Junichi Uekawa | 07b6996 | 2015-11-12 07:49:47 +0900 | [diff] [blame] | 131 | else |
| 132 | LOCAL_POST_INSTALL_CMD += ; ln -sf /system/vendor $(TARGET_ROOT_OUT)/vendor |
Daniel Rosenberg | 595003a | 2015-07-28 15:14:39 -0700 | [diff] [blame] | 133 | endif |
Patrick Tjin | c6535a3 | 2016-05-13 14:22:14 -0700 | [diff] [blame] | 134 | ifdef BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE |
| 135 | LOCAL_POST_INSTALL_CMD += ; mkdir -p $(TARGET_ROOT_OUT)/cache |
| 136 | else |
| 137 | LOCAL_POST_INSTALL_CMD += ; ln -sf /data/cache $(TARGET_ROOT_OUT)/cache |
| 138 | endif |
Daniel Rosenberg | 52b5915 | 2015-10-28 13:13:37 -0700 | [diff] [blame] | 139 | ifdef BOARD_ROOT_EXTRA_SYMLINKS |
| 140 | # BOARD_ROOT_EXTRA_SYMLINKS is a list of <target>:<link_name>. |
| 141 | LOCAL_POST_INSTALL_CMD += $(foreach s, $(BOARD_ROOT_EXTRA_SYMLINKS),\ |
| 142 | $(eval p := $(subst :,$(space),$(s)))\ |
| 143 | ; mkdir -p $(dir $(TARGET_ROOT_OUT)/$(word 2,$(p))) \ |
| 144 | ; ln -sf $(word 1,$(p)) $(TARGET_ROOT_OUT)/$(word 2,$(p))) |
| 145 | endif |
Alex Deymo | e120b47 | 2016-02-29 17:23:36 -0800 | [diff] [blame] | 146 | # The A/B updater uses a top-level /postinstall directory to mount the new |
| 147 | # system before reboot. |
| 148 | ifeq ($(AB_OTA_UPDATER),true) |
| 149 | LOCAL_POST_INSTALL_CMD += ; mkdir -p $(TARGET_ROOT_OUT)/postinstall |
| 150 | endif |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 151 | |
Ying Wang | 5748ee9 | 2013-07-23 18:03:37 -0700 | [diff] [blame] | 152 | include $(BUILD_SYSTEM)/base_rules.mk |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 153 | |
Ying Wang | 7011a85 | 2014-06-14 09:11:02 -0700 | [diff] [blame] | 154 | # Regenerate init.environ.rc if PRODUCT_BOOTCLASSPATH has changed. |
Narayan Kamath | 1fabc35 | 2014-08-05 15:42:34 +0100 | [diff] [blame] | 155 | 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] | 156 | bcp_dep := $(intermediates)/$(bcp_md5).bcp.dep |
| 157 | $(bcp_dep) : |
| 158 | $(hide) mkdir -p $(dir $@) && rm -rf $(dir $@)*.bcp.dep && touch $@ |
| 159 | |
| 160 | $(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/init.environ.rc.in $(bcp_dep) |
Ying Wang | 5748ee9 | 2013-07-23 18:03:37 -0700 | [diff] [blame] | 161 | @echo "Generate: $< -> $@" |
| 162 | @mkdir -p $(dir $@) |
| 163 | $(hide) sed -e 's?%BOOTCLASSPATH%?$(PRODUCT_BOOTCLASSPATH)?g' $< >$@ |
Narayan Kamath | 1fabc35 | 2014-08-05 15:42:34 +0100 | [diff] [blame] | 164 | $(hide) sed -i -e 's?%SYSTEMSERVERCLASSPATH%?$(PRODUCT_SYSTEM_SERVER_CLASSPATH)?g' $@ |
Evgenii Stepanov | 1cbe3d9 | 2015-06-12 15:42:20 -0700 | [diff] [blame] | 165 | $(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] | 166 | |
Ying Wang | 7011a85 | 2014-06-14 09:11:02 -0700 | [diff] [blame] | 167 | bcp_md5 := |
| 168 | bcp_dep := |
Ying Wang | 5748ee9 | 2013-07-23 18:03:37 -0700 | [diff] [blame] | 169 | ####################################### |