public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] arm: mx5: Fix NAND image generation
@ 2016-04-05  8:54 Marek Vasut
  2016-04-19 11:49 ` Marek Vasut
  2016-04-19 13:55 ` Stefano Babic
  0 siblings, 2 replies; 3+ messages in thread
From: Marek Vasut @ 2016-04-05  8:54 UTC (permalink / raw)
  To: u-boot

The echo -ne "\xNN" does not work in certain bourne-compatible shells, like
dash. The recommended way of hex->char conversion is using printf(1), but
there is a pitfall here. The GNU printf does support "\xNN" format, but
according to the opengroup documentation, this is not part of POSIX. The
POSIX printf only defines "\NNN" where N is octal. Thus, for the sake of
compatibility, we use that.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
---
 arch/arm/imx-common/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/imx-common/Makefile b/arch/arm/imx-common/Makefile
index 30e66ba..c208628 100644
--- a/arch/arm/imx-common/Makefile
+++ b/arch/arm/imx-common/Makefile
@@ -86,7 +86,7 @@ u-boot-with-nand-spl.imx: spl/u-boot-nand-spl.imx u-boot.uim FORCE
 	$(call if_changed,pad_cat)
 
 quiet_cmd_u-boot-nand-spl_imx = GEN     $@
-cmd_u-boot-nand-spl_imx = (echo -ne '\x00\x00\x00\x00\x46\x43\x42\x20\x01' && \
+cmd_u-boot-nand-spl_imx = (printf '\000\000\000\000\106\103\102\040\001' && \
 	dd bs=1015 count=1 if=/dev/zero 2>/dev/null) | cat - $< > $@
 
 spl/u-boot-nand-spl.imx: SPL FORCE
-- 
2.8.0.rc3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] arm: mx5: Fix NAND image generation
  2016-04-05  8:54 [U-Boot] [PATCH] arm: mx5: Fix NAND image generation Marek Vasut
@ 2016-04-19 11:49 ` Marek Vasut
  2016-04-19 13:55 ` Stefano Babic
  1 sibling, 0 replies; 3+ messages in thread
From: Marek Vasut @ 2016-04-19 11:49 UTC (permalink / raw)
  To: u-boot

On 04/05/2016 10:54 AM, Marek Vasut wrote:
> The echo -ne "\xNN" does not work in certain bourne-compatible shells, like
> dash. The recommended way of hex->char conversion is using printf(1), but
> there is a pitfall here. The GNU printf does support "\xNN" format, but
> according to the opengroup documentation, this is not part of POSIX. The
> POSIX printf only defines "\NNN" where N is octal. Thus, for the sake of
> compatibility, we use that.
> 
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Stefano Babic <sbabic@denx.de>
> ---
>  arch/arm/imx-common/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm/imx-common/Makefile b/arch/arm/imx-common/Makefile
> index 30e66ba..c208628 100644
> --- a/arch/arm/imx-common/Makefile
> +++ b/arch/arm/imx-common/Makefile
> @@ -86,7 +86,7 @@ u-boot-with-nand-spl.imx: spl/u-boot-nand-spl.imx u-boot.uim FORCE
>  	$(call if_changed,pad_cat)
>  
>  quiet_cmd_u-boot-nand-spl_imx = GEN     $@
> -cmd_u-boot-nand-spl_imx = (echo -ne '\x00\x00\x00\x00\x46\x43\x42\x20\x01' && \
> +cmd_u-boot-nand-spl_imx = (printf '\000\000\000\000\106\103\102\040\001' && \
>  	dd bs=1015 count=1 if=/dev/zero 2>/dev/null) | cat - $< > $@
>  
>  spl/u-boot-nand-spl.imx: SPL FORCE
> 

Can this be applied? This fixes real bug.
-- 
Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] arm: mx5: Fix NAND image generation
  2016-04-05  8:54 [U-Boot] [PATCH] arm: mx5: Fix NAND image generation Marek Vasut
  2016-04-19 11:49 ` Marek Vasut
@ 2016-04-19 13:55 ` Stefano Babic
  1 sibling, 0 replies; 3+ messages in thread
From: Stefano Babic @ 2016-04-19 13:55 UTC (permalink / raw)
  To: u-boot

On 05/04/2016 10:54, Marek Vasut wrote:
> The echo -ne "\xNN" does not work in certain bourne-compatible shells, like
> dash. The recommended way of hex->char conversion is using printf(1), but
> there is a pitfall here. The GNU printf does support "\xNN" format, but
> according to the opengroup documentation, this is not part of POSIX. The
> POSIX printf only defines "\NNN" where N is octal. Thus, for the sake of
> compatibility, we use that.
> 
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Stefano Babic <sbabic@denx.de>
> ---
>  arch/arm/imx-common/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm/imx-common/Makefile b/arch/arm/imx-common/Makefile
> index 30e66ba..c208628 100644
> --- a/arch/arm/imx-common/Makefile
> +++ b/arch/arm/imx-common/Makefile
> @@ -86,7 +86,7 @@ u-boot-with-nand-spl.imx: spl/u-boot-nand-spl.imx u-boot.uim FORCE
>  	$(call if_changed,pad_cat)
>  
>  quiet_cmd_u-boot-nand-spl_imx = GEN     $@
> -cmd_u-boot-nand-spl_imx = (echo -ne '\x00\x00\x00\x00\x46\x43\x42\x20\x01' && \
> +cmd_u-boot-nand-spl_imx = (printf '\000\000\000\000\106\103\102\040\001' && \
>  	dd bs=1015 count=1 if=/dev/zero 2>/dev/null) | cat - $< > $@
>  
>  spl/u-boot-nand-spl.imx: SPL FORCE
> 

Applied to master, thanks !

Best regards,
Stefano Babic
-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-04-19 13:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-05  8:54 [U-Boot] [PATCH] arm: mx5: Fix NAND image generation Marek Vasut
2016-04-19 11:49 ` Marek Vasut
2016-04-19 13:55 ` Stefano Babic

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox