Skip to contentSkip to conversation

RFC: adding customizable linux logo

PATCH New Angelo Compagnucci 4 participants 5 messages Feb 2, 2016 – Jun 9, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 RFC: adding customizable linux logo

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

---

I often use the linux kernel logo as an early full screen bootsplash. For such a reason I wrote this patch and I'm looking for comments.

 linux/Config.ext.in              |  8 ++++++++
 linux/linux-ext-customlogo.mk    | 11 +++++++++++
 package/Config.in                |  1 +
 package/customlogo/Config.in     | 16 ++++++++++++++++
 package/customlogo/customlogo.mk | 15 +++++++++++++++
 5 files changed, 51 insertions(+)
 create mode 100644 linux/linux-ext-customlogo.mk
 create mode 100644 package/customlogo/Config.in
 create mode 100644 package/customlogo/customlogo.mk
linux/Config.ext.in +8 -0
index 755c23b..b752c9c 100644
@@ -1,5 +1,13 @@
 menu "Linux Kernel Extensions"
 
+# Custom logo
+config BR2_LINUX_KERNEL_EXT_CUSTOMLOGO
+	select BR2_PACKAGE_CUSTOMLOGO
+	bool "Custom logo"
+	help
+	  change linux boot logo with your own graphics. 
+	  Can be used as an early bootsplash.
+
 # Xenomai
 config BR2_LINUX_KERNEL_EXT_XENOMAI
 	bool "Adeos/Xenomai Real-time patch"
linux/linux-ext-customlogo.mk new file +11 -0
new file mode 100644
index 0000000..68c613a
@@ -0,0 +1,11 @@
+################################################################################
+#
+# Custom logo
+#
+################################################################################
+
+LINUX_EXTENSIONS += customlogo
+
+define CUSTOMLOGO_PREPARE_KERNEL
+	cp $(CUSTOMLOGO_DIR)/logo_linux_clut224.ppm $(LINUX_DIR)/drivers/video/logo/logo_linux_clut224.ppm
+endef
package/Config.in +1 -0
index 7ced9d4..1552f32 100644
@@ -214,6 +214,7 @@ comment "Sounds"
 
 comment "Themes"
 	source "package/gtk2-engines/Config.in"
+	source "package/customlogo/Config.in"
 
 endmenu
 
package/customlogo/Config.in new file +16 -0
new file mode 100644
index 0000000..f8502da
@@ -0,0 +1,16 @@
+config BR2_PACKAGE_CUSTOMLOGO
+	bool "Custom logo"
+	help
+	  Change linux boot logo with your own graphics. 
+	  Can be used as an early bootsplash.
+
+	  *REQUIRES* a pre installed imagemagick on the host system.
+
+if BR2_PACKAGE_CUSTOMLOGO
+
+config BR2_PACKAGE_CUSTOMLOGO_PATH
+	string "image file path"
+	help
+	  This image will be used as custom logo.
+
+endif
package/customlogo/customlogo.mk new file +15 -0
new file mode 100644
index 0000000..4f11522
@@ -0,0 +1,15 @@
+################################################################################
+#
+# customlogo
+#
+################################################################################
+
+CUSTOMLOGO_SOURCE =
+
+define CUSTOMLOGO_BUILD_CMDS
+	convert $(BR2_PACKAGE_CUSTOMLOGO_PATH) \
+		-dither None -colors 224 -compress none \
+		$(@D)/logo_linux_clut224.ppm
+endef
+
+$(eval $(generic-package))
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 RFC: adding customizable linux logo

Hello Angelo,

It's been a while since you sent this patch. I don't know if this feature is important enough to be integrated, but I'll do some review anyway.

linux/Config.ext.in line 5

Quoted 10 lines · Angelo Compagnucci
linux/Config.ext.in +3 -0
index 755c23b..b752c9c 100644
@@ -1,5 +1,13 @@
 menu "Linux Kernel Extensions"
 
+# Custom logo
+config BR2_LINUX_KERNEL_EXT_CUSTOMLOGO
+	select BR2_PACKAGE_CUSTOMLOGO

I think this customlogo package is not needed.

linux/Config.ext.in line 9

Quoted 4 lines
linux/Config.ext.in +4 -0
+	bool "Custom logo"
+	help
+	  change linux boot logo with your own graphics. 
+	  Can be used as an early bootsplash.

This help text needs to be improved a bit.

