Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,29 @@ ifeq ($(FAILBUILD),1)
$(error cannot continue build)
endif

# Add bootsplash to BOOTSPLASH/logo.bmp
define bootsplash_region_hook
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why make it a hook? .config is sourced in line 184 of this file.


# Only run if a file is provided
ifneq ($(CONFIG_BOOTSPLASH_REGION_LOGO_FILE),"")

real-target: branding_bootsplash_region
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
real-target: branding_bootsplash_region
files_added:: branding_bootsplash_region

Otherwise BRANDING ... can be printed after the final Built ... line. This placement is also not ideal:

    CBFSPRINT  coreboot.rom

    BRANDING   Adding bootsplash (BOOTSPLASH/logo.bmp) from 3rdparty/dasharo-blobs/protectli/bootsplash.bmp
FMAP REGION: COREBOOT
Name                           Offset     Type           Size   Comp

but it's better and I think files_added is how such modifications must be done.


.PHONY: branding_bootsplash_region
branding_bootsplash_region: $(obj)/coreboot.rom $(objutil)/cbfstool/cbfstool
@echo " BRANDING Adding bootsplash (BOOTSPLASH/logo.bmp) from $(CONFIG_BOOTSPLASH_REGION_LOGO_FILE)"
$(objutil)/cbfstool/cbfstool $(obj)/coreboot.rom add \
-r BOOTSPLASH \
-f $(CONFIG_BOOTSPLASH_REGION_LOGO_FILE) \
-n logo.bmp \
-t raw \
-c lzma
@:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks unnecessary.

Suggested change
@:


endif
endef

postinclude-hooks += $(bootsplash_region_hook)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
postinclude-hooks += $(bootsplash_region_hook)
postinclude-hooks += $(bootsplash_region_hook)

# Run hooks registered by subdirectories that need to be evaluated after all files have been parsed
$(eval $(postinclude-hooks))

Expand Down
18 changes: 0 additions & 18 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ function build_msi {
function build_protectli_vault {
DEFCONFIG="configs/config.protectli_${BOARD}"
FW_VERSION=$(cat ${DEFCONFIG} | grep CONFIG_LOCALVERSION | cut -d '=' -f 2 | tr -d '"')
LOGO="3rdparty/dasharo-blobs/protectli/bootsplash.bmp"

build_prep

Expand All @@ -156,14 +155,6 @@ function build_protectli_vault {

cp build/coreboot.rom protectli_${BOARD}_${FW_VERSION}.rom

sdk_run /bin/bash -c "./build/cbfstool \
protectli_${BOARD}_${FW_VERSION}.rom add \
-r BOOTSPLASH \
-f \"$LOGO\" \
-n logo.bmp \
-t raw \
-c lzma"

if [ $? -eq 0 ]; then
echo "Result binary placed in $PWD/protectli_${BOARD}_${FW_VERSION}.rom"
sha256sum protectli_${BOARD}_${FW_VERSION}.rom > protectli_${BOARD}_${FW_VERSION}.rom.sha256
Expand All @@ -176,7 +167,6 @@ function build_protectli_vault {
function build_v1x10 {
DEFCONFIG="configs/config.protectli_vault_jsl_$1"
FW_VERSION=$(cat ${DEFCONFIG} | grep CONFIG_LOCALVERSION | cut -d '=' -f 2 | tr -d '"')
LOGO="3rdparty/dasharo-blobs/protectli/bootsplash.bmp"

build_prep

Expand All @@ -186,14 +176,6 @@ function build_v1x10 {

cp build/coreboot.rom protectli_$1_${FW_VERSION}.rom

sdk_run /bin/bash -c "./build/cbfstool \
./protectli_${1}_${FW_VERSION}.rom add \
-r BOOTSPLASH \
-f \"$LOGO\" \
-n logo.bmp \
-t raw \
-c lzma"

if [ $? -eq 0 ]; then
echo "Result binary placed in $PWD/protectli_$1_${FW_VERSION}.rom"
sha256sum protectli_$1_${FW_VERSION}.rom > protectli_$1_${FW_VERSION}.rom.sha256
Expand Down
10 changes: 10 additions & 0 deletions src/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,13 @@ config BOOTSPLASH_FILE
The minimum necessary ImageMagick command line seems to be:
$ convert input.img -colorspace YCC -sampling-factor 4:2:0 bootsplash.jpg

config BOOTSPLASH_REGION_LOGO_FILE
string "Path to the image to be placed as logo.bmp into the BOOTSPLASH region"
help
Same as BOOTSPLASH_FILE, but instead of placing the file in the coreboot
CBFS as bootsplash.bmp, it's placed into the separate BOOTSPLASH fmap region
as logo.bmp.

config BOOTSPLASH_CONVERT
bool "Pre-process bootsplash file with ImageMagick"
depends on BOOTSPLASH_IMAGE
Expand Down Expand Up @@ -1508,6 +1515,9 @@ config BOOTSPLASH_FILE
depends on BOOTSPLASH_IMAGE
default "bootsplash.jpg"

config BOOTSPLASH_REGION_LOGO_FILE
default "3rdparty/dasharo-blobs/protectli/bootsplash.bmp" if VENDOR_PROTECTLI

config BOOTSPLASH_CONVERT_QUALITY
depends on BOOTSPLASH_CONVERT
default 80
Expand Down