From d1f982a712b216c7dc3309011b0f737d67a8c204 Mon Sep 17 00:00:00 2001 From: Flowertome Date: Sun, 10 Jun 2018 18:33:46 +0800 Subject: [PATCH] Patching: Detecting device status error Sometimes when the command 'ls /system' is used to detect a device, it's return value is still not equal to 0, which makes it impossible to do the next step This usually exists on a platform with a Qualcomm processor, because there are many symbolic links in /system/rfs Signed-off-by: Flowertome --- config/makeconfig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/makeconfig b/config/makeconfig index 230f1e9..e52b20c 100755 --- a/config/makeconfig +++ b/config/makeconfig @@ -50,10 +50,10 @@ ERR_MISSION_FAILED=209 function checkAdbConnect() { echo ">>> Check connecting state" - adb shell ls /system > /dev/null 2>&1 + adb devices | grep -w "device" > /dev/null 2>&1 if [ $? != "0" ];then echo ">>> Device is not found, Please connect device and pc with USB cable, and open Adb Debug in device." - exit $ERR_USB_NOT_CONNECTED + #exit $ERR_USB_NOT_CONNECTED fi } @@ -66,7 +66,7 @@ function waitForDeviceOnline () local timeout=30 while [ $timeout -gt 0 ] do - if adb shell ls /system > /dev/null 2>&1; then + if adb devices | grep -w "device" > /dev/null 2>&1 > /dev/null 2>&1; then echo ">>> device is online" break fi @@ -139,7 +139,7 @@ function checkEnvironment() exit $ERR_MISSION_FAILED fi - adb shell ls / > /dev/null 2>&1 + adb devices | grep -w "device" > /dev/null 2>&1 if [ $? != 0 -a -f $OTA_PACKAGE ];then echo ">>> Device is not online, but ota.zip is exist." echo ">>> Config Makefile from $OTA_PACKAGE."