LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
12
返回列表 发新帖
楼主: dreamrise

bootsplash for kernel 2.6.5 (success! 全过程)

[复制链接]
发表于 2004-5-2 08:55:52 | 显示全部楼层
昨天晚上重启了一个晚上,搞明白了进度条的问题

porgressbar XX
(XX是一个具体的数字)
这一句是把进度条的长度变成XX%位置的,在rc.S和rc.M相应的位置上加才可以
在rc.S和rc.M的开始加入". /etc/rc.d/rc.bootsplash"
(/etc/rc.d/rc.bootsplash的内容就象SunnyLhj给出的那个样子,我的是装上直接就有的-_-UUU)
然后在某个步骤加上progressbar XX
走的均匀不均匀要看自己在什么位置上写porgressbar XX,而且要看XX的数字来定,反正我是没有那个耐心慢慢试了........
还有,我用的是lilo,所以在用
splash -s -f /etc/bootsplash/themes/current/config/bootsplash-1024x768.cfg > /boot/initrd
改变themes之后还要lilo一次才可以-_-UU,看来还是改成grub比较好


我下载的包里面有一个rc.S和rc.M的例子,贴出一个rc.M的(不要 使用这个来替代你的rc.M!!):
[PHP]
#!/bin/sh
#
# rc.M                This file is executed by init(8) when the system is being
#                initialized for one of the "multi user" run levels (i.e.
#                levels 1 through 6).  It usually does mounting of file
#                systems et al.
#
# Version:        @(#)/etc/rc.d/rc.M        2.23        Wed Feb 26 19:20:58 PST 2003
#
# Author:        Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
#                Heavily modified by Patrick Volkerding <volkerdi@slackware.com>
#
## bootsplash
. /etc/rc.d/rc.bootsplash

# Tell the viewers what's going to happen.
progressbar 51
animate startup
echo "Going multiuser..."

# Screen blanks after 15 minutes idle time.
/bin/setterm -blank 15

# If there's no /etc/HOSTNAME, fall back on this default:
if [ ! -r /etc/HOSTNAME ]; then
  progressbar 53
  echo "darkstar.example.net" > /etc/HOSTNAME
fi

# Set the hostname.
/bin/hostname `cat /etc/HOSTNAME | cut -f1 -d .`
progressbar 55

# Initialize PCMCIA devices:
#
# NOTE: This used to be started near the top of rc.S so that PCMCIA devices
# could be fsck'ed along with the other drives.  This had some unfortunate
# side effects, however, since root isn't yet read-write, and /var might not
# even be mounted the .pid files can't be correctly written in /var/run and
# the pcmcia system can't be correctly shut down.  If you want some PCMCIA
# partition to be mounted at boot (or when the card is inserted) then add
# the appropriate lines to /etc/pcmcia/scsi.opts.
#
if [ -x /etc/rc.d/rc.pcmcia ] ; then
   progressbar 57
  . /etc/rc.d/rc.pcmcia start
  # The cards might need a little extra time here to initialize.
  if [ -r /var/run/cardmgr.pid ]; then
    sleep 5
  fi
fi

# Initialize the networking hardware:
if [ -x /etc/rc.d/rc.inet1 ]; then
    progressbar 59
  . /etc/rc.d/rc.inet1
fi
# Initialize the hotplugging subsystem for PCI, Cardbus, and USB devices:
if [ -x /etc/rc.d/rc.hotplug -a -r /proc/modules ]; then
  # Don't run hotplug if 'nohotplug' was given at boot.
  if ! grep nohotplug /proc/cmdline 1> /dev/null 2> /dev/null ; then
    . /etc/rc.d/rc.hotplug start
  fi
fi
# Start networking daemons:
if [ -x /etc/rc.d/rc.inet2 ]; then
    progressbar 61
  . /etc/rc.d/rc.inet2
