LinuxSir.cn,穿越时空的Linuxsir!

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

FBSplash(GenSplash)轻松安装手记

[复制链接]
发表于 2004-8-14 23:40:05 | 显示全部楼层 |阅读模式
本文参照了fbsplash作者的gensplash-in-5-easy-steps,原文见:
http://dev.gentoo.org/~spock/pro ... in-5-easy-steps.php

0)确认你的/etcmake.conf里以下两项已设置好:
[PHP]
ACCEPT_KEYWORDS="~x86"
PORTDIR_OVERLAY=/usr/local/portage
[/PHP]

1)下载安装nitro-sources(强烈推荐使用此内核,已包含最新的fbsplash win4lin reiser4,fb-ng,supermount等适于桌面应用的patch)
[PHP]
#cd /usr/local/portage
#mkdir sys-kernel
#cd sys-kernel
#mkdir nitro-sources
#cd nitro-sources
#wget http://www.sepi.be/nitro/2.6.8.1-nitro6/nitro-sources-2.6.8.1-r6.ebuild
#ebuild nitro-sources-2.6.8_rc4-r2.ebuild digest
#emerge nitro-sources[/PHP]

2)编译内核:
[PHP]
#cd /usr/src
# rm linux
#ln -s linux-2.6.8.1-nitro6 linux
# cd linux
#make menuconfig
#make[/PHP]

(注意一定不要漏选以下和fbsplash有关的选项)

