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@openwrt.org> SVN-Revision: 39583
This commit is contained in:
parent
af63cdf87a
commit
b1d7ebae09
1 changed files with 1 additions and 1 deletions
|
@ -36,7 +36,7 @@ $(if $(1),board=$(1) )$(if $(2),console=$(2)$(COMMA)$(3))
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define mtdpartsize
|
define mtdpartsize
|
||||||
$(shell echo $$((`echo '$(2)' | sed -e 's/.*[:$(COMMA)]\([0-9]*\)k[@]*[0-9a-zx]*($(1)).*/\1/'` * 1024)))
|
$(shell sz=`echo '$(2)' | sed -ne 's/.*[:$(COMMA)]\([0-9]*\)k[@]*[0-9a-zx]*($(1)).*/\1/p'`; [ -n "$$sz" ] && echo $$(($$sz * 1024)))
|
||||||
endef
|
endef
|
||||||
|
|
||||||
SINGLE_PROFILES:=
|
SINGLE_PROFILES:=
|
||||||
|
|
Loading…
Reference in a new issue