blob: d3e0f618ce7b56fc8710a01b5598a59ffbd8bdb3 [file] [log] [blame]
b.liud440f9f2025-04-18 10:44:31 +08001#!/bin/sh /etc/rc.common
2# Copyright (C) 2006-2011 OpenWrt.org
3
4START=15
5USE_PROCD=1
6
7#MBTK_ADB=`getprop persist.mbtk.adb 2> /dev/null`
8
9mbtk_start() {
10 echo "start : $1" > /dev/kmsg
11
12 procd_open_instance
13 procd_set_param command $@
14 procd_close_instance
15}
16
17mbtk_start_with_try() {
18 echo "start_with_try : $1" > /dev/kmsg
19
20 procd_open_instance
21 procd_set_param command $@
22 procd_set_param respawn 3600 3 0
23 procd_close_instance
24}
lichengzhangd4192112025-07-02 13:25:50 +080025PRODMODE=`uci get cmdline.PROD 2> /dev/null`
b.liud440f9f2025-04-18 10:44:31 +080026start_service() {
27 echo "--mbtk normal boot start--" > /dev/kmsg
28# mbtk_start /bin/mbtk_test
29# mbtk_start /bin/mbtk_test "normal" 123
lichengzhangd4192112025-07-02 13:25:50 +080030 if [ "$PRODMODE" == "0" ]; then
hong.liud89d8092025-06-30 20:30:13 +080031 ######### user mode ########
lichengzhangd4192112025-07-02 13:25:50 +080032 /sbin/usb_init &
33 fi
lichengzhanga7089172025-07-01 20:41:46 +080034 # ����app dump
b.liu35419042025-06-24 15:25:00 +080035 DEBUG_ENABLE=`getprop persist.mbtk.appdump 2> /dev/null`
36 if [ "$DEBUG_ENABLE" == "1" ];then
hj.shaof99a6d92025-06-27 00:32:58 -070037 grep -qxF 'ulimit -c unlimited' /etc/profile || echo 'ulimit -c unlimited' >> /etc/profile
38 sed -i 's/^default_media=.*/default_media=2/' /etc/mrvl_tel_diag.cfg
39 sed -i 's|^log_path=.*|log_path=/media/var/log|' /etc/mrvl_tel_diag.cfg
40
41 [ ! -d /media/var/log/modem_dump ] && mkdir -p /media/var/log/modem_dump
b.liuf349f8c2025-06-24 17:31:18 +080042 [ -f /proc/sys/kernel/core_pattern ] && echo "/media/var/log/modem_dump/coredump-%e-%s-%t" > /proc/sys/kernel/core_pattern
b.liu35419042025-06-24 15:25:00 +080043 fi
b.liud440f9f2025-04-18 10:44:31 +080044
45 [ -e /bin/mbtk_adbd ] && mbtk_start /bin/mbtk_adbd
46 [ -e /bin/mbtk_servicesd ] && mbtk_start_with_try /bin/mbtk_servicesd
xy.he17a63d02025-05-27 20:19:24 +080047 [ -e /bin/mbtk_rtpd ] && mbtk_start /bin/mbtk_rtpd
b.liud440f9f2025-04-18 10:44:31 +080048
49 echo "--mbtk normal boot end--" > /dev/kmsg
50}
51