Opened 4 years ago

Closed 4 years ago

#14961 closed defect (fixed)

ar71xx: Changeset 39384 breaks make prereq, "syntax error: invalid arithmetic operator"

Reported by: tastky@… Owned by: developers
Priority: high Milestone: Attitude Adjustment 12.09.1
Component: toolchain Version: Trunk
Keywords: Cc:


(I myself am also on Arch, but have not posted in the forum thread.)

"make prereq" results in the same underlying error on various Linux setups. It's always a bunch of errors in the form:

bash: mtdparts=spi0.0:256k(u-boot),64k(u-boot-env),6272k(firmware),1536k(failsafe),64k(art) * 1024: syntax error: invalid arithmetic operator (error token is ".0:256k(u-boot),64k(u-boot-env),6272k(firmware),1536k(failsafe),64k(art) * 1024")

But apparently the number of these errors differs considerably.

zloop may have traced it back to changeset 39384:

Attachments (0)

Change History (4)

comment:1 Changed 4 years ago by jow

Please try the following change:

diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index 1f181f4..9076f22 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -36,7 +36,7 @@ $(if $(1),board=$(1) )$(if $(2),console=$(2)$(COMMA)$(3))
 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)))

comment:2 Changed 4 years ago by anonymous

Appears to work; no more errors. Thanks!

comment:3 Changed 4 years ago by zloop

working on Debian Sid

comment:4 Changed 4 years ago by jow

  • Resolution set to fixed
  • Status changed from new to closed

Fix committed in r39583

Add Comment

Modify Ticket

as closed .
The resolution will be deleted. Next status will be 'reopened'.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.