From fa405414d7fe94747622f4da74a54b89fbaab5c6 Mon Sep 17 00:00:00 2001 From: Yi-Yo Chiang Date: Tue, 9 Feb 2021 15:51:53 +0800 Subject: [PATCH] adb-remount-test.sh: Fix failure due to missing host tool `hexdump` As we are just using it to generate gibberish, we might as well just hardcode the gibberish in the script. Also fix unhandled `grep` failure. Bug: 179752308 Test: Forrest Change-Id: I534c7cacdb12a104f26d380fe3a571332091490e --- fs_mgr/tests/adb-remount-test.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fs_mgr/tests/adb-remount-test.sh b/fs_mgr/tests/adb-remount-test.sh index ec732533f..242fa93fa 100755 --- a/fs_mgr/tests/adb-remount-test.sh +++ b/fs_mgr/tests/adb-remount-test.sh @@ -881,10 +881,10 @@ D=`get_property ro.serialno` [ -z "${D}" -o -n "${ANDROID_SERIAL}" ] || ANDROID_SERIAL=${D} USB_SERIAL= if [ -n "${ANDROID_SERIAL}" -a "Darwin" != "${HOSTOS}" ]; then - USB_SERIAL="`find /sys/devices -name serial | grep usb`" + USB_SERIAL="`find /sys/devices -name serial | grep usb || true`" if [ -n "${USB_SERIAL}" ]; then USB_SERIAL=`echo "${USB_SERIAL}" | - xargs grep -l ${ANDROID_SERIAL}` + xargs grep -l ${ANDROID_SERIAL} || true` fi fi USB_ADDRESS= @@ -1315,7 +1315,7 @@ check_ne "${BASE_SYSTEM_DEVT}" "${BASE_VENDOR_DEVT}" --warning system/vendor dev [ -n "${VENDOR_DEVT%[0-9a-fA-F][0-9a-fA-F]}" ] || echo "${YELLOW}[ WARNING ]${NORMAL} vendor devt ${VENDOR_DEVT} major 0" >&2 -# Download libc.so, append some gargage, push back, and check if the file +# Download libc.so, append some garbage, push back, and check if the file # is updated. tempdir="`mktemp -d`" cleanup() { @@ -1323,8 +1323,8 @@ cleanup() { } adb pull /system/lib/bootstrap/libc.so ${tempdir} >/dev/null || die "pull libc.so from device" -garbage="`hexdump -n 16 -e '4/4 "%08X" 1 "\n"' /dev/random`" -echo ${garbage} >> ${tempdir}/libc.so +garbage="D105225BBFCB1EB8AB8EBDB7094646F0" +echo "${garbage}" >> ${tempdir}/libc.so adb push ${tempdir}/libc.so /system/lib/bootstrap/libc.so >/dev/null || die "push libc.so to device" adb pull /system/lib/bootstrap/libc.so ${tempdir}/libc.so.fromdevice >/dev/null ||