new parameter to select build number
Signed-off-by: Alex Kaplan <kaplan2539@gmail.com>
This commit is contained in:
parent
3dda573819
commit
7cb800264b
@ -54,7 +54,7 @@ function cache_download {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
while getopts "ufdb:w:" opt; do
|
while getopts "ufdb:w:B:" opt; do
|
||||||
case $opt in
|
case $opt in
|
||||||
u)
|
u)
|
||||||
echo "updating cache"
|
echo "updating cache"
|
||||||
@ -66,6 +66,10 @@ while getopts "ufdb:w:" opt; do
|
|||||||
echo "fastboot enabled"
|
echo "fastboot enabled"
|
||||||
FLASH_SCRIPT_OPTION="-f"
|
FLASH_SCRIPT_OPTION="-f"
|
||||||
;;
|
;;
|
||||||
|
B)
|
||||||
|
BUILD="$OPTARG"
|
||||||
|
echo "BUILD = ${BUILD}"
|
||||||
|
;;
|
||||||
b)
|
b)
|
||||||
BRANCH="$OPTARG"
|
BRANCH="$OPTARG"
|
||||||
echo "BRANCH = ${BRANCH}"
|
echo "BRANCH = ${BRANCH}"
|
||||||
@ -91,10 +95,14 @@ FW_IMAGE_DIR="${FW_DIR}/images"
|
|||||||
BASE_URL="http://opensource.nextthing.co/chip"
|
BASE_URL="http://opensource.nextthing.co/chip"
|
||||||
S3_URL="${BASE_URL}/${WHAT}/${BRANCH}/latest"
|
S3_URL="${BASE_URL}/${WHAT}/${BRANCH}/latest"
|
||||||
|
|
||||||
ROOTFS_URL="$(wget -q -O- ${S3_URL})" || (echo "ERROR: cannot reach ${S3_URL}" && exit 1)
|
if [[ -z "$BUILD" ]]; then
|
||||||
if [[ -z "${ROOTFS_URL}" ]]; then
|
ROOTFS_URL="$(wget -q -O- ${S3_URL})" || (echo "ERROR: cannot reach ${S3_URL}" && exit 1)
|
||||||
echo "error: could not get URL for latest build from ${S3_URL} - check internet connection"
|
if [[ -z "${ROOTFS_URL}" ]]; then
|
||||||
exit 1
|
echo "error: could not get URL for latest build from ${S3_URL} - check internet connection"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
ROOTFS_URL="${S3_URL%latest}$BUILD"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${WHAT}" == "buildroot" ]]; then
|
if [[ "${WHAT}" == "buildroot" ]]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user