Quoted 10 lines
linux/Config.ext.in +1 -0
+
 # Xenomai
 config BR2_LINUX_KERNEL_EXT_XENOMAI
 	bool "Adeos/Xenomai Real-time patch"
linux/linux-ext-customlogo.mk new file +0 -0
new file mode 100644
index 0000000..68c613a

linux/linux-ext-customlogo.mk line 9

Quoted 9 lines
linux/linux-ext-customlogo.mk new file +9 -0
@@ -0,0 +1,11 @@
+################################################################################
+#
+# Custom logo
+#
+################################################################################
+
+LINUX_EXTENSIONS += customlogo
+
+define CUSTOMLOGO_PREPARE_KERNEL

You can do the conversion from the original image format to .ppm here directly, and therefore avoid the need for the customlogo package.

Quoted 20 lines
linux/linux-ext-customlogo.mk new file +2 -0
+	cp $(CUSTOMLOGO_DIR)/logo_linux_clut224.ppm $(LINUX_DIR)/drivers/video/logo/logo_linux_clut224.ppm
+endef
package/Config.in +1 -0
index 7ced9d4..1552f32 100644
@@ -214,6 +214,7 @@ comment "Sounds"
 
 comment "Themes"
 	source "package/gtk2-engines/Config.in"
+	source "package/customlogo/Config.in"
 
 endmenu
 
package/customlogo/Config.in new file +0 -0
new file mode 100644
index 0000000..f8502da

package/customlogo/Config.in line 7

Quoted 7 lines
package/customlogo/Config.in new file +7 -0
@@ -0,0 +1,16 @@
+config BR2_PACKAGE_CUSTOMLOGO
+	bool "Custom logo"
+	help
+	  Change linux boot logo with your own graphics. 
+	  Can be used as an early bootsplash.
+
+	  *REQUIRES* a pre installed imagemagick on the host system.

I don't think this is acceptable. You probably should add a host-imagemagick package, and make the linux package depend on it when a custom logo is selected.

In addition, when a custom logo is selected, you probably want to tweak the Linux kernel configuration to make sure it has the relevant options.

Thanks!

Thomas

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

PATCH 1/1 RFC: adding customizable linux logo

Angelo, Thomas, All,

On 2016-06-01 22:03 +0200, Thomas Petazzoni spake thusly:

Quoted 15 lines

Hello Angelo,

It's been a while since you sent this patch. I don't know if this feature is important enough to be integrated, but I'll do some review anyway.

Quoted 7 lines · Angelo Compagnucci
linux/Config.ext.in +0 -0
index 755c23b..b752c9c 100644
@@ -1,5 +1,13 @@
 menu "Linux Kernel Extensions"
 
Quoted 5 lines

linux/Config.ext.in line 5

Quoted 3 lines
linux/Config.ext.in +3 -0
+# Custom logo
+config BR2_LINUX_KERNEL_EXT_CUSTOMLOGO
+	select BR2_PACKAGE_CUSTOMLOGO

I think this customlogo package is not needed.

Agreed. Just make the logo path an option directly here:

config BR2_LINUX_KERNEL_EXT_CUSTOMLOGO
bool "Custom logo"

config BR2_LINUX_KERNEL_EXT_CUSTOMLOGO_DIR
bool "directory with logo file(s)"
help
Directory with all the logo files to copy. Logo files must be named:
logo_linux_mono.pbm for the B&W version
logo_linux_vga16.ppm for the 16-color version
logo_linux_clut224.ppm for the 224-color version

And then, in the .mk file (see below)...

Quoted 21 lines

linux/Config.ext.in line 9

Quoted 4 lines
linux/Config.ext.in +4 -0
+	bool "Custom logo"
+	help
+	  change linux boot logo with your own graphics. 
+	  Can be used as an early bootsplash.

This help text needs to be improved a bit.

Quoted 14 lines
linux/Config.ext.in +1 -0
+
 # Xenomai
 config BR2_LINUX_KERNEL_EXT_XENOMAI
 	bool "Adeos/Xenomai Real-time patch"
linux/linux-ext-customlogo.mk new file +4 -0
new file mode 100644
index 0000000..68c613a
@@ -0,0 +1,11 @@
+################################################################################
+#
+# Custom logo
+#
Quoted 8 lines

linux/linux-ext-customlogo.mk line 9

