Skip to content

Commit dfa6ce6

Browse files
vincent-mailholhdeller
authored andcommitted
video/logo: allow custom logo
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>
1 parent a7aa2b5 commit dfa6ce6

2 files changed

Lines changed: 51 additions & 1 deletion

File tree

drivers/video/logo/Kconfig

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,55 @@ config LOGO_LINUX_MONO
2222
bool "Standard black and white Linux logo"
2323
default y
2424

25+
config LOGO_LINUX_MONO_FILE
26+
string "Monochrome logo .pbm file"
27+
depends on LOGO_LINUX_MONO
28+
default "drivers/video/logo/logo_linux_mono.pbm"
29+
help
30+
Takes a path to a monochromatic logo in the portable pixmap file
31+
format (.pbm). This defaults to the Tux penguin.
32+
33+
For example, the below ImageMagick command can be used to reduce
34+
an image to black and white and convert it into a pbm file:
35+
36+
magick source_image -compress none destination.pbm
37+
2538
config LOGO_LINUX_VGA16
2639
bool "Standard 16-color Linux logo"
2740
default y
2841

42+
config LOGO_LINUX_VGA16_FILE
43+
string "16-color logo .ppm file"
44+
depends on LOGO_LINUX_VGA16
45+
default "drivers/video/logo/logo_linux_vga16.ppm"
46+
help
47+
Takes a path to a logo in the portable pixmap file format (.ppm),
48+
using the 16 colors from the drivers/video/logo/clut_vga16.ppm
49+
palette. This defaults to the Tux penguin.
50+
51+
For example, the below ImageMagick command can be used to reduce an
52+
image to the VGA 16 colors palette and convert into a ppm file:
53+
54+
magick source_image -compress none \
55+
-remap drivers/video/logo/clut_vga16.ppm destination.ppm
56+
2957
config LOGO_LINUX_CLUT224
3058
bool "Standard 224-color Linux logo"
3159
default y
3260

61+
config LOGO_LINUX_CLUT224_FILE
62+
string "224-color logo .ppm file"
63+
depends on LOGO_LINUX_CLUT224
64+
default "drivers/video/logo/logo_linux_clut224.ppm"
65+
help
66+
Takes a path to a 224-color logo in the portable pixmap file
67+
format (.ppm). This defaults to the Tux penguin.
68+
69+
For example, the below ImageMagick command can be used to reduce
70+
an image palette to 224 colors and convert it into a ppm file:
71+
72+
magick source_image -compress none -colors 224 destination.ppm
73+
3374
config LOGO_DEC_CLUT224
3475
bool "224-color Digital Equipment Corporation Linux logo"
3576
depends on MACH_DECSTATION || ALPHA

drivers/video/logo/Makefile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,16 @@ hostprogs := pnmtologo
2222

2323
# Create commands like "pnmtologo -t mono -n logo_mac_mono -o ..."
2424
quiet_cmd_logo = LOGO $@
25-
cmd_logo = $(obj)/pnmtologo -t $2 -n $* -o $@ $<
25+
cmd_logo = $(obj)/pnmtologo -t $2 -n $(basename $(notdir $@)) -o $@ $<
26+
27+
$(obj)/logo_linux_mono.c: $(CONFIG_LOGO_LINUX_MONO_FILE) $(obj)/pnmtologo FORCE
28+
$(call if_changed,logo,mono)
29+
30+
$(obj)/logo_linux_vga16.c: $(CONFIG_LOGO_LINUX_VGA16_FILE) $(obj)/pnmtologo FORCE
31+
$(call if_changed,logo,vga16)
32+
33+
$(obj)/logo_linux_clut224.c: $(CONFIG_LOGO_LINUX_CLUT224_FILE) $(obj)/pnmtologo FORCE
34+
$(call if_changed,logo,clut224)
2635

2736
$(obj)/%.c: $(src)/%.pbm $(obj)/pnmtologo FORCE
2837
$(call if_changed,logo,mono)

0 commit comments

Comments
 (0)