找回密码
 注册
查看: 9864|回复: 35

替换引导画面和终端的背景

[复制链接]
发表于 2003-1-16 19:15:23 | 显示全部楼层 |阅读模式
这是我自己的。

http://forums.gentoo.org/viewtopic.php?t=26494
发表于 2003-1-16 19:52:55 | 显示全部楼层
cool!
回复

使用道具 举报

发表于 2003-1-16 21:31:28 | 显示全部楼层
只要你的引导是用grub,这在其它的系统也一样能做到吧?不单单是gentoo。
回复

使用道具 举报

发表于 2003-1-17 00:18:27 | 显示全部楼层
Oh.... Yeah!好东西!


打 100 次精华!!!!!!!!!!!!!!!!!!!!!      
回复

使用道具 举报

发表于 2003-1-17 03:25:04 | 显示全部楼层
[quote:bdc6fa3b90="pk"]只要你的引导是用grub,这在其它的系统也一样能做到吧?不单单是gentoo。[/quote]
这是肯定的。 Mandrake 9 和 SuSE 不是也有这个功能?  
Gentoo 这个功能应该是从 SuSE 那儿移植过来的

我编译出的内核比原来大了很多,905 K,原来是 853K。不过核心启动后显示的剩余空间大了很多,现在是 256K,原来是 248K.
而且现在控制台看起来比较刺眼,一是背景加了图片后比较亮,二是 vesa 模式好像不能用 85Hz 的刷新率。。。

to catoc: 你的背景看起来很特别啊,我在那篇帖子里没找到,我现在是用这张背景,眼花。。。 @_@

顺便问问: http://www.geocities.com/kachaffeous 谁能上去吗?
回复

使用道具 举报

 楼主| 发表于 2003-1-17 10:40:45 | 显示全部楼层
几点补充:
1 这不是 grub 的引导画面,所以没有 grub 也是可以的。
2 Loopback device support 可以编译为 m 。
3 如果仅仅是想在控制台使用背景画面,没有必要生成 initrd 。在控制台使用
splash 工具即可。
回复

使用道具 举报

发表于 2003-1-17 12:20:52 | 显示全部楼层
请具体讲讲,我正要这种不是grub就能加画面的东东。
回复

使用道具 举报

发表于 2003-1-17 15:23:40 | 显示全部楼层
这个既然已经是精华了,而且你也说明不 是grub做的,那就是用lilo也可做。 Loopback device support 可以编译为 m 很大一部人都是这样做的吧。

说说具体的情况吧。
回复

使用道具 举报

 楼主| 发表于 2003-1-17 16:49:34 | 显示全部楼层
gentoo forum 上面的步骤说的很清楚了,所以这里没有再提。
关键的两点是对 kernel 打 bootsplash 的 patch ,你的显卡支持
vesa。
make config 一定要选择 Initial RAM disk (initrd) support ,
Video mode selection support , VESA VGA graphics console ,
Use splash screen instead of boot logo

如果没有必要在 boot 的时候显示背景图片,仅仅是在终端显示,也没有
必要制作 initrd 了,在启动后执行 splash -s -u 0 /usr/share/splash/bootsplash.cfg 就可以。

不管是 grub 还是 lilo 都是为了 load kernel & set initrd & set vga=???
所以按照这个思路,即使在 dos 下使用 loadlin 也是可以的。甚至可以在 dos 更改 refresh 后再启动 linux kernel.

在控制台上还可以显示 动画 mng 呢。
回复

使用道具 举报

 楼主| 发表于 2003-1-17 17:33:23 | 显示全部楼层
[quote:1a059c87c3="Kuye"]
to catoc: 你的背景看起来很特别啊,我在那篇帖子里没找到,我现在是用这张背景,眼花。。。 @_@
顺便问问: http://www.geocities.com/kachaffeous 谁能上去吗?[/quote]
我这个图片忘记从什么地方找来的了,resize 了一下。
geocities 一直上不去。
回复

使用道具 举报

发表于 2003-1-17 23:43:34 | 显示全部楼层
恩。。。的确不错。。。 ^_^

就如 catoc 所说,非常容易修改的说。

我等一下写篇总结性的文章,请大家帮我测试一下,看一下哪儿还有不妥之处。

按照我的风格,我用脚指头想也知道写出来的东西肯定极为不严肃。。。。 #_^
回复

