Skip to contentSkip to conversation

linux: Adding customizable linux logo

PATCH New Angelo Compagnucci 3 participants 4 messages Dec 6, 2016 – Dec 11, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux: Adding customizable linux logo

This patch adds a custom linux logo to the generated kernel image.

---
 linux/Config.ext.in           | 26 ++++++++++++++++++++++++++
 linux/linux-ext-customlogo.mk | 19 +++++++++++++++++++
 2 files changed, 45 insertions(+)
 create mode 100644 linux/linux-ext-customlogo.mk
linux/Config.ext.in +26 -0
index 011dffb..da63109 100644
@@ -1,5 +1,31 @@
 menu "Linux Kernel Extensions"
 
+# Custom logo
+config BR2_LINUX_KERNEL_EXT_CUSTOMLOGO
+	bool "Custom logo"
+	select BR2_PACKAGE_CUSTOMLOGO
+	help
+	  Change linux boot logo with your own graphics. 
+	  Can be used as an early bootsplash.
+	  The file should be in kernel ppm format if the
+	  option BR2_PACKAGE_CUSTOMLOGO_CONVERT is not
+	  selected.
+
+config BR2_PACKAGE_CUSTOMLOGO_PATH
+	string "Image file path"
+	depends on BR2_LINUX_KERNEL_EXT_CUSTOMLOGO
+	help
+	  This image will be used as custom logo.
+
+config BR2_PACKAGE_CUSTOMLOGO_CONVERT
+	bool "Convert custom logo to kernel format"
+	depends on BR2_LINUX_KERNEL_EXT_CUSTOMLOGO
+	help
+	  If checked, the convert command will be run on the source
+	  image file to obtain a kernel compatible ppm image file.
+	  *REQUIRES* a pre installed imagemagick on the host system
+	  to convert the image.
+
 #-------------------------------------------------------------------------------
 # Xenomai
 config BR2_LINUX_KERNEL_EXT_XENOMAI
linux/linux-ext-customlogo.mk new file +19 -0
new file mode 100644
index 0000000..99e3ab1
@@ -0,0 +1,19 @@
+################################################################################
+#
+# Custom logo
+#
+################################################################################
+
+LINUX_EXTENSIONS += customlogo
+
+ifeq ($(BR2_PACKAGE_CUSTOMLOGO_CONVERT),)
+define CUSTOMLOGO_PREPARE_KERNEL
+	cp $(BR2_PACKAGE_CUSTOMLOGO_PATH) $(LINUX_DIR)/drivers/video/logo/logo_linux_clut224.ppm
+endef
+else
+define CUSTOMLOGO_PREPARE_KERNEL
+	convert $(BR2_PACKAGE_CUSTOMLOGO_PATH) \
+			-dither None -colors 224 -compress none \
+			$(LINUX_DIR)/drivers/video/logo/logo_linux_clut224.ppm
+endef
+endif
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/1 linux: Adding customizable linux logo

Quoted 16 lines · Angelo Compagnucci

This patch adds a custom linux logo to the generated kernel image.

---
 linux/Config.ext.in           | 26 ++++++++++++++++++++++++++
 linux/linux-ext-customlogo.mk | 19 +++++++++++++++++++
 2 files changed, 45 insertions(+)
 create mode 100644 linux/linux-ext-customlogo.mk
linux/Config.ext.in +0 -0
index 011dffb..da63109 100644
@@ -1,5 +1,31 @@
 menu "Linux Kernel Extensions"
 

linux/Config.ext.in line 12

Quoted 10 lines
linux/Config.ext.in +10 -0
+# Custom logo
+config BR2_LINUX_KERNEL_EXT_CUSTOMLOGO
+	bool "Custom logo"
+	select BR2_PACKAGE_CUSTOMLOGO
+	help
+	  Change linux boot logo with your own graphics. 
+	  Can be used as an early bootsplash.
+	  The file should be in kernel ppm format if the
+	  option BR2_PACKAGE_CUSTOMLOGO_CONVERT is not
+	  selected.

You should wrap at 72 colums (where tab counts as 8, so 62 effective characters).

linux/Config.ext.in line 20

Quoted 8 lines
linux/Config.ext.in +8 -0
+
+config BR2_PACKAGE_CUSTOMLOGO_PATH
+	string "Image file path"
+	depends on BR2_LINUX_KERNEL_EXT_CUSTOMLOGO
+	help
+	  This image will be used as custom logo.
+
+config BR2_PACKAGE_CUSTOMLOGO_CONVERT

The feedback in your RFC patch was to remove the convert option.

Regards,
Arnout

Quoted 37 lines
linux/Config.ext.in +8 -0
+	bool "Convert custom logo to kernel format"
+	depends on BR2_LINUX_KERNEL_EXT_CUSTOMLOGO
+	help
+	  If checked, the convert command will be run on the source
+	  image file to obtain a kernel compatible ppm image file.
+	  *REQUIRES* a pre installed imagemagick on the host system
+	  to convert the image.
+
 #-------------------------------------------------------------------------------
 # Xenomai
 config BR2_LINUX_KERNEL_EXT_XENOMAI
