core/Makefile: Add generated product FW image

... allowing for FW images to be uploaded based on PRODUCT package.
To be used within provision/flash flows.

This message aims to ensure consistency within the lab environment.
Currently, the provisioning and flashing processes retrieve data from
predefined buckets. However, these buckets may become outdated or cached
by various services within the lab, potentially leading to unintended
behavior.

To address this issue, we intend to modify the process to directly
retrieve artifacts for lab test runs from the build artifacts associated
with the target build.

Bug: 396461815, 397532690
Test: m dist
Flag: EXEMPT desktop only change
Change-Id: Id54f5065a722d7b1364746812fe5f97b816f7e68
diff --git a/core/Makefile b/core/Makefile
index 431599d..02b33b6 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -7960,6 +7960,18 @@
 	$(INSTALLED_USERDATAIMAGE_TARGET)
 
 # -----------------------------------------------------------------
+# Desktop generated firmware filesystem.
+TARGET_PRODUCT_FW_IMAGE_PACKAGE := prebuilt-$(TARGET_PRODUCT)-firmware-image
+GENERATED_FW_IMAGE := $(PRODUCT_OUT)/product/etc/$(TARGET_PRODUCT)-firmware.img
+
+generated_fw_image_found := $(strip $(foreach pp,$(PRODUCT_PACKAGES),\
+	$(if $(findstring $(TARGET_PRODUCT_FW_IMAGE_PACKAGE),$(pp)),$(pp))))
+
+ifneq (,$(generated_fw_image_found))
+$(call dist-for-goals,dist_files,$(GENERATED_FW_IMAGE))
+endif
+
+# -----------------------------------------------------------------
 # Desktop pack image hook.
 ifneq (,$(strip $(PACK_DESKTOP_FILESYSTEM_IMAGES)))
 PACK_IMAGE_TARGET := $(PRODUCT_OUT)/android-desktop_image.bin