使用道具 举报

发表于 2003-1-18 00:19:38 | 显示全部楼层

给字符控制台加上背景图片

给字符控制台加上背景图片

效果图在此:
http://www.linuxfans.org/nuke/modules/Forums/files/bootsplash.jpg <- 由 catoc 提供

原帖地址:
http://forums.gentoo.org/viewtopic.php?t=26494
http://www.linuxfans.org/nuke/mo ... wforum&f=37

详细方法:
OK OK, 为了咱们美丽而可爱的控制台背景,开工了

核心源代码肯定是要地,如果不想自己手动修改内核的话还是老老实实用老版本的 2.4.19-r10 版 gentoo 内核:
[code:1]emerge -a gentoo-sources[/code:1]
如果你很不喜欢在控制台上配置内核的话,还需要 tcl,这样便可以在 XWindow 下用 make xconfig 了
[code:1]emerge -a gentoo-source tk[/code:1]

哦。。。召唤背景工具~~~~~

ftp://ftp.suse.com/pub/people/st ... /splashutil.tar.bz2
ftp://ftp.suse.com/pub/people/st ... bootsplash-config.c
ftp://ftp.suse.com/pub/people/st ... ootsplash-config.sh
ftp://ftp.suse.com/pub/people/st ... .4.19-vanilla.patch

DIYer 怎么能老拿别人做好的背景呢? 毛主席说得好:“自己动手,丰衣足食”,下个模板,咱们自己也做,拿自己照片做背景,肯定可以羡慕死一群人!(注释: geocities 好像都连不上去...)

http://www.geocities.com/kachaffeous/gentoo.jpg
http://www.geocities.com/kachaffeous/template.zip

OK, 开始做工具 - splash 了,把 splashutil.tar.bz2 解压缩到一个目录里,我这里用 ~/splash
[code:1]# cd ~/splash
# tar xvjf splashutil.tar.bz2
splashutil/
splashutil/Makefile
splashutil/splash.c
splashutil/ChangeLog
splashutil/COPYING
# cd splashutil
# make
gcc -Os -Wall   -c -o splash.o splash.c
gcc -Os -Wall  -o splash  splash.o
strip splash
# cp splash /sbin/
# cd ..[/code:1]

然后需要用 bootsplash-config 和 bootsplash-config.sh 生成背景的配置文件,gentoo.jpg 不用说也知道是需要的背景啦,不过因为核心的图片解码器不具有缩放图片的功能,所以请事先将其用图形处理软件缩放到屏幕大小:

[code:1]# gcc -o bootsplash-config bootsplash-config.c
# chmod +x bootsplash-config.sh
# ./bootsplash-config.sh
# mkdir -p /usr/share/splash/
# cp *.cfg /usr/share/splash/
# cp bootsplash-1024x768.cfg /usr/share/splash/bootsplash.cfg
# mv gentoo.jpg /usr/share/splash/bootsplash.jpg[/code:1]

go on... 给核心打补丁,不过因为原版补丁是 for 2.4.19 vanilla 核心的(vanilla 的意思好像是"原版核心",没有打 Gentoo 补丁),我们需要修改成 for 2.4.19 gentoo 核心
召唤 vi~~~~ :
[code:1]esc
:%s/2.4.19-vanilla/linux/g
:wq[/code:1]

开始打补丁了:
[code:1] # cp *.patch /usr/src
# cd /usr/src
# patch -p0 < boot_splash_complete.2.4.19-vanilla.patch
patching file linux/include/video/fbcon.h     
patching file linux/drivers/video/fbcon.c     
patching file linux/drivers/video/fbcon-cfb16.c
patching file linux/drivers/video/Makefile   
patching file linux/drivers/video/fbcon-jpegdec.c
patching file linux/drivers/video/fbcon-jpegdec.h
patching file linux/drivers/video/fbcon-splash.c
patching file linux/drivers/video/fbcon-splash.h
patching file linux/drivers/video/Config.in   
Hunk #1 succeeded at 213 (offset 8 lines).   
Hunk #3 succeeded at 347 (offset 8 lines).
patching file linux/drivers/char/console.c
# cd linux[/code:1]

