vc/google/chromeos: Refactor Makefile to use a macro for CBFS logo

This commit introduces a new macro, cbfs_add_bmp_file, to the ChromeOS
vendor code Makefile. The macro simplifies the process of adding BMP
files to the CBFS (coreboot Filesystem) by encapsulating the
repetitive tasks of specifying file attributes such as file path,
type, and compression flag.

TEST:Both 'cb_logo.bmp' and 'cb_plus_logo.bmp' files are included with
     the same properties, within the coreboot firmware image.

Change-Id: I827451da79931c09768965c3ad071ecdd918d367
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/86237
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Subrata Banik <subratabanik@google.com>
This commit is contained in:
Jeremy Compostella 2025-01-30 10:15:01 -08:00 committed by Jérémy Compostella
commit 9d366e83d7

View file

@ -30,12 +30,14 @@ else ifeq ($(CONFIG_BMP_LOGO_COMPRESS_LZ4),y)
BMP_LOGO_COMPRESS_FLAG := LZ4
endif
cbfs-files-$(CONFIG_CHROMEOS_FW_SPLASH_SCREEN) += cb_logo.bmp
cb_logo.bmp-file := $(call strip_quotes,$(CONFIG_CHROMEOS_LOGO_PATH))
cb_logo.bmp-type := raw
cb_logo.bmp-compression := $(BMP_LOGO_COMPRESS_FLAG)
define add_bmp_logo_file_to_cbfs
cbfs-files-$$($(1)) += $(2)
$(2)-file := $$(call strip_quotes,$$($(3)))
$(2)-type := raw
$(2)-compression := $$(BMP_LOGO_COMPRESS_FLAG)
endef
cbfs-files-$(CONFIG_CHROMEOS_FW_SPLASH_SCREEN) += cb_plus_logo.bmp
cb_plus_logo.bmp-file := $(call strip_quotes,$(CONFIG_CHROMEBOOK_PLUS_LOGO_PATH))
cb_plus_logo.bmp-type := raw
cb_plus_logo.bmp-compression := $(BMP_LOGO_COMPRESS_FLAG)
$(eval $(call add_bmp_logo_file_to_cbfs,CONFIG_CHROMEOS_FW_SPLASH_SCREEN, \
cb_logo.bmp,CONFIG_CHROMEOS_LOGO_PATH))
$(eval $(call add_bmp_logo_file_to_cbfs,CONFIG_CHROMEOS_FW_SPLASH_SCREEN, \
cb_plus_logo.bmp,CONFIG_CHROMEBOOK_PLUS_LOGO_PATH))