LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 3807|回复: 1

bootsplash for slackware kernel-2.6.12!

[复制链接]
发表于 2005-8-2 12:44:33 | 显示全部楼层 |阅读模式
放假前整理的,现在贴出来供大家参考,现在自己编译的内核启动速度非常快,不到30秒!
原文:http://zhy2fly.lysafe.com/blogview.asp?logID=166

用了三天时间,终于搞定slackware的bootsplash,其实应该很简单,但是开始走了不少弯路,前两天都是参考其它版本的Linux的bootsplash制作,感觉suse和gentoo的用的比较多,而slackware的介绍就不多,在Linuxsir搜索恢复正常后,终于在slackware版搜索到两篇很有参考价值的关于bootsplash for slk的制作。参考文章url如下:
Slackware 10.0 Bootsplash How-to---zhanggy_zju@linuxsir.cn
bootsplash for kernel 2.6.5 (success! 全过程)---dreamrise@linuxsir.cn

下面介绍下我自己的bootsplash-for-slk-2.6.12步骤:
1.下载所需文件
内核源代码:linux-2.6.12.tar.bz2
针对linux-2.6.12内核的bootsplash补丁:bootsplash-3.1.6-2.6.12.diff
制作bootsplash的相关工具(for slackware):bootsplash-3.1-i486-1.tgz

2.编译内核并打上bootsplash补丁

  1. #cp linux-2.6.12.tar.bz2 bootsplash-3.1.6-2.6.12.diff /usr/src
  2. 删除旧的linux链接
  3. #rm linux
  4. 新建linux链接
  5. #ln -sf linux-2.6.12 linux
复制代码

  1. #cd linux
  2. 打上补丁
  3. #patch -p1 < ../bootsplash-3.1.6-2.6.12.diff
  4. 编译新的内核
  5. #make menuconfig
复制代码

下面是必选项,其余需要根据自己情况选择!

  1. Code maturity level options  --->[*] Prompt for development and/or incomplete code/drivers
  2.               Processor type and features  --->[*] MTRR (Memory Type Range Register) support
  3.               Device Drivers  --->
  4.                          Block devices  --->
  5.                          <*> Loopback device support
  6.                          <*> RAM disk support
  7.                          (4096) Default RAM disk size
  8.                          [*]   Initial RAM disk (initrd) support
  9.               Graphics support  --->[*] Support for frame buffer devices
  10.                                     [*]   VESA VGA graphics support
  11.               Console display driver support  --->[*]   Video mode selection support
  12.                                                   <*> Framebuffer Console support
  13.               Bootsplash configuration  --->[*] Bootup splash screen
复制代码

  1. #make
  2. #make modules_install
  3. #cp arch/i386/boot/bzImage /boot/kernel-2.6.7
  4. #cp System.map /boot/System.map-2.6.7
  5. #cp .config /boot/config-2.6.7
  6. 除非你改过Makefile,去掉#export INSTALL_PATH=/boot这行的#
  7. 否则在slackware中不要用#make install来安装内核。
复制代码


