xf.li | 8611891 | 2025-03-19 20:07:27 -0700 | [diff] [blame^] | 1 | #!/bin/sh |
| 2 | |
| 3 | #jb.qi add for uci check start |
| 4 | check_copy_file() { |
| 5 | if [ $# -ne 2 ];then |
| 6 | return |
| 7 | fi |
| 8 | |
| 9 | diff $1 $2 > /dev/null |
| 10 | if [ $? -ne 0 ]; then |
| 11 | echo "cp $1 $2" > /dev/kmsg |
| 12 | cp $1 $2 |
| 13 | fi |
| 14 | } |
| 15 | |
| 16 | check_uci() |
| 17 | { |
| 18 | uci get lynq_uci.lynq_ril > /dev/null |
| 19 | if [ $? -ne 0 ]; then |
| 20 | echo "$TAG: lynq_uci config cant get" > /dev/kmsg |
| 21 | cp /etc/config/lynq_uci /mnt/userdata/config/lynq_uci |
| 22 | fi |
| 23 | } |
| 24 | mkdir /mnt/userdata/config |
| 25 | check_uci |
| 26 | check_copy_file /etc/config/lynq_uci_ro /mnt/userdata/config/lynq_uci_ro |
| 27 | |
| 28 | #jb.qi add for uci check end |
| 29 | ramdump_mode=`nv get ramdump_mode` |
| 30 | |
| 31 | if [ -e /proc/sys/ramdump_ap/ramdump_start_addr ]; then |
| 32 | if [ "$ramdump_mode" == "CAPEMMC" ]; then |
| 33 | ramdump_dev=`nv get ramdump_emmc_device` |
| 34 | if [ -b $ramdump_dev ]; then |
| 35 | ramdump_start=`fdisk -l | grep $ramdump_dev | awk '{ print $4 }'` |
| 36 | ramdump_save_size=`fdisk -l | grep $ramdump_dev | awk '{ print $6 }'` |
| 37 | echo $ramdump_start > /proc/sys/ramdump_ap/ramdump_start_addr |
| 38 | echo $ramdump_save_size > /proc/sys/ramdump_ap/ramdump_emmc_size |
| 39 | else |
| 40 | echo "[zxic_ramdump]$ramdump_dev is not exist!" |
| 41 | fi |
| 42 | else |
| 43 | if [ -b $ramdump_dev ]; then |
| 44 | echo 0 > /proc/sys/ramdump_ap/ramdump_start_addr |
| 45 | fi |
| 46 | fi |
| 47 | fi |
| 48 | # 0 for usb, 1 for net |
| 49 | if [ -e /proc/sys/zcatkern/log_com_mode ]; then |
| 50 | zcat_com_mode=`nv get zcat_mode` |
| 51 | if [ "$zcat_com_mode" == "net" ]; then |
| 52 | echo 1 > /proc/sys/zcatkern/log_com_mode |
| 53 | else |
| 54 | echo 0 > /proc/sys/zcatkern/log_com_mode |
| 55 | fi |
| 56 | # sh /etc/zcatlog_monitor.sh & |
| 57 | fi |
| 58 | |