diff --git a/CommonInstaller b/CommonInstaller index d9dee907..1d7c2121 100644 --- a/CommonInstaller +++ b/CommonInstaller @@ -881,10 +881,11 @@ nanodroid_finalize () { ########################################################################################## setup_busybox () { - if [[ "$(uname -m)" == a* ]]; then - local bb_arch=arm - else local bb_arch=x86 - fi + case $(uname -m) in + arm* ) local bb_arch=arm ;; + x86* ) local bb_arch=x86 ;; + * ) error "arch \"$(uname -m)\" is not supported" + esac mkdir -p ${INSTALLER}/busybox ln -s ${INSTALLER}/busybox.${bb_arch} ${INSTALLER}/busybox/busybox diff --git a/patcher/CommonPatcher b/patcher/CommonPatcher index cf087515..e19184da 100644 --- a/patcher/CommonPatcher +++ b/patcher/CommonPatcher @@ -332,10 +332,11 @@ detect_odex () { ########################################################################################## setup_busybox () { - if [[ "$(uname -m)" == a* ]]; then - local bb_arch=arm - else local bb_arch=x86 - fi + case $(uname -m) in + arm* ) local bb_arch=arm ;; + x86* ) local bb_arch=x86 ;; + * ) error "arch \"$(uname -m)\" is not supported" + esac if [ -f ${TMPDIR}/busybox.${bb_arch} ]; then BUSY=${TMPDIR}/busybox.${bb_arch} diff --git a/systest/SysTest b/systest/SysTest index 4ad90118..73c3c47f 100644 --- a/systest/SysTest +++ b/systest/SysTest @@ -313,10 +313,11 @@ grep_cmdline() { } setup_busybox () { - if [[ "$(uname -m)" == a* ]]; then - local bb_arch=arm - else local bb_arch=x86 - fi + case $(uname -m) in + arm* ) local bb_arch=arm ;; + x86* ) local bb_arch=x86 ;; + * ) error "arch \"$(uname -m)\" is not supported" + esac mkdir -p ${TMPDIR}/busybox ln -s ${TMPDIR}/busybox.${bb_arch} ${TMPDIR}/busybox/busybox diff --git a/uninstaller/META-INF/com/google/android/update-binary b/uninstaller/META-INF/com/google/android/update-binary index 53e4d5ad..b8d270d2 100644 --- a/uninstaller/META-INF/com/google/android/update-binary +++ b/uninstaller/META-INF/com/google/android/update-binary @@ -65,10 +65,11 @@ setup_busybox () { unzip -oq "${ZIP}" busybox.arm -d "/dev/tmp" unzip -oq "${ZIP}" busybox.x86 -d "/dev/tmp" - if [[ "$(uname -m)" == a* ]]; then - local bb_arch=arm - else local bb_arch=x86 - fi + case $(uname -m) in + arm* ) local bb_arch=arm ;; + x86* ) local bb_arch=x86 ;; + * ) error "arch \"$(uname -m)\" is not supported" + esac mkdir -p /dev/tmp/busybox ln -s /dev/tmp/busybox.${bb_arch} /dev/tmp/busybox/busybox