当前时区为 UTC + 8 小时



发表新帖 回复这个主题  [ 2 篇帖子 ] 
作者 内容
1 楼 
 文章标题 : 请问个问题 关于bootsplash的 shell 帮忙砍下
帖子发表于 : 2007-03-20 14:53 

注册: 2007-03-09 11:30
帖子: 20
送出感谢: 0 次
接收感谢: 0 次
呵呵帮忙注解下 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"


页首
 用户资料  
 
2 楼 
 文章标题 :
帖子发表于 : 2007-03-20 15:05 

注册: 2007-03-09 11:30
帖子: 20
送出感谢: 0 次
接收感谢: 0 次
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.


页首
 用户资料  
 
显示帖子 :  排序  
发表新帖 回复这个主题  [ 2 篇帖子 ] 

当前时区为 UTC + 8 小时


在线用户

正在浏览此版面的用户:没有注册用户 和 5 位游客


不能 在这个版面发表主题
不能 在这个版面回复主题
不能 在这个版面编辑帖子
不能 在这个版面删除帖子
不能 在这个版面提交附件

前往 :  
本站点为公益性站点,用于推广开源自由软件,由 DiaHosting VPSBudgetVM VPS 提供服务。
我们认为:软件应可免费取得,软件工具在各种语言环境下皆可使用,且不会有任何功能上的差异;
人们应有定制和修改软件的自由,且方式不受限制,只要他们自认为合适。

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
简体中文语系由 王笑宇 翻译