1 # Copyright (C) 2008 The Android Open Source Project 2 # 3 # Licensed under the Apache License, Version 2.0 (the "License"); 4 # you may not use this file except in compliance with the License. 5 # You may obtain a copy of the License at 6 # 7 # http://www.apache.org/licenses/LICENSE-2.0 8 # 9 # Unless required by applicable law or agreed to in writing, software 10 # distributed under the License is distributed on an "AS IS" BASIS, 11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 # See the License for the specific language governing permissions and 13 # limitations under the License. 14 15 LOCAL_PATH := $(call my-dir) 16 17 # One can override the default android_filesystem_config.h file by using TARGET_FS_CONFIG_GEN. 18 # Set TARGET_FS_CONFIG_GEN to contain a list of intermediate format files 19 # for generating the android_filesystem_config.h file. 20 # 21 # More information can be found in the README 22 23 ifneq ($(wildcard $(TARGET_DEVICE_DIR)/android_filesystem_config.h),) 24 $(error Using $(TARGET_DEVICE_DIR)/android_filesystem_config.h is deprecated, please use TARGET_FS_CONFIG_GEN instead) 25 endif 26 27 system_android_filesystem_config := system/core/include/private/android_filesystem_config.h 28 system_capability_header := bionic/libc/kernel/uapi/linux/capability.h 29 30 # List of supported vendor, oem, odm, product and product_services Partitions 31 fs_config_generate_extra_partition_list := $(strip \ 32 $(if $(BOARD_USES_VENDORIMAGE)$(BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE),vendor) \ 33 $(if $(BOARD_USES_OEMIMAGE)$(BOARD_OEMIMAGE_FILE_SYSTEM_TYPE),oem) \ 34 $(if $(BOARD_USES_ODMIMAGE)$(BOARD_ODMIMAGE_FILE_SYSTEM_TYPE),odm) \ 35 $(if $(BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE),product) \ 36 $(if $(BOARD_PRODUCT_SERVICESIMAGE_FILE_SYSTEM_TYPE),product_services) \ 37 ) 38 39 ################################## 40 # Generate the <p>/etc/fs_config_dirs binary files for each partition. 41 # Add fs_config_dirs to PRODUCT_PACKAGES in the device make file to enable. 42 include $(CLEAR_VARS) 43 44 LOCAL_MODULE := fs_config_dirs 45 LOCAL_REQUIRED_MODULES := \ 46 fs_config_dirs_system \ 47 $(foreach t,$(fs_config_generate_extra_partition_list),$(LOCAL_MODULE)_$(t)) 48 include $(BUILD_PHONY_PACKAGE) 49 50 51 ################################## 52 # Generate the <p>/etc/fs_config_files binary files for each partition. 53 # Add fs_config_files to PRODUCT_PACKAGES in the device make file to enable. 54 include $(CLEAR_VARS) 55 56 LOCAL_MODULE := fs_config_files 57 LOCAL_REQUIRED_MODULES := \ 58 fs_config_files_system \ 59 $(foreach t,$(fs_config_generate_extra_partition_list),$(LOCAL_MODULE)_$(t)) 60 include $(BUILD_PHONY_PACKAGE) 61 62 ################################## 63 # Generate the <p>/etc/fs_config_dirs binary files for all enabled partitions 64 # excluding /system. Add fs_config_dirs_nonsystem to PRODUCT_PACKAGES in the 65 # device make file to enable. 66 include $(CLEAR_VARS) 67 68 LOCAL_MODULE := fs_config_dirs_nonsystem 69 LOCAL_REQUIRED_MODULES := $(foreach t,$(fs_config_generate_extra_partition_list),fs_config_dirs_$(t)) 70 include $(BUILD_PHONY_PACKAGE) 71 72 ################################## 73 # Generate the <p>/etc/fs_config_files binary files for all enabled partitions 74 # excluding /system. Add fs_config_files_nonsystem to PRODUCT_PACKAGES in the 75 # device make file to enable. 76 include $(CLEAR_VARS) 77 78 LOCAL_MODULE := fs_config_files_nonsystem 79 LOCAL_REQUIRED_MODULES := $(foreach t,$(fs_config_generate_extra_partition_list),fs_config_files_$(t)) 80 include $(BUILD_PHONY_PACKAGE) 81 82 ################################## 83 # Generate the system/etc/fs_config_dirs binary file for the target 84 # Add fs_config_dirs or fs_config_dirs_system to PRODUCT_PACKAGES in 85 # the device make file to enable 86 include $(CLEAR_VARS) 87 88 LOCAL_MODULE := fs_config_dirs_system 89 LOCAL_MODULE_CLASS := ETC 90 LOCAL_INSTALLED_MODULE_STEM := fs_config_dirs 91 include $(BUILD_SYSTEM)/base_rules.mk 92 $(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_FS_HDR := $(system_android_filesystem_config) 93 $(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_CAP_HDR := $(system_capability_header) 94 $(LOCAL_BUILT_MODULE): PRIVATE_PARTITION_LIST := $(fs_config_generate_extra_partition_list) 95 $(LOCAL_BUILT_MODULE): PRIVATE_TARGET_FS_CONFIG_GEN := $(TARGET_FS_CONFIG_GEN) 96 $(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/fs_config_generator.py $(TARGET_FS_CONFIG_GEN) $(system_android_filesystem_config) $(system_capability_header) 97 @mkdir -p $(dir $@) 98 $< fsconfig \ 99 --aid-header $(PRIVATE_ANDROID_FS_HDR) \ 100 --capability-header $(PRIVATE_ANDROID_CAP_HDR) \ 101 --partition system \ 102 --all-partitions $(subst $(space),$(comma),$(PRIVATE_PARTITION_LIST)) \ 103 --dirs \ 104 --out_file $@ \ 105 $(or $(PRIVATE_TARGET_FS_CONFIG_GEN),/dev/null) 106 107 ################################## 108 # Generate the system/etc/fs_config_files binary file for the target 109 # Add fs_config_files or fs_config_files_system to PRODUCT_PACKAGES in 110 # the device make file to enable 111 include $(CLEAR_VARS) 112 113 LOCAL_MODULE := fs_config_files_system 114 LOCAL_MODULE_CLASS := ETC 115 LOCAL_INSTALLED_MODULE_STEM := fs_config_files 116 include $(BUILD_SYSTEM)/base_rules.mk 117 $(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_FS_HDR := $(system_android_filesystem_config) 118 $(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_CAP_HDR := $(system_capability_header) 119 $(LOCAL_BUILT_MODULE): PRIVATE_PARTITION_LIST := $(fs_config_generate_extra_partition_list) 120 $(LOCAL_BUILT_MODULE): PRIVATE_TARGET_FS_CONFIG_GEN := $(TARGET_FS_CONFIG_GEN) 121 $(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/fs_config_generator.py $(TARGET_FS_CONFIG_GEN) $(system_android_filesystem_config) $(system_capability_header) 122 @mkdir -p $(dir $@) 123 $< fsconfig \ 124 --aid-header $(PRIVATE_ANDROID_FS_HDR) \ 125 --capability-header $(PRIVATE_ANDROID_CAP_HDR) \ 126 --partition system \ 127 --all-partitions $(subst $(space),$(comma),$(PRIVATE_PARTITION_LIST)) \ 128 --files \ 129 --out_file $@ \ 130 $(or $(PRIVATE_TARGET_FS_CONFIG_GEN),/dev/null) 131 132 ifneq ($(filter vendor,$(fs_config_generate_extra_partition_list)),) 133 ################################## 134 # Generate the vendor/etc/fs_config_dirs binary file for the target 135 # Add fs_config_dirs or fs_config_dirs_vendor to PRODUCT_PACKAGES in 136 # the device make file to enable. 137 include $(CLEAR_VARS) 138 139 LOCAL_MODULE := fs_config_dirs_vendor 140 LOCAL_MODULE_CLASS := ETC 141 LOCAL_INSTALLED_MODULE_STEM := fs_config_dirs 142 LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc 143 include $(BUILD_SYSTEM)/base_rules.mk 144 $(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_FS_HDR := $(system_android_filesystem_config) 145 $(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_CAP_HDR := $(system_capability_header) 146 $(LOCAL_BUILT_MODULE): PRIVATE_TARGET_FS_CONFIG_GEN := $(TARGET_FS_CONFIG_GEN) 147 $(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/fs_config_generator.py $(TARGET_FS_CONFIG_GEN) $(system_android_filesystem_config) $(system_capability_header) 148 @mkdir -p $(dir $@) 149 $< fsconfig \ 150 --aid-header $(PRIVATE_ANDROID_FS_HDR) \ 151 --capability-header $(PRIVATE_ANDROID_CAP_HDR) \ 152 --partition vendor \ 153 --dirs \ 154 --out_file $@ \ 155 $(or $(PRIVATE_TARGET_FS_CONFIG_GEN),/dev/null) 156 157 ################################## 158 # Generate the vendor/etc/fs_config_files binary file for the target 159 # Add fs_config_files or fs_config_files_vendor to PRODUCT_PACKAGES in 160 # the device make file to enable 161 include $(CLEAR_VARS) 162 163 LOCAL_MODULE := fs_config_files_vendor 164 LOCAL_MODULE_CLASS := ETC 165 LOCAL_INSTALLED_MODULE_STEM := fs_config_files 166 LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc 167 include $(BUILD_SYSTEM)/base_rules.mk 168 $(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_FS_HDR := $(system_android_filesystem_config) 169 $(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_CAP_HDR := $(system_capability_header) 170 $(LOCAL_BUILT_MODULE): PRIVATE_TARGET_FS_CONFIG_GEN := $(TARGET_FS_CONFIG_GEN) 171 $(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/fs_config_generator.py $(TARGET_FS_CONFIG_GEN) $(system_android_filesystem_config) $(system_capability_header) 172 @mkdir -p $(dir $@) 173 $< fsconfig \ 174 --aid-header $(PRIVATE_ANDROID_FS_HDR) \ 175 --capability-header $(PRIVATE_ANDROID_CAP_HDR) \ 176 --partition vendor \ 177 --files \ 178 --out_file $@ \ 179 $(or $(PRIVATE_TARGET_FS_CONFIG_GEN),/dev/null) 180 181 endif 182 183 ifneq ($(filter oem,$(fs_config_generate_extra_partition_list)),) 184 ################################## 185 # Generate the oem/etc/fs_config_dirs binary file for the target 186 # Add fs_config_dirs or fs_config_dirs_oem to PRODUCT_PACKAGES in 187 # the device make file to enable 188 include $(CLEAR_VARS) 189 190 LOCAL_MODULE := fs_config_dirs_oem 191 LOCAL_MODULE_CLASS := ETC 192 LOCAL_INSTALLED_MODULE_STEM := fs_config_dirs 193 LOCAL_MODULE_PATH := $(TARGET_OUT_OEM)/etc 194 include $(BUILD_SYSTEM)/base_rules.mk 195 $(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_FS_HDR := $(system_android_filesystem_config) 196 $(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_CAP_HDR := $(system_capability_header) 197 $(LOCAL_BUILT_MODULE): PRIVATE_TARGET_FS_CONFIG_GEN := $(TARGET_FS_CONFIG_GEN) 198 $(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/fs_config_generator.py $(TARGET_FS_CONFIG_GEN) $(system_android_filesystem_config) $(system_capability_header) 199 @mkdir -p $(dir $@) 200 $< fsconfig \ 201 --aid-header $(PRIVATE_ANDROID_FS_HDR) \ 202 --capability-header $(PRIVATE_ANDROID_CAP_HDR) \ 203 --partition oem \ 204 --dirs \ 205 --out_file $@ \ 206 $(or $(PRIVATE_TARGET_FS_CONFIG_GEN),/dev/null) 207 208 ################################## 209 # Generate the oem/etc/fs_config_files binary file for the target 210 # Add fs_config_files or fs_config_files_oem to PRODUCT_PACKAGES in 211 # the device make file to enable 212 include $(CLEAR_VARS) 213 214 LOCAL_MODULE := fs_config_files_oem 215 LOCAL_MODULE_CLASS := ETC 216 LOCAL_INSTALLED_MODULE_STEM := fs_config_files 217 LOCAL_MODULE_PATH := $(TARGET_OUT_OEM)/etc 218 include $(BUILD_SYSTEM)/base_rules.mk 219 $(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_FS_HDR := $(system_android_filesystem_config) 220 $(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_CAP_HDR := $(system_capability_header) 221 $(LOCAL_BUILT_MODULE): PRIVATE_TARGET_FS_CONFIG_GEN := $(TARGET_FS_CONFIG_GEN) 222 $(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/fs_config_generator.py $(TARGET_FS_CONFIG_GEN) $(system_android_filesystem_config) $(system_capability_header) 223 @mkdir -p $(dir $@) 224 $< fsconfig \ 225 --aid-header $(PRIVATE_ANDROID_FS_HDR) \ 226 --capability-header $(PRIVATE_ANDROID_CAP_HDR) \ 227 --partition oem \ 228 --files \ 229 --out_file $@ \ 230 $(or $(PRIVATE_TARGET_FS_CONFIG_GEN),/dev/null) 231 232 endif 233 234 ifneq ($(filter odm,$(fs_config_generate_extra_partition_list)),) 235 ################################## 236 # Generate the odm/etc/fs_config_dirs binary file for the target 237 # Add fs_config_dirs or fs_config_dirs_odm to PRODUCT_PACKAGES in 238 # the device make file to enable 239 include $(CLEAR_VARS) 240 241 LOCAL_MODULE := fs_config_dirs_odm 242 LOCAL_MODULE_CLASS := ETC 243 LOCAL_INSTALLED_MODULE_STEM := fs_config_dirs 244 LOCAL_MODULE_PATH := $(TARGET_OUT_ODM)/etc 245 include $(BUILD_SYSTEM)/base_rules.mk 246 $(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_FS_HDR := $(system_android_filesystem_config) 247 $(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_CAP_HDR := $(system_capability_header) 248 $(LOCAL_BUILT_MODULE): PRIVATE_TARGET_FS_CONFIG_GEN := $(TARGET_FS_CONFIG_GEN) 249 $(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/fs_config_generator.py $(TARGET_FS_CONFIG_GEN) $(system_android_filesystem_config) $(system_capability_header) 250 @mkdir -p $(dir $@) 251 $< fsconfig \ 252 --aid-header $(PRIVATE_ANDROID_FS_HDR) \ 253 --capability-header $(PRIVATE_ANDROID_CAP_HDR) \ 254 --partition odm \ 255 --dirs \ 256 --out_file $@ \ 257 $(or $(PRIVATE_TARGET_FS_CONFIG_GEN),/dev/null) 258 259 ################################## 260 # Generate the odm/etc/fs_config_files binary file for the target 261 # Add fs_config_files of fs_config_files_odm to PRODUCT_PACKAGES in 262 # the device make file to enable 263 include $(CLEAR_VARS) 264 265 LOCAL_MODULE := fs_config_files_odm 266 LOCAL_MODULE_CLASS := ETC 267 LOCAL_INSTALLED_MODULE_STEM := fs_config_files 268 LOCAL_MODULE_PATH := $(TARGET_OUT_ODM)/etc 269 include $(BUILD_SYSTEM)/base_rules.mk 270 $(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_FS_HDR := $(system_android_filesystem_config) 271 $(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_CAP_HDR := $(system_capability_header) 272 $(LOCAL_BUILT_MODULE): PRIVATE_TARGET_FS_CONFIG_GEN := $(TARGET_FS_CONFIG_GEN) 273 $(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/fs_config_generator.py $(TARGET_FS_CONFIG_GEN) $(system_android_filesystem_config) $(system_capability_header) 274 @mkdir -p $(dir $@) 275 $< fsconfig \ 276 --aid-header $(PRIVATE_ANDROID_FS_HDR) \ 277 --capability-header $(PRIVATE_ANDROID_CAP_HDR) \ 278 --partition odm \ 279 --files \ 280 --out_file $@ \ 281 $(or $(PRIVATE_TARGET_FS_CONFIG_GEN),/dev/null) 282 283 endif 284 285 ifneq ($(filter product,$(fs_config_generate_extra_partition_list)),) 286 ################################## 287 # Generate the product/etc/fs_config_dirs binary file for the target 288 # Add fs_config_dirs or fs_config_dirs_product to PRODUCT_PACKAGES in 289 # the device make file to enable 290 include $(CLEAR_VARS) 291 292 LOCAL_MODULE := fs_config_dirs_product 293 LOCAL_MODULE_CLASS := ETC 294 LOCAL_INSTALLED_MODULE_STEM := fs_config_dirs 295 LOCAL_MODULE_PATH := $(TARGET_OUT_PRODUCT)/etc 296 include $(BUILD_SYSTEM)/base_rules.mk 297 $(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_FS_HDR := $(system_android_filesystem_config) 298 $(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_CAP_HDR := $(system_capability_header) 299 $(LOCAL_BUILT_MODULE): PRIVATE_TARGET_FS_CONFIG_GEN := $(TARGET_FS_CONFIG_GEN) 300 $(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/fs_config_generator.py $(TARGET_FS_CONFIG_GEN) $(system_android_filesystem_config) $(system_capability_header) 301 @mkdir -p $(dir $@) 302 $< fsconfig \ 303 --aid-header $(PRIVATE_ANDROID_FS_HDR) \ 304 --capability-header $(PRIVATE_ANDROID_CAP_HDR) \ 305 --partition product \ 306 --dirs \ 307 --out_file $@ \ 308 $(or $(PRIVATE_TARGET_FS_CONFIG_GEN),/dev/null) 309 310 ################################## 311 # Generate the product/etc/fs_config_files binary file for the target 312 # Add fs_config_files of fs_config_files_product to PRODUCT_PACKAGES in 313 # the device make file to enable 314 include $(CLEAR_VARS) 315 316 LOCAL_MODULE := fs_config_files_product 317 LOCAL_MODULE_CLASS := ETC 318 LOCAL_INSTALLED_MODULE_STEM := fs_config_files 319 LOCAL_MODULE_PATH := $(TARGET_OUT_PRODUCT)/etc 320 include $(BUILD_SYSTEM)/base_rules.mk 321 $(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_FS_HDR := $(system_android_filesystem_config) 322 $(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_CAP_HDR := $(system_capability_header) 323 $(LOCAL_BUILT_MODULE): PRIVATE_TARGET_FS_CONFIG_GEN := $(TARGET_FS_CONFIG_GEN) 324 $(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/fs_config_generator.py $(TARGET_FS_CONFIG_GEN) $(system_android_filesystem_config) $(system_capability_header) 325 @mkdir -p $(dir $@) 326 $< fsconfig \ 327 --aid-header $(PRIVATE_ANDROID_FS_HDR) \ 328 --capability-header $(PRIVATE_ANDROID_CAP_HDR) \ 329 --partition product \ 330 --files \ 331 --out_file $@ \ 332 $(or $(PRIVATE_TARGET_FS_CONFIG_GEN),/dev/null) 333 endif 334 335 ifneq ($(filter product_services,$(fs_config_generate_extra_partition_list)),) 336 ################################## 337 # Generate the product_services/etc/fs_config_dirs binary file for the target 338 # Add fs_config_dirs or fs_config_dirs_product_services to PRODUCT_PACKAGES in 339 # the device make file to enable 340 include $(CLEAR_VARS) 341 342 LOCAL_MODULE := fs_config_dirs_product_services 343 LOCAL_MODULE_CLASS := ETC 344 LOCAL_INSTALLED_MODULE_STEM := fs_config_dirs 345 LOCAL_MODULE_PATH := $(TARGET_OUT_PRODUCT_SERVICES)/etc 346 include $(BUILD_SYSTEM)/base_rules.mk 347 $(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_FS_HDR := $(system_android_filesystem_config) 348 $(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_CAP_HDR := $(system_capability_header) 349 $(LOCAL_BUILT_MODULE): PRIVATE_TARGET_FS_CONFIG_GEN := $(TARGET_FS_CONFIG_GEN) 350 $(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/fs_config_generator.py $(TARGET_FS_CONFIG_GEN) $(system_android_filesystem_config) $(system_capability_header) 351 @mkdir -p $(dir $@) 352 $< fsconfig \ 353 --aid-header $(PRIVATE_ANDROID_FS_HDR) \ 354 --capability-header $(PRIVATE_ANDROID_CAP_HDR) \ 355 --partition product_services \ 356 --dirs \ 357 --out_file $@ \ 358 $(or $(PRIVATE_TARGET_FS_CONFIG_GEN),/dev/null) 359 360 ################################## 361 # Generate the product_services/etc/fs_config_files binary file for the target 362 # Add fs_config_files of fs_config_files_product_services to PRODUCT_PACKAGES in 363 # the device make file to enable 364 include $(CLEAR_VARS) 365 366 LOCAL_MODULE := fs_config_files_product_services 367 LOCAL_MODULE_CLASS := ETC 368 LOCAL_INSTALLED_MODULE_STEM := fs_config_files 369 LOCAL_MODULE_PATH := $(TARGET_OUT_PRODUCT_SERVICES)/etc 370 include $(BUILD_SYSTEM)/base_rules.mk 371 $(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_FS_HDR := $(system_android_filesystem_config) 372 $(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_CAP_HDR := $(system_capability_header) 373 $(LOCAL_BUILT_MODULE): PRIVATE_TARGET_FS_CONFIG_GEN := $(TARGET_FS_CONFIG_GEN) 374 $(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/fs_config_generator.py $(TARGET_FS_CONFIG_GEN) $(system_android_filesystem_config) $(system_capability_header) 375 @mkdir -p $(dir $@) 376 $< fsconfig \ 377 --aid-header $(PRIVATE_ANDROID_FS_HDR) \ 378 --capability-header $(PRIVATE_ANDROID_CAP_HDR) \ 379 --partition product_services \ 380 --files \ 381 --out_file $@ \ 382 $(or $(PRIVATE_TARGET_FS_CONFIG_GEN),/dev/null) 383 endif 384 385 system_android_filesystem_config := 386 system_capability_header := 387 fs_config_generate_extra_partition_list := 388