else
  # Start the system logger.  Normally this is started by
  # rc.inet2 because /usr might be mounted via NFS.
  if [ -x /etc/rc.d/rc.syslog ]; then
     progressbar 61
    . /etc/rc.d/rc.syslog start
  fi
fi

# Remove stale locks and junk files (must be done after mount -a!)
progressbar 63
/bin/rm -f /var/lock/* /var/spool/uucp/LCK..* /tmp/.X*lock /tmp/core /core 1> /dev/null 2> /dev/null

# Remove stale hunt sockets so the game can start.
if [ -r /tmp/hunt -o -r /tmp/hunt.stats ]; then
  progressbar 65
  echo "Removing your stale hunt sockets from /tmp."
  /bin/rm -f /tmp/hunt*
fi

# Ensure basic filesystem permissions sanity.
progressbar 67
chmod 755 / 2> /dev/null
chmod 1777 /tmp /var/tmp

# Update all the shared library links:
if [ -x /sbin/ldconfig ]; then
   echo "Updating shared library links:  /sbin/ldconfig"
   /sbin/ldconfig
fi

# Update the X font indexes:
if [ -x /usr/X11R6/bin/fc-cache ]; then
   progressbar 69
  echo "Updating X font indexes:  /usr/X11R6/bin/fc-cache"
  /usr/X11R6/bin/fc-cache
fi

# Start the print spooling system.  This will usually be LPD or CUPS.
if [ -x /etc/rc.d/rc.cups ]; then
  progressbar 71
  # Start CUPS:
  /etc/rc.d/rc.cups start
elif [ -x /usr/sbin/lpd ]; then
  # Start LPD:
  progressbar 71
  echo "Starting the line printer daemon:  /usr/sbin/lpd"
  /usr/sbin/lpd
fi

# Start netatalk. (a file/print server for Macs using Appletalk)
#if [ -x /etc/rc.d/rc.atalk ]; then
#  /etc/rc.d/rc.atalk
#fi

# Start smartd, which monitors the status of S.M.A.R.T. compatible
# hard drives and reports any problems.  Note some devices (which aren't
# smart, I guess ;) will hang if probed by smartd, so it's commented out
## by default.
#if [ -x /usr/sbin/smartd ]; then
#  progressbar 73
#  /usr/sbin/smartd
#fi

# Monitor the UPS with genpowerd.
# To use this, uncomment it and edit in your serial device and UPS type.  For
# more information, see "man genpowerd" or the extensive documentation in the
# /usr/doc/genpower-1.0.1 directory.  You can see a list of supported UPS
# devices by running genpowerd from the command line.
# You'll also need to configure a similar block in /etc/rc.d/rc.6 if you want
# support for stopping the UPS's inverter after the machine halts.
#if [ -x /sbin/genpowerd ]; then
#  echo "Starting genpowerd daemon..."
#  /sbin/genpowerd /dev/ttyS4 tripp-nt
#fi

# Turn on process accounting.  To enable process accounting, make sure the
# option for BSD process accounting is enabled in your kernel, and then
# create the file /var/log/pacct (touch /var/log/pacct).  By default, process
# accounting is not enabled (since /var/log/pacct does not exist).  This is
# because the log file can get VERY large.
if [ -x /sbin/accton -a -r /var/log/pacct ]; then
  progressbar 74
  /sbin/accton /var/log/pacct
  chmod 640 /var/log/pacct
  echo "rocess accounting turned on."
fi

# Start crond (Dillon's crond):
# If you want cron to actually log activity to /var/log/cron, then change
# -l10 to -l8 to increase the logging level.
if [ -x /usr/sbin/crond ]; then
   progressbar 77
  /usr/sbin/crond -l10 >>/var/log/cron 2>&1
fi

# Start atd (manages jobs scheduled with 'at'):
if [ -x /usr/sbin/atd ]; then
  progressbar 79
  /usr/sbin/atd -b 15 -l 1
fi

# Slackware-Mini-Quota-HOWTO:
# To really activate quotas, you'll need to add 'usrquota' to the appropriate
# partitions as listed in /etc/fstab.  Here's an example:
# /dev/hda2   /home   ext2   defaults,usrquota    1   1
# You'll then need to setup initial quota files at the top of the partitions
# to support quota, like this:
# touch /home/quota.user /home/quota.group
# chmod 600 /home/quota.user /home/quota.group
# Then, reboot to activate the system.
# To edit user quotas, use 'edquota'.  See 'man edquota'.  Also, the
# official Quota Mini-HOWTO has lots of useful information.  That can be found
# here:  /usr/doc/Linux-mini-HOWTOs/Quota

# Check quotas and then turn quota system on:
if fgrep quota /etc/fstab 1> /dev/null 2> /dev/null ; then
  if [ -x /sbin/quotacheck ]; then
    progressbar 81
    echo "Checking filesystem quotas:  /sbin/quotacheck -avugM"
    /sbin/quotacheck -avugM
  fi
  if [ -x /sbin/quotaon ]; then
    progressbar 81
    echo "Activating filesystem quotas:  /sbin/quotaon -avug"
    /sbin/quotaon -avug
  fi
fi

# Start the sendmail daemon:
if [ -x /etc/rc.d/rc.sendmail ]; then
  progressbar 83
  . /etc/rc.d/rc.sendmail start
fi

# Start the APM daemon if APM is enabled in the kernel:
#
if [ -x /usr/sbin/apmd ]; then
  if cat /proc/apm 1> /dev/null 2> /dev/null ; then
    progressbar 85
    echo "Starting APM daemon:  /usr/sbin/apmd"
    /usr/sbin/apmd
  fi
fi

# Start the ACPI (Advanced Configuration and Power Interface) daemon:
if [ -x /etc/rc.d/rc.acpid ]; then
   progressbar 87
  . /etc/rc.d/rc.acpid start
fi

# Load a custom screen font if the user has an rc.font script.
if [ -x /etc/rc.d/rc.font ]; then
  progressbar 89
  . /etc/rc.d/rc.font
fi

# Load a custom keymap if the user has an rc.keymap script.
if [ -x /etc/rc.d/rc.keymap ]; then
   progressbar 91
  . /etc/rc.d/rc.keymap
fi

# Start Web server:
if [ -x /etc/rc.d/rc.httpd ]; then
    progressbar 93
   . /etc/rc.d/rc.httpd start
fi

# Start Samba (a file/print server for Win95/NT machines).
# Samba can be started in /etc/inetd.conf instead.
if [ -x /etc/rc.d/rc.samba ]; then
    progressbar 95
  . /etc/rc.d/rc.samba start
fi

# Start the GPM mouse server:
if [ -x /etc/rc.d/rc.gpm ]; then
    progressbar 97
  . /etc/rc.d/rc.gpm start
fi

# If there are SystemV init scripts for this runlevel, run them.
if [ -x /etc/rc.d/rc.sysvinit ]; then
   progressbar 99
  . /etc/rc.d/rc.sysvinit
fi

# Start the local setup procedure.
if [ -x /etc/rc.d/rc.local ]; then
  progressbar 100
  animate shutdown
  . /etc/rc.d/rc.local
fi

# All done.
[/PHP]


在这里面还有个animate startup和animate shutdown,这个是控制动画的,只要在需要动画开始的地方写一下,需要动画结束的地方写一下就OK了,不过是需要themes里面有动画才可以的
发表于 2004-5-3 08:14:40 | 显示全部楼层

用这个直接替换原来的rc.S、rc.M、rc.bootsplash就可以了!

发表于 2004-5-5 19:08:32 | 显示全部楼层
请问baif:       
**************************************************************
        呵呵,我用的是cko的补丁。

里边包含了这些补丁。

还有mm、reiserfs等等的补丁。

**************************************************************
这个cko的patch是在哪边下的,我也要的说!

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

本版积分规则

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