diff --git a/mount_gpt_image.sh b/mount_gpt_image.sh index ae6aa4032b..7621d7f55e 100755 --- a/mount_gpt_image.sh +++ b/mount_gpt_image.sh @@ -51,6 +51,11 @@ eval set -- "${FLAGS_ARGV}" # Die on error set -e +# Find the last image built on the board. +if [ ${FLAGS_most_recent} -eq ${FLAGS_TRUE} ] ; then + FLAGS_from="$(${SCRIPT_ROOT}/get_latest_image.sh --board="${FLAGS_board}")" +fi + # Check for conflicting args. # If --from is a block device, --image can't also be specified. if [ -b "${FLAGS_from}" ]; then @@ -189,11 +194,6 @@ function mount_image() { "${FLAGS_rootfs_mountpt} successfully." } -# Find the last image built on the board. -if [ ${FLAGS_most_recent} -eq ${FLAGS_TRUE} ] ; then - FLAGS_from="$(${SCRIPT_ROOT}/get_latest_image.sh --board="${FLAGS_board}")" -fi - # Turn paths into absolute paths. FLAGS_from=`eval readlink -f ${FLAGS_from}` FLAGS_rootfs_mountpt=`eval readlink -f ${FLAGS_rootfs_mountpt}`