blob: 21f76f7fcabf493e9faaee57285406b8ffca6d78 [file] [log] [blame]
#!/bin/sh
# Only execute this script on a Brillo-provisioned CreatorCI41.
# See your Brillo-CreatorCI41 online information for initial provisioning and recovery.
set -e
function dir_with_file() {
local file=${1}; shift
local dir;
for dir; do
if [ -z "${dir}" ]; then continue; fi
if [ -r "${dir}/${file}" ]; then
echo ${dir}
return
fi
done
echo "Could not find ${file}, looked in $@" >&2
return 1
}
LOCAL_DIR=$(dirname "${0}")
# Location of where the Brillo OS image is built.
_CREATOR_IMG_DIR=$(dir_with_file boot.img \
"${LOCAL_DIR}" \
"${BRILLO_OUT_DIR}" \
"${ANDROID_PRODUCT_OUT}")
fastboot \
flash partitions "${_CREATOR_IMG_DIR}"/gpt.bin \
flash boot_a "${_CREATOR_IMG_DIR}"/boot.img \
flash system_a "${_CREATOR_IMG_DIR}"/system.img \
flash boot_b "${_CREATOR_IMG_DIR}"/boot.img \
flash system_b "${_CREATOR_IMG_DIR}"/system.img \
flash userdata "${_CREATOR_IMG_DIR}"/userdata.img \
oem set_active 0 "$@"