From: Wolfgang Denk Date: Tue, 04 Dec 2018 10:37:49 +0100 Subject: [U-Boot] [PATCH v4] pico-imx7d: Increase the CONFIG_ENV_OFFSET size In-Reply-To: References: <1543589533-4257-1-git-send-email-festevam@gmail.com> <20181130153312.08C74242267@gemini.denx.de> <20181203155205.6D296242267@gemini.denx.de> Message-ID: <20181204093750.02694242267@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Fabio, In message you wrote: > > On Mon, Dec 3, 2018 at 1:52 PM Wolfgang Denk wrote: > > > Can you live with something like this: > > > > #define CONFIG_ENV_OFFSET (768 * 1024) > > #define CONFIG_BOARD_SIZE_LIMIT ((768 * 1024) - (69 * 1024)) > > It does not work: > > /bin/sh: 1: printf: ((768 * 1024) - (69 * 1024)): expected numeric value > u-boot-nodtb.bin exceeds file size limit: > limit: 0 bytes > actual: 482968 bytes > excess: 482968 bytes Is there any chance you mis-applied my patch? Apparently you still have a shell printf command in your code, most probably the old line limit=`printf "%d" $(CONFIG_BOARD_SIZE_LIMIT)`; But this should not be present any more with my patch applied. Here again as reference: diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile index 53d9e5f42b..a7f02f9996 100644 --- a/arch/arm/mach-imx/Makefile +++ b/arch/arm/mach-imx/Makefile @@ -60,15 +60,13 @@ endif ifneq ($(CONFIG_BOARD_SIZE_LIMIT),) BOARD_SIZE_CHECK = \ - @actual=`wc -c $@ | awk '{print $$1}'`; \ - limit=`printf "%d" $(CONFIG_BOARD_SIZE_LIMIT)`; \ - if test $$actual -gt $$limit; then \ - echo "$@ exceeds file size limit:" >&2 ; \ - echo " limit: $$limit bytes" >&2 ; \ - echo " actual: $$actual bytes" >&2 ; \ - echo " excess: $$((actual - limit)) bytes" >&2; \ - exit 1; \ - fi + @wc -c $@ | \ + awk '{ if ($$1 > $(CONFIG_BOARD_SIZE_LIMIT)) { \ + printf "%s exceeds file size limit:\n", $$2; \ + printf " limit: %d bytes\n", $(CONFIG_BOARD_SIZE_LIMIT); \ + printf " actual: %d bytes\n", $$1; \ + printf " excess: %d bytes\n", $$1 - $(CONFIG_BOARD_SIZE_LIMIT); \ + exit 1; } }' >&2; else BOARD_SIZE_CHECK = endif As you can see, with the patch there is NO printf called before the line which prints ""%s exceeds file size limit:\n", but in your output the error message comes before that. I have tested this code, and it works for me. Please check the code again! Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de You don't have to worry about me. I might have been born yesterday... but I stayed up all night.