Add provisions for flashing local dir
This commit is contained in:
parent
f4efba1514
commit
08b1d61ac5
@ -1,5 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -x
|
||||||
|
|
||||||
SCRIPTDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
SCRIPTDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||||
source $SCRIPTDIR/common.sh
|
source $SCRIPTDIR/common.sh
|
||||||
|
|
||||||
@ -75,17 +77,17 @@ while getopts "sgpbfnrhB:N:F:L:" opt; do
|
|||||||
echo ""
|
echo ""
|
||||||
echo "== Help =="
|
echo "== Help =="
|
||||||
echo ""
|
echo ""
|
||||||
echo " -s -- Server [Debian + Headless]"
|
echo " -s -- Server [Debian + Headless] "
|
||||||
echo " -g -- GUI [Debian + XFCE]"
|
echo " -g -- GUI [Debian + XFCE] "
|
||||||
echo " -p -- PocketCHIP"
|
echo " -p -- PocketCHIP [CHIP on the go!] "
|
||||||
echo " -b -- Buildroot"
|
echo " -b -- Buildroot [Tiny, but powerful] "
|
||||||
echo " -f -- Force clean"
|
echo " -f -- Force clean [re-download if applicable]"
|
||||||
echo " -n -- No limit [enable greater power draw]"
|
echo " -n -- No limit [enable greater power draw]"
|
||||||
echo " -r -- Reset [reset device after flash]"
|
echo " -r -- Reset [reset device after flash] "
|
||||||
echo " -B -- Branch(optional) [eg. -B testing]"
|
echo " -B -- Branch [eg. -B testing] "
|
||||||
echo " -N -- Build#(optional) [eg. -N 150]"
|
echo " -N -- Build# [eg. -N 150] "
|
||||||
echo " -F -- Format(optional) [eg. -F Toshiba_4G_MLC]"
|
echo " -F -- Format [eg. -F Toshiba_4G_MLC] "
|
||||||
echo " -L -- Local (optional) [eg. -L ../img/buildroot/]"
|
echo " -L -- Local [eg. -L ../img/buildroot/] "
|
||||||
echo ""
|
echo ""
|
||||||
echo ""
|
echo ""
|
||||||
exit 0
|
exit 0
|
||||||
@ -105,7 +107,7 @@ function require_directory {
|
|||||||
|
|
||||||
function dl_probe {
|
function dl_probe {
|
||||||
|
|
||||||
if [ -z $CACHENUM ]; then
|
if [ -z $CACHENUM ] && [ -z $LOCALDIR ]; then
|
||||||
CACHENUM=$(curl -s $DL_URL/$BRANCH/$FLAVOR/latest)
|
CACHENUM=$(curl -s $DL_URL/$BRANCH/$FLAVOR/latest)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -143,6 +145,7 @@ function dl_probe {
|
|||||||
else
|
else
|
||||||
case $FORMAT in
|
case $FORMAT in
|
||||||
"Hynix_8G_MLC")
|
"Hynix_8G_MLC")
|
||||||
|
echo hello
|
||||||
export nand_erasesize=400000
|
export nand_erasesize=400000
|
||||||
export nand_oobsize=680
|
export nand_oobsize=680
|
||||||
export nand_writesize=4000
|
export nand_writesize=4000
|
||||||
@ -152,17 +155,19 @@ function dl_probe {
|
|||||||
export nand_oobsize=500
|
export nand_oobsize=500
|
||||||
export nand_writesize=4000
|
export nand_writesize=4000
|
||||||
;;
|
;;
|
||||||
"Toshiba_512M_MLC")
|
"Toshiba_512M_SLC")
|
||||||
|
echo correct
|
||||||
export nand_erasesize=40000
|
export nand_erasesize=40000
|
||||||
export nand_oobsize=100
|
export nand_oobsize=100
|
||||||
export nand_writesize=1000
|
export nand_writesize=1000
|
||||||
;;
|
;;
|
||||||
\?)
|
*)
|
||||||
echo "== Invalid format: $FORMAT ==" >&2
|
echo "== Invalid format: $FORMAT =="
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
UBI_TYPE="$nand_erasesize-$nand_writesize-$nand_oobsize"
|
UBI_TYPE="$nand_erasesize-$nand_writesize-$nand_oobsize"
|
||||||
|
echo $UBI_TYPE > ${IMAGESDIR}/ubi_type
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ! -f "$DL_DIR/$BRANCH-$FLAVOR-b${CACHENUM}/$UBI_PREFIX-$UBI_TYPE.$UBI_SUFFIX" ]] && [ -z $LOCALDIR ]; then
|
if [[ ! -f "$DL_DIR/$BRANCH-$FLAVOR-b${CACHENUM}/$UBI_PREFIX-$UBI_TYPE.$UBI_SUFFIX" ]] && [ -z $LOCALDIR ]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user