From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 2/5] kbuild: images: don't check for missing FW if file didn't change
Date: Mon, 2 Dec 2024 13:44:01 +0100 [thread overview]
Message-ID: <20241202124404.1814203-2-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20241202124404.1814203-1-a.fatoum@pengutronix.de>
The information about the missing firmware is contained in an ELF
section and the ELF file is dependency to the $(obj)/%.pblb: $(obj)/%.pbl
rule.
We can thus don't need to rerun the missing firmware check if the
input file hasn't been changed since the last time.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
images/Makefile | 3 +--
scripts/Makefile.lib | 6 ++++++
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/images/Makefile b/images/Makefile
index 80ea582728a5..f781ecb59ccb 100644
--- a/images/Makefile
+++ b/images/Makefile
@@ -76,8 +76,7 @@ $(obj)/%.elf: $(pbl-lds) $(BAREBOX_PBL_OBJS) $(obj)/piggy.o $(obj)/sha_sum.o FOR
$(obj)/%.pblb: $(obj)/%.pbl FORCE
$(call if_changed,objcopy_bin,$(*F))
- $(Q)$(OBJCOPY) -O binary --only-section=.missing_fw $< $@.missing-firmware
- $(Q)[ -s $@.missing-firmware ] || rm -f $@.missing-firmware
+ $(call if_changed,check_missing_fw,$@,$<)
$(call if_changed,check_file_size,$@,$(CONFIG_BAREBOX_MAX_IMAGE_SIZE))
#
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index b698161f43f6..e2d0168550f8 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -533,6 +533,12 @@ quiet_cmd_check_file_size = CHKFILESIZE $2
exit 1 ; \
fi
+# Check for missing firmware
+quiet_cmd_check_missing_fw = # no message as we collect info for later
+ cmd_check_missing_fw = set -e; \
+ $(OBJCOPY) -O binary --only-section=.missing_fw $3 $2.missing-firmware; \
+ [ -s $2.missing-firmware ] || rm -f $2.missing-firmware
+
quiet_cmd_imximage__S_dcd= DCD_S $@
cmd_imximage_S_dcd= \
( \
--
2.39.5
next prev parent reply other threads:[~2024-12-02 12:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-02 12:44 [PATCH 1/5] kbuild: images: don't compare filesizes " Ahmad Fatoum
2024-12-02 12:44 ` Ahmad Fatoum [this message]
2024-12-03 8:24 ` [PATCH 2/5] kbuild: images: don't check for missing FW " Ahmad Fatoum
2024-12-02 12:44 ` [PATCH 3/5] kbuild: images: fix missing FORCE prerequisite Ahmad Fatoum
2024-12-02 12:44 ` [PATCH 4/5] kbuild: don't prelink if input file didn't change Ahmad Fatoum
2024-12-02 12:44 ` [PATCH 5/5] kbuild: images: don't compute size " Ahmad Fatoum
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241202124404.1814203-2-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox