2 # Intel MIC Platform Software Stack (MPSS)
4 # Copyright(c) 2013 Intel Corporation.
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License, version 2, as
8 # published by the Free Software Foundation.
10 # This program is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # General Public License for more details.
15 # The full GNU General Public License is included in this distribution in
16 # the file called "COPYING".
18 # Intel MIC User Space Tools.
20 # micctrl - Controls MIC boot/start/stop.
22 # chkconfig: 2345 95 05
23 # description: start MPSS stack processing.
29 # Source function library.
30 .
/etc
/init.d
/functions
32 sysfs
="/sys/class/mic"
37 echo -e $1 state
: "`cat $f/state`" shutdown_status
: "`cat $f/shutdown_status`"
42 if [ "`echo $1 | head -c3`" == "mic" ]; then
50 [ $RETVAL -ne 0 ] && return $RETVAL
63 if [ "`echo $1 | head -c3`" == "mic" ]; then
71 [ $RETVAL -ne 0 ] && return $RETVAL
79 echo "linux" > $f/bootmode
80 echo "mic/uos.img" > $f/firmware
81 echo "mic/$1.image" > $f/ramdisk
82 echo "boot" > $f/state
87 if [ "`echo $1 | head -c3`" == "mic" ]; then
95 [ $RETVAL -ne 0 ] && return $RETVAL
103 echo shutdown
> $f/state
108 if [ "`echo $1 | head -c3`" == "mic" ]; then
114 _shutdown
`basename $f`
116 [ $RETVAL -ne 0 ] && return $RETVAL
124 while [ "`cat $f/state`" != "offline" -a "`cat $f/state`" != "online" ]
127 echo -e "Waiting for $1 to go offline"
133 if [ "`echo $1 | head -c3`" == "mic" ]; then
137 # Wait for the cards to go offline
142 [ $RETVAL -ne 0 ] && return $RETVAL
147 if [ ! -d "$sysfs" ]; then
148 echo -e $
"Module unloaded "
169 echo $
"Usage: $0 {-s (status) |-r (reset) |-b (boot) |-S (shutdown) |-w (wait)}"