| #!/bin/sh /etc/rc.common |
| # Copyright (C) 2006-2011 OpenWrt.org |
| |
| START=15 |
| USE_PROCD=1 |
| |
| #MBTK_ADB=`getprop persist.mbtk.adb 2> /dev/null` |
| |
| mbtk_start() { |
| echo "start : $1" > /dev/kmsg |
| |
| procd_open_instance |
| procd_set_param command $@ |
| procd_close_instance |
| } |
| |
| mbtk_start_with_try() { |
| echo "start_with_try : $1" > /dev/kmsg |
| |
| procd_open_instance |
| procd_set_param command $@ |
| procd_set_param respawn 3600 3 0 |
| procd_close_instance |
| } |
| PRODMODE=`uci get cmdline.PROD 2> /dev/null` |
| start_service() { |
| echo "--mbtk normal boot start--" > /dev/kmsg |
| # mbtk_start /bin/mbtk_test |
| # mbtk_start /bin/mbtk_test "normal" 123 |
| if [ "$PRODMODE" == "0" ]; then |
| ######### user mode ######## |
| /sbin/usb_init & |
| fi |
| # ����app dump |
| DEBUG_ENABLE=`getprop persist.mbtk.appdump 2> /dev/null` |
| if [ "$DEBUG_ENABLE" == "1" ];then |
| grep -qxF 'ulimit -c unlimited' /etc/profile || echo 'ulimit -c unlimited' >> /etc/profile |
| |
| [ ! -d /media/var/log/modem_dump ] && mkdir -p /media/var/log/modem_dump |
| [ -f /proc/sys/kernel/core_pattern ] && echo "/media/var/log/modem_dump/coredump-%e-%s-%t" > /proc/sys/kernel/core_pattern |
| fi |
| |
| [ -e /bin/mbtk_adbd ] && mbtk_start /bin/mbtk_adbd |
| [ -e /bin/mbtk_servicesd ] && mbtk_start_with_try /bin/mbtk_servicesd |
| [ -e /bin/mbtk_rtpd ] && mbtk_start /bin/mbtk_rtpd |
| |
| echo "--mbtk normal boot end--" > /dev/kmsg |
| } |
| |