Changeset 39583


Ignore:
Timestamp:
2014-02-13T22:19:00+01:00 (4 years ago)
Author:
jow
Message:

ar71xx: fix mtdpartsize macro in image Makefile (#14961)

The mtdpartsize macro triggers shell errors on various Linux distributions
when the partname argument $(1) does not appear within the partmap $(2).

Change the sed pattern to only emit anything if a successful substitution
occured and only evaluate the arithmetic expression if something was printed
by the sed program.

Signed-off-by: Jo-Philipp Wich <jow@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/ar71xx/image/Makefile

    r39397 r39583  
    3737 
    3838define mtdpartsize 
    39 $(shell echo $$((`echo '$(2)' | sed -e 's/.*[:$(COMMA)]\([0-9]*\)k[@]*[0-9a-zx]*($(1)).*/\1/'` * 1024))) 
     39$(shell sz=`echo '$(2)' | sed -ne 's/.*[:$(COMMA)]\([0-9]*\)k[@]*[0-9a-zx]*($(1)).*/\1/p'`; [ -n "$$sz" ] && echo $$(($$sz * 1024))) 
    4040endef 
    4141 
Note: See TracChangeset for help on using the changeset viewer.