cat101 / Smartwares-CIP-39220-SDHack

Collection of hacks to the factory firmware for Smartwares CIP-39220/EseeCloud P3-S-A/Anyka akv330 cameras
MIT License
3 stars 0 forks source link

/usr/sbin/anyka_ipc.sh: line 120: anyka_ipc: not found #1

Open BoyInTheSun opened 4 months ago

BoyInTheSun commented 4 months ago

When power on, the IPC doesn't work. So I delete production_test.ini to see logs, and I found this in ipc_700101_000008.2.log:

/usr/sbin/anyka_ipc.sh: line 120: anyka_ipc: not found

That is curious! Maybe the firmware has some problems? My firmware: C2L-Q/Y-A(WiFi和4G版本)v3.6.74(WIFI) Download from: https://doc.juancloud.com/docs/download/tools

BTW, there's a tool to update firmware IPCamSuite, but I don't bulid a correct firmware.

Thank you!

BoyInTheSun commented 4 months ago

anyka_ipc.sh in my firmware:

#! /bin/sh
### BEGIN INIT INFO
# File:             camera.sh   
# Provides:         camera service 
# Required-Start:   $
# Required-Stop:
# Default-Start:     
# Default-Stop:
# Short-Description:web service
# Author:           gao_wangsheng
# Email:            gao_wangsheng@anyka.oa
# Date:             2012-8-8
### END INIT INFO

MODE=$1
PATH=$PATH:/bin:/sbin:/usr/bin:/usr/sbin
usage()
{
    echo "Usage: $0 start|stop)"
    exit 3
}

stop()
{
    echo "we don't stop ipc service......"
}

start ()
{
    echo "start ipc service......"
    DEBUG_INI_PATH="/mnt/tf/debug.ini"
    PDTEST_INI_PATH="/mnt/tf/production_test.ini"
    MOUNT_DIR=/mnt/tf
    MMC_DEV=/dev/mmcblk0
    MMC_FS=/dev/mmcblk0p1
    insmod /usr/modules/akmci.ko
    LOG_REDIRECT=0
    umask 077
    ulimit -s 1024
    echo 3 > /proc/sys/vm/drop_caches
    insmod /usr/modules/ak_gpio_module.ko 
    usleep 300000
    if [ -e $MMC_DEV ];then
        echo "exist mmcblk0"
        if [ -e $MMC_FS ];then
            echo "exist mmcblk0p1"
            mkdir $MOUNT_DIR
            mount $MMC_FS $MOUNT_DIR
        fi
    fi

    if [ -f "$DEBUG_INI_PATH" ];then

        if [ -e $MOUNT_DIR/anyka_ipc_nostrip ];then
            if [ ! -e $MOUNT_DIR/do_not_debug.ini ];then
                mount --bind $MOUNT_DIR/anyka_ipc_nostrip /usr/bin/anyka_ipc
                ulimit -c unlimited
                ulimit -a
                echo "/mnt/tf/core/%e_%t.core" > /proc/sys/kernel/core_pattern
            fi
        fi

        if [ -f "$PDTEST_INI_PATH" ];then
            echo "production test mode, no redirect log"
        else
            LOG_REDIRECT=1
        fi

    fi

    pid=`pgrep anyka_ipc`
    if [ "$pid" = "" ]
    then
        if [ $LOG_REDIRECT == 1 ];then
            REBOOTTIMES=1;
            if [ -f "$MOUNT_DIR/.reboot" ];then
                REBOOTTIMES=`cat "$MOUNT_DIR/.reboot"`;let REBOOTTIMES+=1;
            fi

            echo "$REBOOTTIMES" > "$MOUNT_DIR/.reboot";
            cat /proc/kmsg >> $MOUNT_DIR/kmsg.$REBOOTTIMES.log & 2>&1

            CURTIME=`date +%y%m%d_%H%M%S`
            LOG_FILE=ipc_$CURTIME.$REBOOTTIMES.log
            echo $LOG_FILE
            /usr/bin/anyka_ipc >> "$MOUNT_DIR/$LOG_FILE" 2>&1
        else
            /usr/bin/anyka_ipc
        fi
        sync
        echo "anyka_ipc exit"
    fi
    touch /etc/jffs2/error_reboot
}

restart ()
{
    echo "restart ipc service......"
    stop
    start
}

#
# main:
#

case "$MODE" in
    start)
        start
        ;;
    stop)
        stop
        ;;
    restart)
        restart
        ;;
    *)
        usage
        ;;
esac
exit 0