From c64269bf01508c7e672e2768da49580aafd74e04 Mon Sep 17 00:00:00 2001 From: Christopher Roy Bratusek Date: Tue, 29 Dec 2020 20:14:31 +0100 Subject: [PATCH] SysTest: setup bundled busybox before mounting partitions --- .../META-INF/com/google/android/update-binary | 1 + systest/SysTest | 30 +++++++++++-------- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/systest/META-INF/com/google/android/update-binary b/systest/META-INF/com/google/android/update-binary index fc5a1b2..48da779 100644 --- a/systest/META-INF/com/google/android/update-binary +++ b/systest/META-INF/com/google/android/update-binary @@ -24,6 +24,7 @@ ui_print " || storing results in $(dirname ${LOGFILE}):" ui_print " || as $(basename ${LOGFILE})" ui_print " " +setup_busybox mount_partitions system_test diff --git a/systest/SysTest b/systest/SysTest index 570b846..5fd48ac 100644 --- a/systest/SysTest +++ b/systest/SysTest @@ -1,6 +1,6 @@ #!/sbin/sh ########################################################################################## -# +# # NanoDroid System Testing Script # by Nanolx # @@ -296,6 +296,22 @@ grep_cmdline() { sed -n "${REGEX}" 2>/dev/null } +setup_busybox () { + if [[ "$(uname -m)" == a* ]]; then + local bb_arch=arm + else local bb_arch=x86 + fi + + mkdir -p ${TMPDIR}/busybox + ln -s ${TMPDIR}/busybox.${bb_arch} ${TMPDIR}/busybox/busybox + + chmod 0755 ${TMPDIR}/busybox.${bb_arch} + ${TMPDIR}/busybox.${bb_arch} --install -s ${TMPDIR}/busybox/ + + OLD_PATH=${PATH} + export PATH=${TMPDIR}/busybox:/system/bin:/vendor/bin +} + system_test () { ABI=$(grep_prop ro.product.cpu.abi | cut -c-3) ABI2=$(grep_prop ro.product.cpu.abi2 | cut -c-3) @@ -310,27 +326,15 @@ system_test () { case ${ARCH} in arm | arm64 ) - BB=${TMPDIR}/busybox.arm FILE=${TMPDIR}/file.arm AAPT=${TMPDIR}/aapt.arm ;; x86 | x86_64 ) - BB=${TMPDIR}/busybox.x86 FILE=${TMPDIR}/file.x86 AAPT=${TMPDIR}/aapt.x86 ;; esac - OLD_PATH=${PATH} - - mkdir -p ${TMPDIR}/busybox - ln -s ${BB} ${TMPDIR}/busybox/busybox - - chmod 0755 ${BB} - ${BB} --install -s ${TMPDIR}/busybox/ - - export PATH="${TMPDIR}/busybox:${PATH}" - chmod 0755 "${FILE}" "${AAPT}" DALVIKVM_ARCH=$("${FILE}" -m "${BASEDIR}/magic.mgc" -L /system/bin/dalvikvm)