linux/linux-ext-customlogo.mk new file +19 -0
new file mode 100644
index 0000000..99e3ab1
@@ -0,0 +1,19 @@
+################################################################################
+#
+# Custom logo
+#
+################################################################################
+
+LINUX_EXTENSIONS += customlogo
+
+ifeq ($(BR2_PACKAGE_CUSTOMLOGO_CONVERT),)
+define CUSTOMLOGO_PREPARE_KERNEL
+	cp $(BR2_PACKAGE_CUSTOMLOGO_PATH) $(LINUX_DIR)/drivers/video/logo/logo_linux_clut224.ppm
+endef
+else
+define CUSTOMLOGO_PREPARE_KERNEL
+	convert $(BR2_PACKAGE_CUSTOMLOGO_PATH) \
+			-dither None -colors 224 -compress none \
+			$(LINUX_DIR)/drivers/video/logo/logo_linux_clut224.ppm
+endef
+endif
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#2 lore raw

PATCH 1/1 linux: Adding customizable linux logo

Dear Arnout Vandecappelle,

2016-12-07 0:51 GMT+01:00 Arnout Vandecappelle <[email protected]>:

Quoted 19 lines · Angelo Compagnucci
Quoted 16 lines

This patch adds a custom linux logo to the generated kernel image.

---
 linux/Config.ext.in           | 26 ++++++++++++++++++++++++++
 linux/linux-ext-customlogo.mk | 19 +++++++++++++++++++
 2 files changed, 45 insertions(+)
 create mode 100644 linux/linux-ext-customlogo.mk
linux/Config.ext.in +0 -0
index 011dffb..da63109 100644
@@ -1,5 +1,31 @@
 menu "Linux Kernel Extensions"
 
Quoted 14 lines

linux/Config.ext.in line 12

Quoted 10 lines
linux/Config.ext.in +10 -0
+# Custom logo
+config BR2_LINUX_KERNEL_EXT_CUSTOMLOGO
+     bool "Custom logo"
+     select BR2_PACKAGE_CUSTOMLOGO
+     help
+       Change linux boot logo with your own graphics.
+       Can be used as an early bootsplash.
+       The file should be in kernel ppm format if the
+       option BR2_PACKAGE_CUSTOMLOGO_CONVERT is not
+       selected.

You should wrap at 72 colums (where tab counts as 8, so 62 effective
characters).

Ok!

Quoted 12 lines

linux/Config.ext.in line 20

Quoted 9 lines
linux/Config.ext.in +8 -0
+
+config BR2_PACKAGE_CUSTOMLOGO_PATH
+     string "Image file path"
+     depends on BR2_LINUX_KERNEL_EXT_CUSTOMLOGO
+     help
+       This image will be used as custom logo.
+
+config BR2_PACKAGE_CUSTOMLOGO_CONVERT

The feedback in your RFC patch was to remove the convert option.

Yes I know. Let me explain my point of view. There are a tons of way a buildroot power user can overwrite the linux boot logo, but my intent here is not to present something complex to the average user.
This option would cover a simple use case of a user which wants to have a custom boot logo without too much of a hassle, something like the ethernet boot options does. It not covers all the corner cases, only a basic and useful one.

The complex part here is to obtain the ppm file in a correct format and guessing the correct combo of options requires a bit of trial and error. If it's not feasible to run a pre-installed executable on the host system, I will add a dependency on imagemagick, but I think it's a bit overkill to compile all that stuff only to convert an image for a bunch of milliseconds.

Sincerely, Angelo

Quoted 57 lines

Regards,
Arnout

linux/Config.ext.in

Quoted 9 lines
linux/Config.ext.in +8 -0
+     bool "Convert custom logo to kernel format"
+     depends on BR2_LINUX_KERNEL_EXT_CUSTOMLOGO
+     help
+       If checked, the convert command will be run on the source
+       image file to obtain a kernel compatible ppm image file.
+       *REQUIRES* a pre installed imagemagick on the host system
+       to convert the image.
+
 #-----------------------------------------------------------

--------------------

linux/linux-ext-customlogo.

Quoted 3 lines
linux/Config.ext.in +0 -0
 # Xenomai
 config BR2_LINUX_KERNEL_EXT_XENOMAI
linux/linux-ext-customlogo. renamed from linux/linux-ext-customlogo.mk +0 -0

mk

linux/linux-ext-customlogo.mk line 1

Quoted 6 lines

new file mode 100644
index 0000000..99e3ab1

linux/linux-ext-customlogo.mk new file +1 -0
@@ -0,0 +1,19 @@
+###########################################################

#####################

linux/linux-ext-customlogo.mk