然后自己配置一下核心,其它不管,以下的内容必须编译进核心,编译成模块也不行!
Block Devices -> RAM disk support
Block Devices -> Initial RAM disk (initrd) support
Console Drivers -> Video mode selection support
Console Drives -> Frame-buffer support -> Support for frame buffer devices
Console Drives -> Frame-buffer support -> VESA VGA graphics console
Console Drives -> Frame-buffer support -> Use splash screen instead of boot logo


保存退出后开始编译了
[code:1]#  make dep && make clean bzImage modules modules_install && mount /boot && cp arch/i386/boot/bzImage /boot/vmlinuz[/code:1]

漫长的 15-20分钟总算过去了,恭喜你,你还没完:
OK OK, 你现在应该已经拥有了:
一个 /sbin/splash 的命令
一个带有控制台背景支持的新核心
一个用于存放下面的背景相关文件的 /usr/share/splash 目录
bootsplash-1280x1024.cfg
bootsplash-1024x768.cfg
bootsplash-800x600.cfg
bootsplash.cfg
bootsplash.jpg


OK, 咱们用 grub 的和 lilo 其实都差不多。都是给核心传递一些 vga 和 video 参数罢了:
编辑 /etc/lilo.conf 如以下内容,相关配置请按自己情况修改:
[code:1]#menu-scheme=Wb
boot = /dev/hda
#prompt
map = /boot/System.map
lba32

#MENU
        image = /boot/vmlinuz
        read-only
        label = Gentoo
        vga = 791
        root = /dev/hda3
        initrd=/boot/initrd[/code:1]
grub 的可以参考一下我的(我的 initrd 是链接到 initrd-2.4.19-gentoo-r10.new 上的):
[code:1]title Gentoo Linux 1.4 -- 2.4.19-r10 (with background)
kernel (hd0,0)/vmlinuz-2.4.19-gentoo-r10.new root=/dev/hda5 vga=791 video=vesa:1024x768@70
initrd=/initrd-2.4.19-gentoo-r10.new[/code:1]

非常非常重要的两行一定要有!!!
[code:1]vga = 791
initrd=/boot/initrd [/code:1]
vga=791 是将控制台甚至为 1024x768x256 色,不推荐用 792(1024x768x16M)
initrd 就是你想要的背景文件内容了

附上: VGA 代码和分辨率的对照表
[code:1]depth------640x480-----800x600-----1024x768-----1280x1024
256----------769----------771-----------773-------------775
32000-------784----------787-----------790-------------793
65000-------785----------788-----------791-------------794
16.7 Mill.----786----------789-----------792-------------795[/code:1]

(快干完了:))
生成 initrd,并且更新 mbr 中的 Linux loader
[code:1]# splash -s -f /usr/share/splash/bootsplash.cfg > /boot/initrd
# lilo
Added Gentoo * [/code:1]

OK, 如果你想在 tty1 下使用背景时就可以运行
[code:1]# splash -s -u 1 /usr/share/splash/bootsplash.cfg[/code:1]
-u 后面就是控制台号码,如果你想在第 100 个控制台下使用背景当然也可以用 -u 100

ft... 这样每次开机都要一个一个设置太累了,让它在每次启动后自动在每个控制台上加上背景 ;)
[code:1]# cd /usr/share/splash
# for i in tty2 tty3 tty4 tty5 tty6; do mkdir $i ; cp boot* $i ; done
# echo '/bin/splash -s -u 1 /usr/share/splash/tty2/bootsplash.cfg' >> /etc/conf.d/local.start
# echo '/bin/splash -s -u 2 /usr/share/splash/tty3/bootsplash.cfg' >> /etc/conf.d/local.start
# echo '/bin/splash -s -u 3 /usr/share/splash/tty4/bootsplash.cfg' >> /etc/conf.d/local.start
# echo '/bin/splash -s -u 4 /usr/share/splash/tty5/bootsplash.cfg' >> /etc/conf.d/local.start
# echo '/bin/splash -s -u 5 /usr/share/splash/tty6/bootsplash.cfg' >> /etc/conf.d/local.start[/code:1]
这样一来你可以在 /usr/share/splash/tty? 下放入不同的 jpg 图片,就可以让每个控制台显示不同的背景画面了,hoho ^_^

