Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1412576
  • 博文数量: 1334
  • 博客积分: 645
  • 博客等级: 上士
  • 技术积分: 5762
  • 用 户 组: 普通用户
  • 注册时间: 2012-07-25 16:56
文章分类

全部博文(1334)

文章存档

2014年(108)

2013年(1059)

2012年(169)

分类: LINUX

2013-08-30 17:48:11

系统:ubuntu10.10
硬件:s3c6410
 
ubuntu下转换PPM:
sudo get-apt install netpbm
 
:~# apt-get install netpbm
Reading package lists... Done
Building dependency tree      
Reading state information... Done
The following extra packages will be installed:
  libnetpbm10
The following NEW packages will be installed:
  libnetpbm10 netpbm
0 upgraded, 2 newly installed, 0 to remove and 272 not upgraded.
Need to get 1,281kB of archives.
After this operation, 4,932kB of additional disk space will be used.
Do you want to continue [Y/n]?
Get:1 maverick/main libnetpbm10 i386 2:10.0-12.2 [67.4kB]
Get:2 maverick/main netpbm i386 2:10.0-12.2 [1,213kB]                                                                  
Fetched 1,281kB in 55s (23.2kB/s)                                                                                                                           
Selecting previously deselected package libnetpbm10.
(Reading database ... 125683 files and directories currently installed.)
Unpacking libnetpbm10 (from .../libnetpbm10_2%3a10.0-12.2_i386.deb) ...
Selecting previously deselected package netpbm.
Unpacking netpbm (from .../netpbm_2%3a10.0-12.2_i386.deb) ...
Processing triggers for man-db ...
Setting up libnetpbm10 (2:10.0-12.2) ...
Setting up netpbm (2:10.0-12.2) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
 
# ls
linuxlogo.png 
# pngtopnm linuxlogo.png > linuxlogo.pnm
# ls
linuxlogo.png  linuxlogo.pnm 
# pnmquant 224 linuxlogo.pnm > linuxlogo224.pnm
pnmcolormap: making histogram...
pnmcolormap: too many colors!
pnmcolormap: scaling colors from maxval=255 to maxval=127 to improve clustering...
pnmcolormap: making histogram...
pnmcolormap: 22166 colors found
pnmcolormap: choosing 224 colors...
pnmremap: 224 colors found in colormap
# pnmtoplainpnm linuxlogo224.pnm > linuxlogo224.ppm
# ls
linuxlogo224.pnm  linuxlogo224.ppm  linuxlogo.png  linuxlogo.pnm 
这样就生成了logo图片。
最后的转换结果为ppm图片文件,可以拷贝此文件到内核源码树录linux-x-xx/drivers/video/logo/,实现基本logo显示功能。
如果想要单独显示,将现在生成的图片添加进内核,就需要修改linux-x-xx/drivers/vedio/logo下的Makefile和Kconfig文件将这个添加进去。
Makefie
obj-$(CONFIG_LOGO_LINUX_XX_CLUT224)     += logo_linux_xx_clut224.o
Kconfig
config LOGO_LINUX_XX_CLUT224
 bool "Standard xx 224-color Linux logo"
 depends on LOGO
 default y
这样就添加进内核的make menuconfig选项了。
现在还需要修改linux-x-xx/drivers/vedio/logo/下的logo.c文件,将信息添加进去。
extern const struct linux_logo logo_linux_xx_clut224;
......
#ifdef CONFIG_LOGO_LINUX_XX_CLUT224
  logo = &logo_linux_xx_clut224;
#endif
然后执行重新make内核,make之前需要执行make clean或者是指定clean(make clean SUB_DIR=./drivers/video/logo/)目录。
阅读(959) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~