Commit 0ec2ed07356ae1f9106e41f48bf63e8a9884414d

Authored by Silvan Calarco
1 parent 8b735c12e0
Exists in master

rc: remove $PLYMOUTH update calls which were not correct and causing splash to crash on boot

Showing 1 changed file with 0 additions and 4 deletions Inline Diff

1 #!/bin/sh 1 #!/bin/sh
2 # rc - Main Run Level Control Script 2 # rc - Main Run Level Control Script
3 # 3 #
4 # Copyright (c) 2003-2011 by Silvan Calarco <silvan.calarco@mambasoft.it> 4 # Copyright (c) 2003-2011 by Silvan Calarco <silvan.calarco@mambasoft.it>
5 # Copyright (c) 2003-2009,2011 by Davide Madrisan <davide.madrisan@gmail.com> 5 # Copyright (c) 2003-2009,2011 by Davide Madrisan <davide.madrisan@gmail.com>
6 6
7 . /etc/sysconfig/rc 7 . /etc/sysconfig/rc
8 8
9 if [ -r $rc_base/init.d/rc.embedded ]; then 9 if [ -r $rc_base/init.d/rc.embedded ]; then
10 . $rc_base/init.d/rc.embedded 10 . $rc_base/init.d/rc.embedded
11 exit 0 11 exit 0
12 fi 12 fi
13 13
14 . $rc_functions 14 . $rc_functions
15 . /etc/sysconfig/i18n 15 . /etc/sysconfig/i18n
16 16
17 LC_ALL=$LANG 17 LC_ALL=$LANG
18 TEXTDOMAIN=initscripts 18 TEXTDOMAIN=initscripts
19 TEXTDOMAINDIR=/usr/share/locale/ 19 TEXTDOMAINDIR=/usr/share/locale/
20 20
21 HOME="/root"; export HOME 21 HOME="/root"; export HOME
22 22
23 trap "" SIGINT SIGQUIT SIGTSTP 23 trap "" SIGINT SIGQUIT SIGTSTP
24 24
25 # detect kernel command line parameters 25 # detect kernel command line parameters
26 # $CMDLINE is exported from mkinitramfs 26 # $CMDLINE is exported from mkinitramfs
27 [ -z "$CMDLINE" ] && CMDLINE="`cat /proc/cmdline 2>/dev/null`" 27 [ -z "$CMDLINE" ] && CMDLINE="`cat /proc/cmdline 2>/dev/null`"
28 28
29 debug=0 29 debug=0
30 for cmd in $CMDLINE; do 30 for cmd in $CMDLINE; do
31 case "$cmd" in 31 case "$cmd" in
32 debug) debug=1 ;; 32 debug) debug=1 ;;
33 debug=*) debug=${cmd/debug=/} ;; 33 debug=*) debug=${cmd/debug=/} ;;
34 multithread=*) multithread=${cmd/multithread=/} ;; 34 multithread=*) multithread=${cmd/multithread=/} ;;
35 esac 35 esac
36 done 36 done
37 37
38 [ $debug -gt 0 ] && MAKEADD="DEBUG=1" 38 [ $debug -gt 0 ] && MAKEADD="DEBUG=1"
39 39
40 # set current (new) and previous runlevels 40 # set current (new) and previous runlevels
41 runlevel=$1; export runlevel 41 runlevel=$1; export runlevel
42 previous=${PREVLEVEL:-N} 42 previous=${PREVLEVEL:-N}
43 rex="[0-9][0-9]" 43 rex="[0-9][0-9]"
44 44
45 [ "$runlevel" ] || 45 [ "$runlevel" ] ||
46 { echo "Usage: $0 <runlevel>" >&2; exit 1; } 46 { echo "Usage: $0 <runlevel>" >&2; exit 1; }
47 47
48 [ -d $rc_base/rc$runlevel.d ] || 48 [ -d $rc_base/rc$runlevel.d ] ||
49 { echo $"$rc_base/rc$runlevel.d does not exist" >&2; exit 1; } 49 { echo $"$rc_base/rc$runlevel.d does not exist" >&2; exit 1; }
50 50
51 [ "$previous" = "$runlevel" ] && exit 0 51 [ "$previous" = "$runlevel" ] && exit 0
52 52
53 export RUNLEVEL 53 export RUNLEVEL
54 54
55 [ "$previous" != "N" ] && progressbase=10 || progressbase=65 55 [ "$previous" != "N" ] && progressbase=10 || progressbase=65
56 56
57 if [ "$runlevel" = "0" -o "$runlevel" = "6" ]; then 57 if [ "$runlevel" = "0" -o "$runlevel" = "6" ]; then
58 $PLYMOUTHD --attach-to-session 58 $PLYMOUTHD --attach-to-session
59 $PLYMOUTH --show-splash 59 $PLYMOUTH --show-splash
60 if [ "$runlevel" = "0" ]; then 60 if [ "$runlevel" = "0" ]; then
61 $PLYMOUTH message --text=$"System shutting down, please wait..." 61 $PLYMOUTH message --text=$"System shutting down, please wait..."
62 else 62 else
63 $PLYMOUTH message --text=$"System rebooting, please wait..." 63 $PLYMOUTH message --text=$"System rebooting, please wait..."
64 fi 64 fi
65 else 65 else
66 $PLYMOUTH message --text=$"Starting services..." 66 $PLYMOUTH message --text=$"Starting services..."
67 fi 67 fi
68 68
69 $PLYMOUTH update --status=$progressbase
70
71 allservicesnum=`ls -1 $rc_base/rc$runlevel.d/[S,K]* 2>/dev/null | wc -l` 69 allservicesnum=`ls -1 $rc_base/rc$runlevel.d/[S,K]* 2>/dev/null | wc -l`
72 70
73 if [ "$previous" != "N" ]; then 71 if [ "$previous" != "N" ]; then
74 if [ "$multithread" = "1" ]; then 72 if [ "$multithread" = "1" ]; then
75 /bin/echo -e $"Stopping runlevel $runlevel services...""\r" >&2 73 /bin/echo -e $"Stopping runlevel $runlevel services...""\r" >&2
76 make -C /var/init --no-print-directory -i -j -f /var/init/runlevel.mk \ 74 make -C /var/init --no-print-directory -i -j -f /var/init/runlevel.mk \
77 JOB=stop \ 75 JOB=stop \
78 PROGRESS_TOT=${allservicesnum} \ 76 PROGRESS_TOT=${allservicesnum} \
79 PROGRESS_BASE=${progressbase} \ 77 PROGRESS_BASE=${progressbase} \
80 ALLSERVICESNUM=$allservicesnum $MAKEADD 78 ALLSERVICESNUM=$allservicesnum $MAKEADD
81 else 79 else
82 i=0 80 i=0
83 for servicefile in `ls $rc_base/rc$runlevel.d/K* 2>/dev/null`; do 81 for servicefile in `ls $rc_base/rc$runlevel.d/K* 2>/dev/null`; do
84 check_link $servicefile && 82 check_link $servicefile &&
85 { service=${servicefile#$rc_base/rc$runlevel.d/K$rex} 83 { service=${servicefile#$rc_base/rc$runlevel.d/K$rex}
86 prev_start=$rc_base/rc$previous.d/S$rex$service 84 prev_start=$rc_base/rc$previous.d/S$rex$service
87 sysinit_start=$rc_base/rcsysinit.d/S$rex$service 85 sysinit_start=$rc_base/rcsysinit.d/S$rex$service
88 86
89 if [ "$runlevel" != "0" ] && [ "$runlevel" != "6" ]; then 87 if [ "$runlevel" != "0" ] && [ "$runlevel" != "6" ]; then
90 [ ! -f $prev_start ] && [ ! -f $sysinit_start ] && continue 88 [ ! -f $prev_start ] && [ ! -f $sysinit_start ] && continue
91 fi 89 fi
92 90
93 progress=`expr $progressbase + $i \* \( 100 - $progressbase \) / ${allservicesnum}` 91 progress=`expr $progressbase + $i \* \( 100 - $progressbase \) / ${allservicesnum}`
94 $PLYMOUTH update --status=$progress
95 $servicefile stop 92 $servicefile stop
96 i=`expr $i + 1` 93 i=`expr $i + 1`
97 } 94 }
98 done 95 done
99 [ "$progress" ] && progressbase=$progress 96 [ "$progress" ] && progressbase=$progress
100 fi 97 fi
101 fi 98 fi
102 99
103 if [ "$multithread" = "1" ]; then 100 if [ "$multithread" = "1" ]; then
104 /bin/echo -e $"Starting runlevel $runlevel services...""\r" >&2 101 /bin/echo -e $"Starting runlevel $runlevel services...""\r" >&2
105 102
106 # recreate multithreaded dependencies 103 # recreate multithreaded dependencies
107 depinit >/dev/null 2>&1 104 depinit >/dev/null 2>&1
108 105
109 # now start multithreaded init 106 # now start multithreaded init
110 rm -f /var/lock/subsys/local 107 rm -f /var/lock/subsys/local
111 make -C /var/init --no-print-directory -i -j -k -f /var/init/runlevel.mk \ 108 make -C /var/init --no-print-directory -i -j -k -f /var/init/runlevel.mk \
112 JOB=start \ 109 JOB=start \
113 PROGRESS_TOT=${allservicesnum} \ 110 PROGRESS_TOT=${allservicesnum} \
114 PROGRESS_BASE=${progressbase} \ 111 PROGRESS_BASE=${progressbase} \
115 $MAKEADD 2>/dev/null & 112 $MAKEADD 2>/dev/null &
116 while [ ! -e /var/lock/subsys/local ]; do 113 while [ ! -e /var/lock/subsys/local ]; do
117 [ "`jobs`" ] || break 114 [ "`jobs`" ] || break
118 sleep 1 115 sleep 1
119 done 116 done
120 else 117 else
121 i=0 118 i=0
122 for servicefile in `ls $rc_base/rc$runlevel.d/S* 2> /dev/null`; do 119 for servicefile in `ls $rc_base/rc$runlevel.d/S* 2> /dev/null`; do
123 check_link $servicefile || { i=`expr $i + 1`; continue; } 120 check_link $servicefile || { i=`expr $i + 1`; continue; }
124 121
125 if [ "$previous" != "N" ]; then 122 if [ "$previous" != "N" ]; then
126 service=${servicefile#$rc_base/rc$runlevel.d/S$rex} 123 service=${servicefile#$rc_base/rc$runlevel.d/S$rex}
127 stop=$rc_base/rc$runlevel.d/K$rex$service 124 stop=$rc_base/rc$runlevel.d/K$rex$service
128 prev_start=$rc_base/rc$previous.d/S$rex$service 125 prev_start=$rc_base/rc$previous.d/S$rex$service
129 126
130 [ -f $prev_start ] && [ ! -f $stop ] && continue 127 [ -f $prev_start ] && [ ! -f $stop ] && continue
131 fi 128 fi
132 129
133 progress=`expr $progressbase + $i \* \( 100 - $progressbase \) / ${allservicesnum}` 130 progress=`expr $progressbase + $i \* \( 100 - $progressbase \) / ${allservicesnum}`
134 $PLYMOUTH update --status=$progress
135 $servicefile start 131 $servicefile start
136 i=`expr $i + 1` 132 i=`expr $i + 1`
137 done 133 done
138 fi 134 fi
139 135
140 if [ ! "$runlevel" = "5" ]; then 136 if [ ! "$runlevel" = "5" ]; then
141 chvt 1 137 chvt 1
142 $PLYMOUTH quit 138 $PLYMOUTH quit
143 fi 139 fi
144 140