Conditionally generate META/boot_filesystem_config.txt.

if BOARD_BUILD_SYSTEM_ROOT_IMAGE != true:  # case A
  - BOOT/RAMDISK corresponds to the / under normal boot, with matching
    fs_config in META/boot_filesystem_config.txt.
  - RECOVERY/RAMDISK corresponds to the / under recovery, with fs_config
    in META/recovery_filesystem_config.txt.
else:
  if BOARD_USES_RECOVERY_AS_BOOT == true:  # case B
    - ROOT/ corresponds to the / under normal boot, with fs_config in
      META/root_filesystem_config.txt.
    - BOOT/RAMDISK corresponds to the / under recovery, with fs_config
      in META/boot_filesystem_config.txt.
  else:  # case C
    - ROOT/ corresponds to the / under normal boot, with fs_config in
      META/root_filesystem_config.txt.
    - RECOVERY/RAMDISK corresponds to the / under recovery, with fs_config
      in META/recovery_filesystem_config.txt.
    - BOOT/RAMDISK doesn't exist.

This CL fixes case C, where we shouldn't try to generate
'META/boot_filesystem_config.txt' for BOOT/RAMDISK. It wouldn't be fatal
without this fix, but would wrongly scan the current directory and
include a large fs_config output into target-files.zip.

Bug: 72731506
Test: `lunch aosp_bullhead-userdebug` and `m dist`. (case A)
Test: `lunch aosp_marlin-userdebug` and `m dist`. (case B)
Test: Define 'BOARD_BUILD_SYSTEM_ROOT_IMAGE := true' for angler. `m
      dist` and check the generated target-files.zip. (case C)
Change-Id: I5582ce8cca464d535af0718be0fd8e65791bd6c2
Merged-In: I5582ce8cca464d535af0718be0fd8e65791bd6c2
(cherry picked from commit da01b211f816cd63f7fb245012d67e654e625c3e)
diff --git a/core/Makefile b/core/Makefile
index c03f21f..9cf539d 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -2781,9 +2781,15 @@
 	$(hide) $(call fs_config,$(zip_root)/PRODUCT,product/) > $(zip_root)/META/product_filesystem_config.txt
 endif
 ifeq ($(BOARD_BUILD_SYSTEM_ROOT_IMAGE),true)
+	@# When using BOARD_BUILD_SYSTEM_ROOT_IMAGE, ROOT always contains the files for the root under
+	@# normal boot. BOOT/RAMDISK exists only if additionally using BOARD_USES_RECOVERY_AS_BOOT.
 	$(hide) $(call fs_config,$(zip_root)/ROOT,) > $(zip_root)/META/root_filesystem_config.txt
-endif
+ifeq ($(BOARD_USES_RECOVERY_AS_BOOT),true)
 	$(hide) $(call fs_config,$(zip_root)/BOOT/RAMDISK,) > $(zip_root)/META/boot_filesystem_config.txt
+endif
+else # BOARD_BUILD_SYSTEM_ROOT_IMAGE != true
+	$(hide) $(call fs_config,$(zip_root)/BOOT/RAMDISK,) > $(zip_root)/META/boot_filesystem_config.txt
+endif
 ifneq ($(INSTALLED_RECOVERYIMAGE_TARGET),)
 	$(hide) $(call fs_config,$(zip_root)/RECOVERY/RAMDISK,) > $(zip_root)/META/recovery_filesystem_config.txt
 endif