From f37f64d9291b86e6484e9141636a2d54106176d0 Mon Sep 17 00:00:00 2001 From: Chris Sosa Date: Fri, 9 Mar 2012 15:45:08 -0800 Subject: [PATCH] Fix bug where you can't mount a non-developer image from the most recent image. Currently if you use -m and -i chromiumos_test_image.bin, you get an error saying that -i and --from= are incompatible. -m changes --from to the most recent folder but does this after the check so this is broken. This change re-orders the calls to fix this bug. BUG=None TEST=Ran it with args that were broken. Change-Id: I367a74f7b77f127b6ad8eeeb92ab72ae00e5235e Reviewed-on: https://gerrit.chromium.org/gerrit/17760 Commit-Ready: Chris Sosa Reviewed-by: Chris Sosa Tested-by: Chris Sosa --- mount_gpt_image.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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}`