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/libcutils/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)
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_LICENSE_KINDS := legacy_restricted
46LOCAL_LICENSE_CONDITIONS := restricted
47LOCAL_REQUIRED_MODULES := \
48  fs_config_dirs_system \
49  fs_config_dirs_system_ext \
50  fs_config_dirs_product \
51  fs_config_dirs_nonsystem
52include $(BUILD_PHONY_PACKAGE)
53
54##################################
55# Generate the <p>/etc/fs_config_files binary files for each partition.
56# Add fs_config_files to PRODUCT_PACKAGES in the device make file to enable.
57include $(CLEAR_VARS)
58
59LOCAL_MODULE := fs_config_files
60LOCAL_LICENSE_KINDS := legacy_restricted
61LOCAL_LICENSE_CONDITIONS := restricted
62LOCAL_REQUIRED_MODULES := \
63  fs_config_files_system \
64  fs_config_files_system_ext \
65  fs_config_files_product \
66  fs_config_files_nonsystem
67include $(BUILD_PHONY_PACKAGE)
68
69##################################
70# Generate the system_ext/etc/fs_config_dirs binary file for the target if the
71# system_ext partition is generated. Add fs_config_dirs or fs_config_dirs_system_ext
72# to PRODUCT_PACKAGES in the device make file to enable.
73include $(CLEAR_VARS)
74
75LOCAL_MODULE := fs_config_dirs_system_ext
76LOCAL_LICENSE_KINDS := legacy_restricted
77LOCAL_LICENSE_CONDITIONS := restricted
78LOCAL_REQUIRED_MODULES := $(if $(BOARD_USES_SYSTEM_EXTIMAGE)$(BOARD_SYSTEM_EXTIMAGE_FILE_SYSTEM_TYPE),_fs_config_dirs_system_ext)
79include $(BUILD_PHONY_PACKAGE)
80
81##################################
82# Generate the system_ext/etc/fs_config_files binary file for the target if the
83# system_ext partition is generated. Add fs_config_files or fs_config_files_system_ext
84# to PRODUCT_PACKAGES in the device make file to enable.
85include $(CLEAR_VARS)
86
87LOCAL_MODULE := fs_config_files_system_ext
88LOCAL_LICENSE_KINDS := legacy_restricted
89LOCAL_LICENSE_CONDITIONS := restricted
90LOCAL_REQUIRED_MODULES := $(if $(BOARD_USES_SYSTEM_EXTIMAGE)$(BOARD_SYSTEM_EXTIMAGE_FILE_SYSTEM_TYPE),_fs_config_files_system_ext)
91include $(BUILD_PHONY_PACKAGE)
92
93##################################
94# Generate the product/etc/fs_config_dirs binary file for the target if the
95# product partition is generated. Add fs_config_dirs or fs_config_dirs_product
96# to PRODUCT_PACKAGES in the device make file to enable.
97include $(CLEAR_VARS)
98
99LOCAL_MODULE := fs_config_dirs_product
100LOCAL_LICENSE_KINDS := legacy_restricted
101LOCAL_LICENSE_CONDITIONS := restricted
102LOCAL_REQUIRED_MODULES := $(if $(BOARD_USES_PRODUCTIMAGE)$(BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE),_fs_config_dirs_product)
103include $(BUILD_PHONY_PACKAGE)
104
105##################################
106# Generate the product/etc/fs_config_files binary file for the target if the
107# product partition is generated. Add fs_config_files or fs_config_files_product
108# to PRODUCT_PACKAGES in the device make file to enable.
109include $(CLEAR_VARS)
110
111LOCAL_MODULE := fs_config_files_product
112LOCAL_LICENSE_KINDS := legacy_restricted
113LOCAL_LICENSE_CONDITIONS := restricted
114LOCAL_REQUIRED_MODULES := $(if $(BOARD_USES_PRODUCTIMAGE)$(BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE),_fs_config_files_product)
115include $(BUILD_PHONY_PACKAGE)
116
117##################################
118# Generate the <p>/etc/fs_config_dirs binary files for all enabled partitions
119# excluding /system, /system_ext and /product. Add fs_config_dirs_nonsystem to
120# PRODUCT_PACKAGES in the device make file to enable.
121include $(CLEAR_VARS)
122
123LOCAL_MODULE := fs_config_dirs_nonsystem
124LOCAL_LICENSE_KINDS := legacy_restricted
125LOCAL_LICENSE_CONDITIONS := restricted
126LOCAL_REQUIRED_MODULES := $(foreach t,$(fs_config_generate_extra_partition_list),_fs_config_dirs_$(t))
127include $(BUILD_PHONY_PACKAGE)
128
129##################################
130# Generate the <p>/etc/fs_config_files binary files for all enabled partitions
131# excluding /system, /system_ext and /product. Add fs_config_files_nonsystem to
132# PRODUCT_PACKAGES in the device make file to enable.
133include $(CLEAR_VARS)
134
135LOCAL_MODULE := fs_config_files_nonsystem
136LOCAL_LICENSE_KINDS := legacy_restricted
137LOCAL_LICENSE_CONDITIONS := restricted
138LOCAL_REQUIRED_MODULES := $(foreach t,$(fs_config_generate_extra_partition_list),_fs_config_files_$(t))
139include $(BUILD_PHONY_PACKAGE)
140
141##################################
142# Generate the system/etc/fs_config_dirs binary file for the target
143# Add fs_config_dirs or fs_config_dirs_system to PRODUCT_PACKAGES in
144# the device make file to enable
145include $(CLEAR_VARS)
146
147LOCAL_MODULE := fs_config_dirs_system
148LOCAL_LICENSE_KINDS := legacy_restricted
149LOCAL_LICENSE_CONDITIONS := restricted
150LOCAL_MODULE_CLASS := ETC
151LOCAL_INSTALLED_MODULE_STEM := fs_config_dirs
152include $(BUILD_SYSTEM)/base_rules.mk
153$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_FS_HDR := $(system_android_filesystem_config)
154$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_CAP_HDR := $(system_capability_header)
155$(LOCAL_BUILT_MODULE): PRIVATE_PARTITION_LIST := $(fs_config_generate_extra_partition_list)
156$(LOCAL_BUILT_MODULE): PRIVATE_TARGET_FS_CONFIG_GEN := $(TARGET_FS_CONFIG_GEN)
157$(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/fs_config_generator.py $(TARGET_FS_CONFIG_GEN) $(system_android_filesystem_config) $(system_capability_header)
158	@mkdir -p $(dir $@)
159	$< fsconfig \
160	   --aid-header $(PRIVATE_ANDROID_FS_HDR) \
161	   --capability-header $(PRIVATE_ANDROID_CAP_HDR) \
162	   --partition system \
163	   --all-partitions "$(subst $(space),$(comma),$(PRIVATE_PARTITION_LIST))" \
164	   --dirs \
165	   --out_file $@ \
166	   $(or $(PRIVATE_TARGET_FS_CONFIG_GEN),/dev/null)
167
168##################################
169# Generate the system/etc/fs_config_files binary file for the target
170# Add fs_config_files or fs_config_files_system to PRODUCT_PACKAGES in
171# the device make file to enable
172include $(CLEAR_VARS)
173
174LOCAL_MODULE := fs_config_files_system
175LOCAL_LICENSE_KINDS := legacy_restricted
176LOCAL_LICENSE_CONDITIONS := restricted
177LOCAL_MODULE_CLASS := ETC
178LOCAL_INSTALLED_MODULE_STEM := fs_config_files
179include $(BUILD_SYSTEM)/base_rules.mk
180$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_FS_HDR := $(system_android_filesystem_config)
181$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_CAP_HDR := $(system_capability_header)
182$(LOCAL_BUILT_MODULE): PRIVATE_PARTITION_LIST := $(fs_config_generate_extra_partition_list)
183$(LOCAL_BUILT_MODULE): PRIVATE_TARGET_FS_CONFIG_GEN := $(TARGET_FS_CONFIG_GEN)
184$(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/fs_config_generator.py $(TARGET_FS_CONFIG_GEN) $(system_android_filesystem_config) $(system_capability_header)
185	@mkdir -p $(dir $@)
186	$< fsconfig \
187	   --aid-header $(PRIVATE_ANDROID_FS_HDR) \
188	   --capability-header $(PRIVATE_ANDROID_CAP_HDR) \
189	   --partition system \
190	   --all-partitions "$(subst $(space),$(comma),$(PRIVATE_PARTITION_LIST))" \
191	   --files \
192	   --out_file $@ \
193	   $(or $(PRIVATE_TARGET_FS_CONFIG_GEN),/dev/null)
194
195ifneq ($(filter vendor,$(fs_config_generate_extra_partition_list)),)
196##################################
197# Generate the vendor/etc/fs_config_dirs binary file for the target
198# Add fs_config_dirs or fs_config_dirs_nonsystem to PRODUCT_PACKAGES
199# in the device make file to enable
200include $(CLEAR_VARS)
201
202LOCAL_MODULE := _fs_config_dirs_vendor
203LOCAL_LICENSE_KINDS := legacy_restricted
204LOCAL_LICENSE_CONDITIONS := restricted
205LOCAL_MODULE_CLASS := ETC
206LOCAL_INSTALLED_MODULE_STEM := fs_config_dirs
207LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc
208include $(BUILD_SYSTEM)/base_rules.mk
209$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_FS_HDR := $(system_android_filesystem_config)
210$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_CAP_HDR := $(system_capability_header)
211$(LOCAL_BUILT_MODULE): PRIVATE_TARGET_FS_CONFIG_GEN := $(TARGET_FS_CONFIG_GEN)
212$(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/fs_config_generator.py $(TARGET_FS_CONFIG_GEN) $(system_android_filesystem_config) $(system_capability_header)
213	@mkdir -p $(dir $@)
214	$< fsconfig \
215	   --aid-header $(PRIVATE_ANDROID_FS_HDR) \
216	   --capability-header $(PRIVATE_ANDROID_CAP_HDR) \
217	   --partition vendor \
218	   --dirs \
219	   --out_file $@ \
220	   $(or $(PRIVATE_TARGET_FS_CONFIG_GEN),/dev/null)
221
222##################################
223# Generate the vendor/etc/fs_config_files binary file for the target
224# Add fs_config_files or fs_config_files_nonsystem to PRODUCT_PACKAGES
225# in the device make file to enable
226include $(CLEAR_VARS)
227
228LOCAL_MODULE := _fs_config_files_vendor
229LOCAL_LICENSE_KINDS := legacy_restricted
230LOCAL_LICENSE_CONDITIONS := restricted
231LOCAL_MODULE_CLASS := ETC
232LOCAL_INSTALLED_MODULE_STEM := fs_config_files
233LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc
234include $(BUILD_SYSTEM)/base_rules.mk
235$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_FS_HDR := $(system_android_filesystem_config)
236$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_CAP_HDR := $(system_capability_header)
237$(LOCAL_BUILT_MODULE): PRIVATE_TARGET_FS_CONFIG_GEN := $(TARGET_FS_CONFIG_GEN)
238$(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/fs_config_generator.py $(TARGET_FS_CONFIG_GEN) $(system_android_filesystem_config) $(system_capability_header)
239	@mkdir -p $(dir $@)
240	$< fsconfig \
241	   --aid-header $(PRIVATE_ANDROID_FS_HDR) \
242	   --capability-header $(PRIVATE_ANDROID_CAP_HDR) \
243	   --partition vendor \
244	   --files \
245	   --out_file $@ \
246	   $(or $(PRIVATE_TARGET_FS_CONFIG_GEN),/dev/null)
247
248endif
249
250ifneq ($(filter oem,$(fs_config_generate_extra_partition_list)),)
251##################################
252# Generate the oem/etc/fs_config_dirs binary file for the target
253# Add fs_config_dirs or fs_config_dirs_nonsystem to PRODUCT_PACKAGES
254# in the device make file to enable
255include $(CLEAR_VARS)
256
257LOCAL_MODULE := _fs_config_dirs_oem
258LOCAL_LICENSE_KINDS := legacy_restricted
259LOCAL_LICENSE_CONDITIONS := restricted
260LOCAL_MODULE_CLASS := ETC
261LOCAL_INSTALLED_MODULE_STEM := fs_config_dirs
262LOCAL_MODULE_PATH := $(TARGET_OUT_OEM)/etc
263include $(BUILD_SYSTEM)/base_rules.mk
264$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_FS_HDR := $(system_android_filesystem_config)
265$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_CAP_HDR := $(system_capability_header)
266$(LOCAL_BUILT_MODULE): PRIVATE_TARGET_FS_CONFIG_GEN := $(TARGET_FS_CONFIG_GEN)
267$(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/fs_config_generator.py $(TARGET_FS_CONFIG_GEN) $(system_android_filesystem_config) $(system_capability_header)
268	@mkdir -p $(dir $@)
269	$< fsconfig \
270	   --aid-header $(PRIVATE_ANDROID_FS_HDR) \
271	   --capability-header $(PRIVATE_ANDROID_CAP_HDR) \
272	   --partition oem \
273	   --dirs \
274	   --out_file $@ \
275	   $(or $(PRIVATE_TARGET_FS_CONFIG_GEN),/dev/null)
276
277##################################
278# Generate the oem/etc/fs_config_files binary file for the target
279# Add fs_config_files or fs_config_files_nonsystem to PRODUCT_PACKAGES
280# in the device make file to enable
281include $(CLEAR_VARS)
282
283LOCAL_MODULE := _fs_config_files_oem
284LOCAL_LICENSE_KINDS := legacy_restricted
285LOCAL_LICENSE_CONDITIONS := restricted
286LOCAL_MODULE_CLASS := ETC
287LOCAL_INSTALLED_MODULE_STEM := fs_config_files
288LOCAL_MODULE_PATH := $(TARGET_OUT_OEM)/etc
289include $(BUILD_SYSTEM)/base_rules.mk
290$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_FS_HDR := $(system_android_filesystem_config)
291$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_CAP_HDR := $(system_capability_header)
292$(LOCAL_BUILT_MODULE): PRIVATE_TARGET_FS_CONFIG_GEN := $(TARGET_FS_CONFIG_GEN)
293$(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/fs_config_generator.py $(TARGET_FS_CONFIG_GEN) $(system_android_filesystem_config) $(system_capability_header)
294	@mkdir -p $(dir $@)
295	$< fsconfig \
296	   --aid-header $(PRIVATE_ANDROID_FS_HDR) \
297	   --capability-header $(PRIVATE_ANDROID_CAP_HDR) \
298	   --partition oem \
299	   --files \
300	   --out_file $@ \
301	   $(or $(PRIVATE_TARGET_FS_CONFIG_GEN),/dev/null)
302
303endif
304
305ifneq ($(filter odm,$(fs_config_generate_extra_partition_list)),)
306##################################
307# Generate the odm/etc/fs_config_dirs binary file for the target
308# Add fs_config_dirs or fs_config_dirs_nonsystem to PRODUCT_PACKAGES
309# in the device make file to enable
310include $(CLEAR_VARS)
311
312LOCAL_MODULE := _fs_config_dirs_odm
313LOCAL_LICENSE_KINDS := legacy_restricted
314LOCAL_LICENSE_CONDITIONS := restricted
315LOCAL_MODULE_CLASS := ETC
316LOCAL_INSTALLED_MODULE_STEM := fs_config_dirs
317LOCAL_MODULE_PATH := $(TARGET_OUT_ODM)/etc
318include $(BUILD_SYSTEM)/base_rules.mk
319$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_FS_HDR := $(system_android_filesystem_config)
320$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_CAP_HDR := $(system_capability_header)
321$(LOCAL_BUILT_MODULE): PRIVATE_TARGET_FS_CONFIG_GEN := $(TARGET_FS_CONFIG_GEN)
322$(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/fs_config_generator.py $(TARGET_FS_CONFIG_GEN) $(system_android_filesystem_config) $(system_capability_header)
323	@mkdir -p $(dir $@)
324	$< fsconfig \
325	   --aid-header $(PRIVATE_ANDROID_FS_HDR) \
326	   --capability-header $(PRIVATE_ANDROID_CAP_HDR) \
327	   --partition odm \
328	   --dirs \
329	   --out_file $@ \
330	   $(or $(PRIVATE_TARGET_FS_CONFIG_GEN),/dev/null)
331
332##################################
333# Generate the odm/etc/fs_config_files binary file for the target
334# Add fs_config_files or fs_config_files_nonsystem to PRODUCT_PACKAGES
335# in the device make file to enable
336include $(CLEAR_VARS)
337
338LOCAL_MODULE := _fs_config_files_odm
339LOCAL_LICENSE_KINDS := legacy_restricted
340LOCAL_LICENSE_CONDITIONS := restricted
341LOCAL_MODULE_CLASS := ETC
342LOCAL_INSTALLED_MODULE_STEM := fs_config_files
343LOCAL_MODULE_PATH := $(TARGET_OUT_ODM)/etc
344include $(BUILD_SYSTEM)/base_rules.mk
345$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_FS_HDR := $(system_android_filesystem_config)
346$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_CAP_HDR := $(system_capability_header)
347$(LOCAL_BUILT_MODULE): PRIVATE_TARGET_FS_CONFIG_GEN := $(TARGET_FS_CONFIG_GEN)
348$(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/fs_config_generator.py $(TARGET_FS_CONFIG_GEN) $(system_android_filesystem_config) $(system_capability_header)
349	@mkdir -p $(dir $@)
350	$< fsconfig \
351	   --aid-header $(PRIVATE_ANDROID_FS_HDR) \
352	   --capability-header $(PRIVATE_ANDROID_CAP_HDR) \
353	   --partition odm \
354	   --files \
355	   --out_file $@ \
356	   $(or $(PRIVATE_TARGET_FS_CONFIG_GEN),/dev/null)
357
358endif
359
360ifneq ($(filter vendor_dlkm,$(fs_config_generate_extra_partition_list)),)
361##################################
362# Generate the vendor_dlkm/etc/fs_config_dirs binary file for the target
363# Add fs_config_dirs or fs_config_dirs_nonsystem to PRODUCT_PACKAGES in
364# the device make file to enable
365include $(CLEAR_VARS)
366
367LOCAL_MODULE := _fs_config_dirs_vendor_dlkm
368LOCAL_LICENSE_KINDS := legacy_restricted
369LOCAL_LICENSE_CONDITIONS := restricted
370LOCAL_MODULE_CLASS := ETC
371LOCAL_INSTALLED_MODULE_STEM := fs_config_dirs
372LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_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 vendor_dlkm \
383	   --dirs \
384	   --out_file $@ \
385	   $(or $(PRIVATE_TARGET_FS_CONFIG_GEN),/dev/null)
386
387##################################
388# Generate the vendor_dlkm/etc/fs_config_files binary file for the target
389# Add fs_config_files or fs_config_files_nonsystem to PRODUCT_PACKAGES in
390# the device make file to enable
391include $(CLEAR_VARS)
392
393LOCAL_MODULE := _fs_config_files_vendor_dlkm
394LOCAL_LICENSE_KINDS := legacy_restricted
395LOCAL_LICENSE_CONDITIONS := restricted
396LOCAL_MODULE_CLASS := ETC
397LOCAL_INSTALLED_MODULE_STEM := fs_config_files
398LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_DLKM)/etc
399include $(BUILD_SYSTEM)/base_rules.mk
400$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_FS_HDR := $(system_android_filesystem_config)
401$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_CAP_HDR := $(system_capability_header)
402$(LOCAL_BUILT_MODULE): PRIVATE_TARGET_FS_CONFIG_GEN := $(TARGET_FS_CONFIG_GEN)
403$(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/fs_config_generator.py $(TARGET_FS_CONFIG_GEN) $(system_android_filesystem_config) $(system_capability_header)
404	@mkdir -p $(dir $@)
405	$< fsconfig \
406	   --aid-header $(PRIVATE_ANDROID_FS_HDR) \
407	   --capability-header $(PRIVATE_ANDROID_CAP_HDR) \
408	   --partition vendor_dlkm \
409	   --files \
410	   --out_file $@ \
411	   $(or $(PRIVATE_TARGET_FS_CONFIG_GEN),/dev/null)
412
413endif
414
415ifneq ($(filter odm_dlkm,$(fs_config_generate_extra_partition_list)),)
416##################################
417# Generate the odm_dlkm/etc/fs_config_dirs binary file for the target
418# Add fs_config_dirs or fs_config_dirs_nonsystem to PRODUCT_PACKAGES
419# in the device make file to enable
420include $(CLEAR_VARS)
421
422LOCAL_MODULE := _fs_config_dirs_odm_dlkm
423LOCAL_LICENSE_KINDS := legacy_restricted
424LOCAL_LICENSE_CONDITIONS := restricted
425LOCAL_MODULE_CLASS := ETC
426LOCAL_INSTALLED_MODULE_STEM := fs_config_dirs
427LOCAL_MODULE_PATH := $(TARGET_OUT_ODM_DLKM)/etc
428include $(BUILD_SYSTEM)/base_rules.mk
429$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_FS_HDR := $(system_android_filesystem_config)
430$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_CAP_HDR := $(system_capability_header)
431$(LOCAL_BUILT_MODULE): PRIVATE_TARGET_FS_CONFIG_GEN := $(TARGET_FS_CONFIG_GEN)
432$(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/fs_config_generator.py $(TARGET_FS_CONFIG_GEN) $(system_android_filesystem_config) $(system_capability_header)
433	@mkdir -p $(dir $@)
434	$< fsconfig \
435	   --aid-header $(PRIVATE_ANDROID_FS_HDR) \
436	   --capability-header $(PRIVATE_ANDROID_CAP_HDR) \
437	   --partition odm_dlkm \
438	   --dirs \
439	   --out_file $@ \
440	   $(or $(PRIVATE_TARGET_FS_CONFIG_GEN),/dev/null)
441
442##################################
443# Generate the odm_dlkm/etc/fs_config_files binary file for the target
444# Add fs_config_files or fs_config_files_nonsystem to PRODUCT_PACKAGES
445# in the device make file to enable
446include $(CLEAR_VARS)
447
448LOCAL_MODULE := _fs_config_files_odm_dlkm
449LOCAL_LICENSE_KINDS := legacy_restricted
450LOCAL_LICENSE_CONDITIONS := restricted
451LOCAL_MODULE_CLASS := ETC
452LOCAL_INSTALLED_MODULE_STEM := fs_config_files
453LOCAL_MODULE_PATH := $(TARGET_OUT_ODM_DLKM)/etc
454include $(BUILD_SYSTEM)/base_rules.mk
455$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_FS_HDR := $(system_android_filesystem_config)
456$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_CAP_HDR := $(system_capability_header)
457$(LOCAL_BUILT_MODULE): PRIVATE_TARGET_FS_CONFIG_GEN := $(TARGET_FS_CONFIG_GEN)
458$(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/fs_config_generator.py $(TARGET_FS_CONFIG_GEN) $(system_android_filesystem_config) $(system_capability_header)
459	@mkdir -p $(dir $@)
460	$< fsconfig \
461	   --aid-header $(PRIVATE_ANDROID_FS_HDR) \
462	   --capability-header $(PRIVATE_ANDROID_CAP_HDR) \
463	   --partition odm_dlkm \
464	   --files \
465	   --out_file $@ \
466	   $(or $(PRIVATE_TARGET_FS_CONFIG_GEN),/dev/null)
467
468endif
469
470ifneq ($(BOARD_USES_PRODUCTIMAGE)$(BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE),)
471##################################
472# Generate the product/etc/fs_config_dirs binary file for the target
473# Add fs_config_dirs or fs_config_dirs_product to PRODUCT_PACKAGES in
474# the device make file to enable
475include $(CLEAR_VARS)
476
477LOCAL_MODULE := _fs_config_dirs_product
478LOCAL_LICENSE_KINDS := legacy_restricted
479LOCAL_LICENSE_CONDITIONS := restricted
480LOCAL_MODULE_CLASS := ETC
481LOCAL_INSTALLED_MODULE_STEM := fs_config_dirs
482LOCAL_MODULE_PATH := $(TARGET_OUT_PRODUCT)/etc
483include $(BUILD_SYSTEM)/base_rules.mk
484$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_FS_HDR := $(system_android_filesystem_config)
485$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_CAP_HDR := $(system_capability_header)
486$(LOCAL_BUILT_MODULE): PRIVATE_TARGET_FS_CONFIG_GEN := $(TARGET_FS_CONFIG_GEN)
487$(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/fs_config_generator.py $(TARGET_FS_CONFIG_GEN) $(system_android_filesystem_config) $(system_capability_header)
488	@mkdir -p $(dir $@)
489	$< fsconfig \
490	   --aid-header $(PRIVATE_ANDROID_FS_HDR) \
491	   --capability-header $(PRIVATE_ANDROID_CAP_HDR) \
492	   --partition product \
493	   --dirs \
494	   --out_file $@ \
495	   $(or $(PRIVATE_TARGET_FS_CONFIG_GEN),/dev/null)
496
497##################################
498# Generate the product/etc/fs_config_files binary file for the target
499# Add fs_config_files or fs_config_files_product to PRODUCT_PACKAGES in
500# the device make file to enable
501include $(CLEAR_VARS)
502
503LOCAL_MODULE := _fs_config_files_product
504LOCAL_LICENSE_KINDS := legacy_restricted
505LOCAL_LICENSE_CONDITIONS := restricted
506LOCAL_MODULE_CLASS := ETC
507LOCAL_INSTALLED_MODULE_STEM := fs_config_files
508LOCAL_MODULE_PATH := $(TARGET_OUT_PRODUCT)/etc
509include $(BUILD_SYSTEM)/base_rules.mk
510$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_FS_HDR := $(system_android_filesystem_config)
511$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_CAP_HDR := $(system_capability_header)
512$(LOCAL_BUILT_MODULE): PRIVATE_TARGET_FS_CONFIG_GEN := $(TARGET_FS_CONFIG_GEN)
513$(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/fs_config_generator.py $(TARGET_FS_CONFIG_GEN) $(system_android_filesystem_config) $(system_capability_header)
514	@mkdir -p $(dir $@)
515	$< fsconfig \
516	   --aid-header $(PRIVATE_ANDROID_FS_HDR) \
517	   --capability-header $(PRIVATE_ANDROID_CAP_HDR) \
518	   --partition product \
519	   --files \
520	   --out_file $@ \
521	   $(or $(PRIVATE_TARGET_FS_CONFIG_GEN),/dev/null)
522endif
523
524ifneq ($(BOARD_USES_SYSTEM_EXTIMAGE)$(BOARD_SYSTEM_EXTIMAGE_FILE_SYSTEM_TYPE),)
525##################################
526# Generate the system_ext/etc/fs_config_dirs binary file for the target
527# Add fs_config_dirs or fs_config_dirs_system_ext to PRODUCT_PACKAGES in
528# the device make file to enable
529include $(CLEAR_VARS)
530
531LOCAL_MODULE := _fs_config_dirs_system_ext
532LOCAL_LICENSE_KINDS := legacy_restricted
533LOCAL_LICENSE_CONDITIONS := restricted
534LOCAL_MODULE_CLASS := ETC
535LOCAL_INSTALLED_MODULE_STEM := fs_config_dirs
536LOCAL_MODULE_PATH := $(TARGET_OUT_SYSTEM_EXT)/etc
537include $(BUILD_SYSTEM)/base_rules.mk
538$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_FS_HDR := $(system_android_filesystem_config)
539$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_CAP_HDR := $(system_capability_header)
540$(LOCAL_BUILT_MODULE): PRIVATE_TARGET_FS_CONFIG_GEN := $(TARGET_FS_CONFIG_GEN)
541$(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/fs_config_generator.py $(TARGET_FS_CONFIG_GEN) $(system_android_filesystem_config) $(system_capability_header)
542	@mkdir -p $(dir $@)
543	$< fsconfig \
544	   --aid-header $(PRIVATE_ANDROID_FS_HDR) \
545	   --capability-header $(PRIVATE_ANDROID_CAP_HDR) \
546	   --partition system_ext \
547	   --dirs \
548	   --out_file $@ \
549	   $(or $(PRIVATE_TARGET_FS_CONFIG_GEN),/dev/null)
550
551##################################
552# Generate the system_ext/etc/fs_config_files binary file for the target
553# Add fs_config_files or fs_config_files_system_ext to PRODUCT_PACKAGES in
554# the device make file to enable
555include $(CLEAR_VARS)
556
557LOCAL_MODULE := _fs_config_files_system_ext
558LOCAL_LICENSE_KINDS := legacy_restricted
559LOCAL_LICENSE_CONDITIONS := restricted
560LOCAL_MODULE_CLASS := ETC
561LOCAL_INSTALLED_MODULE_STEM := fs_config_files
562LOCAL_MODULE_PATH := $(TARGET_OUT_SYSTEM_EXT)/etc
563include $(BUILD_SYSTEM)/base_rules.mk
564$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_FS_HDR := $(system_android_filesystem_config)
565$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_CAP_HDR := $(system_capability_header)
566$(LOCAL_BUILT_MODULE): PRIVATE_TARGET_FS_CONFIG_GEN := $(TARGET_FS_CONFIG_GEN)
567$(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/fs_config_generator.py $(TARGET_FS_CONFIG_GEN) $(system_android_filesystem_config) $(system_capability_header)
568	@mkdir -p $(dir $@)
569	$< fsconfig \
570	   --aid-header $(PRIVATE_ANDROID_FS_HDR) \
571	   --capability-header $(PRIVATE_ANDROID_CAP_HDR) \
572	   --partition system_ext \
573	   --files \
574	   --out_file $@ \
575	   $(or $(PRIVATE_TARGET_FS_CONFIG_GEN),/dev/null)
576endif
577
578system_android_filesystem_config :=
579system_capability_header :=
580fs_config_generate_extra_partition_list :=
581