Magellan Linux

Contents of /trunk/busybox/splash-functions-plymouth.rc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1870 - (show annotations) (download)
Mon Jul 30 18:26:27 2012 UTC (11 years, 8 months ago) by niro
File size: 1674 byte(s)
-include more upstream changes
1 # /etc/rc.d/init.d/splash-functions - splash-functions for plymouth
2 # $Id$
3
4 _plymouth=/usr/bin/plymouth
5 _plymouthd=/usr/sbin/plymouthd
6 _pidfile=/run/plymouth/pid
7 _udevadm=/usr/bin/udevadm
8
9 splash()
10 {
11 # proc must be mounted too
12 [[ ! -e /proc/cmdline ]] && return 0
13
14 if grep plymouth.enable=0 /proc/cmdline &> /dev/null
15 then
16 rc_echo "User requested to disable plymouth via cmdline"
17 return 0
18 fi
19
20 case $1 in
21 rc_init) rc_init ;;
22 rc_exit) rc_exit ;;
23 rc_verbose) ;;
24 svc_started) svc_update "$2" ;;
25 svc_stopped) svc_update "$2" ;;
26 esac
27 }
28
29 svc_update()
30 {
31 if [ -x ${_plymouth} ]
32 then
33 ${_plymouth} --ping && ${_plymouth} --update="$1"
34 # ${_plymouth} --ping && ${_plymouth} message --text="$1"
35 fi
36 }
37
38 rc_init()
39 {
40 if [[ ${runlevel} = boot ]] || [[ ${runlevel} = sysinit ]]
41 then
42 if [ -x ${_plymouthd} ]
43 then
44 ${_plymouthd} --mode=boot --pidfile=${_pidfile} --attach-to-session
45 fi
46 if [ -x ${_udevadm} ]
47 then
48 ${_udevadm} trigger --action=add --subsystem-match=graphics --subsystem-match=drm --subsystem-match=tty
49 ${_udevadm} settle --timeout=30 --exit-if-exists=/sys/class/drm/card0/dev
50 ${_udevadm} settle --timeout=30 --exit-if-exists=/sys/class/graphics/fb0/dev
51 fi
52 if [ -x ${_plymouth} ]
53 then
54 ${_plymouth} show-splash
55 fi
56 fi
57
58 if [[ ${runlevel} = shutdown ]] || [[ ${runlevel} = reboot ]]
59 then
60 if [ -x ${_plymouthd} ]
61 then
62 ${_plymouthd} --mode=shutdown --pidfile=${_pidfile} --attach-to-session
63 fi
64 if [ -x ${_plymouth} ]
65 then
66 ${_plymouth} show-splash
67 fi
68 fi
69 }
70
71 rc_exit()
72 {
73 if [ -x ${_plymouth} ]
74 then
75 # update rootfs data
76 ${_plymouth} update-root-fs --read-write
77 # and quit
78 ${_plymouth} quit
79 fi
80 }