LinuxSir.cn,穿越时空的Linuxsir!

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

给没做gensplash的朋友

[复制链接]
发表于 2008-8-7 17:45:25 | 显示全部楼层 |阅读模式
“<lidaibin> cbkid, 看着黑漆漆的屏幕白字不停翻滚不大爽吧”

一些题外话:没有什么技术含量,因为第一次安装的时候用的wiki里的一篇,没有成功。wiki里用的是vesa-tng“<lidaibin> cbkid, 记得以前跟 r0bertz 在#gentoo-cn里讨论过关于uvesafb”小弟对此不怎么了解,希望二位可以贴出聊天记录,让小弟学习一下。
我也是通过lidaibin才了解到uvesafb的。我一向是有事都从wiki里找的,希望能给按照wiki里没有成功的朋友一些帮助。(小弟绝对对wiki没有恶意,gentoo的wiki是很强大的)。
因为小弟技术不行所以尽量都用的原话和原文。写此文也为了表示对lidaibin的谢意,但我绝没搞崇拜。

以下几乎全部来此uvesafb::v86d的翻译,有兴趣的可以参看原文连接:http://dev.gentoo.org/~spock/projects/uvesafb/

1。cd /usr/src/linux (编译内核)
2,在"Device Drivers" 这一节里选择:
Connector - unified userspace <-> kernelspace linker 和
Graphics support ---> Userspace VESA VGA graphics support
(也就是 CONFIG_CONNECTOR=y 和 CONFIG_FB_UVESA=y)。(在次不要选择关于你显卡的东西,只要这两个就可以了。否则可能会出问题)
3,make(可以不install,因为后边还要编译)
4,从新编译klibc: emerge klibc
注意:这一步是必要的。因为之前的编译使得内核选项里不包含uvesafb.你只需做一次,也就是说,你不用在每次安装新内核和模块的时候都从新编译klibc.
5.安装v86d:emerge v86d
6.再次*配置你的内核;在"General Setup"这一节里选择
Initial RAM filesystem and RAM disk (initramfs/initrd) support
并且把 Initramfs source file(s)设置为
/usr/share/v86d/initramfs
(也就是说 CONFIG_INITRAMFS_SOURCE="/usr/share/v86d/initramfs")
7。从新编译内核:make 并且install.
8.在你的内核启动选项里添加video=uvesafb:1024x768-32,mtrr:3,ywrap,或者和此相似即可。(第十条会详细说明)
9。“制作initramfs镜像.

如果您需要让splash的背景在启动开始就出现的话,您需要用到initramfs。否则请直接跳往 Configuring Your Bootloader.

Initramfs (initial ramfs) is a chunk of code that unpacks the compressed cpio image midway through the kernel boot process. The files contained within that image are then used to populate the root filesystem. Initramfs is a part of a bigger concept called 'early-userspace', says (Spock).
Genkernel

由于genkernel必须一个initrd镜像,而且"将initramfs的数据添加到initrd镜像"[2]是不可能的, 我们并不能利用initramfs镜像达到目的。作为代替方案,我们可以为gensplash标记一个特定的genkernel initrd镜像。这一过程非常的简单而且在当前系统下耗时不会超过一分钟。
代码: Genkernel - making initrd image with gensplash

# genkernel --gensplash=themename initrd

将 themename替换为/etc/splash下某选中的主题的名字。

非 genkernel

您有两种选择,我们推荐第一个选择。

   1. 启动时加载initramfs(建议)
   2. compiling the initramfs image directly into the kernel

启动时加载initramfs(建议)

如果您选择了此过程,您已经创建了一个initramfs镜像(一个单独的文件),它就是我们熟悉的initrd文件。所以,您不需要在每次更换镜像文件的时候再重新编译一次内核了。

现在您唯一需要作的事就是用splash_geninitramfs命令建立一个initrd文件(它包含pictures,configs以及userspace helper):
代码:

# cd /etc/splash/
# splash_geninitramfs emergence -r 1024x768 -g /boot/fbsplash-emergence-1024x768 -v

Change the resolution and theme to match your monitor's resolution and chosen theme.
注意: To help explain what's going on here for those who don't know, the first command we gave "emergence" simply tells it which theme to use, the next command "-r 1024x768" is our desired resolution, then "-g /boot/fbsplash-emergence-1024x768" tells it where to generate the new initramfs file, and finally -v simply tells it to be verbose in it's output so we can see what it's working on ;-)

