You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ma...@apache.org on 2016/02/12 23:58:27 UTC

incubator-mynewt-larva git commit: Don't execute bin2img if image was created already with 'newt target label'.

Repository: incubator-mynewt-larva
Updated Branches:
  refs/heads/master 738750cb7 -> 993f4693f


Don't execute bin2img if image was created already with 'newt target label'.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/commit/993f4693
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/tree/993f4693
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/diff/993f4693

Branch: refs/heads/master
Commit: 993f4693fc4a37ff22174ab0306c41231e6a7acb
Parents: 738750c
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Fri Feb 12 14:57:15 2016 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
Committed: Fri Feb 12 14:57:15 2016 -0800

----------------------------------------------------------------------
 .../nrf51dk-16kbram/nrf51dk-16kbram_download.sh | 16 +++++++++------
 hw/bsp/nrf51dk/nrf51dk_download.sh              | 16 +++++++++------
 hw/bsp/nrf52pdk/nrf52pdk_download.sh            |  2 +-
 .../olimex_stm32-e407_devboard_download.sh      | 21 ++++++++++----------
 4 files changed, 32 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/993f4693/hw/bsp/nrf51dk-16kbram/nrf51dk-16kbram_download.sh
----------------------------------------------------------------------
diff --git a/hw/bsp/nrf51dk-16kbram/nrf51dk-16kbram_download.sh b/hw/bsp/nrf51dk-16kbram/nrf51dk-16kbram_download.sh
index 3603afa..9f57060 100755
--- a/hw/bsp/nrf51dk-16kbram/nrf51dk-16kbram_download.sh
+++ b/hw/bsp/nrf51dk-16kbram/nrf51dk-16kbram_download.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
 # distributed with this work for additional information
@@ -49,11 +49,15 @@ if [ $IS_BOOTLOADER -eq 1 ]; then
     FILE_NAME=$BASENAME.elf.bin
 else
     FLASH_OFFSET=0x7000
-    FILE_NAME=$BASENAME.elf.img
-    echo "Version is >" $VER "<"
-    $BIN2IMG $BASENAME.elf.bin $FILE_NAME $VER
-    if [ "$?" -ne 0 ]; then
-	exit 1
+    ELF_FILE=$BASENAME.elf
+    BIN_FILE=$BASENAME.elf.bin
+    FILE_NAME=$BASENAME.img
+    if [ \! -f $FILE_NAME -o $FILE_NAME -ot $ELF_FILE ]; then
+        echo "Version is >" $VER "<"
+        $BIN2IMG $BASENAME.elf.bin $FILE_NAME $VER
+        if [ "$?" -ne 0 ]; then
+	    exit 1
+	fi
     fi
 fi
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/993f4693/hw/bsp/nrf51dk/nrf51dk_download.sh
----------------------------------------------------------------------
diff --git a/hw/bsp/nrf51dk/nrf51dk_download.sh b/hw/bsp/nrf51dk/nrf51dk_download.sh
index 3603afa..78b7b29 100755
--- a/hw/bsp/nrf51dk/nrf51dk_download.sh
+++ b/hw/bsp/nrf51dk/nrf51dk_download.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
 # distributed with this work for additional information
@@ -49,11 +49,15 @@ if [ $IS_BOOTLOADER -eq 1 ]; then
     FILE_NAME=$BASENAME.elf.bin
 else
     FLASH_OFFSET=0x7000
-    FILE_NAME=$BASENAME.elf.img
-    echo "Version is >" $VER "<"
-    $BIN2IMG $BASENAME.elf.bin $FILE_NAME $VER
-    if [ "$?" -ne 0 ]; then
-	exit 1
+    ELF_FILE=$BASENAME.elf
+    BIN_FILE=$BASENAME.elf.bin
+    FILE_NAME=$BASENAME.img
+    if [ \! -f $FILE_NAME -o $FILE_NAME -ot $ELF_FILE ]; then
+        echo "Version is >" $VER "<"
+        $BIN2IMG $BIN_FILE $FILE_NAME $VER
+        if [ "$?" -ne 0 ]; then
+             exit 1
+        fi
     fi
 fi
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/993f4693/hw/bsp/nrf52pdk/nrf52pdk_download.sh
----------------------------------------------------------------------
diff --git a/hw/bsp/nrf52pdk/nrf52pdk_download.sh b/hw/bsp/nrf52pdk/nrf52pdk_download.sh
index d5ab27e..a897368 100755
--- a/hw/bsp/nrf52pdk/nrf52pdk_download.sh
+++ b/hw/bsp/nrf52pdk/nrf52pdk_download.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
 # distributed with this work for additional information

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/993f4693/hw/bsp/olimex_stm32-e407_devboard/olimex_stm32-e407_devboard_download.sh
----------------------------------------------------------------------
diff --git a/hw/bsp/olimex_stm32-e407_devboard/olimex_stm32-e407_devboard_download.sh b/hw/bsp/olimex_stm32-e407_devboard/olimex_stm32-e407_devboard_download.sh
index 6829236..79e2439 100755
--- a/hw/bsp/olimex_stm32-e407_devboard/olimex_stm32-e407_devboard_download.sh
+++ b/hw/bsp/olimex_stm32-e407_devboard/olimex_stm32-e407_devboard_download.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
 # distributed with this work for additional information
@@ -32,7 +32,6 @@ BASENAME=$1
 IS_BOOTLOADER=0
 BIN2IMG=project/bin2img/bin/bin2img/bin2img.elf
 VER=11.22.33.44
-VER_FILE=version.txt # or somewhere else
 
 # Look for 'bootloader' from 2nd arg onwards
 shift
@@ -48,14 +47,16 @@ if [ $IS_BOOTLOADER -eq 1 ]; then
     FILE_NAME=$BASENAME.elf.bin
 else
     FLASH_OFFSET=0x08020000
-    FILE_NAME=$BASENAME.elf.img
-    if [ -f $VER_FILE ]; then
-	VER=`echo $VER_FILE`
-    fi
-    echo "Version is >" $VER "<"
-    $BIN2IMG $BASENAME.elf.bin $FILE_NAME $VER
-    if [ "$?" -ne 0 ]; then
-	exit 1
+    ELF_FILE=$BASENAME.elf
+    BIN_FILE=$BASENAME.elf.bin
+    FILE_NAME=$BASENAME.img
+    # If there is no image file, or it is older than bin file, run bin2img.
+    if [ ! -f $FILE_NAME -o $FILE_NAME -ot $ELF_FILE ]; then
+        echo "Version is >" $VER "<"
+        $BIN2IMG $BIN_FILE $FILE_NAME $VER
+        if [ "$?" -ne 0 ]; then
+	    exit 1
+	fi
     fi
 fi
 echo "Downloading" $FILE_NAME "to" $FLASH_OFFSET