|
发表于 2005-6-24 01:05:17
|
显示全部楼层
GRUB splash 切换脚本
Post by LiEn
Grub启动图片更换:
到/boot/grub/grub.conf文件中找到以下字段;
#boot=/dev/hda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz在这里把准备好的图片打包为gz后的文件名放在这里,同进将准备好的图片考备到这里。
下面是我写的用来自动切换 GRUB splash 的脚本,运行一次按图片文件名的字母序选择下一个 splash。
[php]# change the GRUB splash
# /boot 应该准备好了
cd /boot/grub
# 下面“btb”是我的名字,可以随意改变
# 但是注意 grub.conf 里要用如 btb.xpm.gz 来做 splash 的文件
## splashimage=(hd0,9)/boot/grub/btb.xpm.gz
# btb.xpm.gz 只是一个软链接,其它图片放在 splash.xpm.gz 同目录下即可
curxpm=`ls *.gz -l | grep btb|cut -d'>' -f2`
#echo "current xpm.gz is curxpm"
if test "$curxpm" = ""
then
nextxpm=`ls *.gz|head -n 1`
else
`rm btb.xpm.gz`
total=`ls *.gz -l |wc -l`
current=`ls *.gz|sort|grep -n $curxpm|cut -d: -f1`
next=`expr $current + 1`
if test $next -gt $total
then
next="1"
fi
nextxpm=`ls *.gz|sort|head -n $next|tail -n 1`
#echo $nextxpm
fi
`ln -s $nextxpm btb.xpm.gz`[/php] |
|