2 # SPDX-License-Identifier: GPL-2.0-only
3 # Intel MIC Platform Software Stack (MPSS)
5 # Copyright(c) 2013 Intel Corporation.
7 # Intel MIC User Space Tools.
9 # micctrl - Controls MIC boot/start/stop.
11 # chkconfig: 2345 95 05
12 # description: start MPSS stack processing.
18 # Source function library.
19 .
/etc
/init.d
/functions
21 sysfs
="/sys/class/mic"
26 echo -e $1 state
: "`cat $f/state`" shutdown_status
: "`cat $f/shutdown_status`"
31 if [ "`echo $1 | head -c3`" == "mic" ]; then
39 [ $RETVAL -ne 0 ] && return $RETVAL
52 if [ "`echo $1 | head -c3`" == "mic" ]; then
60 [ $RETVAL -ne 0 ] && return $RETVAL
68 echo "linux" > $f/bootmode
69 echo "mic/uos.img" > $f/firmware
70 echo "mic/$1.image" > $f/ramdisk
71 echo "boot" > $f/state
76 if [ "`echo $1 | head -c3`" == "mic" ]; then
84 [ $RETVAL -ne 0 ] && return $RETVAL
92 echo shutdown
> $f/state
97 if [ "`echo $1 | head -c3`" == "mic" ]; then
103 _shutdown
`basename $f`
105 [ $RETVAL -ne 0 ] && return $RETVAL
113 while [ "`cat $f/state`" != "offline" -a "`cat $f/state`" != "online" ]
116 echo -e "Waiting for $1 to go offline"
122 if [ "`echo $1 | head -c3`" == "mic" ]; then
126 # Wait for the cards to go offline
131 [ $RETVAL -ne 0 ] && return $RETVAL
136 if [ ! -d "$sysfs" ]; then
137 echo -e $
"Module unloaded "
158 echo $
"Usage: $0 {-s (status) |-r (reset) |-b (boot) |-S (shutdown) |-w (wait)}"