Quoted 5 lines
linux/linux-ext-customlogo.mk new file +5 -0
+################################################################################
+
+LINUX_EXTENSIONS += customlogo
+
+define CUSTOMLOGO_PREPARE_KERNEL

You can do the conversion from the original image format to .ppm here directly, and therefore avoid the need for the customlogo package.

Or better yet, expect the user to provide pre-rendered images to start with (see at the end)...

Quoted 1 line

linux/linux-ext-customlogo.mk line 10

Quoted 1 line
linux/linux-ext-customlogo.mk new file +1 -0
+	cp $(CUSTOMLOGO_DIR)/logo_linux_clut224.ppm $(LINUX_DIR)/drivers/video/logo/logo_linux_clut224.ppm

... and in the .mk file, just copy all logo files:

    cp $(BR2_LINUX_KERNEL_EXT_CUSTOMLOGO_DIR)/logo_linux_*.p{p,b}m \
       $(LINUX_DIR)/drivers/video/logo/
Quoted 22 lines
Quoted 22 lines
linux/linux-ext-customlogo.mk new file +1 -0
+endef
package/Config.in +1 -0
index 7ced9d4..1552f32 100644
@@ -214,6 +214,7 @@ comment "Sounds"
 
 comment "Themes"
 	source "package/gtk2-engines/Config.in"
+	source "package/customlogo/Config.in"
 
 endmenu
 
package/customlogo/Config.in new file +3 -0
new file mode 100644
index 0000000..f8502da
@@ -0,0 +1,16 @@
+config BR2_PACKAGE_CUSTOMLOGO
+	bool "Custom logo"
+	help
Quoted 8 lines

package/customlogo/Config.in line 7

Quoted 4 lines
package/customlogo/Config.in new file +4 -0
+	  Change linux boot logo with your own graphics. 
+	  Can be used as an early bootsplash.
+
+	  *REQUIRES* a pre installed imagemagick on the host system.

I don't think this is acceptable. You probably should add a host-imagemagick package, and make the linux package depend on it when a custom logo is selected.

I don't think that adding host-imagemagick just for this is sane. Let the user provide a ppm image.

Quoted 2 lines

In addition, when a custom logo is selected, you probably want to tweak the Linux kernel configuration to make sure it has the relevant options.

Tweak or check? Or do we care?

Regards,
Yann E. MORIN.

Quoted 11 lines

Thanks!

Thomas

Signature · 7 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#3 lore raw

PATCH 1/1 RFC: adding customizable linux logo

Yann, Thomas, All,

2016-06-03 0:05 GMT+02:00 Yann E. MORIN <[email protected]>:

Quoted 111 lines

Angelo, Thomas, All,

On 2016-06-01 22:03 +0200, Thomas Petazzoni spake thusly:

Quoted 15 lines

Hello Angelo,

It's been a while since you sent this patch. I don't know if this feature is important enough to be integrated, but I'll do some review anyway.

Quoted 7 lines · Angelo Compagnucci
linux/Config.ext.in +0 -0
index 755c23b..b752c9c 100644
@@ -1,5 +1,13 @@
 menu "Linux Kernel Extensions"
 
Quoted 5 lines

linux/Config.ext.in line 5

Quoted 3 lines
linux/Config.ext.in +3 -0
+# Custom logo
+config BR2_LINUX_KERNEL_EXT_CUSTOMLOGO
+   select BR2_PACKAGE_CUSTOMLOGO

I think this customlogo package is not needed.

Agreed. Just make the logo path an option directly here:

config BR2_LINUX_KERNEL_EXT_CUSTOMLOGO
bool "Custom logo"

config BR2_LINUX_KERNEL_EXT_CUSTOMLOGO_DIR
bool "directory with logo file(s)"
help
Directory with all the logo files to copy. Logo files must be named:
logo_linux_mono.pbm for the B&W version
logo_linux_vga16.ppm for the 16-color version
logo_linux_clut224.ppm for the 224-color version

And then, in the .mk file (see below)...

Quoted 21 lines

linux/Config.ext.in line 9

Quoted 4 lines
linux/Config.ext.in +4 -0
+   bool "Custom logo"
+   help
+     change linux boot logo with your own graphics.
+     Can be used as an early bootsplash.

This help text needs to be improved a bit.

Quoted 14 lines
linux/Config.ext.in +1 -0
+
 # Xenomai
 config BR2_LINUX_KERNEL_EXT_XENOMAI
    bool "Adeos/Xenomai Real-time patch"
