Boot loop, unless specified otherwise

This commit is contained in:
computermouth 2016-12-02 16:15:24 -08:00
parent 6b2086eb6f
commit 0a91687a6d
2 changed files with 13 additions and 2 deletions

View File

@ -25,7 +25,7 @@ UBI_PREFIX="chip"
UBI_SUFFIX="ubi.sparse"
UBI_TYPE="400000-4000-680"
while getopts "sgpbfnhB:N:F:" opt; do
while getopts "sgpbfnrhB:N:F:" opt; do
case $opt in
s)
echo "== Server selected =="
@ -51,6 +51,10 @@ while getopts "sgpbfnhB:N:F:" opt; do
echo "== No Limit mode =="
NO_LIMIT="while itest.b *0x80400000 -ne 03; do i2c mw 0x34 0x30 0x03; i2c read 0x34 0x30 1 0x80400000; done; "
;;
r)
echo "== Reset after flash =="
RESET_COMMAND="reset"
;;
B)
BRANCH="$OPTARG"
echo "== ${BRANCH} branch selected =="
@ -73,6 +77,7 @@ while getopts "sgpbfnhB:N:F:" opt; do
echo " -b -- Buildroot"
echo " -f -- Force clean"
echo " -n -- No limit [enable greater power draw]"
echo " -r -- Reset [reset device after flash]"
echo " -B -- Branch(optional) [eg. -B testing]"
echo " -N -- Build#(optional) [eg. -N 150]"
echo " -F -- Format(optional) [eg. -F Toshiba_4G_MLC]"

View File

@ -177,7 +177,12 @@ flash_images() {
echo "echo going to fastboot mode" >> $ubootcmds
echo "fastboot 0" >> $ubootcmds
echo "reset" >> $ubootcmds
if [ -z $RESET_COMMAND ]; then
RESET_COMMAND="while true; do; sleep 10; done;"
fi
echo "$RESET_COMMAND" >> $ubootcmds
mkimage -A arm -T script -C none -n "flash $FLAVOR" -d $ubootcmds $ubootscr || RC=1
@ -197,6 +202,7 @@ flash_images() {
if wait_for_fastboot; then
fastboot -i 0x1f3a -u flash UBI $IMAGESDIR/chip-$nand_erasesize-$nand_writesize-$nand_oobsize.ubi.sparse || RC=1
fastboot -i 0x1f3a continue > /dev/null
else
echo "failed to flash the UBI image"
RC=1