From b0ea62a5dfcc435c2fcfa750adc583afaafe9b48 Mon Sep 17 00:00:00 2001 From: Ashwin Ramesh Date: Sun, 13 Aug 2017 12:00:15 +0530 Subject: [PATCH] envsetup: Fix installboot on ZSH * ZSH errors out when it doesn't find anything in $OUT/system/lib/modules/. * So add a check to avoid error while using installboot() with a target that doesn't have modules enabled. Change-Id: Ibe66f6962943e9b90c7059a4c9b4ded558318326 --- build/envsetup.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/build/envsetup.sh b/build/envsetup.sh index 7825ba02..d13fa39a 100644 --- a/build/envsetup.sh +++ b/build/envsetup.sh @@ -322,12 +322,15 @@ function installboot() if (adb shell getprop ro.cm.device | grep -q "$CM_BUILD"); then adb push $OUT/boot.img /cache/ - for i in $OUT/system/lib/modules/*; - do - adb push $i /system/lib/modules/ - done + if [ -e "$OUT/system/lib/modules/*" ]; + then + for i in $OUT/system/lib/modules/*; + do + adb push $i /system/lib/modules/ + done + adb shell chmod 644 /system/lib/modules/* + fi adb shell dd if=/cache/boot.img of=$PARTITION - adb shell chmod 644 /system/lib/modules/* echo "Installation complete." else echo "The connected device does not appear to be $CM_BUILD, run away!"