board/armltd/integrator/split_by_variant.sh: fix 'echo -n'
PATCH 1/1 board/armltd/integrator/split_by_variant.sh: fix 'echo -n'
This patch fixes an error when running MAKEALL for ARM9.
On OS X /bin/sh uses builtin echo which does not utilise '-n' switch. GNU manual for builtins recomend to use here-document style to solve this portability issue.
--- board/armltd/integrator/split_by_variant.sh | 139 +++++++++++++-------------- 1 files changed, 67 insertions(+), 72 deletions(-)
board/armltd/integrator/split_by_variant.sh +67 -72
@@ -10,12 +10,12 @@ then # --------------------------------------------------------- # Set the platform defines # --------------------------------------------------------- -echo -n "/* Integrator configuration implied " > ${config_file} -echo " by Makefile target */" >> ${config_file} -echo -n "#define CONFIG_INTEGRATOR" >> ${config_file} -echo " /* Integrator board */" >> ${config_file} -echo -n "#define CONFIG_ARCH_INTEGRATOR" >> ${config_file} -echo " 1 /* Integrator/AP */" >> ${config_file} +cat > ${config_file} << _EOF +/* Integrator configuration implied by Makefile target */ +#define CONFIG_INTEGRATOR /* Integrator board */ +#define CONFIG_ARCH_INTEGRATOR 1 /* Integrator/AP */ +_EOF + # --------------------------------------------------------- # Set the core module defines according to Core Module # ---------------------------------------------------------
@@ -50,37 +50,42 @@ else ap720t_config) cpu="arm720t" - echo -n "#define CONFIG_CM720T" >> ${config_file} - echo " 1 /* CPU core is ARM720T */ " >> ${config_file} + cat >> ${config_file} << _EOF +#define CONFIG_CM720T 1 /* CPU core is ARM720T */ +_EOF variant="Core module CM720T" ;; ap922_XA10_config) cpu="arm_intcm" variant="unported core module CM922T_XA10" - echo -n "#define CONFIG_CM922T_XA10" >> ${config_file} - echo " 1 /* CPU core is ARM922T_XA10 */" >> ${config_file} + cat >> ${config_file} << _EOF +#define CONFIG_CM922T_XA10 1 /* CPU core is ARM922T_XA10 */ +_EOF ;; ap920t_config) cpu="arm920t" variant="Core module CM920T" - echo -n "#define CONFIG_CM920T" >> ${config_file} - echo " 1 /* CPU core is ARM920T */" >> ${config_file} + cat >> ${config_file} << _EOF +#define CONFIG_CM920T 1 /* CPU core is ARM920T */ +_EOF ;; ap926ejs_config) cpu="arm926ejs" variant="Core module CM926EJ-S" - echo -n "#define CONFIG_CM926EJ_S" >> ${config_file} - echo " 1 /* CPU core is ARM926EJ-S */ " >> ${config_file} + cat >> ${config_file} << _EOF +#define CONFIG_CM926EJ_S 1 /* CPU core is ARM926EJ-S */ +_EOF ;; ap946es_config) cpu="arm946es" variant="Core module CM946E-S" - echo -n "#define CONFIG_CM946E_S" >> ${config_file} - echo " 1 /* CPU core is ARM946E-S */ " >> ${config_file} + cat >> ${config_file} << _EOF +#define CONFIG_CM946E_S 1 /* CPU core is ARM946E-S */ +_EOF ;; *)
@@ -94,33 +99,26 @@ fi case "$cpu" in arm_intcm) - echo "/* Core module undefined/not ported */" >> ${config_file} - echo "#define CONFIG_ARM_INTCM 1" >> ${config_file} - echo -n "#undef CONFIG_CM_MULTIPLE_SSRAM" >> ${config_file} - echo -n " /* CM may not have " >> ${config_file} - echo "multiple SSRAM mapping */" >> ${config_file} - echo -n "#undef CONFIG_CM_SPD_DETECT " >> ${config_file} - echo -n " /* CM may not support SPD " >> ${config_file} - echo "query */" >> ${config_file} - echo -n "#undef CONFIG_CM_REMAP " >> ${config_file} - echo -n " /* CM may not support " >> ${config_file} - echo "remapping */" >> ${config_file} - echo -n "#undef CONFIG_CM_INIT " >> ${config_file} - echo -n " /* CM may not have " >> ${config_file} - echo "initialization reg */" >> ${config_file} - echo -n "#undef CONFIG_CM_TCRAM " >> ${config_file} - echo " /* CM may not have TCRAM */" >> ${config_file} - echo -n " /* May not be processor " >> ${config_file} - echo "without cache support */" >> ${config_file} - echo "#define CONFIG_SYS_NO_ICACHE 1" >> ${config_file} - echo "#define CONFIG_SYS_NO_DCACHE 1" >> ${config_file} + cat >> ${config_file} << _EOF +/* Core module undefined/not ported */ +#define CONFIG_ARM_INTCM 1 +#undef CONFIG_CM_MULTIPLE_SSRAM /* CM may not have multiple SSRAM mapping */ +#undef CONFIG_CM_SPD_DETECT /* CM may not support SPD query */ +#undef CONFIG_CM_REMAP /* CM may not support remapping */ +#undef CONFIG_CM_INIT /* CM may not have initialization reg */ +#undef CONFIG_CM_TCRAM /* CM may not have TCRAM */ +/* May not be processor without cache support */ +#define CONFIG_SYS_NO_ICACHE 1 +#define CONFIG_SYS_NO_DCACHE 1 +_EOF ;; arm720t) - echo -n " /* May not be processor " >> ${config_file} - echo "without cache support */" >> ${config_file} - echo "#define CONFIG_SYS_NO_ICACHE 1" >> ${config_file} - echo "#define CONFIG_SYS_NO_DCACHE 1" >> ${config_file} + cat >> ${config_file} << _EOF +/* May not be processor without cache support */ +#define CONFIG_SYS_NO_ICACHE 1 +#define CONFIG_SYS_NO_DCACHE 1 +_EOF ;; esac
@@ -129,12 +127,11 @@ else # --------------------------------------------------------- # Set the platform defines # --------------------------------------------------------- -echo -n "/* Integrator configuration implied " > ${config_file} -echo " by Makefile target */" >> ${config_file} -echo -n "#define CONFIG_INTEGRATOR" >> ${config_file} -echo " /* Integrator board */" >> ${config_file} -echo -n "#define CONFIG_ARCH_CINTEGRATOR" >> ${config_file} -echo " 1 /* Integrator/CP */" >> ${config_file} +cat >> ${config_file} << _EOF +/* Integrator configuration implied by Makefile target */ +#define CONFIG_INTEGRATOR /* Integrator board */ +#define CONFIG_ARCH_CINTEGRATOR 1 /* Integrator/CP */ +_EOF cpu="arm_intcm" variant="unknown core module"
@@ -163,37 +160,42 @@ else cp922_XA10_config) cpu="arm_intcm" variant="unported core module CM922T_XA10" - echo -n "#define CONFIG_CM922T_XA10" >> ${config_file} - echo " 1 /* CPU core is ARM922T_XA10 */" >> ${config_file} + cat >> ${config_file} << _EOF +#define CONFIG_CM922T_XA10 1 /* CPU core is ARM922T_XA10 */ +_EOF ;; cp920t_config) cpu="arm920t" variant="Core module CM920T" - echo -n "#define CONFIG_CM920T" >> ${config_file} - echo " 1 /* CPU core is ARM920T */" >> ${config_file} + cat >> ${config_file} << _EOF +#define CONFIG_CM920T 1 /* CPU core is ARM920T */ +_EOF ;; cp926ejs_config) cpu="arm926ejs" variant="Core module CM926EJ-S" - echo -n "#define CONFIG_CM926EJ_S" >> ${config_file} - echo " 1 /* CPU core is ARM926EJ-S */ " >> ${config_file} + cat >> ${config_file} << _EOF +#define CONFIG_CM926EJ_S 1 /* CPU core is ARM926EJ-S */ +_EOF ;; cp946es_config) cpu="arm946es" variant="Core module CM946E-S" - echo -n "#define CONFIG_CM946E_S" >> ${config_file} - echo " 1 /* CPU core is ARM946E-S */ " >> ${config_file} + cat >> ${config_file} << _EOF +#define CONFIG_CM946E_S 1 /* CPU core is ARM946E-S */ +_EOF ;; cp1136_config) cpu="arm1136" variant="Core module CM1136EJF-S" - echo -n "#define CONFIG_CM1136EJF_S" >> ${config_file} - echo " 1 /* CPU core is ARM1136JF-S */ " >> ${config_file} + cat >> ${config_file} << _EOF +#define CONFIG_CM1136EJF_S 1 /* CPU core is ARM1136JF-S */ +_EOF ;; *)
@@ -208,22 +210,15 @@ fi if [ "$cpu" = "arm_intcm" ] then - echo "/* Core module undefined/not ported */" >> ${config_file} - echo "#define CONFIG_ARM_INTCM 1" >> ${config_file} - echo -n "#undef CONFIG_CM_MULTIPLE_SSRAM" >> ${config_file} - echo -n " /* CM may not have " >> ${config_file} - echo "multiple SSRAM mapping */" >> ${config_file} - echo -n "#undef CONFIG_CM_SPD_DETECT " >> ${config_file} - echo -n " /* CM may not support SPD " >> ${config_file} - echo "query */" >> ${config_file} - echo -n "#undef CONFIG_CM_REMAP " >> ${config_file} - echo -n " /* CM may not support " >> ${config_file} - echo "remapping */" >> ${config_file} - echo -n "#undef CONFIG_CM_INIT " >> ${config_file} - echo -n " /* CM may not have " >> ${config_file} - echo "initialization reg */" >> ${config_file} - echo -n "#undef CONFIG_CM_TCRAM " >> ${config_file} - echo " /* CM may not have TCRAM */" >> ${config_file} + cat >> ${config_file} << _EOF +/* Core module undefined/not ported */ +#define CONFIG_ARM_INTCM 1 +#undef CONFIG_CM_MULTIPLE_SSRAM /* CM may not have multiple SSRAM mapping */ +#undef CONFIG_CM_SPD_DETECT /* CM may not support SPD query */ +#undef CONFIG_CM_REMAP /* CM may not support remapping */ +#undef CONFIG_CM_INIT /* CM may not have initialization reg */ +#undef CONFIG_CM_TCRAM /* CM may not have TCRAM */ +_EOF fi fi # ap
Signature · 1 line
1.7.2.3
PATCH 1/1 board/armltd/integrator/split_by_variant.sh: fix 'echo -n'
board/armltd/integrator/split_by_variant.sh else · line 55
Quoted 5 lines · On Friday, September 24, 2010 12:27:52 Andreas Bie?mann wrote:
board/armltd/integrator/split_by_variant.sh +3
-2- echo -n "#define CONFIG_CM720T" >> ${config_file} - echo " 1 /* CPU core is ARM720T */ " >> ${config_file} + cat >> ${config_file} << _EOF +#define CONFIG_CM720T 1 /* CPU core is ARM720T */ +_EOF
changing multiline echos to a cat makes sense, but using cat for a single line is overkill. a simple echo "..." is better.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20100924/76193dd9/attachment.pgp
PATCH v2 1/1 board/armltd/integrator/split_by_variant.sh: fix 'echo -n'
This patch fixes an error when running MAKEALL for ARM9.
On OS X /bin/sh uses builtin echo which does not utilise '-n' switch. GNU manual for builtins recomend to use here-document style to solve this portability issue.
This patch removes the usage of 'echo -n' and replace by here-document style or a oneline echo command.
---
v1: first try, replace each occurrence of 'echo' by here-document
v2: replace oneliners by single 'echo' as sugested by Mike
board/armltd/integrator/split_by_variant.sh | 129 ++++++++++++--------------- 1 files changed, 57 insertions(+), 72 deletions(-)
board/armltd/integrator/split_by_variant.sh +57 -72
@@ -10,12 +10,12 @@ then # --------------------------------------------------------- # Set the platform defines # --------------------------------------------------------- -echo -n "/* Integrator configuration implied " > ${config_file} -echo " by Makefile target */" >> ${config_file} -echo -n "#define CONFIG_INTEGRATOR" >> ${config_file} -echo " /* Integrator board */" >> ${config_file} -echo -n "#define CONFIG_ARCH_INTEGRATOR" >> ${config_file} -echo " 1 /* Integrator/AP */" >> ${config_file} +cat > ${config_file} << _EOF +/* Integrator configuration implied by Makefile target */ +#define CONFIG_INTEGRATOR /* Integrator board */ +#define CONFIG_ARCH_INTEGRATOR 1 /* Integrator/AP */ +_EOF + # --------------------------------------------------------- # Set the core module defines according to Core Module # ---------------------------------------------------------
@@ -50,37 +50,37 @@ else ap720t_config) cpu="arm720t" - echo -n "#define CONFIG_CM720T" >> ${config_file} - echo " 1 /* CPU core is ARM720T */ " >> ${config_file} + echo "#define CONFIG_CM720T 1 /* CPU core is ARM720T */" \ + >> ${config_file} variant="Core module CM720T" ;; ap922_XA10_config) cpu="arm_intcm" variant="unported core module CM922T_XA10" - echo -n "#define CONFIG_CM922T_XA10" >> ${config_file} - echo " 1 /* CPU core is ARM922T_XA10 */" >> ${config_file} + echo "#define CONFIG_CM922T_XA10 1 /* CPU core is ARM922T_XA10 */" \ + >> ${config_file} ;; ap920t_config) cpu="arm920t" variant="Core module CM920T" - echo -n "#define CONFIG_CM920T" >> ${config_file} - echo " 1 /* CPU core is ARM920T */" >> ${config_file} + echo "#define CONFIG_CM920T 1 /* CPU core is ARM920T */" \ + >> ${config_file} ;; ap926ejs_config) cpu="arm926ejs" variant="Core module CM926EJ-S" - echo -n "#define CONFIG_CM926EJ_S" >> ${config_file} - echo " 1 /* CPU core is ARM926EJ-S */ " >> ${config_file} + echo "#define CONFIG_CM926EJ_S 1 /* CPU core is ARM926EJ-S */" \ + >> ${config_file} ;; ap946es_config) cpu="arm946es" variant="Core module CM946E-S" - echo -n "#define CONFIG_CM946E_S" >> ${config_file} - echo " 1 /* CPU core is ARM946E-S */ " >> ${config_file} + echo "#define CONFIG_CM946E_S 1 /* CPU core is ARM946E-S */" \ + >> ${config_file} ;; *)
@@ -94,33 +94,26 @@ fi case "$cpu" in arm_intcm) - echo "/* Core module undefined/not ported */" >> ${config_file} - echo "#define CONFIG_ARM_INTCM 1" >> ${config_file} - echo -n "#undef CONFIG_CM_MULTIPLE_SSRAM" >> ${config_file} - echo -n " /* CM may not have " >> ${config_file} - echo "multiple SSRAM mapping */" >> ${config_file} - echo -n "#undef CONFIG_CM_SPD_DETECT " >> ${config_file} - echo -n " /* CM may not support SPD " >> ${config_file} - echo "query */" >> ${config_file} - echo -n "#undef CONFIG_CM_REMAP " >> ${config_file} - echo -n " /* CM may not support " >> ${config_file} - echo "remapping */" >> ${config_file} - echo -n "#undef CONFIG_CM_INIT " >> ${config_file} - echo -n " /* CM may not have " >> ${config_file} - echo "initialization reg */" >> ${config_file} - echo -n "#undef CONFIG_CM_TCRAM " >> ${config_file} - echo " /* CM may not have TCRAM */" >> ${config_file} - echo -n " /* May not be processor " >> ${config_file} - echo "without cache support */" >> ${config_file} - echo "#define CONFIG_SYS_NO_ICACHE 1" >> ${config_file} - echo "#define CONFIG_SYS_NO_DCACHE 1" >> ${config_file} + cat >> ${config_file} << _EOF +/* Core module undefined/not ported */ +#define CONFIG_ARM_INTCM 1 +#undef CONFIG_CM_MULTIPLE_SSRAM /* CM may not have multiple SSRAM mapping */ +#undef CONFIG_CM_SPD_DETECT /* CM may not support SPD query */ +#undef CONFIG_CM_REMAP /* CM may not support remapping */ +#undef CONFIG_CM_INIT /* CM may not have initialization reg */ +#undef CONFIG_CM_TCRAM /* CM may not have TCRAM */ +/* May not be processor without cache support */ +#define CONFIG_SYS_NO_ICACHE 1 +#define CONFIG_SYS_NO_DCACHE 1 +_EOF ;; arm720t) - echo -n " /* May not be processor " >> ${config_file} - echo "without cache support */" >> ${config_file} - echo "#define CONFIG_SYS_NO_ICACHE 1" >> ${config_file} - echo "#define CONFIG_SYS_NO_DCACHE 1" >> ${config_file} + cat >> ${config_file} << _EOF +/* May not be processor without cache support */ +#define CONFIG_SYS_NO_ICACHE 1 +#define CONFIG_SYS_NO_DCACHE 1 +_EOF ;; esac
@@ -129,12 +122,11 @@ else # --------------------------------------------------------- # Set the platform defines # --------------------------------------------------------- -echo -n "/* Integrator configuration implied " > ${config_file} -echo " by Makefile target */" >> ${config_file} -echo -n "#define CONFIG_INTEGRATOR" >> ${config_file} -echo " /* Integrator board */" >> ${config_file} -echo -n "#define CONFIG_ARCH_CINTEGRATOR" >> ${config_file} -echo " 1 /* Integrator/CP */" >> ${config_file} +cat >> ${config_file} << _EOF +/* Integrator configuration implied by Makefile target */ +#define CONFIG_INTEGRATOR /* Integrator board */ +#define CONFIG_ARCH_CINTEGRATOR 1 /* Integrator/CP */ +_EOF cpu="arm_intcm" variant="unknown core module"
@@ -163,37 +155,37 @@ else cp922_XA10_config) cpu="arm_intcm" variant="unported core module CM922T_XA10" - echo -n "#define CONFIG_CM922T_XA10" >> ${config_file} - echo " 1 /* CPU core is ARM922T_XA10 */" >> ${config_file} + echo "#define CONFIG_CM922T_XA10 1 /* CPU core is ARM922T_XA10 */" \ + >> ${config_file} ;; cp920t_config) cpu="arm920t" variant="Core module CM920T" - echo -n "#define CONFIG_CM920T" >> ${config_file} - echo " 1 /* CPU core is ARM920T */" >> ${config_file} + echo "#define CONFIG_CM920T 1 /* CPU core is ARM920T */" \ + >> ${config_file} ;; cp926ejs_config) cpu="arm926ejs" variant="Core module CM926EJ-S" - echo -n "#define CONFIG_CM926EJ_S" >> ${config_file} - echo " 1 /* CPU core is ARM926EJ-S */ " >> ${config_file} + echo "#define CONFIG_CM926EJ_S 1 /* CPU core is ARM926EJ-S */" \ + >> ${config_file} ;; cp946es_config) cpu="arm946es" variant="Core module CM946E-S" - echo -n "#define CONFIG_CM946E_S" >> ${config_file} - echo " 1 /* CPU core is ARM946E-S */ " >> ${config_file} + echo "#define CONFIG_CM946E_S 1 /* CPU core is ARM946E-S */" \ + >> ${config_file} ;; cp1136_config) cpu="arm1136" variant="Core module CM1136EJF-S" - echo -n "#define CONFIG_CM1136EJF_S" >> ${config_file} - echo " 1 /* CPU core is ARM1136JF-S */ " >> ${config_file} + echo "#define CONFIG_CM1136EJF_S 1 /* CPU core is ARM1136JF-S */" \ + >> ${config_file} ;; *)
@@ -208,22 +200,15 @@ fi if [ "$cpu" = "arm_intcm" ] then - echo "/* Core module undefined/not ported */" >> ${config_file} - echo "#define CONFIG_ARM_INTCM 1" >> ${config_file} - echo -n "#undef CONFIG_CM_MULTIPLE_SSRAM" >> ${config_file} - echo -n " /* CM may not have " >> ${config_file} - echo "multiple SSRAM mapping */" >> ${config_file} - echo -n "#undef CONFIG_CM_SPD_DETECT " >> ${config_file} - echo -n " /* CM may not support SPD " >> ${config_file} - echo "query */" >> ${config_file} - echo -n "#undef CONFIG_CM_REMAP " >> ${config_file} - echo -n " /* CM may not support " >> ${config_file} - echo "remapping */" >> ${config_file} - echo -n "#undef CONFIG_CM_INIT " >> ${config_file} - echo -n " /* CM may not have " >> ${config_file} - echo "initialization reg */" >> ${config_file} - echo -n "#undef CONFIG_CM_TCRAM " >> ${config_file} - echo " /* CM may not have TCRAM */" >> ${config_file} + cat >> ${config_file} << _EOF +/* Core module undefined/not ported */ +#define CONFIG_ARM_INTCM 1 +#undef CONFIG_CM_MULTIPLE_SSRAM /* CM may not have multiple SSRAM mapping */ +#undef CONFIG_CM_SPD_DETECT /* CM may not support SPD query */ +#undef CONFIG_CM_REMAP /* CM may not support remapping */ +#undef CONFIG_CM_INIT /* CM may not have initialization reg */ +#undef CONFIG_CM_TCRAM /* CM may not have TCRAM */ +_EOF fi fi # ap
Signature · 1 line
1.7.3
PATCH v2 1/1 board/armltd/integrator/split_by_variant.sh: fix 'echo -n'
Dear =?UTF-8?q?Andreas=20Bie=C3=9Fmann?=,
Quoted 10 lines · In message <[email protected]>…
This patch fixes an error when running MAKEALL for ARM9.
On OS X
/bin/shuses builtin echo which does not utilise '-n' switch. GNU manual for builtins recomend to use here-document style to solve this portability issue.This patch removes the usage of 'echo -n' and replace by here-document style or a oneline echo command.
Quoted 8 lines
Signed-off-by Andreas Bie?mann <[email protected]>CC Peter Pearse <[email protected]>---
v1: first try, replace each occurrence of 'echo' by here-document
v2: replace oneliners by single 'echo' as sugested by Mikeboard/armltd/integrator/split_by_variant.sh | 129 ++++++++++++--------------- 1 files changed, 57 insertions(+), 72 deletions(-)
Applied to u-boot-arm, thanks.
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel 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 Wait! You have not been prepared! -- Mr. Atoz, "Tomorrow is Yesterday", stardate 3113.2