当前位置:   article > 正文

挂载qnx 日志到android_qnx日志存储到android侧方案

qnx日志存储到android侧方案

#!/vendor/bin/sh

action=$1
RESULT="1"
qlog_mounted=`getprop vendor.nfs.qlog.mounted`

log -t "mount_nfs" "$action"
##### action umount  #############
if [ "$action" == "umount" ]; then
    log -t "mount_nfs"  "starting umount qlog"
    if [ "$qlog_mounted" != "true" ]; then
        log -t "mount_nfs" "qlog not mounted, exit"
        exit 0
    fi

    umount /qlog
    RESULT=$?
    if [ $RESULT == "0" ]; then
        log -t "mount_nfs" "qlog umount success"
        setprop vendor.nfs.qlog.mounted false
        exit 0
    else
        log -t "mount_nfs" "qlog umount failed"
        exit 1
    fi
fi

##### action mount  #############
if [ "$qlog_mounted" == "true" ]; then
    log -t "mount_nfs" "qlog mounted, exit"
    exit 0
fi

QNX_IP=$(cat /etc/hosts |grep cdc-qnx | awk '{print $1}')

count=1
RESULT="1"
while [ $RESULT != "0" ];
do
    log -t "mount_nfs"  "try to mount qlog $count"
    mount -o nolock,vers=3,noacl,noexec,nosuid,noatime,nodev,nodiratime,dirsync,norelatime,timeo=10,retrans=30,addr=$QNX_IP -t nfs $QNX_IP:/log/qlog /qlog
    RESULT=$?
    if [ $RESULT == "0" ]; then
        break
    fi

    let count++
    if [ $count -gt 60 ]; then
        break
    fi

    sleep 1
done

echo "mount result: $RESULT"
if [ $RESULT != "0" ]; then
    echo "mount qlog failed"
    log -t "mount_nfs" "mount qlog failed"
    setprop vendor.nfs.qlog.mounted false
    exit 1
fi

if [ -f /qlog/.qlog.nfs ]; then
    echo "mount qlog success"
    log -t "mount_nfs" "mount qlog success"
    setprop vendor.nfs.qlog.mounted true
fi

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/知新_RL/article/detail/964074
推荐阅读
相关标签
  

闽ICP备14008679号