From 9e9f8ca8f34cb0f695daf58db10f8983cb33a905 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Sat, 2 Sep 2017 23:24:34 +0800 Subject: [PATCH] Restore cwd --- scripts/boot_patch.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/boot_patch.sh b/scripts/boot_patch.sh index 593edb1e5..fd38d90c1 100644 --- a/scripts/boot_patch.sh +++ b/scripts/boot_patch.sh @@ -96,8 +96,10 @@ cpio_mkdir() { [ -z $1 ] && abort_wrap "This script requires a boot image as a parameter" +cwd=`pwd` cd "`dirname_wrap $1`" BOOTIMAGE="`pwd`/`basename_wrap $1`" +cd $cwd [ -e "$BOOTIMAGE" ] || abort_wrap "$BOOTIMAGE does not exist!" @@ -110,7 +112,7 @@ id | grep "uid=0" >/dev/null 2>&1 && ROOT=true || ROOT=false # Switch to the location of the script file [ -z $SOURCEDMODE ] && cd "`dirname_wrap "${BASH_SOURCE:-$0}"`" -chmod +x ./* +chmod -R 755 . ########################################################################################## # Unpack