Fix bug to find script dir location in arm64 SHI

This fixes a bug that resulted in the SHA not being
generated when creating the arm64 SHI.  The path to the
tool that generates the SHA wasn't generated correctly,
which caused the SHA field to be empty.  This moves that
line into the correct place so that the path resolves
correctly.

Bug: 147402461
Test: local build and boot
Change-Id: I1db3cc3808943bbddbf723ec9dc1d7a4000a4383
diff --git a/tools/create_base_image_arm.sh b/tools/create_base_image_arm.sh
index 64133e9..262d427 100755
--- a/tools/create_base_image_arm.sh
+++ b/tools/create_base_image_arm.sh
@@ -14,6 +14,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
+
 source "${ANDROID_BUILD_TOP}/external/shflags/src/shflags"
 
 DEFINE_boolean p1 \
@@ -142,7 +144,6 @@
 find_script=if test -e mmc ${devnum}:${distro_bootpart} /boot/boot.scr; then echo Found U-Boot script /boot/boot.scr; run run_scr; fi
 run_scr=load mmc ${devnum}:${distro_bootpart} ${scriptaddr} /boot/boot.scr; source ${scriptaddr}
 EOF
-	script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
 	echo "Sha=`${script_dir}/gen_sha.sh --kernel ${KERNEL_DIR}`" >> ${tmpfile}
 	${ANDROID_HOST_OUT}/bin/mkenvimage -s 32768 -o ${bootenv} - < ${tmpfile}
 fi