Add option to flash from local download

This commit is contained in:
computermouth 2016-07-11 17:26:14 -07:00
parent 8cf52b335a
commit dcbd2ff550
1 changed files with 17 additions and 6 deletions

View File

@ -14,8 +14,9 @@ METHOD=fel
FLAVOR=buildroot FLAVOR=buildroot
BRANCH=stable BRANCH=stable
DL_DIR=".dl" DL_DIR=".dl"
NO_LIM="lim"
while getopts "fsdpb:" opt; do while getopts "fsdpb:l:" opt; do
case $opt in case $opt in
f) f)
echo "fastboot enabled" echo "fastboot enabled"
@ -36,8 +37,14 @@ while getopts "fsdpb:" opt; do
FLAVOR=pocket FLAVOR=pocket
;; ;;
b) b)
echo "${BRANCH} branch selected"
BRANCH="$OPTARG" BRANCH="$OPTARG"
echo "${BRANCH} branch selected"
;;
l)
LOC=1
BUILDROOT_OUTPUT_DIR="$OPTARG"
FIRMWARE_DIR="$OPTARG"
echo "${BUILDROOT_OUTPUT_DIR} directory selected"
;; ;;
\?) \?)
echo "Invalid option: -$OPTARG" >&2 echo "Invalid option: -$OPTARG" >&2
@ -120,10 +127,14 @@ assert_error() {
fi fi
} }
echo == preparing images == if [[ -z $LOC ]]; then
require_directory "$FIRMWARE_DIR"
require_directory "$DL_DIR" echo == preparing images ==
dl_check require_directory "$FIRMWARE_DIR"
require_directory "$DL_DIR"
dl_check
fi
echo == upload the SPL to SRAM and execute it == echo == upload the SPL to SRAM and execute it ==
if ! wait_for_fel; then if ! wait_for_fel; then