blob: eee7c8f309f7093ed8ee7263ec7b90e2dcc77696 [file] [log] [blame]
#!/bin/sh /etc/rc.common
START=11
USE_PROCD=1
PATH_BIN=/bin/
PATH_UBIN=/usr/bin/
PATH_CURR=
start_instance() {
local respawn="$1"
local name="$2"
local path="$3$2"
local param="$4"
procd_open_instance "$name"
if [ -n "$param" ]; then
procd_set_param command "$path" "$param"
else
procd_set_param command "$path"
fi
if [ $respawn == 1 ]; then
procd_set_param respawn
fi
procd_close_instance
}
start_service() {
PIPE=`uci get cmdline.PIPE 2> /dev/null`
IOT_MODE=`getprop persist.iot_mode 2> /dev/null`
PRODMODE=`uci get cmdline.PROD 2> /dev/null`
LDTAMODE=`uci get cmdline.LDTA 2> /dev/null`
if [ -n "$LDTAMODE" ]; then
sleep 5
fi
if [ "$IOT_MODE" == "1" ]; then
[ "$PRODMODE" == "0" ] && /sbin/kmodloader
start_instance 0 "chl_agent" "${PATH_UBIN}"
else
if [ "$PIPE" == "1" ]; then
if cat /etc/mversion |grep p702 >/dev/null
then echo "p702 no need start CM services"
else
start_instance 0 "cm" "${PATH_UBIN}" -p
fi
local lan_dev
cp -rf /etc/config/pipe_org /etc/config/pipe
sync
lan_dev=`uci get pipe.lan.device`
if [ -z "$lan_dev" ]; then
echo "WARNING: no lan device configured"
fi
insmod mrvlpipe.ko lan_dev="$lan_dev"
[ "$PRODMODE" == "0" ] && /sbin/kmodloader
else
if cat /etc/mversion |grep p702 >/dev/null
then echo "p702 no need start CM services"
else
start_instance 0 "cm" "${PATH_UBIN}"
fi
[ "$PRODMODE" == "0" ] && /sbin/kmodloader
insmod mfp.ko
fi
fi
}