QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 4074|回复: 3

Bootsplash学习

[复制链接]
发表于 2005-1-23 16:14:25 | 显示全部楼层 |阅读模式
刚在gentoo上完成,写了心得大家看看
网上有好多这文章,但我只有用我自己的这种才搞定

http://ice.stwan.com/do/blogview.asp?logID=94
发表于 2005-3-3 23:15:17 | 显示全部楼层
帮作者转贴一下.. :D

安装完Gentoo后,觉得启动的时候如果像live-cd一样的图形化的话,那不错。于是上网学习,
最终完成了fbsplash.现在对学习过的东西及自已在安装过程中的经验进行整理。

环境:
Linux Do 2.6.10-gentoo-r4 #25 Device Drivers -> Graphics support -> Console display Drivers support ->
i686 Mobile Intel(R) Pentium(R) 4 - M CPU 2.00GHz GenuineIntel GNU/Linux
显示卡: ATI 7500 mobile

过程:
1、内核版本2.6.10-gentoo-r4
2、从http://dhruba.codewordt.co.uk/patches/patch-2.6.X-bootsplash.bz2下载针对2.6内核的bootsplash的补丁
3、解压补丁
    bunzip2 patch-2.6.X-bootsplash.bz2
4、为内核打补丁
    patch -p1 <patch-2.6.X-bootsplash/root
因为文些patch不是为2.6.10所做,所有会出现一些问题,不过我没理它,为了减少一点错误,
        我将patch中的2.6.0-test9都替换成2.6.10-gentoo-r4(也不知道有没有用)

[code:1]sed -i -e '1,$s/2.6.0-test9/2.6.10-gentoo-r4/g' patch-2.6.X-bootsplash[/code:1]

    如果真有问题,大家就看看patch文件,一个个的改一下吧   :(
   

5、配置内核
[code:1]
#  Code maturity level options  ---> Prompt for development and/or incomplete code/drivers
    Processor type and features  --->
#  MTRR (Memory Type Range Register) support
    Device Drivers -> Block Devices ->
#  Loopback device support
        Device Drivers -> Block Devices ->
#  RAM disk support   
    Device Drivers -> Block Devices ->
#  Initial RAM disk (initrd) support
    Device Drivers -> Graphics support ->
#  Support for frame buffer devices
    Device Drivers -> Graphics support ->
#  VESA VGA graphics console
#

    Device Drivers -> Graphics support -> VESA driver type(vesafb)
    Device Drivers -> Graphics support -> Console display Drivers support ->
#  VGA text console
    Device Drivers -> Graphics support -> Console display Drivers support ->
#  Video mode selection support
    Device Drivers -> Graphics support -> Console display Drivers support ->
#  Framebuffer Console support
    Device Drivers -> Graphics support -> Console display Drivers support ->
#  Select compiled-in fonts
    Device Drivers -> Graphics support ->
# Support for the framebuffer splash
     

     
[/color]
    7) Why do I get wrong colors when using the native atyfb/aty128fb driver (and maybe others)?

        The ATI kernel framebuffer drivers don't use true color for 16/24/32bit resolutions per default but
         rather some index/true color mix.There's a patch to change this behaviour is avaliable for the ATI Rage128
         driver at ftp.openbios.org/pub/bootsplash/kernel/aty128-bootsplash.diff
[/code:1]   
Note:
        Logo configuration可以要,也可以不要,不要效果更好:) 虽然我的显示卡是ATI的,而且在kernel配置中,你可以看到
        ATI Radeon display support,但是请您不要将这两个选项打进内核,如果你这样子做,那么内核启动时,将会使用radeonfb,而不是
    vesafb。
        当使用radeonfb时,2.6.10-gentoo-r4没有补丁.



6、编译、安装
       make ; make modules_install
       cp arch/i386/boot/bzlinux /boot/kernel-2.6.10-gentoo-r4
       cp System.map /boot/System-2.6.10-gentoo-r4.map
       unlink System.map
       link -s /boot/System-2.6.10-gentoo-r4.map System.map

7、安装splashutils
    # emerge splashutils
    我利用bootsplash的时候,没有成功,在bootsplash中,好像不存在/sbin/splash_helper,但是在
    /usr/src/linux/Document/fb/splash.txt中有下面的两段内容:
[code:1]
To get fb splash up-and-running you will have to:
     1) get a copy of splashutils from (FIXME URL)
     2) get some splash themes (FIXME URL)
     3) build the kernel helper program
     4) build your kernel with the FB_SPLASH option enabled.
   

The userspace helper
    --------------------
   
    The userspace splash helper (by default: /sbin/splash_helper) is called by the
    kernel whenever an important event occurs and the kernel needs some kind of*
    You need to have a working framebuffer device with 16bit colordepth,
    preferably vesafb (i.e. vga=0x317 for 1024x768)

* You need a bootsplash theme. Get one here or make one yourself.

* You need the splash utility,
    job to be carried out. Important events include console switches and graphic
    mode switches (the kernel requests background images and config for the current
    console). The splash helper must be accessible at all times. If it's not,
    fbsplash will be switched off automatically.
    [/code:1]

所以,我认为没有/sbin/splash_helper时,bootsplash应该是不能成功的。而在bootsplash中,没有这个。

8、 创建initrd.img
    在这儿initrd.img不是用mkinitrd进行创建的,而是利用splashutils所带的splash_geninitramfs来创建。
    # splash_geninitramfs -v -g /boot/initrd.img -r 1280x1024 emergence
    我用bootsplash时,
    用

