|
楼主 |
发表于 2004-5-5 20:28:43
|
显示全部楼层
对不起,今天晚上重新想了一下,实现这个并不需要这么烦的,于是重新做了一下
如下:
其实原理也就是利用fbmngplay这么程序,magic上有,
[root@MagicLinux huting]# fbmngplay -h
usage: fbmngplay [ -x <val> ] [ -y <val> ] [ -a <val> ] [-b] [-v] [-s] [file.mng [file.mng [...]]]
-x: x coordinate
-y: y coordinate
-a, --alpha: default alpha channel 1..100
-v, --verbose: verbose mode
-b, --buffered: buffered mode
-s, --signal: wait for SIGUSR1 between animations
-p, --position: dynamically select position
-V, --version: show version and exit
-?, -h, --help: print this help.
-S --start-console: only output animation on console it was started on.
-c: start output animation on specified console.
也来写一个脚本:
animate.sh放在/sbin中
源码:
case "$1" in
start)
fbmngplay -x 420 -y 580 /etc/bootsplash/themes/current/animations/bounce.mng &
exit 0
;;
stop)
killall -q fbmngplay
exit 0
;;
esac
将其的属性改为可执行。
chmod +x animate.sh
然后在/etc/rc.d/rc.sysinit中加入一行
找到这一段
# Graphical bootup...
if [ "$BOOTUP" = "graphical" ]; then
if [ -w /proc/splash -a -e /proc/fb ]; then
# Initialize bootsplash
# TODO: Find out runlevel (-> number of startup scripts -> number of steps)
runlevel=5
export kscripts=`/bin/ls /etc/rc.d/rc$runlevel.d/K* |/usr/bin/wc |/bin/awk '{ print $1 }'`
export sscripts=`/bin/ls /etc/rc.d/rc$runlevel.d/S* |/usr/bin/wc |/bin/awk '{ print $1 }'`
export progress=1
# HACK: count rc.sysinit stuff as startup scripts...
sscripts=$(( $sscripts + 19 ))
/sbin/animate.sh start <-加入这一行,在启动时运行fbmngplay
else
# Kernel doesn't have bootsplash support --> switch to text
export BOOTUP=color
fi
fi
要关掉fbmngplay也行简单。我是找到/etc/rc.d/init.d有找到最后一个运行的脚来,在start)那一段最后加一句
/sbin/animate.sh stop
比如我最后运行的是vmware。所以,修改vmware
case "$1" in <-找到这一段
start)
if [ -e "$vmware_etc_dir"/not_configured ]; then
echo "`vmware_product_name`"' is installed, but it has not been (correctly) configured'
echo 'for the running kernel. To (re-)configure it, invoke the'
echo
...
[ -d /var/lock/subsys ] || mkdir -p /var/lock/subsys
touch /var/lock/subsys/"$subsys"
/sbin/animate.sh stop <-加入这一行
;;
关闭系统时,首先关闭的是atd,所以在atd的脚本中stop)段最开始加一句
/sbin/animate.sh start
stop() {
/sbin/animate.sh start <-加入这一行
echo -n $"Stopping $prog: "
killproc /usr/sbin/atd
RETVAL=$?
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/atd
echo
return $RETVAL
这样就行了:) |
|