Quoted 4 lines
linux/linux-ext-customlogo.mk new file +4 -0
+#
+# Custom logo
+#
+###########################################################

#####################

linux/linux-ext-customlogo.mk

Quoted 6 lines
linux/linux-ext-customlogo.mk new file +6 -0
+
+LINUX_EXTENSIONS += customlogo
+
+ifeq ($(BR2_PACKAGE_CUSTOMLOGO_CONVERT),)
+define CUSTOMLOGO_PREPARE_KERNEL
+     cp $(BR2_PACKAGE_CUSTOMLOGO_PATH) $(LINUX_DIR)/drivers/video/

logo/logo_linux_clut224.ppm

linux/linux-ext-customlogo.mk

Quoted 6 lines
linux/linux-ext-customlogo.mk new file +6 -0
+endef
+else
+define CUSTOMLOGO_PREPARE_KERNEL
+     convert $(BR2_PACKAGE_CUSTOMLOGO_PATH) \
+                     -dither None -colors 224 -compress none \
+                     $(LINUX_DIR)/drivers/video/

logo/logo_linux_clut224.ppm

linux/linux-ext-customlogo.mk line 19

Quoted 3 lines
linux/linux-ext-customlogo.mk new file +2 -0
+endef
+endif

--

Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
Signature · 4 lines
Profile: http://it.linkedin.com/in/compagnucciangelo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20161207/6721e1d4/attachment-0001.html>
#3 lore raw

PATCH 1/1 linux: Adding customizable linux logo

In reply to Angelo Compagnucci

Hello,

Quoted 14 lines · Angelo Compagnucci

This patch adds a custom linux logo to the generated kernel image.

---
 linux/Config.ext.in           | 26 ++++++++++++++++++++++++++
 linux/linux-ext-customlogo.mk | 19 +++++++++++++++++++
 2 files changed, 45 insertions(+)
 create mode 100644 linux/linux-ext-customlogo.mk
linux/Config.ext.in +0 -0
index 011dffb..da63109 100644

linux/Config.ext.in line 1

Quoted 1 line
linux/Config.ext.in +0 -0
@@ -1,5 +1,31 @@
 menu "Linux Kernel Extensions"

Why is this implemented as a Linux extension? There's no reason for that, it could just be an option of the Linux package itself.

Quoted 10 lines
linux/Config.ext.in +10 -0
+# Custom logo
+config BR2_LINUX_KERNEL_EXT_CUSTOMLOGO
+	bool "Custom logo"
+	select BR2_PACKAGE_CUSTOMLOGO
+	help
+	  Change linux boot logo with your own graphics. 
+	  Can be used as an early bootsplash.
+	  The file should be in kernel ppm format if the
+	  option BR2_PACKAGE_CUSTOMLOGO_CONVERT is not
+	  selected.

linux/Config.ext.in line 22

Quoted 10 lines
linux/Config.ext.in +10 -0
+
+config BR2_PACKAGE_CUSTOMLOGO_PATH
+	string "Image file path"
+	depends on BR2_LINUX_KERNEL_EXT_CUSTOMLOGO
+	help
+	  This image will be used as custom logo.
+
+config BR2_PACKAGE_CUSTOMLOGO_CONVERT
+	bool "Convert custom logo to kernel format"
+	depends on BR2_LINUX_KERNEL_EXT_CUSTOMLOGO

Why do we have this sub-option? Makes more sense to just run "convert" unconditionally. Of course, as Arnout said, this will require add host-imagemagick in the dependencies of the linux package.

linux/Config.ext.in line 24

Quoted 3 lines
linux/Config.ext.in +3 -0
+ifeq ($(BR2_PACKAGE_CUSTOMLOGO_CONVERT),)
+define CUSTOMLOGO_PREPARE_KERNEL
+	cp $(BR2_PACKAGE_CUSTOMLOGO_PATH) $(LINUX_DIR)/drivers/video/logo/logo_linux_clut224.ppm

But there's a more fundamental problem to this: you're simply generating logo_linux_clut224.ppm, but what tells you that the kernel is going to use this specific file?

Depending on whether the screen supports 1-bit, 4-bit or 8-bit pixel depth, and depending on the kernel configuration in drivers/video/logo/, it's not necessarily logo_linux_clut224.ppm that will be used.

I think if we want to do this, we want to:

- Enable CONFIG_LOGO_LINUX_MONO, CONFIG_LOGO_LINUX_VGA16 and CONFIG_LOGO_LINUX_CLUT224

- Install logo_linux_clut224.ppm, logo_linux_mono.pbm and logo_linux_vga16.ppm.

However, this means the user can no longer disable CONFIG_LOGO_LINUX_VGA16 and/or CONFIG_LOGO_LINUX_MONO if he only uses CONFIG_LOGO_LINUX_CLUT224.

Overall, I think the benefit is really not worth the complexity.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com