OK, 完成,重新启动吧
如果无法显示请用 dmesg 检查一下是否有以下内容:
[code:1]# dmesg
Looking for splash picture.... found (1024x768, 27481 bytes).
Splash status on console 1 changed to on
Looking for splash picture.... found (1024x768, 89306 bytes).
Splash status on console 2 changed to on
Looking for splash picture.... found (1024x768, 68567 bytes).
Splash status on console 3 changed to on
Looking for splash picture.... found (1024x768, 66762 bytes).
Splash status on console 4 changed to on
Looking for splash picture.... found (1024x768, 59607 bytes).
Splash status on console 5 changed to on [/code:1]

enjoy your new terminal

附录1: 背景图片完了就玩一下背景动画吧 ^_^
这里有可以在控制台背景上播放 mng 动画的工具:
ftp://ftp.suse.com/pub/people/st ... g/fbmngplay.tar.bz2
然后:
[code:1]#emerge libmng
#tar xjvf fbmngplay.tar.bz2
*cd to where you unpacked the tar file*
# make fbmngplay
# cp fbmngplay /bin/[/code:1]
fbmngplay 的使用方法基本和 splash 命令差不多,详细情况请参考 --help, 这里就不多说

附录2: cfg 修改简易教程
[code:1]# 设置文件版本
version=2

# 需要现实图片吗? <- 不显示花那么多功夫干嘛?
state=1

# fgcolor 是文字颜色
# bgcolor 是文字背景颜色(默认透明)。
fgcolor=4
bgcolor=0

# (tx, ty) 是文字窗口以 pixels 为单位的坐标.
# tw/th is 是文字窗口以 pixels 为单位的宽高.
tx=91
ty=161
tw=840
th=544

# 该选项用于隐藏 SuSE Linux 7.3 的“企鹅”? <- ??? 可能是指左上角的企鹅 logo,搞错可别怪我 :P
# (px, py) 是企鹅位置的坐标
# pw/ph 是企鹅的宽高
#px=82
#py=157
#pw=859
#ph=552

# (pr, pg, pb) 是企鹅填充区域的颜色
#pr=240
#pg=240
#pb=240

# 背景图片的完整路径
jpeg=/usr/share/splash/bootsplash.jpg [/code:1]

颜色对照表:
[code:1]fgcolor #--------------color
0----------------------black
1----------------------blue
2----------------------green
3----------------------teal
4----------------------red
5----------------------purple
6----------------------brown
7----------------------grayish white
8----------------------grayish black
9----------------------light blue
10--------------------Bright Green
11--------------------Bright Cyan
12--------------------Bright Red
13--------------------Bright Magenta
14--------------------Yellow
15--------------------Bright White[/code:1]

相关下载:
SuSE 的 splash :  http://www.geocities.com/kachaffeous/splash.tgz
SuSE 的 mng    :  http://www.geocities.com/kachaffeous/mngfiles.tgz
SuSE 的 boot splash 主题: ftp://ftp.suse.com/pub/people/st ... uSE-classic.tar.bz2

鸣谢:
第一个: 我们最最最可爱的 catoc,多谢他在得到了这么个好东东的时候还记得将其共享出来 ^_^
第二个: Gentoo Linux <- 一句话概括:"爱你爱到骨头里"
第三个: 自然是公社,提供了我一个不错的,扮演唐僧的好地方
第四个: 就是你! 对.... 别东张西望了,就是盯着屏幕顶着瞌睡看到现在的你,废话太多,您辛苦啦!
如果发现本文有什么不妥或者使用中有什么疑问请去这张帖子里一起研究

广告:
欢迎大家体验 SuSE 高性能 Linux
也欢迎大家去 Gentoo Linux 及其讨论区淘金.

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

×
回复

使用道具 举报

发表于 2003-1-21 10:52:57 | 显示全部楼层

Re: 替换引导画面和终端的背景

请问您的启动图片是如何截取的?


[quote:238e83847e="catoc"]这是我自己的。

http://forums.gentoo.org/viewtopic.php?t=26494[/quote]
回复

使用道具 举报

 楼主| 发表于 2003-1-21 19:34:30 | 显示全部楼层
vpc 中截取的。
回复

使用道具 举报

发表于 2003-1-21 23:47:46 | 显示全部楼层
Framebuffer to pngFramebuffer Shot 也可以截图咯
回复

使用道具 举报

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

本版积分规则

GMT+8, 2025-2-12 07:51 , Processed in 0.041951 second(s), 16 queries .

© 2001-2025 Discuz! Team. Powered by Discuz! X3.5.

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