如果是2.4.xx的内核,则下面是必选项,其余需要根据自己情况选择!

  1. Code maturity level options  --->[*] Prompt for development and/or incomplete code/drivers
  2.            Processor type and features  --->[*] MTRR (Memory Type Range Register) support
  3.            Block Devices ->[*] Loopback device support
  4.                            [*] RAM disk support
  5.                           (4096)   Default RAM disk size
  6.                            [*] Initial RAM disk (iPOST http://www.linuxsir.cn/bbs/editpost.php HTTP/1.s/editpost.php[/url] HTTP/1.] VGA text console
  7.                            [*] Video mode selection support
  8.            Console Drivers -> Frame-buffer support ->[*] Support for frame buffer devices
  9.                                                      [*] VESA VGA graphics console
  10.                                                      [*] Use splash screen instead of boot logo
复制代码

  1. #make dep
  2. #make clean
  3. #make bzImage
  4. #make modules
  5. #make modules_install
  6. #cp arch/i386/boot/bzImage /boot/kernel-2.4.26
  7. #cp System.map /boot/System.map-2.4.26
  8. #cp .config /boot/config-2.4.26
复制代码


3.使用bootsplash工具
安装bootsplash-3.1-i486-1.tgz

  1. #installpkg bootsplash-3.1-i486-1.tgz
复制代码

安装后在/etc/rc.d/下就多了rc.bootsplash和rc.splash两个启动脚本。
修改rc.splash,让6个tty都有漂亮的背景。

  1. ......
  2. # start_console : first fb console to display bootsplash
  3. # console numeber is zero based!
  4. # start_console = 0 Ctrl+Alt+F1
  5. start_console=0
  6. # end_console : last fb console to display bootsplash
  7. # end_console = 5 Ctrl+Alt+F6
  8. end_console=5
  9. ......
复制代码

根据rc.splash的开始的注释部分修改/etc/rc.d/rc.local,添加下面这段使每一个终端都有背景。

  1. if [ -x /etc/rc.d/rc.splash ]; then
  2.        . /etc/rc.d/rc.splash
  3. fi
复制代码


检查/etc/bootsplash/themes目录,选个自己喜欢的主题链接到current。

用splash命令制作initrd-1024*768

  1. #/sbin/splash -s -f /etc/bootsplash/themes/current/config/bootsplash-1024x768.cfg > /boot/initrd-1024x768
复制代码


4.修改/etc/lilo.conf

  1. # LILO configuration file
  2. # generated by 'liloconfig'
  3. #
  4. # Start LILO global section
  5. boot = /dev/hda
  6. message = /boot/boot_message.txt
  7. prompt
  8. timeout = 600
  9. # Override dangerous defaults that rewrite the partition table:
  10. change-rules
  11.   reset
  12. # VESA framebuffer console @ 800x600x256
  13. #vga = 773
  14. # Normal VGA console
  15. # vga = normal
  16. # VESA framebuffer console @ 1024x768x64k
  17. vga=791
  18. # VESA framebuffer console @ 1024x768x32k
  19. # vga=790
  20. # VESA framebuffer console @ 1024x768x256
  21. # vga=773
  22. # VESA framebuffer console @ 800x600x64k
  23. # vga=788
  24. # VESA framebuffer console @ 800x600x32k
  25. # vga=787
  26. # VESA framebuffer console @ 800x600x256
  27. # vga=771
  28. # VESA framebuffer console @ 640x480x64k
  29. # vga=785
  30. # VESA framebuffer console @ 640x480x32k
  31. # vga=784
  32. # VESA framebuffer console @ 640x480x256
  33. # vga=769
  34. # End LILO global section
  35. # Windows bootable partition config begins
  36. #other = /dev/hda1
  37. #  label = Windows
  38. #  table = /dev/hda
  39. # Windows bootable partition config ends
  40. # Linux bootable partition config begins
  41. image = /boot/vmlinuz
  42.   root = /dev/hda3
  43.   label = Linux
  44.   read-only

  45. image = /boot/kernel-2.6.12
  46. root = /dev/hda3
  47. label = SLK2612
  48. read-only
  49. append = " video = vesafb : ywrap, mtrr "
  50. initrd = /boot/initrd-1024*768
  51. # Linux bootable partition config ends
  52. # Windows bootable partition config begins
  53. other = /dev/hda1
  54.   label = Windows
  55.   table = /dev/hda
  56. # Windows bootable partition config ends
复制代码


执行lilo
  1. #lilo
复制代码


5.重启,enjoy!

NOTICE:
1.开机后发现没有开启硬盘dma,因此修改/etc/rc.d/rc.local,添加:
  1. # open harddisk dma
  2. # for testing to use the following command:
  3. # #hdparm -Tt /dev/hda
  4. # ATA33 : -X66
  5. # ATA66 : -X68
  6. # ATA100: -X69
  7. # ATA133: -X70
  8. /usr/sbin/hdparm -d1 -X70 -c3 -m16 /dev/hda
复制代码


2.多个控制台ttyN多个背景
Post by Debentoo [email
Gao@Linuxsir.org[/email]]
OK, 如果你想在 tty1 下使用背景时就可以运行
代码:
# splash -s -u 1 /usr/share/splash/bootsplash.cfg

-u 后面就是控制台号码,如果你想在第 100 个控制台下使用背景当然也可以用 -u 100 icon_razz.gif

ft... 这样每次开机都要一个一个设置太累了,让它在每次启动后自动在每个控制台上加上背景 icon_wink.gif
代码:
# cd /usr/share/splash
# for i in tty2 tty3 tty4 tty5 tty6; do mkdir $i ; cp boot* $i ; done
# echo '/bin/splash -s -u 1 /usr/share/splash/tty2/bootsplash.cfg' >> /etc/conf.d/local.start
# echo '/bin/splash -s -u 2 /usr/share/splash/tty3/bootsplash.cfg' >> /etc/conf.d/local.start
# echo '/bin/splash -s -u 3 /usr/share/splash/tty4/bootsplash.cfg' >> /etc/conf.d/local.start
# echo '/bin/splash -s -u 4 /usr/share/splash/tty5/bootsplash.cfg' >> /etc/conf.d/local.start
# echo '/bin/splash -s -u 5 /usr/share/splash/tty6/bootsplash.cfg' >> /etc/conf.d/local.start

这样一来你可以在 /usr/share/splash/tty? 下放入不同的 jpg 图片,就可以让每个控制台显示不同的背景画面了,hoho ^_^

OK, 完成,重新启动吧

引用地址:http://www.linuxsir.cn/forum.php?mod=viewthread&tid=22104
Post by tram@Linuxsir.org

splash -n -s -u 1 /etc/bootsplash/themes/{任何主题}/config/bootsplash-1024x768.cfg
如果要把背景去掉:
splash -n -s -u 1


3.重要参考:
http://www.linuxsir.cn/bbs/showthread.php?t=83174
进度条、动画效果、关机画面、定做自己的主题等技巧!

注意
首先,第一次编译时没有选择NTFS(File System)支持,所以重启后windows下的ntfs盘不能识别。

其次,第二次编译时没有选择正确的chipset型号,出现

  1. ......
  2. warning: The dma on your hard drive is turned off
  3. ......
复制代码

重新编译,在
Device Drivers--->ATA/ATAPI/MFM/RLL Support-->
下,选择对应IDE Chipset,输入lspci查看自己的型号
  1. [zhyfly]@[zhy2fly][~](0)$lspci
  2. 00:00.0 Host bridge: VIA Technologies, Inc. VT8601 [Apollo ProMedia] (rev 05)
  3. 00:01.0 PCI bridge: VIA Technologies, Inc. VT8601 [Apollo ProMedia AGP]
  4. 00:07.0 ISA bridge: VIA Technologies, Inc. VT82C686 [Apollo Super South] (rev 40)
  5. 00:07.1 IDE interface: VIA Technologies, Inc. VT82C586A/B/VT82C686/A/B/VT823x/A/C/VT8235 PIPC Bus Master IDE (rev 06)
  6. 00:07.2 USB Controller: VIA Technologies, Inc. VT6202 [USB 2.0 controller] (rev 1a)
  7. 00:07.4 Bridge: VIA Technologies, Inc. VT82C686 [Apollo Super ACPI] (rev 40)
  8. 00:08.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)
  9. 01:00.0 VGA compatible controller: Trident Microsystems CyberBlade/i1 (rev 6a)
  10. [zhyfly]@[zhy2fly][~](0)$
复制代码

以上也可以通过修改/usr/src/linux/.config后(把对应项改为y),再make oldconfig实现。
发表于 2005-8-5 08:55:04 | 显示全部楼层
good!

详尽无比,内容精要、有序。

兄弟辛苦了。。

北南 呈上
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表