LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
楼主: Debentoo Gao

给字符控制台加上背景图片 【转贴自LinuxFans.org Kuye兄著】

[复制链接]
发表于 2004-6-23 09:18:53 | 显示全部楼层
是不是内核的问题???
发表于 2004-6-23 10:01:35 | 显示全部楼层
最初由 一郎 发表
是不是内核的问题???

#emerge bootsplash
发表于 2004-6-23 10:03:33 | 显示全部楼层
最初由 zhanggy_zju 发表
#emerge bootsplash


这是做什么啊?能否详细的介绍一下啊
发表于 2004-6-23 10:08:29 | 显示全部楼层
最初由 一郎 发表
这是做什么啊?能否详细的介绍一下啊

你要看这篇:
http://forums.gentoo.org/viewtopic.php?t=49036
发表于 2004-6-23 10:08:50 | 显示全部楼层
对了,还有,我在make menuconfig时
在Console Drives -> Frame-buffer support ->
没有 Use splash screen instead of boot logo这个选项。
发表于 2004-6-23 14:00:21 | 显示全部楼层
我emerge bootsplash完后,就出现了Use splash screen instead of boot logo

我再研究一下。

谢谢
发表于 2004-6-23 14:03:57 | 显示全部楼层

我来帮大家贴一下

The Gentoo Framebuffer, Bootsplash & Grubsplash How-To
(now updated for 2.6.x kernel tree)


Latest Screenshot

Self Portrait  (Kernel 2.6.4)

Patches

Here are bootsplash patches for all available kernel versions.


Objectives
  • High resolution framebuffer (example)
  • High resolution bootsplash image (example)
  • Smaller fonts on framebuffer for greater area (example)
  • Greater choice of fonts for varied appearance
  • Personalising your bootsplash theme (example)
  • Taking screenshots of your framebuffer and bootsplash
  • Using multimedia apps and graphical browser on framebuffer
  • Personalising your grub splash screen image
  • Extending framebuffer and bootsplash to all 12 virtual terminals


Benefits
  • Higher resolution
  • Configurable and pretty appearance
  • Multimedia and graphical browser capability on VTs
  • Framebuffer will work on any kernel version

Drawbacks
  • Slow scrolling of text output on VTs
  • Reduced or zero scroll back buffer

