fs_config: fix fs_config_*_system targets
Content from fs_config designated for other partitions is leaking
into the system fs_config_* files. Notably /vendor is showing up.
Rule expansion happens late, after all parsing. This is the same in
make and kati. build/make/tools/fs_config/Android.mk ends with
fs_config_generate_extra_partition_list :=, so by the time you get to
rule expansion the value is empty.
Added a PRIVATE_PARTITION_LIST variable to record the value of
fs_config_generate_extra_partition-list.
Test: inspect result of ${OUT}/product/*/system/etc/fs_config_files
Bug: 119677224
Bug: 119310326
Change-Id: I968b4936ab2c5d174f164c760820af13434654ca
diff --git a/tools/fs_config/Android.mk b/tools/fs_config/Android.mk
index cb32b9e..bf5e171 100644
--- a/tools/fs_config/Android.mk
+++ b/tools/fs_config/Android.mk
@@ -163,10 +163,11 @@
LOCAL_MODULE_CLASS := ETC
LOCAL_INSTALLED_MODULE_STEM := fs_config_dirs
include $(BUILD_SYSTEM)/base_rules.mk
+$(LOCAL_BUILT_MODULE): PRIVATE_PARTITION_LIST := $(fs_config_generate_extra_partition_list)
$(LOCAL_BUILT_MODULE): $(fs_config_generate_bin)
@mkdir -p $(dir $@)
- $< -D $(if $(fs_config_generate_extra_partition_list), \
- -P '$(subst $(space),$(comma),$(addprefix -,$(fs_config_generate_extra_partition_list)))') \
+ $< -D $(if $(PRIVATE_PARTITION_LIST), \
+ -P '$(subst $(space),$(comma),$(addprefix -,$(PRIVATE_PARTITION_LIST)))') \
-o $@
##################################
@@ -179,10 +180,11 @@
LOCAL_MODULE_CLASS := ETC
LOCAL_INSTALLED_MODULE_STEM := fs_config_files
include $(BUILD_SYSTEM)/base_rules.mk
+$(LOCAL_BUILT_MODULE): PRIVATE_PARTITION_LIST := $(fs_config_generate_extra_partition_list)
$(LOCAL_BUILT_MODULE): $(fs_config_generate_bin)
@mkdir -p $(dir $@)
- $< -F $(if $(fs_config_generate_extra_partition_list), \
- -P '$(subst $(space),$(comma),$(addprefix -,$(fs_config_generate_extra_partition_list)))') \
+ $< -F $(if $(PRIVATE_PARTITION_LIST), \
+ -P '$(subst $(space),$(comma),$(addprefix -,$(PRIVATE_PARTITION_LIST)))') \
-o $@
ifneq ($(filter vendor,$(fs_config_generate_extra_partition_list)),)