[v4,2/4] linux: add custom linux logo

Message ID 1535118300-26815-2-git-send-email-angelo@amarulasolutions.com
State Accepted
Commit 551e48a812c3bd3bc287e164391d8caad3697ca7
Headers show
Series
  • Untitled series #62343
Related show

Commit Message

Angelo Compagnucci Aug. 24, 2018, 1:44 p.m.
From: Angelo Compagnucci <angelo.compagnucci@gmail.com>

This patch adds a simple way to change the linux bootup logo.
The patch was kept purposely simple to support only the use cause
where a user needs a color linux boot up logo.

Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>
---
 linux/Config.in | 10 ++++++++++
 linux/linux.mk  | 15 +++++++++++++++
 2 files changed, 25 insertions(+)

Comments

Yann E. MORIN Aug. 24, 2018, 9:19 p.m. | #1
Angelo, All,

On 2018-08-24 15:44 +0200, Angelo Compagnucci spake thusly:
> From: Angelo Compagnucci <angelo.compagnucci@gmail.com>
> 
> This patch adds a simple way to change the linux bootup logo.
> The patch was kept purposely simple to support only the use cause
> where a user needs a color linux boot up logo.
> 
> Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>

Snce you applied the changes I suggested, you could have carried over
my:

Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

Regards,
Yann E. MORIN.

> ---
>  linux/Config.in | 10 ++++++++++
>  linux/linux.mk  | 15 +++++++++++++++
>  2 files changed, 25 insertions(+)
> 
> diff --git a/linux/Config.in b/linux/Config.in
> index b7bee99..9a410b1 100644
> --- a/linux/Config.in
> +++ b/linux/Config.in
> @@ -188,6 +188,16 @@ config BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES
>  	  A space-separated list of kernel configuration fragment files,
>  	  that will be merged to the main kernel configuration file.
>  
> +config BR2_LINUX_KERNEL_CUSTOM_LOGO_PATH
> +	string "Custom logo file path"
> +	help
> +	  Change the linux boot logo with your own graphics,
> +	  it can be used as an early bootsplash, framebuffer support
> +	  should be enabled to have this feature working.
> +	  Custom logo should be in png or jpg, it will be
> +	  converted to the linux kernel format (224 colors only)
> +	  and copied over the original logo file.
> +
>  #
>  # Binary format
>  #
> diff --git a/linux/linux.mk b/linux/linux.mk
> index 675e790..e38c7de 100644
> --- a/linux/linux.mk
> +++ b/linux/linux.mk
> @@ -248,6 +248,18 @@ define LINUX_TRY_PATCH_TIMECONST
>  endef
>  LINUX_POST_PATCH_HOOKS += LINUX_TRY_PATCH_TIMECONST
>  
> +LINUX_KERNEL_CUSTOM_LOGO_PATH = $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_LOGO_PATH))
> +ifneq ($(LINUX_KERNEL_CUSTOM_LOGO_PATH),)
> +LINUX_DEPENDENCIES += host-imagemagick
> +LINUX_KERNEL_CUSTOM_LOGO = y
> +define LINUX_KERNEL_CUSTOM_LOGO_CONVERT
> +	$(HOST_DIR)/usr/bin/convert $(LINUX_KERNEL_CUSTOM_LOGO_PATH) \
> +		-dither None -colors 224 -compress none \
> +		$(LINUX_DIR)/drivers/video/logo/logo_linux_clut224.ppm
> +endef
> +LINUX_PRE_BUILD_HOOKS += LINUX_KERNEL_CUSTOM_LOGO_CONVERT
> +endif
> +
>  ifeq ($(BR2_LINUX_KERNEL_USE_DEFCONFIG),y)
>  LINUX_KCONFIG_DEFCONFIG = $(call qstrip,$(BR2_LINUX_KERNEL_DEFCONFIG))_defconfig
>  else ifeq ($(BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG),y)
> @@ -349,6 +361,9 @@ define LINUX_KCONFIG_FIXUP_CMDS
>  		$(call KCONFIG_ENABLE_OPT,CONFIG_ARM_APPENDED_DTB,$(@D)/.config))
>  	$(if $(BR2_PACKAGE_KERNEL_MODULE_IMX_GPU_VIV),
>  		$(call KCONFIG_DISABLE_OPT,CONFIG_MXC_GPU_VIV,$(@D)/.config))
> +	$(if $(LINUX_KERNEL_CUSTOM_LOGO),
> +		$(call KCONFIG_ENABLE_OPT,CONFIG_LOGO,$(@D)/.config)
> +		$(call KCONFIG_ENABLE_OPT,CONFIG_LOGO_LINUX_CLUT224,$(@D)/.config))
>  endef
>  
>  ifeq ($(BR2_LINUX_KERNEL_DTS_SUPPORT),y)
> -- 
> 2.7.4
> 
> _______________________________________________
> buildroot mailing list
> buildroot@busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
Peter Korsgaard Oct. 21, 2018, 4:15 p.m. | #2
>>>>> "Angelo" == Angelo Compagnucci <angelo@amarulasolutions.com> writes:

 > From: Angelo Compagnucci <angelo.compagnucci@gmail.com>
 > This patch adds a simple way to change the linux bootup logo.
 > The patch was kept purposely simple to support only the use cause
 > where a user needs a color linux boot up logo.

 > Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>
 > ---
 >  linux/Config.in | 10 ++++++++++
 >  linux/linux.mk  | 15 +++++++++++++++
 >  2 files changed, 25 insertions(+)

 > diff --git a/linux/Config.in b/linux/Config.in
 > index b7bee99..9a410b1 100644
 > --- a/linux/Config.in
 > +++ b/linux/Config.in
 > @@ -188,6 +188,16 @@ config BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES
 >  	  A space-separated list of kernel configuration fragment files,
 >  	  that will be merged to the main kernel configuration file.
 
 > +config BR2_LINUX_KERNEL_CUSTOM_LOGO_PATH
 > +	string "Custom logo file path"

It is IMHO not directly clear what this logo is about, so I've changed
it to:

Custom boot logo file path

> +	help
 > +	  Change the linux boot logo with your own graphics,
 > +	  it can be used as an early bootsplash, framebuffer support
 > +	  should be enabled to have this feature working.

Instead of describing that framebuffer support should be enabled, we
should just enable it.

This help text is IMHO not so clear. I've rewored it to:

          Use a custom Linux framebuffer boot logo.
          Custom logo should be in PNG or JPEG format, it will be


> +	  Custom logo should be in png or jpg, it will be
 > +	  converted to the linux kernel format (224 colors only)
 > +	  and copied over the original logo file.
 > +
 >  #
 >  # Binary format
 >  #
 > diff --git a/linux/linux.mk b/linux/linux.mk
 > index 675e790..e38c7de 100644
 > --- a/linux/linux.mk
 > +++ b/linux/linux.mk
 > @@ -248,6 +248,18 @@ define LINUX_TRY_PATCH_TIMECONST
 >  endef
 >  LINUX_POST_PATCH_HOOKS += LINUX_TRY_PATCH_TIMECONST
 
 > +LINUX_KERNEL_CUSTOM_LOGO_PATH = $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_LOGO_PATH))
 > +ifneq ($(LINUX_KERNEL_CUSTOM_LOGO_PATH),)
 > +LINUX_DEPENDENCIES += host-imagemagick
 > +LINUX_KERNEL_CUSTOM_LOGO = y

This variable isn't really needed as the $(if logic can just use
LINUX_KERNEL_CUSTOM_LOGO_PATH directly.

> +define LINUX_KERNEL_CUSTOM_LOGO_CONVERT
 > +	$(HOST_DIR)/usr/bin/convert $(LINUX_KERNEL_CUSTOM_LOGO_PATH) \

convert gets installed in $(HOST_DIR)/bin, so we should use that.

 > +	$(if $(LINUX_KERNEL_CUSTOM_LOGO),
 > +		$(call KCONFIG_ENABLE_OPT,CONFIG_LOGO,$(@D)/.config)
 > +		$(call KCONFIG_ENABLE_OPT,CONFIG_LOGO_LINUX_CLUT224,$(@D)/.config))

We should also enable CONFIG_FB.

Committed with these changes, thanks.

Patch

diff --git a/linux/Config.in b/linux/Config.in
index b7bee99..9a410b1 100644
--- a/linux/Config.in
+++ b/linux/Config.in
@@ -188,6 +188,16 @@  config BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES
 	  A space-separated list of kernel configuration fragment files,
 	  that will be merged to the main kernel configuration file.
 
+config BR2_LINUX_KERNEL_CUSTOM_LOGO_PATH
+	string "Custom logo file path"
+	help
+	  Change the linux boot logo with your own graphics,
+	  it can be used as an early bootsplash, framebuffer support
+	  should be enabled to have this feature working.
+	  Custom logo should be in png or jpg, it will be
+	  converted to the linux kernel format (224 colors only)
+	  and copied over the original logo file.
+
 #
 # Binary format
 #
diff --git a/linux/linux.mk b/linux/linux.mk
index 675e790..e38c7de 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -248,6 +248,18 @@  define LINUX_TRY_PATCH_TIMECONST
 endef
 LINUX_POST_PATCH_HOOKS += LINUX_TRY_PATCH_TIMECONST
 
+LINUX_KERNEL_CUSTOM_LOGO_PATH = $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_LOGO_PATH))
+ifneq ($(LINUX_KERNEL_CUSTOM_LOGO_PATH),)
+LINUX_DEPENDENCIES += host-imagemagick
+LINUX_KERNEL_CUSTOM_LOGO = y
+define LINUX_KERNEL_CUSTOM_LOGO_CONVERT
+	$(HOST_DIR)/usr/bin/convert $(LINUX_KERNEL_CUSTOM_LOGO_PATH) \
+		-dither None -colors 224 -compress none \
+		$(LINUX_DIR)/drivers/video/logo/logo_linux_clut224.ppm
+endef
+LINUX_PRE_BUILD_HOOKS += LINUX_KERNEL_CUSTOM_LOGO_CONVERT
+endif
+
 ifeq ($(BR2_LINUX_KERNEL_USE_DEFCONFIG),y)
 LINUX_KCONFIG_DEFCONFIG = $(call qstrip,$(BR2_LINUX_KERNEL_DEFCONFIG))_defconfig
 else ifeq ($(BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG),y)
@@ -349,6 +361,9 @@  define LINUX_KCONFIG_FIXUP_CMDS
 		$(call KCONFIG_ENABLE_OPT,CONFIG_ARM_APPENDED_DTB,$(@D)/.config))
 	$(if $(BR2_PACKAGE_KERNEL_MODULE_IMX_GPU_VIV),
 		$(call KCONFIG_DISABLE_OPT,CONFIG_MXC_GPU_VIV,$(@D)/.config))
+	$(if $(LINUX_KERNEL_CUSTOM_LOGO),
+		$(call KCONFIG_ENABLE_OPT,CONFIG_LOGO,$(@D)/.config)
+		$(call KCONFIG_ENABLE_OPT,CONFIG_LOGO_LINUX_CLUT224,$(@D)/.config))
 endef
 
 ifeq ($(BR2_LINUX_KERNEL_DTS_SUPPORT),y)