High resolution framebuffer & bootsplash!
  • Update portage tree.
    1. emerge sync
    复制代码

  • Emerge media-gfx/bootsplash (graphical backgrounds for frame buffer consoles).
    1. emerge bootsplash
    复制代码

    Overwrite your old bootsplash configuration files.
    1. etc-update
    复制代码

  • Check that the symbolic link /usr/src/linux is pointing to the kernel of your choice.
    1. ls -l /usr/src/
    复制代码

    Some kernels such as gentoo-sources, gaming-sources and xfs-sources already have the bootsplash patch built in. Check whether your kernel supplies bootsplash and if it does not have it then patch the kernel as below.
    1. ebuild /var/db/pkg/media-gfx/bootsplash-0.6-r2/bootsplash-0.6-r9.ebuild config
    复制代码


    Or you can run the following command which takes an additional argument and executes the line above.
    1. bootsplash_patch
    复制代码

  • Enter the kernel configuration.

    1. cd /usr/src/linux
    2. make menuconfig
    复制代码


    For all kernel trees build these options directly into your kernel. Do NOT make them modules and do not enable nvidia or ATi specific options.

    For 2.6.x kernel tree enable the following options.

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



    For 2.4.x kernel tree enable the following options.
    1. Code maturity level options  --->
    2.     \[*\] Prompt for development and/or incomplete code/drivers
    3. Processor type and features  --->
    4.     \[*\] MTRR (Memory Type Range Register) support
    5. Block Devices ->
    6.     \[*\] Loopback device support
    7.     \[*\] RAM disk support
    8.     (4096)   Default RAM disk size
    9.     \[*\] Initial RAM disk (initrd) support
    10. Console Drivers ->
    11.     \[*\] VGA text console
    12.     \[*\] Video mode selection support
    13. Console Drivers -> Frame-buffer support ->
    14.     \[*\] Support for frame buffer devices
    15.     \[*\] VESA VGA graphics console
    16.     \[*\] Use splash screen instead of boot logo
    复制代码



    For any kernel do NOT enable the following options or else you risk bootsplash not working or framebuffer corruption when switching VTs.
    1. Device Drivers  --->
    2.     Graphics support  --->
    3.             < >   nVidia Riva support  (do not enable!)
    4.         Logo configuration  --->
    5.             [ ] Bootup logo  (do not enable!)
    复制代码



    If you have problems later disable the following option in kernel
    1. Device Drivers  --->
    2.     Character devices  --->
    3.         < > /dev/agpgart (AGP Support)
    复制代码


    And add the following line to your /etc/X11/XF86Config[-4] file.
    1. Option          "NvAGP"         "1"
    复制代码

  • Compile your kernel as below for 2.6.x kernel.
    1. make
    复制代码

    Compile your kernel as below for 2.4.x kernel.
    1. make dep && make clean bzImage modules modules_install
    复制代码

    Install your kernel as below but do NOT unmount /boot and do NOT reboot until asked to later.
    1. mount /boot
    2. mv /boot/bzImage /boot/bzImage.old
    3. cp /usr/src/linux/arch/i386/boot/bzImage /boot/
    复制代码

    If you get errors during kernel compilation or missing options during configuration do as below.
    1. cd /usr/src/linux/
    2. mv .config ~/kernel.config
    3. make mrproper
    4. mv ~/kernel.config .config
    5. make oldconfig
    6. make menuconfig
    复制代码

  • Assuming /boot is mounted set an image to appear during the boot process.
    1. /sbin/splash -s -f /etc/bootsplash/default/config/bootsplash-1280x1024.cfg > /boot/initrd-1280x1024
    复制代码

    Or you can copy an already exisiting initrd image that is provided with the bootsplash package.
    1. cp /usr/share/bootsplash/initrd-1280x1024 /boot/
    复制代码

  • Edit your /boot/grub/grub.conf file. The example below has been provided for your convenience. Here are the meanings of the various parameters.

    video= goes on kernel line and controls display options such as ywrap and mtrr which speed up framebuffer scrolling
    vga= goes on kernel line and controls the resolution and colour depth of framebuffer
    splash= goes on kernel line and takes either 'silent' or 'verbose' but silent boots may not work
    initrd= goes on a new line after kernel line and loads an image during the booting process.

    1. default 0
    2. timeout 10
    3. splashimage=(hd0,0)/boot/grub/splash.xpm.gz

    4. # With both framebuffer and bootsplash
    5. title=Gentoo GNU/Linux 1.4 (+fb +splash)
    6. root=(hd0,0)
    7. kernel=(hd0,0)/boot/bzImage root=/dev/hda3 video=vesafb:ywrap,mtrr vga=0x31A
    8. initrd=/boot/initrd-1280x1024

    9. # With framebuffer but without bootsplash
    10. title=Gentoo GNU/Linux 1.4 (+fb -splash)
    11. root=(hd0,0)
    12. kernel=(hd0,0)/boot/bzImage root=/dev/hda3 video=vesafb:ywrap,mtrr vga=0x31A

    13. # Without both framebuffer and bootsplash
    14. title=Gentoo GNU/Linux 1.4 (-fb -splash)
    15. root=(hd0,0)
    16. kernel=(hd0,0)/boot/bzImage root=/dev/hda3
    复制代码

    Here is a lilo.conf example configuration courtesy of ophidia.
    1. image="/boot/bzImage"
    2. vga=0x31A
    3. root="/dev/hdb2"
    4. label="2.4.20-r4"
    5. read-only # read-only for checking
    6. append="hdc=ide-scsi video=vesafb:ywrap,mtrr"
    7. initrd=/boot/initrd-1280x1024
    复制代码

    Note that in the above grub and lilo configuration examples the keyword 'vesafb' is applicable to 2.6.x kernels. For 2.4.x kernels it should be changed to 'vesa'.

    Here is a chart of kernel mode numbers for the 'vga=' boot parameter.
    1.     | 640x480  800x600  1024x768 1280x1024
    2. ----+-------------------------------------
    3. 256 |  0x301    0x303    0x305    0x307   
    4. 32k |  0x310    0x313    0x316    0x319   
    5. 64k |  0x311    0x314    0x317    0x31A   
    6. 16M |  0x312    0x315    0x318    0x31B
    复制代码

    If you want to find ALL video modes for use with the framebuffer look at this forum post for further information on how to find it yourself.

    Look at the following reference files if you need more detailed information.
    1. /usr/share/bootsplash/grub.conf.sample
    2. /usr/src/linux/Documentation/fb/vesafb.txt
    3. /usr/src/linux/Documentation/svga.txt
    复制代码

  • Add bootsplash to the default run level so that it starts on every boot.
    1. rc-update add bootsplash default
    复制代码

  • Reboot and bask in the glory of bootplash wonder. To remind yourself of what kernel parameters you booted with do as below.
    1. cat /proc/cmdline
    复制代码

    [/list=1]
    Setting framebuffer without bootsplash!
    • To have a framebuffer only without bootsplash for greater area remove bootsplash from your default run level and reboot.
      1. rc-update del bootsplash default
      复制代码

    • Remove or comment out this line from your chosen menu entry in grub.conf.
      1. initrd=/boot/initrd-1280x1024
      复制代码


      Smaller fonts on framebuffer for greater area!

      Open /etc/rc.conf and change the following variable.
      1. CONSOLEFONT="default8x9"
      复制代码

      To see what other fonts are available for use look in the following location and add the name without the extension to /etc/rc.conf.
      1. /usr/share/consolefonts
      复制代码



      Extending consolefont, framebuffer and bootsplash to all 12 virtual terminals!

      • Open /etc/init.d/consolefont and change all instances of
        1. for x in 1 2 3 4 5 6 7 8 9 10
        复制代码

        to
        1. for x in `seq 1 12`
        复制代码

      • Open /etc/conf.d/bootsplash.conf and change the following variable as below.
        1. BOOTSPLASH_TTYS="0 1 2 3 4 5 7 8 9 10 11"
        复制代码

      • For the above changes to take effect you can either reboot or restart the above init.d scripts as below. Voila!
        1. /etc/init.d/consolefont restart
        2. /etc/init.d/bootsplash restart
        复制代码



      Personalising your bootsplash theme!

      • Create your own directory structure called 'personal'.
        1. mkdir -p /etc/bootsplash/personal/images/
        2. cp -r /etc/bootsplash/default/config /etc/bootsplash/personal/
        复制代码

      • Change the symbolic link for the default theme.
        1. rm /etc/bootsplash/default
        2. ln -s /etc/bootsplash/personal /etc/bootsplash/default
        复制代码

      • Open /etc/conf.d/bootsplash.conf and change as below.
        1. BOOTSPLASH_THEME=personal
        复制代码

      • Copy images of your choice and of correct resolution and depth into /etc/bootsplash/personal/images/. Make sure images have a resolution of 96x96 and not 300x300. Note that this is not image size but rather 'pixels per inch'. For more information look here.
      • Open /etc/bootsplash/personal/config/bootsplash-1280x1024.cfg and change paths below to point to your images.
        1. jpeg=/etc/bootsplash/gentoo/images/bootsplash-1280x1024.jpg
        2. silentjpeg=/etc/bootsplash/gentoo/images/silent-1280x1024.jpg
        复制代码

      • To have your image appear during boot add it to /boot otherwise omit this step.
        1. mount /boot
        2. /sbin/splash -s -f /etc/bootsplash/default/config/bootsplash-1280x1024.cfg > /boot/initrd-1280x1024
        复制代码

      • Reboot, test and post feedback.


      Taking screenshots!

      To use fbgrab emerge it as root and execute it as normal user on terminal 1.
      1. emerge fbgrab
      2. fbgrab ~/console.png
      复制代码


      Personalising your grub splash image!

      • To change your grub splash image create an image then move it to /boot/grub. As root do the following.
        1. emerge gimp
        2. wget [url]http://dhruba.codewordt.co.uk/files/grub-image.scm[/url] -P ~
        3. mv ~/grub-image.scm /usr/share/gimp/1.2/scripts/
        复制代码

      • Start gimp and open an image of your choice. Right click on the image, select File, Grub Boot Image and save in your home directory. A sample image is provided in instructions below for you to try. Other images can be found here which is a very useful resource.

        1. mount /boot
        2. wget [url]http://linux.tkdack.com/downloads/grub/powered-by.xpm.gz[/url] -P ~
        3. mv ~powered-by.xpm.gz /boot/grub/
        复制代码

      • Modify /boot/grub/grub.conf to point to the new image.
        1. splashimage=(hd0,0)/boot/grub/gentoo-boot.xpm.gz
        复制代码

      • To create images of the correct kind either follow the command line instructions at linux.tkdack.com duplicated below for convenience or use the gimp plugin.
        1. convert -size 800x600 file.jpg -resize 640x480 -colors 15 -profile '*' file.xpm
        2. gzip file.xpm
        复制代码



      Feedback: Since this thread is now split into two here's how to decide which thread to post on. If you are asking questions about problems or are helping another user with problems then post on the support thread. Remember to provide kernel name and version, contents of your grub.conf file and make, model and driver version of your graphics card. Everthing else can be posted in this thread including comments on improving this guide or correcting mistakes which are both welcome! Remember that if you have general problems unrelated to this guide then file bugs immediately so that hacks are no longer necessary and that problems are resolved officially for future users.

      Latest news: As you can tell by the number of times that this post has been edited the guide is undergoing continual overhaul as a result of feedback from users. It is now much more concise and has recently been expanded to fit new content. Look here for people who have it working: quikchaos, basquiat, mojo, danb, maw, Cappy!

      Trivia: For trivia first emerge aalib, svgalib and DirectFB. Mplayer on framebuffer: Try 'emerge mplayer' and then 'mplayer -vo svga <filename>'. Have you managed to get mplayer working under framebuffer? If so, post details! Graphical browser on framebuffer: (1) emerge links (2) chown root.root /usr/bin/links2 (3) chmod +s /usr/bin/links2 (4) links2 -g www.gentoo.org -driver directfb. Other drivers are X, vesa, svgalib and fb. Try them all and see what works best for you. How did links go for you?

      Still to come: Separate sections for framebuffer, bootsplash and grubsplash (done!); Extending to all 12 VTs (done!); Using your own themes with bootsplash (done!); Smaller fonts for greater area (done!); Binding a key for taking framebuffer screenshots; Modifying console fonts! Bear with me - hugely busy atm!

      Acknowledgements: devs: TaD, LiveWire; #gentoo: r2d2, Malketh, antifa, kote, Hayl, cybbe; beejay; forums: quikchaos, aardvark, allucid, tkdack; anubis2002; ophidia; other: HandyAndE.
发表于 2004-6-23 14:06:50 | 显示全部楼层
这里有maxzhongcn兄以前翻译整理的一篇文档,虽然旧了点,还是挺有用的:
http://gentoo.linuxsir.cn/doc/fb.xml.html
发表于 2004-6-23 15:32:50 | 显示全部楼层
最初由 joanphan 发表
这里有maxzhongcn兄以前翻译整理的一篇文档,虽然旧了点,还是挺有用的:
http://gentoo.linuxsir.cn/doc/fb.xml.html



不错,很有用。谢谢!
发表于 2004-6-23 16:34:33 | 显示全部楼层
这个是用了FrameBuffer驱动的吧,然后把图片打包到内核里面。重新编译内核后内核可能很大的。。。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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