[2/4] buildscript: copy the (optional) -eu/-us factory images

Submitted by Tim Niemeyer on Jan. 6, 2017, 1:15 p.m.

Details

Message ID 1483708558-24965-3-git-send-email-tim@tn-x.org
State Accepted
Commit 8a459ff8541ffbb37eab5cc1bdebb45a27e1b4c9
Headers show

Commit Message

Tim Niemeyer Jan. 6, 2017, 1:15 p.m.
Signed-off-by: Tim Niemeyer <tim@tn-x.org>
---

 buildscript | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

Patch hide | download patch | download mbox

diff --git a/buildscript b/buildscript
index 68f7407..7e56ba7 100755
--- a/buildscript
+++ b/buildscript
@@ -278,14 +278,16 @@  cp_firmware() {
         filename_build=${filename_build//generic/g}
         cp "$target/bin/${chipset}/$image" "./bin/$filename_build"
 
-        image_factory=${image/sysupgrade/factory}
-        if [[ -f "$target/bin/${chipset}/$image_factory" ]]; then
-          filename_build_factory=${filename_build/sysupgrade/factory}
-          if [ ${#image_factory} -lt ${#filename_build_factory} ]; then
-            echo "Warning: The factory image file name (${filename_build_factory}) is longer than the OpenWrt one, which might be incompatibility with the stock firmware."
-          fi
-          cp "$target/bin/${chipset}/$image_factory" "./bin/$filename_build_factory"
-        fi
+        for region in "" "-eu" "-us"; do
+            image_factory=${image/sysupgrade/factory$region}
+            if [[ -f "$target/bin/${chipset}/$image_factory" ]]; then
+              filename_build_factory=${filename_build/sysupgrade/factory$region}
+              if [ ${#image_factory} -lt ${#filename_build_factory} ]; then
+                echo "Warning: The factory image file name (${filename_build_factory}) is longer than the OpenWrt one, which might be incompatibility with the stock firmware."
+              fi
+              cp "$target/bin/${chipset}/$image_factory" "./bin/$filename_build_factory"
+            fi
+        done
     done
 }
 

Comments

Jan Kraus Jan. 7, 2017, 2:17 p.m.
Schaut auch gut aus:
Reviewed-by: Jan Kraus <mayosemmel@gmail.com>

Am Freitag, den 06.01.2017, 14:15 +0100 schrieb Tim Niemeyer:
> Signed-off-by: Tim Niemeyer <tim@tn-x.org>
> ---
> 
>  buildscript | 18 ++++++++++--------
>  1 file changed, 10 insertions(+), 8 deletions(-)
> 
> diff --git a/buildscript b/buildscript
> index 68f7407..7e56ba7 100755
> --- a/buildscript
> +++ b/buildscript
> @@ -278,14 +278,16 @@ cp_firmware() {
>          filename_build=${filename_build//generic/g}
>          cp "$target/bin/${chipset}/$image" "./bin/$filename_build"
>  
> -        image_factory=${image/sysupgrade/factory}
> -        if [[ -f "$target/bin/${chipset}/$image_factory" ]]; then
> -          filename_build_factory=${filename_build/sysupgrade/factory}
> -          if [ ${#image_factory} -lt ${#filename_build_factory} ]; then
> -            echo "Warning: The factory image file name (${filename_build_factory}) is longer than the OpenWrt one, which might be incompatibility with the stock firmware."
> -          fi
> -          cp "$target/bin/${chipset}/$image_factory" "./bin/$filename_build_factory"
> -        fi
> +        for region in "" "-eu" "-us"; do
> +            image_factory=${image/sysupgrade/factory$region}
> +            if [[ -f "$target/bin/${chipset}/$image_factory" ]]; then
> +              filename_build_factory=${filename_build/sysupgrade/factory$region}
> +              if [ ${#image_factory} -lt ${#filename_build_factory} ]; then
> +                echo "Warning: The factory image file name (${filename_build_factory}) is longer than the OpenWrt one, which might be incompatibility with the stock firmware."
> +              fi
> +              cp "$target/bin/${chipset}/$image_factory" "./bin/$filename_build_factory"
> +            fi
> +        done
>      done
>  }
>  
> -- 
> 2.1.4
>
Tobias Klaus Jan. 9, 2017, 9:41 p.m.
Hey,

Reviewed-by: Tobias Klaus <tk+ff@meskal.net>

Grüße
Tobias

Am Freitag, 6. Januar 2017, 14:15:56 CET schrieb Tim Niemeyer:
> Signed-off-by: Tim Niemeyer <tim@tn-x.org>
> ---
> 
>  buildscript | 18 ++++++++++--------
>  1 file changed, 10 insertions(+), 8 deletions(-)
> 
> diff --git a/buildscript b/buildscript
> index 68f7407..7e56ba7 100755
> --- a/buildscript
> +++ b/buildscript
> @@ -278,14 +278,16 @@ cp_firmware() {
>          filename_build=${filename_build//generic/g}
>          cp "$target/bin/${chipset}/$image" "./bin/$filename_build"
> 
> -        image_factory=${image/sysupgrade/factory}
> -        if [[ -f "$target/bin/${chipset}/$image_factory" ]]; then
> -          filename_build_factory=${filename_build/sysupgrade/factory}
> -          if [ ${#image_factory} -lt ${#filename_build_factory} ]; then
> -            echo "Warning: The factory image file name
> (${filename_build_factory}) is longer than the OpenWrt one, which might be
> incompatibility with the stock firmware." -          fi
> -          cp "$target/bin/${chipset}/$image_factory"
> "./bin/$filename_build_factory" -        fi
> +        for region in "" "-eu" "-us"; do
> +            image_factory=${image/sysupgrade/factory$region}
> +            if [[ -f "$target/bin/${chipset}/$image_factory" ]]; then
> +             
> filename_build_factory=${filename_build/sysupgrade/factory$region} +       
>       if [ ${#image_factory} -lt ${#filename_build_factory} ]; then +      
>          echo "Warning: The factory image file name
> (${filename_build_factory}) is longer than the OpenWrt one, which might be
> incompatibility with the stock firmware." +              fi
> +              cp "$target/bin/${chipset}/$image_factory"
> "./bin/$filename_build_factory" +            fi
> +        done
>      done
>  }