| #!/bin/sh |
| # Copyright (C) 2006 OpenWrt.org |
| # Copyright (C) 2010 Vertical Communications |
| |
| nvm_update() { |
| local oem_nvm_dir=$NVM_ROOT_DIR/oem_data/config |
| local file src_file dst_file |
| |
| for file in $(ls ${oem_nvm_dir} 2>/dev/null); do |
| src_file=${oem_nvm_dir}/$(basename $file) |
| dst_file=$NVM_ROOT_DIR/$(basename $file) |
| |
| if [ ! -e "${dst_file}" -o -e "$NVM_ROOT_DIR/oemd" ]; then |
| cp ${src_file} ${dst_file} |
| sync |
| echo "==> cp ${src_file} to ${dst_file}" > /dev/kmsg |
| fi |
| done |
| |
| [ -e "$NVM_ROOT_DIR/oemd" ] && { |
| echo "==> delete mark file $NVM_ROOT_DIR/oemd" > /dev/kmsg |
| rm -rf $NVM_ROOT_DIR/oemd |
| sync |
| } |
| } |
| |
| /sbin/mrvl_init |
| export NVM_ROOT_DIR=/NVM |
| #Check if customized NVM files need to be updated |
| nvm_update |
| |
| #Delete proerties UCI |
| rm -f /etc/config/properties |
| #Set UCI file "cmdline" from /proc/cmdline |
| cmdline2uci |
| |
| # Add by liubin for open/close dump. |
| RDUP_MODE=`getprop persist.mbtk.sysdump 2> /dev/null` |
| if [ "$RDUP_MODE" == "0" ];then |
| echo 0xE > /proc/sys/kernel/print-fatal-signals |
| else |
| echo 0xF > /proc/sys/kernel/print-fatal-signals |
| fi |
| |
| #Set default properties |
| setprop sys.default.loglevel 7 |
| setprop sys.cp_load.loglevel 8 |
| setprop sys.atcmdsrv.loglevel 6 |
| setprop sys.ciClientStubTas.loglevel 6 |
| setprop sys.nvmproxy.loglevel 8 |
| setprop sys.rild.loglevel 8 |
| setprop ril.telephony.properties 0 |
| setprop persist.radio.sim1.auto_answer false |
| setprop persist.radio.fastdorm.timeout 0 |
| setprop persist.mbtk.dev_ttymodem0 custom |
| setprop persist.mbtk.dev_ttyS1 custom |
| setprop persist.mbtk.appdump 1 |
| |
| #log option: 0-none 1-logcat 2-kmsg |
| setprop sys.log.option 1 |
| #CATLOG=`uci get cmdline.CPLOG 2> /dev/null` |
| #if [ "$CATLOG" == "1" ];then |
| # setprop sys.log.option 1 |
| #else |
| # setprop sys.log.option 0 |
| #fi |
| |
| PRODMODE=`uci get cmdline.PROD 2> /dev/null` |
| NOCP=`uci get cmdline.NOCP 2> /dev/null` |
| RDUPMODE=`uci get cmdline.RDUP 2> /dev/null` |
| |
| #for P403 spi-nor version first boot, need to mount_root before nvmproxy |
| grep -q p403 /etc/mversion && [ -d /tmp/root ] && mount_root done |
| grep -q p503 /etc/mversion && [ -d /tmp/root ] && mount_root done |
| #do not start telephony in ramdump mode |
| # Add by liubin |
| if [ "$PRODMODE" != "5" -a "$NOCP" != "1" ]; then |
| /bin/cp_load |
| /bin/nvmproxy & |
| (while ! /bin/atcmdsrv; do echo "Restarting atcmdsrv..."; done) & |
| /etc/init.d/mbtk_boot_eary & |
| else |
| setprop sys.log.option 0 |
| /bin/atcmdsrv -A & |
| fi |
| |
| if [ "$PRODMODE" == "0" ] && [ "$RDUPMODE" == "1" ];then |
| nice -n -5 /bin/diag & |
| fi |
| |
| #need to start rndis for ramdump mode |
| if [ "$PRODMODE" == "0" ]; then |
| ######### user mode ######## |
| /bin/rild & |
| # /sbin/usb_init & |
| |
| #Quickly start audio_if, ecall daemon & app, slic app |
| [ -e "/usr/bin/audio_if" ] && { |
| /usr/bin/audio_if & |
| } |
| [ -e "/usr/bin/ecall_daemon" ] && { |
| /usr/bin/ecall_daemon & |
| } |
| [ -e "/usr/bin/ecall_app" ] && { |
| /usr/bin/ecall_app & |
| } |
| [ -e "/usr/bin/proslic" ] && { |
| /usr/bin/proslic & |
| } |
| [ -e "/usr/bin/mislic" ] && { |
| /usr/bin/mislic & |
| } |
| [ -e "/usr/bin/dxslic" ] && { |
| /usr/bin/dxslic & |
| } |
| elif [ "$PRODMODE" == "5" ]; then |
| ######### disable ap log output ######## |
| setprop sys.log.option 0 |
| ######### RDUP mode ######## |
| /sbin/rdp_usb_init & |
| else |
| ######### PROD mode ######## |
| /sbin/prod_usb_init & |
| # add by mbtk |
| /bin/rild & |
| [ -e "/usr/bin/audio_if" ] && { |
| /usr/bin/audio_if & |
| } |
| fi |
| |
| insmod /etc/imu/industrialio-triggered-buffer.ko |
| insmod /etc/imu/st_asm330lhhx.ko |
| insmod /etc/imu/st_asm330lhhx_i2c.ko |
| |