b.liu | d440f9f | 2025-04-18 10:44:31 +0800 | [diff] [blame] | 1 | #!/bin/sh /etc/rc.common |
| 2 | # Copyright (C) 2006-2011 OpenWrt.org |
| 3 | |
| 4 | START=15 |
| 5 | USE_PROCD=1 |
| 6 | |
| 7 | #MBTK_ADB=`getprop persist.mbtk.adb 2> /dev/null` |
| 8 | |
| 9 | mbtk_start() { |
| 10 | echo "start : $1" > /dev/kmsg |
| 11 | |
| 12 | procd_open_instance |
| 13 | procd_set_param command $@ |
| 14 | procd_close_instance |
| 15 | } |
| 16 | |
| 17 | mbtk_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 | } |
lichengzhang | d419211 | 2025-07-02 13:25:50 +0800 | [diff] [blame] | 25 | PRODMODE=`uci get cmdline.PROD 2> /dev/null` |
b.liu | d440f9f | 2025-04-18 10:44:31 +0800 | [diff] [blame] | 26 | start_service() { |
| 27 | echo "--mbtk normal boot start--" > /dev/kmsg |
| 28 | # mbtk_start /bin/mbtk_test |
| 29 | # mbtk_start /bin/mbtk_test "normal" 123 |
lichengzhang | d419211 | 2025-07-02 13:25:50 +0800 | [diff] [blame] | 30 | if [ "$PRODMODE" == "0" ]; then |
hong.liu | d89d809 | 2025-06-30 20:30:13 +0800 | [diff] [blame] | 31 | ######### user mode ######## |
lichengzhang | d419211 | 2025-07-02 13:25:50 +0800 | [diff] [blame] | 32 | /sbin/usb_init & |
| 33 | fi |
lichengzhang | a708917 | 2025-07-01 20:41:46 +0800 | [diff] [blame] | 34 | # ����app dump |
b.liu | 3541904 | 2025-06-24 15:25:00 +0800 | [diff] [blame] | 35 | DEBUG_ENABLE=`getprop persist.mbtk.appdump 2> /dev/null` |
| 36 | if [ "$DEBUG_ENABLE" == "1" ];then |
hj.shao | f99a6d9 | 2025-06-27 00:32:58 -0700 | [diff] [blame] | 37 | grep -qxF 'ulimit -c unlimited' /etc/profile || echo 'ulimit -c unlimited' >> /etc/profile |
hj.shao | f99a6d9 | 2025-06-27 00:32:58 -0700 | [diff] [blame] | 38 | |
| 39 | [ ! -d /media/var/log/modem_dump ] && mkdir -p /media/var/log/modem_dump |
b.liu | f349f8c | 2025-06-24 17:31:18 +0800 | [diff] [blame] | 40 | [ -f /proc/sys/kernel/core_pattern ] && echo "/media/var/log/modem_dump/coredump-%e-%s-%t" > /proc/sys/kernel/core_pattern |
b.liu | 3541904 | 2025-06-24 15:25:00 +0800 | [diff] [blame] | 41 | fi |
b.liu | d440f9f | 2025-04-18 10:44:31 +0800 | [diff] [blame] | 42 | |
| 43 | [ -e /bin/mbtk_adbd ] && mbtk_start /bin/mbtk_adbd |
| 44 | [ -e /bin/mbtk_servicesd ] && mbtk_start_with_try /bin/mbtk_servicesd |
xy.he | 17a63d0 | 2025-05-27 20:19:24 +0800 | [diff] [blame] | 45 | [ -e /bin/mbtk_rtpd ] && mbtk_start /bin/mbtk_rtpd |
b.liu | d440f9f | 2025-04-18 10:44:31 +0800 | [diff] [blame] | 46 | |
| 47 | echo "--mbtk normal boot end--" > /dev/kmsg |
| 48 | } |
| 49 | |