内核启动logo(我用的是2.6.12)

创建logo图片: 1、内核默认的logo图片为drivers/video/logo/logo_linux_clut224.ppm file logo_linux_clut224.ppm 先得到图片的大小,然后再用gimp等工具创建一个同样大小的png图片 2、把自己创建的png图片转换为只有224色的ppm图片 pngtopnm logo.png | ppmquant -fs 224 | pnmtoplainpnm > logo_linux_clut224.ppm 如果没有以上的转换命令请安装netpbm工具包 3、覆盖原来的logo_linux_clut224.ppm文件,若有logo_linux_clut224.o和logo_linux_clut224.c文件则删除 内核配置: Device Drivers -> Graphics Support -> [*] Support for frame buffer devices [*] VESA VGA graphics support Console display driver support -> [*] Video mode selection support [*] Framebuffer Console support [*]Select compiled-in fonts [*]VGA 8x16 font Logo configuration-> [*]Bootup logo [*] Standard 224-color Linux logo 重新编译内核 logo居中: 1、设置logo图片在屏幕中的位置 vi drivers/video/fbmem.c 找到"fb_show_logo_line"函数,把 image.dx = 0; image.dy = y; 改为 image.dx = (info->var.xres/2) - (610/2); image.dy = (info->var.yres/2) - (206/2); [注: info->var.xres和info->var.yres是分辨率大小 610和206是logo图片的大小 2、 vi drivers/video/console/fbcon.c 找到"fbcon_prepare_logo"函数,在 logo_height = fb_prepare_logo(info, ops->rotate); 后面加上 logo_height += (info->var.yres/2) - (206/2); 添加新图片: 在Makefile中有这么一句:extra-y += $(call logo-cfiles,_clut224,ppm) 它的意思是在当前找到以"_clut224"结尾的ppm图片,然后根据它生成.c文件,所以添加新的图片名可以 类似这样:logo_linux_sullg_clut224.ppm 1.Makefile,加入一行 obj-$(CONFIG_LOGO_LINUX_SULLG_CLUT224) += logo_linux_sullg_clut224.o 2.Kconfig,加入 config LOGO_LINUX_SULLG_CLUT224 bool "Standard 224-color Linux logo for sullg" default y 3.logo.c,加入 extern const struct linux_logo logo_linux_sullg_clut224; 在"fb_find_logo"中找到"#ifdef CONFIG_LOGO_LINUX_CLUT224",在其后加入: #ifdef CONFIG_LOGO_LINUX_SULLG_CLUT224 logo = &logo_linux_sullg_clut224; #endif 3. logo全屏 搞定了 在配置的时候 在Console drivers --->Frame-buffer support --->把 Select compiled-in fonts 去掉 就能成功的做全屏的logo了 呵呵 ,这个自己也还没实现过,只是按上面得方法做了居中的处理。 转自:http://blog.sina.com.cn/s/blog_62335a1f0100gzad.html 按上面那篇文字,我的logo有了个轮廓,但是,没能成功显示图片,另外参看了一篇文字,就ok了: It is a common fashion for most newer Linux distributions to show the familiar penguin logo at boot time. You know it, the herring-stuffed penguin in the upper-left of a boot screen. If you ever wanted to get rid of it, here is how to do it. [edit]Procedure 1. Make sure that you have the kernel sources installed. As annoying as this may seem, you will need to recompile the kernel to change this image. 2. Download fblogo, either from http://freakzone.net/gordon/#fblogo or from your distribution's package repository. It is a quite common tool so it should be available as a package. 3. Create or otherwise obtain the image, but be warned that there are some constraints: no more than 224 colors, and 80x80px size so that you do not disturb the messages shown by your distro at boot time. You need not be too restrictive when creating the image: we will use another tool to convert it so that it meets the color-related prerequisites. 4. Save the image as png, and run the following: pngtopnm logo.png | ppmquant -fs223| pnmtoplainpnm > logo_linux_clut224.ppm cp logo_linux_clut224.ppm /usr/src/linux/drivers/video/logo/5. Now configure your kernel, making sure that the following options are enabled (they can be found under the Device Drivers, Graphics Support subsection): Support for frame buffer devices VESA VGA graphics support Video mode selection support Framebuffer Console support Select compiled-in fonts VGA 8x16 font Bootup logo Standard 224-color Linux logo 6. Change your bootloader to use the new kernel. Make sure you also add a VGA argument to it, so that it boots into a graphic mode. For example: kernel (hd0,0)/vmlinuz root=/dev/hda1 vga=0x318

你可能感兴趣的:(linux,image,constraints,makefile,fonts,colors)