linux/linux-ext-customlogo.mk new file +4 -0
new file mode 100644
index 0000000..68c613a
@@ -0,0 +1,11 @@
+################################################################################
+#
+# Custom logo
+#
Quoted 8 lines

linux/linux-ext-customlogo.mk line 9

Quoted 5 lines
linux/linux-ext-customlogo.mk new file +5 -0
+################################################################################
+
+LINUX_EXTENSIONS += customlogo
+
+define CUSTOMLOGO_PREPARE_KERNEL

You can do the conversion from the original image format to .ppm here directly, and therefore avoid the need for the customlogo package.

Or better yet, expect the user to provide pre-rendered images to start with (see at the end)...

Quoted 1 line

linux/linux-ext-customlogo.mk line 10

Quoted 1 line
linux/linux-ext-customlogo.mk new file +1 -0
+   cp $(CUSTOMLOGO_DIR)/logo_linux_clut224.ppm $(LINUX_DIR)/drivers/video/logo/logo_linux_clut224.ppm

... and in the .mk file, just copy all logo files:

    cp $(BR2_LINUX_KERNEL_EXT_CUSTOMLOGO_DIR)/logo_linux_*.p{p,b}m \
       $(LINUX_DIR)/drivers/video/logo/
Quoted 22 lines
Quoted 22 lines
linux/linux-ext-customlogo.mk new file +1 -0
+endef
package/Config.in +1 -0
index 7ced9d4..1552f32 100644
@@ -214,6 +214,7 @@ comment "Sounds"
 
 comment "Themes"
    source "package/gtk2-engines/Config.in"
+   source "package/customlogo/Config.in"
 
 endmenu
 
package/customlogo/Config.in new file +3 -0
new file mode 100644
index 0000000..f8502da
@@ -0,0 +1,16 @@
+config BR2_PACKAGE_CUSTOMLOGO
+   bool "Custom logo"
+   help
Quoted 8 lines

package/customlogo/Config.in line 7

Quoted 4 lines
package/customlogo/Config.in new file +4 -0
+     Change linux boot logo with your own graphics.
+     Can be used as an early bootsplash.
+
+     *REQUIRES* a pre installed imagemagick on the host system.

I don't think this is acceptable. You probably should add a host-imagemagick package, and make the linux package depend on it when a custom logo is selected.

Quoted 7 lines

I don't think that adding host-imagemagick just for this is sane. Let the user provide a ppm image.

Quoted 2 lines

In addition, when a custom logo is selected, you probably want to tweak the Linux kernel configuration to make sure it has the relevant options.

Tweak or check? Or do we care?

A little recap:

a) I should rework the custom logo package and logic, no problem here.
b) Relaying on user pre-installed imagemagick it's not allowed by buildroot policies but I don't want to build the complete host-imagemagick only for converting a ppm.
c) IMHO, the complex part here is to convert correctly an image to a kernel suitable ppm (not so trivial): let a user preparing his own ppm it's not advisable and prone to errors.

So if b) and c) are not acceptable for buildroot policies, please discard this patch.

Sincerely, Angelo

Quoted 23 lines

Regards,
Yann E. MORIN.

Quoted 11 lines

Thanks!

Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

--
.-----------------.--------------------.------------------.--------------------.

|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |

'------------------------------^-------^------------------^--------------------'

Signature · 1 line
Profile: http://it.linkedin.com/in/compagnucciangelo
#4 lore raw

PATCH 1/1 RFC: adding customizable linux logo

Angelo and all

Quoted 10 lines · Angelo Compagnucci

A little recap:

a) I should rework the custom logo package and logic, no problem here.
b) Relaying on user pre-installed imagemagick it's not allowed by buildroot policies but I don't want to build the complete host-imagemagick only for converting a ppm.
c) IMHO, the complex part here is to convert correctly an image to a kernel suitable ppm (not so trivial): let a user preparing his own ppm it's not advisable and prone to errors.

Quoted 2 lines

So if b) and c) are not acceptable for buildroot policies, please discard this patch.

I realize this is late feedback, but I actually found your patch useful, so I'd lobby to not abandon it.

In my use, I had to remove the imagemagick call since it wasn't right for my image (a pbm), but the rest was convenient. It beat what I previously was doing which was turning the pbm into a kernel patch.

Regards,
Frank