请问个问题 关于bootsplash的 shell 帮忙砍下

为当前最终发行版之前的所有版本提供支持
回复
nuclearxin
帖子: 20
注册时间: 2007-03-09 11:30
送出感谢: 0
接收感谢: 0

请问个问题 关于bootsplash的 shell 帮忙砍下

#1

帖子 nuclearxin » 2007-03-20 14:53

呵呵帮忙注解下 shell 的含意吧 有的懂有的不懂
就像看看原理 !!!!!!!!!!!!!帮忙懂的啊
有点偷懒见谅~~~~
trigger events during bootup
we suggest that you add a function to your init scripts that is called every time an init script is started. This can either be done in the runlevel scripts themselves or by the script/program scheduling it (i.e. /etc/init.d/rc)
function rc_splash() //这个函数作用域是??
{
test "$SPLASH" != "no" && test "$_rc_splash" -eq 1 && /sbin/splash "$1"
progress=$(( $progress + 1 ))
}
when adding the rc_splash call to your runlevel script scheduler, do it
about like this: //这个runleve script 需要替换原来的什么dd吗?

for i in $runrc/S${rex}*; do //这个$runrc/S${rex}* 怎么解释?运行$runrc 目录下所有S开头的dd?
[..] // 这个[..]是什么意思?
# send information to bootsplash handler.
rc_splash "$i start"
[..]
done
the splash program will look for the file // 这个splash will 是只什么时候?
/etc/bootsplash/themes/current/config/animations.cfg which looks like the following:

[ .. ]
fsck start:bootanim start fsck.mng //8懂~什么语法?
fsck stop:bootanim stop
[ .. ]
so when %i is "fsck" and the runlevel script is executed during system start, the bootanim start fsck.mng //fsck.mng 是什么dd 程序?script?

Basically, it's a list of bootup hooks that are associated with a command to be executed when a certain service is started/stopped during boot/shutdown. //这句话怎么解释?hooks 是什么意思?

The syntax is this:

[service] [start|stop]:[command-to-execute]
"Service" is almost always the name of an executed init script. There are some additional hooks for finetuning. See the SuSE 8.1 theme's config file "animations.cfg"
nuclearxin
帖子: 20
注册时间: 2007-03-09 11:30
送出感谢: 0
接收感谢: 0

#2

帖子 nuclearxin » 2007-03-20 15:05

The splash scripts //这个是简介吧??
The splash.sh wrapper script, which:
- paints a truetype rendered text during bootup and shutdown at predefined coordinates
- moves a progress bar, if there is one, using the proc interface.
- reads the config file /etc/bootsplash/themes/current/config/bootsplash-[X]x[Y].cfg
The bootanim wrapper script.

This script starts/stops animations played with fbmngplay. It looks for these animations in /etc/bootsplash/themes/current/animations/ per default. It will likely be called from the file animations.cfg. When you want to play an animation when apache is started, you would write: apache start:bootanim start animation.mng To fade out an animation, run bootanim stop. Bootanim can also play multiple animations in a row, each synchronized to a certain point in bootup. This can be used to keep the last picture of an animation visible after playing the animation. To achieve this, use bootanim start with option -m and multiple mng files. To move on to the next animation, use bootanim next later on. Before playing the next animation (esp. at the same position as before), you need to find a hook that can properly stop the boot animation (esp. when playing looped animations). It's also advised to have an entry in your config file that stops running animations as soon as the final system runlevel is reached: master:bootanim stop


加入bar了



Progress bar handling in the init scripts
To have a progress bar during bootup you need the following

A theme that contains a progress bar.
Look in the Theme section for information on how to add a progress bar and for example themes.
The above function rc_splash (or comparable functionality)
The splash.sh script (called from rc_splash as a wrapper to the splash utility)
Additionally you need to make your runlevel script scheduler (i.e. /etc/init.d/rc) aware of the number of scripts to be executed in the current runlevel:

#
# initialize boosplash progressbar variables
#
runrc=/etc/init.d/rc${RUNLEVEL}.d //.....${} 里面的变量是不是开机就确定啦啊?
prerc=/etc/init.d/rc${PREVLEVEL}.d

SSC=($runrc/S*)
case "$SSC" in
*\*) sscripts=0 ;;
*) sscripts=${#SSC[*]}
esac
export sscripts
if test "$PREVLEVEL" != "N" ; then
KSC=($prerc/K*)
case "$KSC" in
*\*) kscripts=0 ;;
*) kscripts=${#KSC[*]}
esac //上面这一段有点迷糊 帮忙解释下:)
export kscripts
fi

if [ "$PREVLEVEL" == "N" -a "$RUNLEVEL" == "5" ]; then
export progress=16
sscripts=$(( $sscripts+15 ))
else
export progress=0
fi //这段呢 那里用到 开始的那个function()函数啦?????
To switch the bootsplash off when the final runlevel is reached you can add the following to the runlevel script scheduler at the according place:

rc_splash "master"
This will cause most themes to switch off the bootsplash screen.
回复

回到 “老旧版本支持”