]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
video/logo: allow custom logo
authorVincent Mailhol <mailhol@kernel.org>
Thu, 8 Jan 2026 19:04:51 +0000 (20:04 +0100)
committerHelge Deller <deller@gmx.de>
Sat, 14 Feb 2026 10:09:46 +0000 (11:09 +0100)
Some people like to replace the default Tux boot logo by an image of
their own. There exist a few tutorials here [1] and there [2]. But
this requires modifying the source tree which is a bit cumbersome.

Add a string entry in Kbuild for each of the logo categories
(monochrome, 16-colors, 224-colors). The string entry takes a path to
a .pbm or .ppm image allowing the user to more easily provide a custom
logo without having to modify the sources.

Add an help entry with a short hint on how to convert images to the
portable pixmap file format.

Update the Makefile accordingly. When converted to .c file, the logo
will have one of these fixed file name:

  - logo_linux_mono.c
  - logo_linux_vga16.c
  - logo_linux_clut224.c:

depending on the image type and this regardless of the name of the
.pgm/.ppm source filename. This will allow for further simplifications
in an upcoming change.

[1] ArmadeuS Project wiki -- Linux Boot Logo
Link: https://www.armadeus.org/wiki/index.php?title=Linux_Boot_Logo
[2] Timesys -- How To Use a Custom Boot Logo / Splash Screen
Link: https://linuxlink.timesys.com/docs/wiki/engineering/HOWTO_Use_a_custom_boot_logo
Signed-off-by: Vincent Mailhol <mailhol@kernel.org>
Signed-off-by: Helge Deller <deller@gmx.de>
drivers/video/logo/Kconfig
drivers/video/logo/Makefile

index ce6bb753522d215d738b9477dd10759b0e2b9f0a..1d1651c067a198da1c834891e8fbdf240d852dae 100644 (file)
@@ -22,14 +22,55 @@ config LOGO_LINUX_MONO
        bool "Standard black and white Linux logo"
        default y
 
+config LOGO_LINUX_MONO_FILE
+       string "Monochrome logo .pbm file"
+       depends on LOGO_LINUX_MONO
+       default "drivers/video/logo/logo_linux_mono.pbm"
+       help
+         Takes a path to a monochromatic logo in the portable pixmap file
+         format (.pbm). This defaults to the Tux penguin.
+
+         For example, the below ImageMagick command can be used to reduce
+         an image to black and white and convert it into a pbm file:
+
+           magick source_image -compress none destination.pbm
+
 config LOGO_LINUX_VGA16
        bool "Standard 16-color Linux logo"
        default y
 
+config LOGO_LINUX_VGA16_FILE
+       string "16-color logo .ppm file"
+       depends on LOGO_LINUX_VGA16
+       default "drivers/video/logo/logo_linux_vga16.ppm"
+       help
+         Takes a path to a logo in the portable pixmap file format (.ppm),
+         using the 16 colors from the drivers/video/logo/clut_vga16.ppm
+         palette. This defaults to the Tux penguin.
+
+         For example, the below ImageMagick command can be used to reduce an
+         image to the VGA 16 colors palette and convert into a ppm file:
+
+           magick source_image -compress none \
+             -remap drivers/video/logo/clut_vga16.ppm destination.ppm
+
 config LOGO_LINUX_CLUT224
        bool "Standard 224-color Linux logo"
        default y
 
+config LOGO_LINUX_CLUT224_FILE
+       string "224-color logo .ppm file"
+       depends on LOGO_LINUX_CLUT224
+       default "drivers/video/logo/logo_linux_clut224.ppm"
+       help
+         Takes a path to a 224-color logo in the portable pixmap file
+         format (.ppm). This defaults to the Tux penguin.
+
+         For example, the below ImageMagick command can be used to reduce
+         an image palette to 224 colors and convert it into a ppm file:
+
+           magick source_image -compress none -colors 224 destination.ppm
+
 config LOGO_DEC_CLUT224
        bool "224-color Digital Equipment Corporation Linux logo"
        depends on MACH_DECSTATION || ALPHA
index 3f249e9dcf37a75cbdf5a051b7841629afcca5fc..ac8e9da3f51a480677e2ae4180d06d9268a5d037 100644 (file)
@@ -22,7 +22,16 @@ hostprogs := pnmtologo
 
 # Create commands like "pnmtologo -t mono -n logo_mac_mono -o ..."
 quiet_cmd_logo = LOGO    $@
-      cmd_logo = $(obj)/pnmtologo -t $2 -n $* -o $@ $<
+      cmd_logo = $(obj)/pnmtologo -t $2 -n $(basename $(notdir $@)) -o $@ $<
+
+$(obj)/logo_linux_mono.c: $(CONFIG_LOGO_LINUX_MONO_FILE) $(obj)/pnmtologo FORCE
+       $(call if_changed,logo,mono)
+
+$(obj)/logo_linux_vga16.c: $(CONFIG_LOGO_LINUX_VGA16_FILE) $(obj)/pnmtologo FORCE
+       $(call if_changed,logo,vga16)
+
+$(obj)/logo_linux_clut224.c: $(CONFIG_LOGO_LINUX_CLUT224_FILE) $(obj)/pnmtologo FORCE
+       $(call if_changed,logo,clut224)
 
 $(obj)/%.c: $(src)/%.pbm $(obj)/pnmtologo FORCE
        $(call if_changed,logo,mono)