| Index: bin/cros_run_vm_update | 
| diff --git a/bin/cros_run_vm_update b/bin/cros_run_vm_update | 
| index 05e035683a547e879f50034e021e86351e65974d..04ca97b9590f4af4f62d00f8cb266685bb9ed8a2 100755 | 
| --- a/bin/cros_run_vm_update | 
| +++ b/bin/cros_run_vm_update | 
| @@ -6,8 +6,28 @@ | 
| # | 
| # Updates an existing vm image with another image. | 
|  | 
| -. "$(dirname $0)/../common.sh" | 
| -. "$(dirname $0)/../lib/cros_vm_lib.sh" | 
| +# --- BEGIN COMMON.SH BOILERPLATE --- | 
| +# Load common CrOS utilities.  Inside the chroot this file is installed in | 
| +# /usr/lib/crosutils.  Outside the chroot we find it relative to the script's | 
| +# location. | 
| +find_common_sh() { | 
| +  local common_paths=(/usr/lib/crosutils "$(dirname "$(readlink -f "$0")")/..") | 
| +  local path | 
| + | 
| +  SCRIPT_ROOT= | 
| +  for path in "${common_paths[@]}"; do | 
| +    if [ -r "${path}/common.sh" ]; then | 
| +      SCRIPT_ROOT=${path} | 
| +      break | 
| +    fi | 
| +  done | 
| +} | 
| + | 
| +find_common_sh | 
| +. "${SCRIPT_ROOT}/common.sh" || (echo "Unable to load common.sh" && exit 1) | 
| +# --- END COMMON.SH BOILERPLATE --- | 
| + | 
| +. "${SCRIPT_ROOT}/lib/cros_vm_lib.sh" || die "Unable to load cros_vm_lib.sh" | 
|  | 
| DEFINE_string payload "" "Full name of the payload to update with." | 
| DEFINE_string proxy_port "" \ | 
| @@ -43,7 +63,7 @@ if [ -n "${FLAGS_proxy_port}" ]; then | 
| IMAGE_ARGS="${IMAGE_ARGS} --proxy_port=${FLAGS_proxy_port}" | 
| fi | 
|  | 
| -$(dirname $0)/../image_to_live.sh \ | 
| +"${SCRIPTS_DIR}/image_to_live.sh" \ | 
| --for_vm \ | 
| --remote=127.0.0.1 \ | 
| --ssh_port=${FLAGS_ssh_port} \ | 
|  |