From: SCHNEIDER Johannes <johannes.schneider@leica-geosystems.com>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: HAEMMERLE Thomas <thomas.haemmerle@leica-geosystems.com>,
"barebox@lists.infradead.org" <barebox@lists.infradead.org>
Subject: Re: [PATCH] lib: logo: support a single pre-rendered logo file as an alternative to SVG
Date: Fri, 5 Jun 2026 05:46:40 +0000 [thread overview]
Message-ID: <AM0PR06MB4148A7BB04949283840342DCBC112@AM0PR06MB4148.eurprd06.prod.outlook.com> (raw)
In-Reply-To: <90cd7b0f-4783-4fb3-8faf-3436d21db90b@pengutronix.de>
Hoi Ahmad,
>
> Hello Johannes,
>
> On 6/2/26 8:08 AM, Johannes Schneider wrote:
> > Add a "Logo source" choice that switches between the upstream behaviour
> > (BAREBOX_LOGO_STOCK -- render Documentation/barebox.svg at build time
> > with ImageMagick) and a new pre-rendered single-file mode
> > (BAREBOX_LOGO_FILE -- include one PNG verbatim, no conversion).
> >
> > The single-file mode addresses two issues for vendor-branded splashes
> > on fixed-resolution panels:
> >
> > - The multi-size stock options can be combined; e.g. enabling 640
> > and a hypothetical 800 variant in parallel embedded both blobs,
> > even though only one is ever displayed on a given panel. The new
> > BAREBOX_LOGO_FILE selector replaces all of the BAREBOX_LOGO_<size>
> > flags with a single configurable PNG path -- exactly one logo
> > blob in the resulting binary.
> >
> > - It removes the build-time ImageMagick dependency in the
> > custom-logo path. CI environments where Inkscape and ImageMagick
> > versions drift (see the SELF_CALL=xxx Inkscape workaround at
> > the top of cmd_png) can produce a pre-rendered PNG once and check
> > it in. Stock mode keeps its existing convert(1) chain.
> >
> > The new symbol is barebox-logo-custom; the resulting bblogo blob is
> > embedded under __bblogo_barebox_logo_custom_{start,end} and exposed at
> > /logo/barebox-logo-custom.<ext> in the running barebox.
> >
> > CONFIG_BAREBOX_LOGO_FILE_PATH selects the source PNG, relative to the
> > barebox srctree (default lib/logo/barebox-logo-custom.png). The
> > existing BAREBOX_LOGO_64..640 size options remain available, gated on
> > BAREBOX_LOGO_STOCK.
>
> CONFIG_BAREBOX_LOGO is solely about including the barebox logo.
>
> To include your custom PNG, just put it into your environment (e.g.
> /env/data), no need to patch barebox. You are not even limited to one
> logo in that case.
>
... *that* is indeed the better solution.
so please disregard this patch :-S
>
> Tangentially related, I am in favor of including vendor logos (e.g. in
> your case Leica's) into barebox for use with the vendor board support,
> but these should also be SVGs IMO.
>
they are SVGs, but (now would) live in the yocto/bitbake level, not the sources
directly - like the rest of the files going into the /env while we build barebox
gruß
Johannes
>
> > Upstream-Status: Pending
>
> Please drop this out-of-place tag.
>
> Cheers,
> Ahmad
>
> >
> > Assisted-by: Claude Opus 4.7 (1M context)
> > Signed-off-by: Johannes Schneider <johannes.schneider@leica-geosystems.com>
> > ---
> > lib/logo/Kconfig | 35 +++++++++++++++++++++++++++++++++++
> > lib/logo/Makefile | 19 +++++++++++++++++++
> > 2 files changed, 54 insertions(+)
> >
> > diff --git a/lib/logo/Kconfig b/lib/logo/Kconfig
> > index 7e5a6fcb63..ab64ce242d 100644
> > --- a/lib/logo/Kconfig
> > +++ b/lib/logo/Kconfig
> > @@ -35,6 +35,30 @@ config BAREBOX_LOGO_QOI
> >
> > endchoice
> >
> > +choice
> > + prompt "Logo source"
> > + default BAREBOX_LOGO_STOCK
> > + help
> > + Choose how the boot logo is produced.
> > +
> > +config BAREBOX_LOGO_STOCK
> > + bool "Stock barebox logo (rendered from SVG)"
> > + help
> > + Render Documentation/barebox.svg at build time into the sizes
> > + selected below. Requires ImageMagick's convert tool in the
> > + build environment.
> > +
> > +config BAREBOX_LOGO_FILE
> > + bool "Pre-rendered logo from file"
> > + help
> > + Use a pre-rendered PNG as the boot logo, taken verbatim with
> > + no build-time conversion. Suitable for vendor-branded boot
> > + splashes; no ImageMagick dependency.
> > +
> > +endchoice
> > +
> > +if BAREBOX_LOGO_STOCK
> > +
> > config BAREBOX_LOGO_64
> > bool "include 64x32 pixel logo"
> >
> > @@ -50,4 +74,15 @@ config BAREBOX_LOGO_400
> > config BAREBOX_LOGO_640
> > bool "include 640x320 pixel logo"
> >
> > +endif # BAREBOX_LOGO_STOCK
> > +
> > +config BAREBOX_LOGO_FILE_PATH
> > + string "Pre-rendered logo path (relative to srctree)"
> > + depends on BAREBOX_LOGO_FILE
> > + default "lib/logo/barebox-logo-custom.png"
> > + help
> > + Path to the pre-rendered PNG, relative to the barebox source
> > + tree. The file is included as-is; drop it at this location
> > + before invoking the build.
> > +
> > endif # BAREBOX_LOGO
> > diff --git a/lib/logo/Makefile b/lib/logo/Makefile
> > index 9792a4699f..7bd7fbb352 100644
> > --- a/lib/logo/Makefile
> > +++ b/lib/logo/Makefile
> > @@ -1,5 +1,6 @@
> > # SPDX-License-Identifier: GPL-2.0-only
> >
> > +ifdef CONFIG_BAREBOX_LOGO_STOCK
> > OPTS_barebox-logo-w64 = -resize 64
> > bblogo-$(CONFIG_BAREBOX_LOGO_64) += barebox-logo-w64
> >
> > @@ -14,6 +15,14 @@ bblogo-$(CONFIG_BAREBOX_LOGO_400) += barebox-logo-w400
> >
> > OPTS_barebox-logo-w640 = -resize 640
> > bblogo-$(CONFIG_BAREBOX_LOGO_640) += barebox-logo-w640
> > +endif
> > +
> > +ifdef CONFIG_BAREBOX_LOGO_FILE
> > +# Strip the Kconfig string's surrounding quotes.
> > +barebox-logo-file-path := $(patsubst "%",%,$(CONFIG_BAREBOX_LOGO_FILE_PATH))
> > +
> > +bblogo-y += barebox-logo-custom
> > +endif
> >
> > obj-y += $(patsubst %,%.bblogo.o,$(bblogo-y))
> > extra-y += $(patsubst %,%.bblogo,$(bblogo-y))
> > @@ -62,6 +71,7 @@ endif
> >
> > CONVERTOPTS += -background none
> >
> > +ifdef CONFIG_BAREBOX_LOGO_STOCK
> > quiet_cmd_bmp = BMP $@
> > cmd_bmp = convert $(OPTS_$(@F:.bmp=)) $(CONVERTOPTS) $< bmp:$@
> >
> > @@ -76,6 +86,15 @@ quiet_cmd_png = PNG $@
> >
> > %.png: $(srctree)/Documentation/barebox.svg FORCE
> > $(call if_changed,png)
> > +endif
> > +
> > +ifdef CONFIG_BAREBOX_LOGO_FILE
> > +quiet_cmd_logo_copy = COPY $@
> > + cmd_logo_copy = cp $< $@
> > +
> > +barebox-logo-custom.png: $(srctree)/$(barebox-logo-file-path) FORCE
> > + $(call if_changed,logo_copy)
> > +endif
> >
> > quiet_cmd_qoi = QOI $@
> > cmd_qoi = $(objtree)/scripts/qoiconv $< $@
> >
> > base-commit: 81fbe2e8d0d445032498a0bfecf9fd270f00985a
>
prev parent reply other threads:[~2026-06-05 5:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-02 6:08 Johannes Schneider
2026-06-02 7:00 ` Ahmad Fatoum
2026-06-05 5:46 ` SCHNEIDER Johannes [this message]
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=AM0PR06MB4148A7BB04949283840342DCBC112@AM0PR06MB4148.eurprd06.prod.outlook.com \
--to=johannes.schneider@leica-geosystems.com \
--cc=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=thomas.haemmerle@leica-geosystems.com \
/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