[code:1]/sbin/splash -s -f /etc/bootsplash/themes/yourtheme/config/bootsplash-1024x768.cfg >> /boot/initrd.splash[/code:1]
创建的initrd总是有错,至今不清楚原因,还有就是mkinitrd创建的initrd.img也不能引导(有它时会panic,没它就可以引导)


9、配置grub
    # cd /boot/grub
    # vi /boot/grub
    [code:1] title GUN/Linux[Splash-vesafb]
    root (hd0,5)
    kernel /vmlinuz ro video=vesafb:ywrap,pmipal,accel,mtrr,1280x1024-32@60 vga=794 splash=silent,theme:emergence
    initrd /initrd.img
    [/code:1]
顺便说一句,vga=xxx的写法是不被radeon所接受的,可以从kernel的document中找到如下内容
[code:1] You should compile in both vgacon (for text mode) and vesafb (for graphics mode).
    Which of them takes over the console depends on whenever the specified mode is
    text or graphics.
   
    The graphic modes are NOT in the list which you get if you boot with vga=ask
    and hit return. The mode you wish to use is derived from the VESA mode number.
    Here are those VESA mode numbers:
   
        | 640x480  800x600  1024x768 1280x1024
    ----+-------------------------------------
    256 |  0x101    0x103    0x105    0x107
    32k |  0x110    0x113    0x116    0x119
    64k |  0x111    0x114    0x117    0x11A
    16M |  0x112    0x115    0x118    0x11B

    The video mode number of the Linux kernel is the VESA mode number plus 0x200.
   
     Linux_kernel_mode_number = VESA_mode_number + 0x200
   
    So the table for the Kernel mode numbers are:
   
        | 640x480  800x600  1024x768 1280x1024
    ----+-------------------------------------
    256 |  0x301    0x303    0x305    0x307
    32k |  0x310    0x313    0x316    0x319
    64k |  0x311    0x314    0x317    0x31A
    16M |  0x312    0x315    0x318    0x31B

    或者可以使用下面的对应表(十进制)
      Colours   640x480 800x600 1024x768 1280x1024 1600x1200
      --------+---------------------------------------------
      256     |   769     771      773      775       796
      32,768  |   784     787      790      793       797
      65,536  |   785     788      791      794       798
      16.8M   |   786     789      792      795       799
    [/code:1]
可以在kernel的Documents/fb/vesafb.txt里面看到video后面可以跟哪些参数,
    当然这些参数与内核中的项是一一对应的,你没有打到内核中的使用参数也没用


10、将splash加入到default中
       rc-update add splash default
11、bootsplash的启动过程分析
    1)、内核支持(patching and compiling the kernel)
    2)、图片准备(通过initram来传递)

    3)、工具支持splash[code:1]# attach pictures to an initrd.
    # attach a jpg picture including the bootsplash config header to an initrd with:
    splash -s -f \ /etc/bootsplash/themes/current/config/bootsplash-1024x768.cfg \ >> /boot/initrd
    You can add several pictures like this, if you intend to boot your machine with several resolutions.
   
    # use a new picture on the fly
   
    # show a new bootsplash graphics on the fly on the first console by using
    splash -s -u 0 \ /etc/bootsplash/themes/current/config/bootsplash-1024x768.cfg
    any other console can be used by specifying -u [console number]
     where the console number starts at 0 (i.e. by default you have 0-5)
   
    # trigger events during bootup[/code:1]

参考及引用文档:
    http://www.bootsplash.org/kernel.html
    http://www.bootsplash.org/user.html
    http://www.bootsplash.org/faq.html
    http://linuxsir.zahui.net/html/25/138789.htm
回复

使用道具 举报

发表于 2006-1-8 20:51:04 | 显示全部楼层
我用bootsplash时,

代码:
/sbin/splash -s -f /etc/bootsplash/themes/yourtheme/config/bootsplash-1024x768.cfg >> /boot/initrd.splash

创建的initrd总是有错,至今不清楚原因,还有就是mkinitrd创建的initrd.img也不能引导(有它时会panic,没它就可以引导)


这应该是 追加已有 的initrd上,不能直接生成新文件.如果本来没有/boot/initrd.splash的话,肯定失败.
cp /boot/initrd.2.6.x /boot/initrd.splash
/sbin/splash -s -f /etc/bootsplash/themes/yourtheme/config/bootsplash-1024x768.cfg >> /boot/initrd.splash
回复

使用道具 举报

发表于 2006-10-15 22:37:01 | 显示全部楼层
Code maturity level options  --->
  • Prompt for development and/or incomplete code/drivers
                  Processor type and features  --->
  • MTRR (Memory Type Range Register) support
                  Device Drivers  --->
                             Block devices  --->
                             <*> Loopback device support
                             <*> RAM disk support
                             (4096) Default RAM disk size
                            
  •    Initial RAM disk (initrd) support
                  Graphics support  --->
  • Support for frame buffer devices
                                        
  •    VESA VGA graphics support
                  Console display driver support  --->
  •    Video mode selection support
                                                      <*> Framebuffer Console support
                  Bootsplash configuration  --->
  • Bootup splash screen
  • 回复

    使用道具 举报

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

    本版积分规则

    GMT+8, 2024-11-2 04:32 , Processed in 0.039072 second(s), 15 queries .

    © 2021 Powered by Discuz! X3.5.

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