警告: Before you rag your brains out, you must delete the symbolic link 'default' in the /etc/splash directory. Otherwise no images will show. (Gentoo-2.6.11-r9). You can also change the link to point to the theme you're using instead of deleting the link if you wish.

另一种方法:直接将initramfs编译进核心

首先,删除已有的initramfs映像: rm -iv /usr/src/linux/usr/initramfs_data.cpio.gz

然后,你要创建一个新的包含图像、配置和userspace helper(调整示例中的分辨率和主题——emergence——以适合你的需求)的initramfs映像。
代码:

splash_geninitramfs -g /usr/src/linux/usr/initramfs_data.cpio.gz -v -r 1024x768 emergence

必须要touch一下initramfs映像,确保它会被编译进你的新核心中:touch /usr/src/linux/usr/initramfs_data.cpio.gz. 然后参考 recompile your kernel.
View contents of initramfs

The initramfs should contain the splash theme files. To verify that it contains the theme that you chose you may use this command:
代码:

# zcat /boot/fbsplash-emergence-1024x768 | cpio --list

选择一个主题

如果您需要在不重新启动的情况下查看主题您可以用splash_manager命令:
代码:

# splash_manager --theme=emergence --cmd=set --tty=1

该命令会把tty1的主题设为emergence。您可以在当前设置下选择/etc/splash目录下的任何主题。现在您可以通过按组合键Ctrl+Alt+F1进入tty1查看主题。

获取更多主题

The media-gfx/bootsplash-themes package has quite a lot of themes.:

# emerge bootsplash-themes"

以上加引号的来自wiki原文:http://zh.gentoo-wiki.com/index. ... _.E4.B8.BB.E9.A2.98

10。设置启动选项。
因为一些选项没有详细说面我也不知道是什么意思,有兴趣的可以去google.以下是我的grub.conf

title Gentoo Linux 2.6.26
root (hd0,0)
kernel /kernel-2.6.26-gentoo root=/dev/sda7 video=uvesafb:1280x800-32,ywrap,mtrr:3 splash=silent,fadein,theme:#livecd-2007.0# console=tty1
initrd /#fbsplash-livecd-2007.0-1280x800#

用#号括起来的是你需要修改的splash主题。(当然内核和/目录这个不用说了吧)
lidaibin> cbkid, 加上quiet内核自检信息就不显示了



*此处原词是reconfigure为了不引起歧义翻译成再次。
发表于 2008-8-7 18:30:16 | 显示全部楼层
听说uvesafb 可以支持1280x800的分辨率?
以前看了几次都闲麻烦没做。。

启动的时候看console下面一个个的[ok]让我觉得很安心.嘿嘿
回复 支持 反对

使用道具 举报

发表于 2008-8-7 22:08:07 | 显示全部楼层
我的 945gm,看了文档的结论是不能启动就得到 1280*800,要915resolution 启动才行……
回复 支持 反对

使用道具 举报

发表于 2008-8-8 02:22:38 | 显示全部楼层
看了楼上的话我决定不看文档了- -p


# lspci |grep VGA
00:02.0 VGA compatible controller: Intel Corporation Mobile 945GM/GMS, 943/940GML Express Integrated Graphics Controller (rev 03)
回复 支持 反对

使用道具 举报

发表于 2008-8-8 13:07:18 | 显示全部楼层
我的启动选项是这样写的,也是1280x800的分辨率,一切正常。
关键在于vga的这个参数,866不是个常见的参数,是利用vbetest这个命令获取的。

#boot
title                Gentoo Linux, kernel-2.6.26 (Default)
root                (hd0,0)
kernel                /kernel-genkernel-x86-2.6.26-gentoo vga=866 splash=silent,theme:livecd-2007.0 console=tty1 quiet real_root=/dev/sda7
initrd                /initramfs-genkernel-x86-2.6.26-gentoo
boot
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-8-8 16:13:37 | 显示全部楼层
我的GMA X3100 14。1宽屏(1280*800)
<lidaibin> cbkid, uvesafb is the successor of vesafb-tng
<lidaibin> works on non-x86 systems, the Video BIOS code is run in userspace by a helper application
做过之后感觉很漂亮,我新手,作的话估计也就10分(我出了点意外,按照wiki作的多选了一个选项没去,所以耽误了点时间)所以应该不是很麻烦,在我用的主题里开始的时候也是滚字幕,但是最顶上面有两个企鹅,而且字体很小巧很精美,唯一的遗憾就是我用的GDM关机的时候就没有了splash。希望各位GNOME同伴能给点指教。
回复 支持 反对

