Skip to content

bootlogo improvements: handling of background color

Mikhail Vanyulin requested to merge parse-logo-background into main

This MR is intended to address two remaining questions from SECO in JIRA issue dedicated to boologo improvements https://secogroup.atlassian.net/issues/YT-71:

Could you have a look if it is possible to get the background color from the png file and use that, if not specified?

Two cases are possible:

  • a PNG file contains an optional block which defines a background in RGB format. In this case we extract this color from this block and use it to generate background for logo.
  • a PNG file does not contain a block with background color, we use either a white or black color to generate background.

So, following low-level logic is implemented:

  • we analyze the output of pngtopam and make a decision which background color should be set depending on existence and content of block with background in RGB format;
  • if background block is found, we adjust vt.default_red, vt.default_grn, vt.default_blu and vt.color command line boot arguments to set a background color during boot.
  • if background block is not found, we set either black or white background by using a background kernel argument.

Could we reset the background color if the bootlogo removal code is called?

If bootlogo file is absent, all color adjustment in kernel cmdline are erased.

But there is a slight issue with this. Default cmdline is set in meta-seconorth-machine/recipes-bsp/bootscript recipe. And we will have to keep boot.cfg and this script in sync.

Ideally default value should be saved somewhere before boot.cfg is modified and restored to that saved value. But it will require some additional logic and cause some issues.

One of the default values is the background color. For now "-b --background" argument for prepare-logo.sh script (currently accepts only "black" - default value and "white") can be used to set which background will be used.

Edited by Mikhail Vanyulin

Merge request reports