90 lines
2.3 KiB
Plaintext
90 lines
2.3 KiB
Plaintext
|
#!/bin/sh /etc/rc.common
|
||
|
# Copyright (C) 2006-2011 OpenWrt.org
|
||
|
|
||
|
STOP=121
|
||
|
USE_PROCD=1
|
||
|
|
||
|
PROG_VOICE=/bin/netease_voice
|
||
|
PROG_CC=/usr/sbin/netease_control_center
|
||
|
PROG_PLAYER=/usr/bin/ihwplayer
|
||
|
PROG_LE_APP=/usr/bin/app_nevsps_bt
|
||
|
PROG_WIFI_APP=/bin/app_wifi_manager
|
||
|
PROG_OTA=/usr/bin/ota
|
||
|
PROG_ALARMER=/usr/bin/alarmer
|
||
|
PROG_KPLAYER=/usr/bin/KPlayer
|
||
|
PROG_SPLAYER=/usr/bin/SPlayer
|
||
|
|
||
|
PROG_WIRELESS_TEST=/usr/bin/wirelessTest
|
||
|
PROG_MCU_OTA=/usr/bin/mcu_ota
|
||
|
|
||
|
OOM_ADJ=2
|
||
|
LOG=/tmp/netease.init.log
|
||
|
GOROOT=/usr/share/golang/
|
||
|
|
||
|
init_dbus() {
|
||
|
echo "init dbus" >> $LOG
|
||
|
if [ -x /tmp/dbus_env.sh ]
|
||
|
then
|
||
|
DBUS_DAEMON_ON=`ps | grep "dbus-daemon --fork" | grep -v grep | wc -l`
|
||
|
if [ "$DBUS_DAEMON_ON" == "1" ]
|
||
|
then
|
||
|
source /tmp/dbus_env.sh
|
||
|
else
|
||
|
echo "-----------------" >> /mnt/UDISK/reboot.log
|
||
|
date -R >> /mnt/UDISK/reboot.log
|
||
|
reboot -f
|
||
|
fi
|
||
|
else
|
||
|
export $(dbus-launch)
|
||
|
echo "export DBUS_SESSION_BUS_ADDRESS=\"$DBUS_SESSION_BUS_ADDRESS\"" > /tmp/dbus_env.sh
|
||
|
echo "export DBUS_SESSION_BUS_PID=\"$DBUS_SESSION_BUS_PID\"" >> /tmp/dbus_env.sh
|
||
|
chmod +x /tmp/dbus_env.sh
|
||
|
fi
|
||
|
|
||
|
echo "wzj: DBUS_SESSION_BUS_ADDRESS=\"$DBUS_SESSION_BUS_ADDRESS\"" >> $LOG
|
||
|
}
|
||
|
|
||
|
start_cc() {
|
||
|
echo "start cc manufacture mode" >> $LOG
|
||
|
echo $DBUS_SESSION_BUS_ADDRESS >> $LOG
|
||
|
procd_open_instance
|
||
|
procd_set_param oom_adj $OOM_ADJ
|
||
|
procd_set_param command $PROG_CC
|
||
|
procd_set_param respawn
|
||
|
procd_append_param limits core=unlimited
|
||
|
procd_set_param env DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS ccmode=manufacture GOROOT=$GOROOT
|
||
|
procd_close_instance
|
||
|
|
||
|
}
|
||
|
|
||
|
start_wirelessTest() {
|
||
|
echo "start cc manufacture mode" >> $LOG
|
||
|
echo $DBUS_SESSION_BUS_ADDRESS >> $LOG
|
||
|
procd_open_instance
|
||
|
procd_set_param oom_adj $OOM_ADJ
|
||
|
procd_set_param command $PROG_WIRELESS_TEST
|
||
|
procd_set_param respawn
|
||
|
procd_append_param limits core=unlimited
|
||
|
procd_set_param env DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS ccmode=manufacture GOROOT=$GOROOT
|
||
|
procd_close_instance
|
||
|
|
||
|
}
|
||
|
start_mcu_ota() {
|
||
|
echo "start cc manufacture mode" >> $LOG
|
||
|
echo $DBUS_SESSION_BUS_ADDRESS >> $LOG
|
||
|
procd_open_instance
|
||
|
procd_set_param oom_adj $OOM_ADJ
|
||
|
procd_set_param command $PROG_MCU_OTA
|
||
|
procd_set_param respawn
|
||
|
procd_append_param limits core=unlimited
|
||
|
procd_set_param env DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS ccmode=manufacture GOROOT=$GOROOT
|
||
|
procd_close_instance
|
||
|
|
||
|
}
|
||
|
|
||
|
start_service() {
|
||
|
init_dbus
|
||
|
|
||
|
start_wirelessTest
|
||
|
}
|