[PHP]
Device Drivers  ---> Graphics support  ---> and make sure
  • Support for frame buffer devices is checked * <. Also make sure you have <*>   VESA VGA graphics support                                                                  (640x480@60) VESA default mode (NEW) +
    Console display driver support  --->
  •    Video mode selection support +
    <*> Framebuffer Console support and
    Logo configuration  --->
  • Bootup logo
  •    Standard 224-color Linux logo (NEW)
    and finally
  • Support for the framebuffer splash
    [/PHP]

    3)安装splashutils:
    [PHP]emerge splashutils[/PHP]

    4)给fbsplash建立一个initramfs映像文件并重新编译内核:
    [PHP]# rm /usr/src/linux/usr/initramfs_data.cpio.gz
    # splash_geninitramfs -v -g /usr/src/linux/usr/initramfs_data.cpio.gz -r 1024x768 emergence[/PHP]

    5)修改grub.conf文件:
    这是我的grub.conf文件,请根据自己系统的实际情况做修改:
    [PHP]
    default 0
    timeout 15
    splashimage=(hd0,5)/grub/splash.xpm.gz

    title=Gentoo Linux 2004 (linux-2.6.8.1-nitro-r6 Reiser4+Gensplash)
    root (hd0,5)
    kernel /nitro-2.6.8.1-r6 ro root=/dev/hda7 video=vesafb:ywrap,pmipal,1024x768-32@60 splash=silent,theme:personal
    [/PHP]

    重启试试看,漂亮的splash应该出来了吧。

    P.S:

    定制自己的fbsplash图片:
    a)[PHP]#mkdir /etc/splash/personal
    #cd /etc/splash
    #rm -rdf default
    #ln -s personal default[/PHP]
    自己找些1024x768或者符合自己屏幕分辨率的图片分别命名为:
    [PHP]
    silent-1024x768.jpg         verbose-1024x768.jpg
    silent-1024x768-240.png  verbose-1024x768-240.png  verbose-1024x768.png
    [/PHP]

    b)[PHP]
    #cp emergence/1024x768.cfg personal
    #nano -w  1024x768.cfg
    把fbsplash图片路径修改为:
    pic=/etc/splash/personal/verbose-1024x768.png
    silentpic=/etc/splash/personal/silent-1024x768.jpg
    pic256=/etc/splash/personal/verbose-1024x768-240.png
    silentpic256=/etc/splash/personal/silent-1024x768-240.png
    [/PHP]

    c)然后重复步骤4),注意这一步:
    [PHP]
    # splash_geninitramfs -v -g /usr/src/linux/usr/initramfs_data.cpio.gz -r 1024x768 emergence
    其中emergence要改为personal
    [/PHP]

    d)修改grub.conf,把
    [PHP]
    theme:emergence
    改为
    theme:personal
    就OK啦
    [/PHP]

    [
  • 发表于 2004-8-15 09:30:02 | 显示全部楼层
    你用GCC的版本是多少?我现在编译splahsutils通不过。出错了。
    make[1]: Leaving directory `/var/tmp/portage/splashutils-0.9_pre05/work/miscsplashutils-0.1/fbtruetype'
    CC kernel/splash_unpack.o
    splash_unpack.c:22:17: png.h: No such file or directory
    splash_unpack.c: In function `load_png':
    splash_unpack.c:87: error: `png_structp' undeclared (first use in this function)
    splash_unpack.c:87: error: (Each undeclared identifier is reported only once
    splash_unpack.c:87: error: for each function it appears in.)
    splash_unpack.c:87: error: syntax error before "png_ptr"
    splash_unpack.c:88: error: `png_infop' undeclared (first use in this function)
    splash_unpack.c:89: error: `png_bytep' undeclared (first use in this function)
    splash_unpack.c:90: error: `png_colorp' undeclared (first use in this function)
    splash_unpack.c:102: error: `png_ptr' undeclared (first use in this function)
    splash_unpack.c:102: error: `PNG_LIBPNG_VER_STRING' undeclared (first use in this function)
    splash_unpack.c:103: error: `info_ptr' undeclared (first use in this function)
    splash_unpack.c:112: error: `PNG_COLOR_TYPE_PALETTE' undeclared (first use in this function)
    splash_unpack.c:118: error: `PNG_COLOR_MASK_ALPHA' undeclared (first use in this function)
    splash_unpack.c:121: error: `PNG_COLOR_TYPE_GRAY' undeclared (first use in this function)
    splash_unpack.c:122: error: `PNG_COLOR_TYPE_GRAY_ALPHA' undeclared (first use in this function)
    splash_unpack.c:126: error: `palette' undeclared (first use in this function)
    splash_unpack.c:168: error: `row_pointer' undeclared (first use in this function)
    make: *** [kernel/splash_unpack.o] Error 1

    !!! ERROR: media-gfx/splashutils-0.9_pre05 failed.
    !!! Function src_install, Line 45, Exitcode 2
    !!! (no error message)

    我用的是development sources linux-2.6.8-r4。
     楼主| 发表于 2004-8-15 10:47:58 | 显示全部楼层
    [PHP]
    root@finalbaby /home/debentoogao # emerge --info
    Portage 2.0.50-r9 (default-x86-2004.2, gcc-3.3.4, glibc-2.3.4.20040619-r0, 2.6.8-rc4-nitro2)
    =================================================================
    System uname: 2.6.8-rc4-nitro2 i686 AMD Duron(tm) Processor
    Gentoo Base System version 1.5.2
    Autoconf: sys-devel/autoconf-2.59-r4
    Automake: sys-devel/automake-1.8.5-r1
    ACCEPT_KEYWORDS="x86 ~x86"
    AUTOCLEAN="yes"
    CFLAGS="-mcpu=athlon-xp -O3 -pipe"
    CHOST="i686-pc-linux-gnu"
    COMPILER="gcc3"
    CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3/share/config /usr/kde/cvs/share/config /usr/share/config /var/qmail/control"
    CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
    CXXFLAGS="-mcpu=athlon-xp -O3 -pipe"
    DISTDIR="/usr/portage/distfiles"
    FEATURES="autoaddcvs buildpkg ccache cvs sandbox"
    GENTOO_MIRRORS="http://mirror.gentoo.gr.jp"
    MAKEOPTS="-j2"
    PKGDIR="/usr/portage/packages"
    PORTAGE_TMPDIR="/var/tmp"
    PORTDIR="/usr/portage"
    PORTDIR_OVERLAY="/usr/local/portage"
    SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
    USE="3dnow X acpi alsa apache2 apm arts avi bindist canna cjk composite crypt cs46xx cups dba dga dvd encode esd f77 fbcon foomaticdb ftp gcj gd gd-external gdbm gif gpm gtk gtk2 imap imlib ipv6 java jpeg kde ldap libg++ libwww mad maildir mbox mikmod motif mpeg msn mysql ncurses nls nptl oggvorbis opengl oss pam pdflib perl png postgres python qt quicktime radeon readline sasl sdl slang spell ssl svga tcltk tcpd theora truetype usb videos x86 xml2 xv yahoo zlib"
    [/PHP]
     楼主| 发表于 2004-8-15 10:51:55 | 显示全部楼层
    最初由 blackwhite 发表
    你用GCC的版本是多少?我现在编译splahsutils通不过。出错了。

    我用的是development sources linux-2.6.8-r4。

    好像是找不到png的头文件,重新emerge libpng试试看
    发表于 2004-8-15 10:53:37 | 显示全部楼层
    好文!
    发表于 2004-8-15 15:24:22 | 显示全部楼层
    打开控制台的splash
    splash_utils -c setcfg --v=${TTY_NO} --theme=${THEME} -m=s
    splash_utils -c on --v ${TTY_NO}
    其中TTY_NO为终端的序号0,1,2...THEME为fbsplash的主题如:emergence.可以参照bootsplash启动脚本写一个小脚本来做.
    现在没有时间等一下再试一试.
    发表于 2004-8-15 16:36:26 | 显示全部楼层
    1. #!/sbin/runscript
    2. # Copyright 1999-2004 Gentoo Technologies, Inc.
    3. # Distributed under the terms of the GNU General Public License v2
    4. # $Header:
    5. # source our config
    6. source /etc/conf.d/splash
    7. # default settings
    8. test -z "${SPLASH_THEME}" && SPLASH_THEME="default"                                                                              
    9. test -z "${SPLASH_TTYS}"  && SPLASH_TTYS=`seq 0 5`
    10. depend() {
    11.         # run after local so that the boot time splash image
    12.         # is visible for as long as possible
    13.         need local
    14. }
    15. box () {
    16.         # dummy function to handle sourcing of splash config file
    17.         return;
    18. }
    19. get_splash_theme () {
    20.         # try to get splash theme from kernel command line
    21.         for param in `grep "theme:" /proc/cmdline`; do
    22.                 t=${param%:*}
    23.                 if [ "${t#*,}" == "theme" ]; then
    24.                         SPLASH_THEME="${param#*:}"
    25.                 fi
    26.         done
    27. }
    28. start() {
    29.         # Only do this if the kernel has support
    30.         if [ -f /proc/fbsplash ]
    31.         then
    32.                 ebegin "Turning Console splash on"
    33.                 get_splash_theme
    34.                 # get console resolution
    35.                 RESOLUTION=$(/sbin/fbresolution)
    36.                 for TTY in `echo "${SPLASH_TTYS}" | sed -e 's# #\n#g'`
    37.                 do
    38.                         if [ -e /etc/splash/${SPLASH_THEME}/${RESOLUTION}.cfg ]
    39.                         then
    40.                                 /sbin/splash_util -c setcfg --v $TTY --theme=${SPLASH_THEME} -m=s
    41.                                 /sbin/splash_util -c on --v $TTY
    42.                         fi
    43.                 done
    44.                 eend $? "Failed to turn Console splash on"
    45.         fi
    46. }
    47. stop() {
    48.         # Only do this if the kernel has support
    49.         if [ -f /proc/fbsplash ]
    50.         then
    51.                 ebegin "Turning Console splash off"
    52.                 get_splash_theme
    53.                 for TTY in `echo "${SPLASH_TTYS}" | sed -e 's# #\n#g'`
    54.                 do
    55.                         /sbin/splash_util -c off --v $TTY
    56.                 done
    57.                
    58.                 eend $? "Failed to turn Console splash off"       
    59.         fi
    60. }
    复制代码
     楼主| 发表于 2004-8-15 21:46:28 | 显示全部楼层
    谢谢兄弟,我待会去试试看
    发表于 2004-8-16 00:34:19 | 显示全部楼层
    最初由 Debentoo Gao 发表
    好像是找不到png的头文件,重新emerge libpng试试看

    这些lib都是它自己带的。比较怪的事情是它有的时候,可以安装成功,有的时候不行。看样子我要看看把现有的libemerge一下。等会儿我试试。我已经搞了好多天了。搞不定。实在不想研究它的ebuild。
    发表于 2004-8-16 03:17:48 | 显示全部楼层
    把需要的lib给emerge一下,就可以了。不过我的FB设备还是没有,可能是因为我没有打VESA-FB的patch吧。我编译你推荐的内核,启动以后,出现一个模糊不清的画面后,系统就crash了。
    如果你方便的话,把你的CONFIG中和SPLASH有关的部分给贴出来。现在HOWTO版本比较多,让人迷茫。
    您需要登录后才可以回帖 登录 | 注册

    本版积分规则

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