hc
2024-03-22 a0752693d998599af469473b8dc239ef973a012f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/sh
 
pvrsrvkm_ko="/lib/modules/$(/bin/uname -r)/extra/pvrsrvkm.ko"
 
pvr_loaded() {
   /sbin/lsmod | /bin/grep -q '^\<pvrsrvkm\>'
}
 
pvr_load() {
   /sbin/insmod "$pvrsrvkm_ko" > /dev/null 2>&1
}
 
start() {
   printf 'Loading pvrsrvkm module: '
   pvr_loaded || pvr_load
   status=$?
   if [ "$status" -eq 0 ]; then
       printf 'Starting PowerVR services: '
       /usr/bin/pvrsrvctl --start --no-module > /dev/null 2>&1
       status=$?
   fi
   if [ "$status" -eq 0 ]; then
       echo "OK"
   else
       echo "FAIL"
   fi
   return "$status"
}
 
stop() {
   printf 'Starting PowerVR services: '
   /usr/bin/pvrsrvctl --stop > /dev/null 2>&1
   status=$?
   if [ "$status" -eq 0 ]; then
       echo "OK"
   else
       echo "FAIL"
   fi
   return "$status"
}
 
restart() {
   stop
   sleep 1
   start
}
 
case "$1" in
   start|stop|restart)
       "$1";;
   reload)
       restart;;
   *)
       echo "Usage: $0 {start|stop|restart|reload}"
       exit 1
esac