标题: 给没做gensplash的朋友
http://www.linuxsir.org/bbs/thread334836.html


“<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.php?...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为了不引起歧义翻译成再次。