使用道具 举报

发表于 2008-8-8 16:18:41 | 显示全部楼层
感觉不错。这也是我喜欢2007.0的LIVECD的原因。
但我更喜欢FEDORA那个,既美观也可以选择看详细信息。
回复 支持 反对

使用道具 举报

发表于 2008-8-9 00:46:17 | 显示全部楼层
945GM谁还有办法作出1280x800的分辨率......
俺无奈了...
  1. localhost ~ # vbetest
  2. VBE Version 3.0
  3. Intel(r) 82945GM Chipset Family Graphics Chip Accelerated VGA BIOS
  4. [261] 1024x768 (256 color palette)
  5. [279] 1024x768 (5:6:5)
  6. [280] 1024x768 (8:8:8)
  7. [274] 640x480 (8:8:8)
  8. [276] 800x600 (5:6:5)
  9. [277] 800x600 (8:8:8)
  10. [257] 640x480 (256 color palette)
  11. [259] 800x600 (256 color palette)
  12. [273] 640x480 (5:6:5)
  13. Type a mode number, or 'q' to quit - q
  14. localhost ~ # 915resolution -l
  15. Intel 800/900 Series VBIOS Hack : version 0.5.3
  16. Chipset: 945GM
  17. BIOS: TYPE 1
  18. Mode Table Offset: $C0000 + $269
  19. Mode Table Entries: 36
  20. Mode 30 : 640x480, 8 bits/pixel
  21. Mode 32 : 800x600, 8 bits/pixel
  22. Mode 34 : 1024x768, 8 bits/pixel
  23. Mode 38 : 1280x1024, 8 bits/pixel
  24. Mode 3a : 1600x1200, 8 bits/pixel
  25. Mode 3c : 1920x1440, 8 bits/pixel
  26. Mode 41 : 640x480, 16 bits/pixel
  27. Mode 43 : 800x600, 16 bits/pixel
  28. Mode 45 : 1024x768, 16 bits/pixel
  29. Mode 49 : 1280x1024, 16 bits/pixel
  30. Mode 4b : 1600x1200, 16 bits/pixel
  31. Mode 4d : 1920x1440, 16 bits/pixel
  32. Mode 50 : 640x480, 32 bits/pixel
  33. Mode 52 : 800x600, 32 bits/pixel
  34. Mode 54 : 1024x768, 32 bits/pixel
  35. Mode 58 : 1280x1024, 32 bits/pixel
  36. Mode 5a : 1600x1200, 32 bits/pixel
  37. Mode 5c : 1920x1440, 32 bits/pixel
复制代码
回复 支持 反对

使用道具 举报

发表于 2008-8-9 02:02:03 | 显示全部楼层
楼上的,很奇怪你为什么没有宽屏的分辨率。

我的如下:
VBE Version 3.0
Intel(r) 82945GM Chipset Family Graphics Chip Accelerated VGA BIOS
[352] 1280x800 (256 color palette)
[353] 1280x800 (5:6:5)
[354] 1280x800 (8:8:8)
[261] 1024x768 (256 color palette)
[279] 1024x768 (5:6:5)
[280] 1024x768 (8:8:8)
[274] 640x480 (8:8:8)
[276] 800x600 (5:6:5)
[277] 800x600 (8:8:8)
[257] 640x480 (256 color palette)
[259] 800x600 (256 color palette)
[273] 640x480 (5:6:5)
Type a mode number, or 'q' to quit - q
回复 支持 反对

使用道具 举报

发表于 2008-8-9 18:55:31 | 显示全部楼层
01:00.0 VGA compatible controller: ATI Technologies Inc Radeon Mobility M7 LW [Radeon Mobility 7500

按这个办法没有成功。
splash_manager --theme=emergence --cmd=set --tty=1
Failed to open the fbcon_decor control device.
Failed to open the fbcon_decor control device.
回复 支持 反对

使用道具 举报

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

本版积分规则

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