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 15LOCAL_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 23ifneq ($(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) 25endif 26 27system_android_filesystem_config := system/core/include/private/android_filesystem_config.h 28system_capability_header := bionic/libc/kernel/uapi/linux/capability.h 29 30# List of supported vendor, oem, odm, product and product_services Partitions 31fs_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. 42include $(CLEAR_VARS) 43 44LOCAL_MODULE := fs_config_dirs 45LOCAL_REQUIRED_MODULES := \ 46 fs_config_dirs_system \ 47 $(foreach t,$(fs_config_generate_extra_partition_list),$(LOCAL_MODULE)_$(t)) 48include $(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. 54include $(CLEAR_VARS) 55 56LOCAL_MODULE := fs_config_files 57LOCAL_REQUIRED_MODULES := \ 58 fs_config_files_system \ 59 $(foreach t,$(fs_config_generate_extra_partition_list),$(LOCAL_MODULE)_$(t)) 60include $(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. 66include $(CLEAR_VARS) 67 68LOCAL_MODULE := fs_config_dirs_nonsystem 69LOCAL_REQUIRED_MODULES := $(foreach t,$(fs_config_generate_extra_partition_list),fs_config_dirs_$(t)) 70include $(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. 76include $(CLEAR_VARS) 77 78LOCAL_MODULE := fs_config_files_nonsystem 79LOCAL_REQUIRED_MODULES := $(foreach t,$(fs_config_generate_extra_partition_list),fs_config_files_$(t)) 80include $(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 86include $(CLEAR_VARS) 87 88LOCAL_MODULE := fs_config_dirs_system 89LOCAL_MODULE_CLASS := ETC 90LOCAL_INSTALLED_MODULE_STEM := fs_config_dirs 91include $(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 111include $(CLEAR_VARS) 112 113LOCAL_MODULE := fs_config_files_system 114LOCAL_MODULE_CLASS := ETC 115LOCAL_INSTALLED_MODULE_STEM := fs_config_files 116include $(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 132ifneq ($(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. 137include $(CLEAR_VARS) 138 139LOCAL_MODULE := fs_config_dirs_vendor 140LOCAL_MODULE_CLASS := ETC 141LOCAL_INSTALLED_MODULE_STEM := fs_config_dirs 142LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc 143include $(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 161include $(CLEAR_VARS) 162 163LOCAL_MODULE := fs_config_files_vendor 164LOCAL_MODULE_CLASS := ETC 165LOCAL_INSTALLED_MODULE_STEM := fs_config_files 166LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc 167include $(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 181endif 182 183ifneq ($(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 188include $(CLEAR_VARS) 189 190LOCAL_MODULE := fs_config_dirs_oem 191LOCAL_MODULE_CLASS := ETC 192LOCAL_INSTALLED_MODULE_STEM := fs_config_dirs 193LOCAL_MODULE_PATH := $(TARGET_OUT_OEM)/etc 194include $(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 212include $(CLEAR_VARS) 213 214LOCAL_MODULE := fs_config_files_oem 215LOCAL_MODULE_CLASS := ETC 216LOCAL_INSTALLED_MODULE_STEM := fs_config_files 217LOCAL_MODULE_PATH := $(TARGET_OUT_OEM)/etc 218include $(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 232endif 233 234ifneq ($(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 239include $(CLEAR_VARS) 240 241LOCAL_MODULE := fs_config_dirs_odm 242LOCAL_MODULE_CLASS := ETC 243LOCAL_INSTALLED_MODULE_STEM := fs_config_dirs 244LOCAL_MODULE_PATH := $(TARGET_OUT_ODM)/etc 245include $(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 263include $(CLEAR_VARS) 264 265LOCAL_MODULE := fs_config_files_odm 266LOCAL_MODULE_CLASS := ETC 267LOCAL_INSTALLED_MODULE_STEM := fs_config_files 268LOCAL_MODULE_PATH := $(TARGET_OUT_ODM)/etc 269include $(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 283endif 284 285ifneq ($(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 290include $(CLEAR_VARS) 291 292LOCAL_MODULE := fs_config_dirs_product 293LOCAL_MODULE_CLASS := ETC 294LOCAL_INSTALLED_MODULE_STEM := fs_config_dirs 295LOCAL_MODULE_PATH := $(TARGET_OUT_PRODUCT)/etc 296include $(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 314include $(CLEAR_VARS) 315 316LOCAL_MODULE := fs_config_files_product 317LOCAL_MODULE_CLASS := ETC 318LOCAL_INSTALLED_MODULE_STEM := fs_config_files 319LOCAL_MODULE_PATH := $(TARGET_OUT_PRODUCT)/etc 320include $(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) 333endif 334 335ifneq ($(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 340include $(CLEAR_VARS) 341 342LOCAL_MODULE := fs_config_dirs_product_services 343LOCAL_MODULE_CLASS := ETC 344LOCAL_INSTALLED_MODULE_STEM := fs_config_dirs 345LOCAL_MODULE_PATH := $(TARGET_OUT_PRODUCT_SERVICES)/etc 346include $(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 364include $(CLEAR_VARS) 365 366LOCAL_MODULE := fs_config_files_product_services 367LOCAL_MODULE_CLASS := ETC 368LOCAL_INSTALLED_MODULE_STEM := fs_config_files 369LOCAL_MODULE_PATH := $(TARGET_OUT_PRODUCT_SERVICES)/etc 370include $(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) 383endif 384 385system_android_filesystem_config := 386system_capability_header := 387fs_config_generate_extra_partition_list := 388