Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1038999
  • 博文数量: 836
  • 博客积分: 43880
  • 博客等级: 大将
  • 技术积分: 5485
  • 用 户 组: 普通用户
  • 注册时间: 2008-08-20 17:36
文章分类

全部博文(836)

文章存档

2011年(1)

2008年(835)

我的朋友

分类: LINUX

2008-08-20 18:26:17


Linux的各种发行版在启动时基本上都有两种模式:silentmode和verbosemode。verbose模式下会打印极为详尽的启动信息,比如挂载文件系统,加载光驱,激活网络服务等等,而silent模式则屏蔽掉这些信息。bootsplash工具可以将一张图片放在silent模式下的虚拟控制台上,从而使Linux用户看到一个全画面的启动过程。另外一个工具是gensplash,比bootsplash要稍微复杂一些,不过功能更为强大,设计也更为合理——它将一些非必要的元素从kernelspace挪出来,放在userspace来做。 网络上关于bootsplash(启动动画)的使用基本上是基于Linux的SuSe发行版进行讨论的——开发这组工具的作者说他们的工作平台是SuSe。gensplash则是基于Linux的Gentoo发行版进行讨论的。当然这些两组工具都可以通过适当的改动应用于Linux的其它发行版。 现在我们进入正题。网站上说,bootsplash的内核补丁针对2.4.18--2.4.22和2.6.0-test9,这个消息很旧了,可以到站点查看bootsplash所提供的各个版本的内核补丁,然后确定你所用的Linux内核版本,选择一个补丁下载。 我的内核是2.4.20-8,下载补丁bootsplash-3.0.7-2.4.20.vanilla.diff。补丁中的3.0.7是bootsplash工具的版本号,我们下载bootsplash-3.0.7.tar.bz2,再下载所要用的主题Theme-NewLinux.tar.bz2,关于材料的准备就完成了。这些都可以在上面的提及的网站上找到。如果你的内核没有相应补丁,那么可以选择一个版本的内核源代码,打上补丁后,编译一个新的内核。 如果没有编译过内核,可以到网上查找相关资料,对照着练习一下。当然,我们需要root的权限。 第一步修改/usr/include目录下的三个符号链接:asm,scsi,linux(mvasmasm.bak,mvscsiscsi.bak,mvlinuxlinux.bak),如果没有,则要新建。在编译内核时,用到这些链接所指向的一些头文件。我在/usr/src目录下建了一个名为linux的链接指向同一层的内核源代码目录linux-2.4.20-8(这样以后再编译不同版本内核时,只需修改/usr/src目录下的linux符号链接就可以了)。(命令ln-slinux-2.4.20-8linux),然后进入/usr/include目录,分别执行ln-s/usr/src/linux/include/asm-i386asm;ln-s/usr/src/linux/include/linuxlinux;ln-s/usr/src/linux/include/scsiscsi。 第二步打补丁,假设补丁在/usr/src/linux目录下(不在的话加上路径即可)。patch-p1   第三步设定核心:makemenuconfig。确定下列选项被编译进内核而不是被编译成模块。 对于2.4.x内核:
  
  Codematurityleveloptions --->
#  Promptfordevelopmentand/orincompletecode/drivers
  Processortypeandfeatures --->
  
#MTRR(MemoryTypeRangeRegister)support
  BlockDevices->
  
#Loopbackdevicesupport
  
#RAMdisksupport
  (4096)  DefaultRAMdisksize
  
#InitialRAMdisk(initrd)support
  ConsoleDrivers->
  
#VGAtextconsole
  
#Videomodeselectionsupport
  ConsoleDrivers->Frame-buffersupport->
  
#Supportforframebufferdevices
  
#VESAVGAgraphicsconsole
  
#Usesplashscreeninsteadofbootlogo
   对于2.6.x内核:
  Codematurityleveloptions --->
  
#Promptfordevelopmentand/orincompletecode/drivers
  Processortypeandfeatures --->
  
#MTRR(MemoryTypeRangeRegister)support
  DeviceDrivers --->
  Blockdevices --->
  <*>Loopbackdevicesupport
  <*>RAMdisksupport
  (4096)DefaultRAMdisksize
  
#  InitialRAMdisk(initrd)support
  Graphicssupport --->
  
#Supportforframebufferdevices
  
#  VESAVGAgraphicssupport
  Consoledisplaydriversupport --->
  
#  Videomodeselectionsupport
  <*>FramebufferConsolesupport
  Bootsplashconfiguration --->
  
#Bootupsplashscreen
   第四步
  
  a>  makemkproper清除旧的设定
  b>  makedep    产生依赖
  c>  makebzImage 编译内核
  d>  makemodulesmodules_install编译模块
  e>  cp/usr/src/linux/arch/i386/boot/bzImage/boot/bzImage-2.4.20
   第五步安装bootsplash的工具软件和主题图片
  
  #tarjxvf/patch/bootsplash-3.0.7.tar.bz2
  #tarjxvf/patch/Theme-NewLinux.tar.bz2
  #cdbootsplash-3.0.7/Utilities
  #makeall
  #cpfbmngplayfbresolutionfbtruetypesplash/sbin
  #cd../../
下面这几步必须要做,不然在用splash命令时就会出现类似下面的错误:splash:/etc/bootsplash/themes/Linux/images/silent-800x600.jpg不存在。这个其实是由于主题的配置文件中做了绝对路径设定。
  
  #mkdir/etc/bootsplash
  #mkdir/etc/bootsplash/themes
  #cp-aNewLinux/etc/bootsplash/themes/
   1 2 3 4 下一页>>


下载本文示例代码
阅读(762) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~