blob: 499ab67331a64088c13fc1fd469278e78e025212 [file] [log] [blame]
#!/usr/bin/env bash
# Copyright 2018 The Fuchsia Authors
#
# Use of this source code is governed by a MIT-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/MIT
set -eo pipefail
SCRIPTS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
ZIRCON_DIR="${SCRIPTS_DIR}/.."
EXTRA_ARGS=()
function HELP {
echo "help:"
echo "-m : Add mexec option to command line"
echo "-h for help"
exit 1
}
while getopts "mh" FLAG; do
case $FLAG in
m) EXTRA_ARGS+=(-m);;
h) HELP;;
\?)
echo unrecognized option
HELP
;;
esac
done
shift $((OPTIND-1))
"${ZIRCON_DIR}/kernel/target/arm64/board/eagle/package-image.sh" -B "${ZIRCON_DIR}/build-arm64" "${EXTRA_ARGS[@]}"
BOOT_IMG="${ZIRCON_DIR}/build-arm64/eagle-boot.img"
fastboot flash boot "${BOOT_IMG}" && fastboot reboot