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, vendor_dlkm, odm_dlkm, product and system_ext 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_USES_VENDOR_DLKMIMAGE)$(BOARD_VENDOR_DLKMIMAGE_FILE_SYSTEM_TYPE),vendor_dlkm) \
36  $(if $(BOARD_USES_ODM_DLKMIMAGE)$(BOARD_ODM_DLKMIMAGE_FILE_SYSTEM_TYPE),odm_dlkm) \
37  $(if $(BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE),product) \
38  $(if $(BOARD_SYSTEM_EXTIMAGE_FILE_SYSTEM_TYPE),system_ext) \
39)
40
41##################################
42# Generate the <p>/etc/fs_config_dirs binary files for each partition.
43# Add fs_config_dirs to PRODUCT_PACKAGES in the device make file to enable.
44include $(CLEAR_VARS)
45
46LOCAL_MODULE := fs_config_dirs
47LOCAL_REQUIRED_MODULES := \
48	fs_config_dirs_system \
49	$(foreach t,$(fs_config_generate_extra_partition_list),$(LOCAL_MODULE)_$(t))
50include $(BUILD_PHONY_PACKAGE)
51
52
53##################################
54# Generate the <p>/etc/fs_config_files binary files for each partition.
55# Add fs_config_files to PRODUCT_PACKAGES in the device make file to enable.
56include $(CLEAR_VARS)
57
58LOCAL_MODULE := fs_config_files
59LOCAL_REQUIRED_MODULES := \
60  fs_config_files_system \
61  $(foreach t,$(fs_config_generate_extra_partition_list),$(LOCAL_MODULE)_$(t))
62include $(BUILD_PHONY_PACKAGE)
63
64##################################
65# Generate the <p>/etc/fs_config_dirs binary files for all enabled partitions
66# excluding /system. Add fs_config_dirs_nonsystem to PRODUCT_PACKAGES in the
67# device make file to enable.
68include $(CLEAR_VARS)
69
70LOCAL_MODULE := fs_config_dirs_nonsystem
71LOCAL_REQUIRED_MODULES := $(foreach t,$(fs_config_generate_extra_partition_list),fs_config_dirs_$(t))
72include $(BUILD_PHONY_PACKAGE)
73
74##################################
75# Generate the <p>/etc/fs_config_files binary files for all enabled partitions
76# excluding /system. Add fs_config_files_nonsystem to PRODUCT_PACKAGES in the
77# device make file to enable.
78include $(CLEAR_VARS)
79
80LOCAL_MODULE := fs_config_files_nonsystem
81LOCAL_REQUIRED_MODULES := $(foreach t,$(fs_config_generate_extra_partition_list),fs_config_files_$(t))
82include $(BUILD_PHONY_PACKAGE)
83
84##################################
85# Generate the system/etc/fs_config_dirs binary file for the target
86# Add fs_config_dirs or fs_config_dirs_system to PRODUCT_PACKAGES in
87# the device make file to enable
88include $(CLEAR_VARS)
89
90LOCAL_MODULE := fs_config_dirs_system
91LOCAL_MODULE_CLASS := ETC
92LOCAL_INSTALLED_MODULE_STEM := fs_config_dirs
93include $(BUILD_SYSTEM)/base_rules.mk
94$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_FS_HDR := $(system_android_filesystem_config)
95$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_CAP_HDR := $(system_capability_header)
96$(LOCAL_BUILT_MODULE): PRIVATE_PARTITION_LIST := $(fs_config_generate_extra_partition_list)
97$(LOCAL_BUILT_MODULE): PRIVATE_TARGET_FS_CONFIG_GEN := $(TARGET_FS_CONFIG_GEN)
98$(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/fs_config_generator.py $(TARGET_FS_CONFIG_GEN) $(system_android_filesystem_config) $(system_capability_header)
99	@mkdir -p $(dir $@)
100	$< fsconfig \
101	   --aid-header $(PRIVATE_ANDROID_FS_HDR) \
102	   --capability-header $(PRIVATE_ANDROID_CAP_HDR) \
103	   --partition system \
104	   --all-partitions "$(subst $(space),$(comma),$(PRIVATE_PARTITION_LIST))" \
105	   --dirs \
106	   --out_file $@ \
107	   $(or $(PRIVATE_TARGET_FS_CONFIG_GEN),/dev/null)
108
109##################################
110# Generate the system/etc/fs_config_files binary file for the target
111# Add fs_config_files or fs_config_files_system to PRODUCT_PACKAGES in
112# the device make file to enable
113include $(CLEAR_VARS)
114
115LOCAL_MODULE := fs_config_files_system
116LOCAL_MODULE_CLASS := ETC
117LOCAL_INSTALLED_MODULE_STEM := fs_config_files
118include $(BUILD_SYSTEM)/base_rules.mk
119$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_FS_HDR := $(system_android_filesystem_config)
120$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_CAP_HDR := $(system_capability_header)
121$(LOCAL_BUILT_MODULE): PRIVATE_PARTITION_LIST := $(fs_config_generate_extra_partition_list)
122$(LOCAL_BUILT_MODULE): PRIVATE_TARGET_FS_CONFIG_GEN := $(TARGET_FS_CONFIG_GEN)
123$(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/fs_config_generator.py $(TARGET_FS_CONFIG_GEN) $(system_android_filesystem_config) $(system_capability_header)
124	@mkdir -p $(dir $@)
125	$< fsconfig \
126	   --aid-header $(PRIVATE_ANDROID_FS_HDR) \
127	   --capability-header $(PRIVATE_ANDROID_CAP_HDR) \
128	   --partition system \
129	   --all-partitions "$(subst $(space),$(comma),$(PRIVATE_PARTITION_LIST))" \
130	   --files \
131	   --out_file $@ \
132	   $(or $(PRIVATE_TARGET_FS_CONFIG_GEN),/dev/null)
133
134ifneq ($(filter vendor,$(fs_config_generate_extra_partition_list)),)
135##################################
136# Generate the vendor/etc/fs_config_dirs binary file for the target
137# Add fs_config_dirs or fs_config_dirs_vendor to PRODUCT_PACKAGES in
138# the device make file to enable.
139include $(CLEAR_VARS)
140
141LOCAL_MODULE := fs_config_dirs_vendor
142LOCAL_MODULE_CLASS := ETC
143LOCAL_INSTALLED_MODULE_STEM := fs_config_dirs
144LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc
145include $(BUILD_SYSTEM)/base_rules.mk
146$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_FS_HDR := $(system_android_filesystem_config)
147$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_CAP_HDR := $(system_capability_header)
148$(LOCAL_BUILT_MODULE): PRIVATE_TARGET_FS_CONFIG_GEN := $(TARGET_FS_CONFIG_GEN)
149$(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/fs_config_generator.py $(TARGET_FS_CONFIG_GEN) $(system_android_filesystem_config) $(system_capability_header)
150	@mkdir -p $(dir $@)
151	$< fsconfig \
152	   --aid-header $(PRIVATE_ANDROID_FS_HDR) \
153	   --capability-header $(PRIVATE_ANDROID_CAP_HDR) \
154	   --partition vendor \
155	   --dirs \
156	   --out_file $@ \
157	   $(or $(PRIVATE_TARGET_FS_CONFIG_GEN),/dev/null)
158
159##################################
160# Generate the vendor/etc/fs_config_files binary file for the target
161# Add fs_config_files or fs_config_files_vendor to PRODUCT_PACKAGES in
162# the device make file to enable
163include $(CLEAR_VARS)
164
165LOCAL_MODULE := fs_config_files_vendor
166LOCAL_MODULE_CLASS := ETC
167LOCAL_INSTALLED_MODULE_STEM := fs_config_files
168LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc
169include $(BUILD_SYSTEM)/base_rules.mk
170$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_FS_HDR := $(system_android_filesystem_config)
171$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_CAP_HDR := $(system_capability_header)
172$(LOCAL_BUILT_MODULE): PRIVATE_TARGET_FS_CONFIG_GEN := $(TARGET_FS_CONFIG_GEN)
173$(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/fs_config_generator.py $(TARGET_FS_CONFIG_GEN) $(system_android_filesystem_config) $(system_capability_header)
174	@mkdir -p $(dir $@)
175	$< fsconfig \
176	   --aid-header $(PRIVATE_ANDROID_FS_HDR) \
177	   --capability-header $(PRIVATE_ANDROID_CAP_HDR) \
178	   --partition vendor \
179	   --files \
180	   --out_file $@ \
181	   $(or $(PRIVATE_TARGET_FS_CONFIG_GEN),/dev/null)
182
183endif
184
185ifneq ($(filter oem,$(fs_config_generate_extra_partition_list)),)
186##################################
187# Generate the oem/etc/fs_config_dirs binary file for the target
188# Add fs_config_dirs or fs_config_dirs_oem to PRODUCT_PACKAGES in
189# the device make file to enable
190include $(CLEAR_VARS)
191
192LOCAL_MODULE := fs_config_dirs_oem
193LOCAL_MODULE_CLASS := ETC
194LOCAL_INSTALLED_MODULE_STEM := fs_config_dirs
195LOCAL_MODULE_PATH := $(TARGET_OUT_OEM)/etc
196include $(BUILD_SYSTEM)/base_rules.mk
197$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_FS_HDR := $(system_android_filesystem_config)
198$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_CAP_HDR := $(system_capability_header)
199$(LOCAL_BUILT_MODULE): PRIVATE_TARGET_FS_CONFIG_GEN := $(TARGET_FS_CONFIG_GEN)
200$(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/fs_config_generator.py $(TARGET_FS_CONFIG_GEN) $(system_android_filesystem_config) $(system_capability_header)
201	@mkdir -p $(dir $@)
202	$< fsconfig \
203	   --aid-header $(PRIVATE_ANDROID_FS_HDR) \
204	   --capability-header $(PRIVATE_ANDROID_CAP_HDR) \
205	   --partition oem \
206	   --dirs \
207	   --out_file $@ \
208	   $(or $(PRIVATE_TARGET_FS_CONFIG_GEN),/dev/null)
209
210##################################
211# Generate the oem/etc/fs_config_files binary file for the target
212# Add fs_config_files or fs_config_files_oem to PRODUCT_PACKAGES in
213# the device make file to enable
214include $(CLEAR_VARS)
215
216LOCAL_MODULE := fs_config_files_oem
217LOCAL_MODULE_CLASS := ETC
218LOCAL_INSTALLED_MODULE_STEM := fs_config_files
219LOCAL_MODULE_PATH := $(TARGET_OUT_OEM)/etc
220include $(BUILD_SYSTEM)/base_rules.mk
221$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_FS_HDR := $(system_android_filesystem_config)
222$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_CAP_HDR := $(system_capability_header)
223$(LOCAL_BUILT_MODULE): PRIVATE_TARGET_FS_CONFIG_GEN := $(TARGET_FS_CONFIG_GEN)
224$(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/fs_config_generator.py $(TARGET_FS_CONFIG_GEN) $(system_android_filesystem_config) $(system_capability_header)
225	@mkdir -p $(dir $@)
226	$< fsconfig \
227	   --aid-header $(PRIVATE_ANDROID_FS_HDR) \
228	   --capability-header $(PRIVATE_ANDROID_CAP_HDR) \
229	   --partition oem \
230	   --files \
231	   --out_file $@ \
232	   $(or $(PRIVATE_TARGET_FS_CONFIG_GEN),/dev/null)
233
234endif
235
236ifneq ($(filter odm,$(fs_config_generate_extra_partition_list)),)
237##################################
238# Generate the odm/etc/fs_config_dirs binary file for the target
239# Add fs_config_dirs or fs_config_dirs_odm to PRODUCT_PACKAGES in
240# the device make file to enable
241include $(CLEAR_VARS)
242
243LOCAL_MODULE := fs_config_dirs_odm
244LOCAL_MODULE_CLASS := ETC
245LOCAL_INSTALLED_MODULE_STEM := fs_config_dirs
246LOCAL_MODULE_PATH := $(TARGET_OUT_ODM)/etc
247include $(BUILD_SYSTEM)/base_rules.mk
248$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_FS_HDR := $(system_android_filesystem_config)
249$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_CAP_HDR := $(system_capability_header)
250$(LOCAL_BUILT_MODULE): PRIVATE_TARGET_FS_CONFIG_GEN := $(TARGET_FS_CONFIG_GEN)
251$(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/fs_config_generator.py $(TARGET_FS_CONFIG_GEN) $(system_android_filesystem_config) $(system_capability_header)
252	@mkdir -p $(dir $@)
253	$< fsconfig \
254	   --aid-header $(PRIVATE_ANDROID_FS_HDR) \
255	   --capability-header $(PRIVATE_ANDROID_CAP_HDR) \
256	   --partition odm \
257	   --dirs \
258	   --out_file $@ \
259	   $(or $(PRIVATE_TARGET_FS_CONFIG_GEN),/dev/null)
260
261##################################
262# Generate the odm/etc/fs_config_files binary file for the target
263# Add fs_config_files of fs_config_files_odm to PRODUCT_PACKAGES in
264# the device make file to enable
265include $(CLEAR_VARS)
266
267LOCAL_MODULE := fs_config_files_odm
268LOCAL_MODULE_CLASS := ETC
269LOCAL_INSTALLED_MODULE_STEM := fs_config_files
270LOCAL_MODULE_PATH := $(TARGET_OUT_ODM)/etc
271include $(BUILD_SYSTEM)/base_rules.mk
272$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_FS_HDR := $(system_android_filesystem_config)
273$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_CAP_HDR := $(system_capability_header)
274$(LOCAL_BUILT_MODULE): PRIVATE_TARGET_FS_CONFIG_GEN := $(TARGET_FS_CONFIG_GEN)
275$(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/fs_config_generator.py $(TARGET_FS_CONFIG_GEN) $(system_android_filesystem_config) $(system_capability_header)
276	@mkdir -p $(dir $@)
277	$< fsconfig \
278	   --aid-header $(PRIVATE_ANDROID_FS_HDR) \
279	   --capability-header $(PRIVATE_ANDROID_CAP_HDR) \
280	   --partition odm \
281	   --files \
282	   --out_file $@ \
283	   $(or $(PRIVATE_TARGET_FS_CONFIG_GEN),/dev/null)
284
285endif
286
287ifneq ($(filter vendor_dlkm,$(fs_config_generate_extra_partition_list)),)
288##################################
289# Generate the vendor_dlkm/etc/fs_config_dirs binary file for the target
290# Add fs_config_dirs or fs_config_dirs_vendor_dlkm to PRODUCT_PACKAGES in
291# the device make file to enable
292include $(CLEAR_VARS)
293
294LOCAL_MODULE := fs_config_dirs_vendor_dlkm
295LOCAL_MODULE_CLASS := ETC
296LOCAL_INSTALLED_MODULE_STEM := fs_config_dirs
297LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_DLKM)/etc
298include $(BUILD_SYSTEM)/base_rules.mk
299$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_FS_HDR := $(system_android_filesystem_config)
300$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_CAP_HDR := $(system_capability_header)
301$(LOCAL_BUILT_MODULE): PRIVATE_TARGET_FS_CONFIG_GEN := $(TARGET_FS_CONFIG_GEN)
302$(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/fs_config_generator.py $(TARGET_FS_CONFIG_GEN) $(system_android_filesystem_config) $(system_capability_header)
303	@mkdir -p $(dir $@)
304	$< fsconfig \
305	   --aid-header $(PRIVATE_ANDROID_FS_HDR) \
306	   --capability-header $(PRIVATE_ANDROID_CAP_HDR) \
307	   --partition vendor_dlkm \
308	   --dirs \
309	   --out_file $@ \
310	   $(or $(PRIVATE_TARGET_FS_CONFIG_GEN),/dev/null)
311
312##################################
313# Generate the vendor_dlkm/etc/fs_config_files binary file for the target
314# Add fs_config_files of fs_config_files_vendor_dlkm to PRODUCT_PACKAGES in
315# the device make file to enable
316include $(CLEAR_VARS)
317
318LOCAL_MODULE := fs_config_files_vendor_dlkm
319LOCAL_MODULE_CLASS := ETC
320LOCAL_INSTALLED_MODULE_STEM := fs_config_files
321LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_DLKM)/etc
322include $(BUILD_SYSTEM)/base_rules.mk
323$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_FS_HDR := $(system_android_filesystem_config)
324$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_CAP_HDR := $(system_capability_header)
325$(LOCAL_BUILT_MODULE): PRIVATE_TARGET_FS_CONFIG_GEN := $(TARGET_FS_CONFIG_GEN)
326$(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/fs_config_generator.py $(TARGET_FS_CONFIG_GEN) $(system_android_filesystem_config) $(system_capability_header)
327	@mkdir -p $(dir $@)
328	$< fsconfig \
329	   --aid-header $(PRIVATE_ANDROID_FS_HDR) \
330	   --capability-header $(PRIVATE_ANDROID_CAP_HDR) \
331	   --partition vendor_dlkm \
332	   --files \
333	   --out_file $@ \
334	   $(or $(PRIVATE_TARGET_FS_CONFIG_GEN),/dev/null)
335
336endif
337
338ifneq ($(filter odm_dlkm,$(fs_config_generate_extra_partition_list)),)
339##################################
340# Generate the odm_dlkm/etc/fs_config_dirs binary file for the target
341# Add fs_config_dirs or fs_config_dirs_odm_dlkm to PRODUCT_PACKAGES in
342# the device make file to enable
343include $(CLEAR_VARS)
344
345LOCAL_MODULE := fs_config_dirs_odm_dlkm
346LOCAL_MODULE_CLASS := ETC
347LOCAL_INSTALLED_MODULE_STEM := fs_config_dirs
348LOCAL_MODULE_PATH := $(TARGET_OUT_ODM_DLKM)/etc
349include $(BUILD_SYSTEM)/base_rules.mk
350$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_FS_HDR := $(system_android_filesystem_config)
351$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_CAP_HDR := $(system_capability_header)
352$(LOCAL_BUILT_MODULE): PRIVATE_TARGET_FS_CONFIG_GEN := $(TARGET_FS_CONFIG_GEN)
353$(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/fs_config_generator.py $(TARGET_FS_CONFIG_GEN) $(system_android_filesystem_config) $(system_capability_header)
354	@mkdir -p $(dir $@)
355	$< fsconfig \
356	   --aid-header $(PRIVATE_ANDROID_FS_HDR) \
357	   --capability-header $(PRIVATE_ANDROID_CAP_HDR) \
358	   --partition odm_dlkm \
359	   --dirs \
360	   --out_file $@ \
361	   $(or $(PRIVATE_TARGET_FS_CONFIG_GEN),/dev/null)
362
363##################################
364# Generate the odm_dlkm/etc/fs_config_files binary file for the target
365# Add fs_config_files of fs_config_files_odm_dlkm to PRODUCT_PACKAGES in
366# the device make file to enable
367include $(CLEAR_VARS)
368
369LOCAL_MODULE := fs_config_files_odm_dlkm
370LOCAL_MODULE_CLASS := ETC
371LOCAL_INSTALLED_MODULE_STEM := fs_config_files
372LOCAL_MODULE_PATH := $(TARGET_OUT_ODM_DLKM)/etc
373include $(BUILD_SYSTEM)/base_rules.mk
374$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_FS_HDR := $(system_android_filesystem_config)
375$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_CAP_HDR := $(system_capability_header)
376$(LOCAL_BUILT_MODULE): PRIVATE_TARGET_FS_CONFIG_GEN := $(TARGET_FS_CONFIG_GEN)
377$(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/fs_config_generator.py $(TARGET_FS_CONFIG_GEN) $(system_android_filesystem_config) $(system_capability_header)
378	@mkdir -p $(dir $@)
379	$< fsconfig \
380	   --aid-header $(PRIVATE_ANDROID_FS_HDR) \
381	   --capability-header $(PRIVATE_ANDROID_CAP_HDR) \
382	   --partition odm_dlkm \
383	   --files \
384	   --out_file $@ \
385	   $(or $(PRIVATE_TARGET_FS_CONFIG_GEN),/dev/null)
386
387endif
388
389ifneq ($(filter product,$(fs_config_generate_extra_partition_list)),)
390##################################
391# Generate the product/etc/fs_config_dirs binary file for the target
392# Add fs_config_dirs or fs_config_dirs_product to PRODUCT_PACKAGES in
393# the device make file to enable
394include $(CLEAR_VARS)
395
396LOCAL_MODULE := fs_config_dirs_product
397LOCAL_MODULE_CLASS := ETC
398LOCAL_INSTALLED_MODULE_STEM := fs_config_dirs
399LOCAL_MODULE_PATH := $(TARGET_OUT_PRODUCT)/etc
400include $(BUILD_SYSTEM)/base_rules.mk
401$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_FS_HDR := $(system_android_filesystem_config)
402$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_CAP_HDR := $(system_capability_header)
403$(LOCAL_BUILT_MODULE): PRIVATE_TARGET_FS_CONFIG_GEN := $(TARGET_FS_CONFIG_GEN)
404$(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/fs_config_generator.py $(TARGET_FS_CONFIG_GEN) $(system_android_filesystem_config) $(system_capability_header)
405	@mkdir -p $(dir $@)
406	$< fsconfig \
407	   --aid-header $(PRIVATE_ANDROID_FS_HDR) \
408	   --capability-header $(PRIVATE_ANDROID_CAP_HDR) \
409	   --partition product \
410	   --dirs \
411	   --out_file $@ \
412	   $(or $(PRIVATE_TARGET_FS_CONFIG_GEN),/dev/null)
413
414##################################
415# Generate the product/etc/fs_config_files binary file for the target
416# Add fs_config_files of fs_config_files_product to PRODUCT_PACKAGES in
417# the device make file to enable
418include $(CLEAR_VARS)
419
420LOCAL_MODULE := fs_config_files_product
421LOCAL_MODULE_CLASS := ETC
422LOCAL_INSTALLED_MODULE_STEM := fs_config_files
423LOCAL_MODULE_PATH := $(TARGET_OUT_PRODUCT)/etc
424include $(BUILD_SYSTEM)/base_rules.mk
425$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_FS_HDR := $(system_android_filesystem_config)
426$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_CAP_HDR := $(system_capability_header)
427$(LOCAL_BUILT_MODULE): PRIVATE_TARGET_FS_CONFIG_GEN := $(TARGET_FS_CONFIG_GEN)
428$(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/fs_config_generator.py $(TARGET_FS_CONFIG_GEN) $(system_android_filesystem_config) $(system_capability_header)
429	@mkdir -p $(dir $@)
430	$< fsconfig \
431	   --aid-header $(PRIVATE_ANDROID_FS_HDR) \
432	   --capability-header $(PRIVATE_ANDROID_CAP_HDR) \
433	   --partition product \
434	   --files \
435	   --out_file $@ \
436	   $(or $(PRIVATE_TARGET_FS_CONFIG_GEN),/dev/null)
437endif
438
439ifneq ($(filter system_ext,$(fs_config_generate_extra_partition_list)),)
440##################################
441# Generate the system_ext/etc/fs_config_dirs binary file for the target
442# Add fs_config_dirs or fs_config_dirs_system_ext to PRODUCT_PACKAGES in
443# the device make file to enable
444include $(CLEAR_VARS)
445
446LOCAL_MODULE := fs_config_dirs_system_ext
447LOCAL_MODULE_CLASS := ETC
448LOCAL_INSTALLED_MODULE_STEM := fs_config_dirs
449LOCAL_MODULE_PATH := $(TARGET_OUT_SYSTEM_EXT)/etc
450include $(BUILD_SYSTEM)/base_rules.mk
451$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_FS_HDR := $(system_android_filesystem_config)
452$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_CAP_HDR := $(system_capability_header)
453$(LOCAL_BUILT_MODULE): PRIVATE_TARGET_FS_CONFIG_GEN := $(TARGET_FS_CONFIG_GEN)
454$(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/fs_config_generator.py $(TARGET_FS_CONFIG_GEN) $(system_android_filesystem_config) $(system_capability_header)
455	@mkdir -p $(dir $@)
456	$< fsconfig \
457	   --aid-header $(PRIVATE_ANDROID_FS_HDR) \
458	   --capability-header $(PRIVATE_ANDROID_CAP_HDR) \
459	   --partition system_ext \
460	   --dirs \
461	   --out_file $@ \
462	   $(or $(PRIVATE_TARGET_FS_CONFIG_GEN),/dev/null)
463
464##################################
465# Generate the system_ext/etc/fs_config_files binary file for the target
466# Add fs_config_files of fs_config_files_system_ext to PRODUCT_PACKAGES in
467# the device make file to enable
468include $(CLEAR_VARS)
469
470LOCAL_MODULE := fs_config_files_system_ext
471LOCAL_MODULE_CLASS := ETC
472LOCAL_INSTALLED_MODULE_STEM := fs_config_files
473LOCAL_MODULE_PATH := $(TARGET_OUT_SYSTEM_EXT)/etc
474include $(BUILD_SYSTEM)/base_rules.mk
475$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_FS_HDR := $(system_android_filesystem_config)
476$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_CAP_HDR := $(system_capability_header)
477$(LOCAL_BUILT_MODULE): PRIVATE_TARGET_FS_CONFIG_GEN := $(TARGET_FS_CONFIG_GEN)
478$(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/fs_config_generator.py $(TARGET_FS_CONFIG_GEN) $(system_android_filesystem_config) $(system_capability_header)
479	@mkdir -p $(dir $@)
480	$< fsconfig \
481	   --aid-header $(PRIVATE_ANDROID_FS_HDR) \
482	   --capability-header $(PRIVATE_ANDROID_CAP_HDR) \
483	   --partition system_ext \
484	   --files \
485	   --out_file $@ \
486	   $(or $(PRIVATE_TARGET_FS_CONFIG_GEN),/dev/null)
487endif
488
489system_android_filesystem_config :=
490system_capability_header :=
491fs_config_generate_extra_partition_list :=
492