[PATCH] ARM: Using unsigned specifiers for unsigned arguments for printf

2013-05-28 Thread Alexander Shiyan

Signed-off-by: Alexander Shiyan 
---
 arch/arm/lib/bootm.c  | 2 +-
 arch/arm/lib/module.c | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
index e7a0625..0d3b59e 100644
--- a/arch/arm/lib/bootm.c
+++ b/arch/arm/lib/bootm.c
@@ -326,7 +326,7 @@ static int aimage_load_resource(int fd, struct resource *r, 
void* buf, int ps)
 
ret = read_full(fd, buf, to_read);
if (ret < 0)
-   printf("could not read dummy %d\n", to_read);
+   printf("could not read dummy %u\n", to_read);
 
return ret;
 }
diff --git a/arch/arm/lib/module.c b/arch/arm/lib/module.c
index 643a8be..be7965d 100644
--- a/arch/arm/lib/module.c
+++ b/arch/arm/lib/module.c
@@ -34,7 +34,7 @@ apply_relocate(Elf32_Shdr *sechdrs, const char *strtab, 
unsigned int symindex,
 
offset = ELF32_R_SYM(rel->r_info);
if (offset < 0 || offset > (symsec->sh_size / 
sizeof(Elf32_Sym))) {
-   printf("%s: bad relocation, section %d reloc %d\n",
+   printf("%s: bad relocation, section %u reloc %u\n",
module->name, relindex, i);
return -ENOEXEC;
}
@@ -43,7 +43,7 @@ apply_relocate(Elf32_Shdr *sechdrs, const char *strtab, 
unsigned int symindex,
 
if (rel->r_offset < 0 || rel->r_offset > dstsec->sh_size - 
sizeof(u32)) {
printf("%s: out of bounds relocation, "
-   "section %d reloc %d offset %d size %d\n",
+   "section %u reloc %u offset %d size %d\n",
module->name, relindex, i, rel->r_offset,
dstsec->sh_size);
return -ENOEXEC;
@@ -68,7 +68,7 @@ apply_relocate(Elf32_Shdr *sechdrs, const char *strtab, 
unsigned int symindex,
offset <= (s32)0xfe00 ||
offset >= (s32)0x0200) {
printf("%s: relocation out of range, section "
-  "%d reloc %d sym '%s'\n", module->name,
+  "%u reloc %u sym '%s'\n", module->name,
   relindex, i, strtab + sym->st_name);
return -ENOEXEC;
}
-- 
1.8.1.5


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


Re: [SPAM] [PATCH] scripts: genenv: remove empty files from tempdir

2013-05-28 Thread Jan Lübbe
On Tue, 2013-05-28 at 12:55 +0200, Jean-Christophe PLAGNIOL-VILLARD
wrote:
> On 09:45 Tue 28 May , Jan Luebbe wrote:
> > This allows leaving out default files from the environment by overriding
> > them with empty files in the board or BSP.
> > 
> > Signed-off-by: Jan Luebbe 
> > ---
> can we move it to the buildir and keep it
> 
> and no need to have a uniq name everytime

Sorry, could you explain this again differently? I don't understand your
comment.

Regards,
Jan
-- 
Pengutronix e.K.   | |
Industrial Linux Solutions | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


[PATCH] omap4: set voltage according to mpu freq

2013-05-28 Thread Jan Weitzel
For OMAP4460 omap4_scale_vcores must set the voltage according to mpu freq.

OPP100  700MHz 1210mV
OPPTB   920MHz 1320mV
OPPNT  1200MHz 1380mV

Signed-off-by: Jan Weitzel 
---
 arch/arm/boards/archosg9/lowlevel.c |2 +-
 arch/arm/boards/panda/lowlevel.c|2 +-
 arch/arm/boards/pcm049/lowlevel.c   |2 +-
 arch/arm/boards/phycard-a-xl2/lowlevel.c|2 +-
 arch/arm/mach-omap/include/mach/omap4-silicon.h |2 +-
 arch/arm/mach-omap/omap4_generic.c  |6 +++---
 6 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/arch/arm/boards/archosg9/lowlevel.c 
b/arch/arm/boards/archosg9/lowlevel.c
index 0334693..0fae6da 100644
--- a/arch/arm/boards/archosg9/lowlevel.c
+++ b/arch/arm/boards/archosg9/lowlevel.c
@@ -49,7 +49,7 @@ static noinline void archosg9_init_lowlevel(void)
set_muxconf_regs();
 
/* Set VCORE1 = 1.3 V, VCORE2 = VCORE3 = 1.21V */
-   omap4_scale_vcores(TPS62361_VSEL0_GPIO);
+   omap4_scale_vcores(TPS62361_VSEL0_GPIO, 1380);
 
/* Enable all clocks */
omap4_enable_all_clocks();
diff --git a/arch/arm/boards/panda/lowlevel.c b/arch/arm/boards/panda/lowlevel.c
index ed1dc6f..591ff2f 100644
--- a/arch/arm/boards/panda/lowlevel.c
+++ b/arch/arm/boards/panda/lowlevel.c
@@ -70,7 +70,7 @@ static void noinline panda_init_lowlevel(void)
omap4_ddr_init(&ddr_regs_400_mhz_2cs, &core);
 
/* Set VCORE1 = 1.3 V, VCORE2 = VCORE3 = 1.21V */
-   omap4_scale_vcores(TPS62361_VSEL0_GPIO);
+   omap4_scale_vcores(TPS62361_VSEL0_GPIO, 1210);
 }
 
 void barebox_arm_reset_vector(void)
diff --git a/arch/arm/boards/pcm049/lowlevel.c 
b/arch/arm/boards/pcm049/lowlevel.c
index 33519f7..8548868 100644
--- a/arch/arm/boards/pcm049/lowlevel.c
+++ b/arch/arm/boards/pcm049/lowlevel.c
@@ -109,7 +109,7 @@ static void noinline pcm049_init_lowlevel(void)
 #endif
 
/* Set VCORE1 = 1.3 V, VCORE2 = VCORE3 = 1.21V */
-   omap4_scale_vcores(TPS62361_VSEL0_GPIO);
+   omap4_scale_vcores(TPS62361_VSEL0_GPIO, 1320);
 
writel(CM_SYS_CLKSEL_19M2, CM_SYS_CLKSEL);
 
diff --git a/arch/arm/boards/phycard-a-xl2/lowlevel.c 
b/arch/arm/boards/phycard-a-xl2/lowlevel.c
index 07505ff..3750bae 100644
--- a/arch/arm/boards/phycard-a-xl2/lowlevel.c
+++ b/arch/arm/boards/phycard-a-xl2/lowlevel.c
@@ -58,7 +58,7 @@ static noinline void pcaaxl2_init_lowlevel(void)
omap4_ddr_init(&ddr_regs_mt42L64M64_25_400_mhz, &core);
 
/* Set VCORE1 = 1.3 V, VCORE2 = VCORE3 = 1.21V */
-   omap4_scale_vcores(TPS62361_VSEL0_GPIO);
+   omap4_scale_vcores(TPS62361_VSEL0_GPIO, 1320);
 
writel(CM_SYS_CLKSEL_19M2, CM_SYS_CLKSEL);
 
diff --git a/arch/arm/mach-omap/include/mach/omap4-silicon.h 
b/arch/arm/mach-omap/include/mach/omap4-silicon.h
index 9e82435..5684a38 100644
--- a/arch/arm/mach-omap/include/mach/omap4-silicon.h
+++ b/arch/arm/mach-omap/include/mach/omap4-silicon.h
@@ -211,7 +211,7 @@ struct dpll_param;
 void omap4_ddr_init(const struct ddr_regs *, const struct dpll_param *);
 void omap4_power_i2c_send(u32);
 unsigned int omap4_revision(void);
-noinline int omap4_scale_vcores(unsigned vsel0_pin);
+noinline int omap4_scale_vcores(unsigned vsel0_pin, unsigned volt_mv);
 
 #endif
 
diff --git a/arch/arm/mach-omap/omap4_generic.c 
b/arch/arm/mach-omap/omap4_generic.c
index 38993be..1eeaf30 100644
--- a/arch/arm/mach-omap/omap4_generic.c
+++ b/arch/arm/mach-omap/omap4_generic.c
@@ -511,7 +511,7 @@ static void __iomem *omap4_get_gpio_base(unsigned gpio)
 
 #define I2C_SLAVE 0x12
 
-noinline int omap4_scale_vcores(unsigned vsel0_pin)
+noinline int omap4_scale_vcores(unsigned vsel0_pin, unsigned volt_mv)
 {
void __iomem *base;
unsigned int rev = omap4_revision();
@@ -529,8 +529,8 @@ noinline int omap4_scale_vcores(unsigned vsel0_pin)
 * Setup SET1 and SET0 with right values so that kernel
 * can use either of them based on its needs.
 */
-   omap4_do_scale_tps62361(TPS62361_REG_ADDR_SET0, 1430);
-   omap4_do_scale_tps62361(TPS62361_REG_ADDR_SET1, 1430);
+   omap4_do_scale_tps62361(TPS62361_REG_ADDR_SET0, volt_mv);
+   omap4_do_scale_tps62361(TPS62361_REG_ADDR_SET1, volt_mv);
 
/*
 * Select SET1 in TPS62361:
-- 
1.7.0.4


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


[PATCH] pcm049: add 1GB RAM support

2013-05-28 Thread Jan Weitzel
From: Teresa Gámez 

Add config to select RAM assembly. The difference is if one or two chip selects
are used. This can't be checkt at runtime.

Signed-off-by: Jan Weitzel 
---
 arch/arm/boards/pcm049/board.c|4 
 arch/arm/boards/pcm049/lowlevel.c |   21 -
 arch/arm/mach-omap/Kconfig|   12 
 3 files changed, 36 insertions(+), 1 deletions(-)

diff --git a/arch/arm/boards/pcm049/board.c b/arch/arm/boards/pcm049/board.c
index b0d689b..3c4b1a7 100644
--- a/arch/arm/boards/pcm049/board.c
+++ b/arch/arm/boards/pcm049/board.c
@@ -48,7 +48,11 @@ console_initcall(pcm049_console_init);
 
 static int pcm049_mem_init(void)
 {
+#ifdef CONFIG_1024MB_DDR2RAM
+   omap_add_ram0(SZ_1G);
+#else
omap_add_ram0(SZ_512M);
+#endif
 
omap44xx_add_sram0();
return 0;
diff --git a/arch/arm/boards/pcm049/lowlevel.c 
b/arch/arm/boards/pcm049/lowlevel.c
index 5075bbb..2df5fae 100644
--- a/arch/arm/boards/pcm049/lowlevel.c
+++ b/arch/arm/boards/pcm049/lowlevel.c
@@ -30,6 +30,7 @@
 
 void set_muxconf_regs(void);
 
+/* 512MB */
 static const struct ddr_regs ddr_regs_mt42L64M64_25_400_mhz = {
.tim1   = 0x0EEB0662,
.tim2   = 0x20370DD2,
@@ -43,6 +44,20 @@ static const struct ddr_regs ddr_regs_mt42L64M64_25_400_mhz 
= {
.mr2= 0x4
 };
 
+/* 1GB */
+static const struct ddr_regs ddr_regs_mt42L128M64_25_400_mhz = {
+   .tim1   = 0x0EEB0663,
+   .tim2   = 0x205715D2,
+   .tim3   = 0x00BFC53F,
+   .phy_ctrl_1 = 0x849FF408,
+   .ref_ctrl   = 0x0618,
+   .config_init= 0x80001AB9,
+   .config_final   = 0x80001AB9,
+   .zq_config  = 0x50093215,
+   .mr1= 0x83,
+   .mr2= 0x4
+};
+
 static void noinline pcm049_init_lowlevel(void)
 {
struct dpll_param core = OMAP4_CORE_DPLL_PARAM_19M2_DDR400;
@@ -55,7 +70,11 @@ static void noinline pcm049_init_lowlevel(void)
 
set_muxconf_regs();
 
-   omap4_ddr_init(&ddr_regs_mt42L64M64_25_400_mhz, &core);
+#ifdef CONFIG_1024MB_DDR2RAM
+   omap4_ddr_init(&ddr_regs_mt42L128M64_25_400_mhz, &core);
+#else
+   omap4_ddr_init(&ddr_regs_mt42L64M64_25_400_mhz, &core);
+#endif
 
/* Set VCORE1 = 1.3 V, VCORE2 = VCORE3 = 1.21V */
omap4_scale_vcores(TPS62361_VSEL0_GPIO);
diff --git a/arch/arm/mach-omap/Kconfig b/arch/arm/mach-omap/Kconfig
index 42e5f4a..87d3b3e 100644
--- a/arch/arm/mach-omap/Kconfig
+++ b/arch/arm/mach-omap/Kconfig
@@ -209,6 +209,18 @@ endchoice
 
 endif
 
+if MACH_PCM049
+   choice
+   prompt "Select DDR2-RAM Size"
+
+   config 512MB_DDR2RAM
+   bool "512MB"
+   config 1024MB_DDR2RAM
+   bool "1024MB"
+
+   endchoice
+endif
+
 config MACH_OMAP_ADVANCED_MUX
bool "Enable advanced pin muxing"
depends on MACH_OMAP343xSDP
-- 
1.7.0.4


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


[PATCH] OMAP4: Use default clock source for mcbsp

2013-05-28 Thread Jan Weitzel
In omap4_enable_all_clocks we not only enable the mcbsp clocks, but also
change the source from ABE_24M_FCLK to 24M_FCLK. Revert this and default
to the reset state.

Signed-off-by: Jan Weitzel 
---
 arch/arm/mach-omap/omap4_clock.c |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-omap/omap4_clock.c b/arch/arm/mach-omap/omap4_clock.c
index 0621fd3..889d1f9 100644
--- a/arch/arm/mach-omap/omap4_clock.c
+++ b/arch/arm/mach-omap/omap4_clock.c
@@ -253,9 +253,9 @@ void omap4_enable_all_clocks(void)
sr32(CM1_ABE_PDM_CLKCTRL, 0, 32, 0x2);
sr32(CM1_ABE_DMIC_CLKCTRL, 0, 32, 0x2);
sr32(CM1_ABE_MCASP_CLKCTRL, 0, 32, 0x2);
-   sr32(CM1_ABE_MCBSP1_CLKCTRL, 0, 32, 0x0802);
-   sr32(CM1_ABE_MCBSP2_CLKCTRL, 0, 32, 0x0802);
-   sr32(CM1_ABE_MCBSP3_CLKCTRL, 0, 32, 0x0802);
+   sr32(CM1_ABE_MCBSP1_CLKCTRL, 0, 32, 0x2);
+   sr32(CM1_ABE_MCBSP2_CLKCTRL, 0, 32, 0x2);
+   sr32(CM1_ABE_MCBSP3_CLKCTRL, 0, 32, 0x2);
sr32(CM1_ABE_SLIMBUS_CLKCTRL, 0, 32, 0xf02);
sr32(CM1_ABE_TIMER5_CLKCTRL, 0, 32, 0x2);
sr32(CM1_ABE_TIMER6_CLKCTRL, 0, 32, 0x2);
-- 
1.7.0.4


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


[PATCH] pcm049: clean up

2013-05-28 Thread Jan Weitzel
Remove magic numbers
Signed-off-by: Jan Weitzel 
---
 arch/arm/boards/pcm049/lowlevel.c |   10 +-
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/arm/boards/pcm049/lowlevel.c 
b/arch/arm/boards/pcm049/lowlevel.c
index 8548868..caac21e 100644
--- a/arch/arm/boards/pcm049/lowlevel.c
+++ b/arch/arm/boards/pcm049/lowlevel.c
@@ -127,11 +127,11 @@ static void noinline pcm049_init_lowlevel(void)
/* Enable all clocks */
omap4_enable_all_clocks();
 
-   sr32(0x4A30a31C, 8, 1, 0x1);  /* enable software ioreq */
-   sr32(0x4A30a31C, 1, 2, 0x0);  /* set for sys_clk (19.2MHz) */
-   sr32(0x4A30a31C, 16, 4, 0x0); /* set divisor to 1 */
-   sr32(0x4A30a110, 0, 1, 0x1);  /* set the clock source to active */
-   sr32(0x4A30a110, 2, 2, 0x3);  /* enable clocks */
+   sr32(OMAP44XX_SCRM_AUXCLK3, 8, 1, 0x1);  /* enable software ioreq */
+   sr32(OMAP44XX_SCRM_AUXCLK3, 1, 2, 0x0);  /* set for sys_clk (19.2MHz) */
+   sr32(OMAP44XX_SCRM_AUXCLK3, 16, 4, 0x0); /* set divisor to 1 */
+   sr32(OMAP44XX_SCRM_ALTCLKSRC, 0, 1, 0x1);  /* activate clock source */
+   sr32(OMAP44XX_SCRM_ALTCLKSRC, 2, 2, 0x3);  /* enable clocks */
 }
 
 void barebox_arm_reset_vector(void)
-- 
1.7.0.4


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


[PATCH] twl6030: Set WR_S for VMMC

2013-05-28 Thread Jan Weitzel
After Reset VMMC goes to default VSEL. This is not a clean power cycle for
some SD cards.
Set flag WR_S for VMMC to avoid going to default VSEL.

Signed-off-by: Jan Weitzel 
---
 drivers/mci/twl6030.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/mci/twl6030.c b/drivers/mci/twl6030.c
index 4a875bd..ad1043d 100644
--- a/drivers/mci/twl6030.c
+++ b/drivers/mci/twl6030.c
@@ -21,6 +21,7 @@ static int twl6030_mci_write(u8 address, u8 data)
 void twl6030_mci_power_init(void)
 {
twl6030_mci_write(TWL6030_PMCS_VMMC_CFG_VOLTAGE,
+   TWL6030_VMMC_WR_S | 
TWL6030_VMMC_VSEL_0 | TWL6030_VMMC_VSEL_2 |
TWL6030_VMMC_VSEL_4);
twl6030_mci_write(TWL6030_PMCS_VMMC_CFG_STATE,
-- 
1.7.0.4


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


Re: [SPAM] [PATCH] scripts: genenv: remove empty files from tempdir

2013-05-28 Thread Jean-Christophe PLAGNIOL-VILLARD
On 09:45 Tue 28 May , Jan Luebbe wrote:
> This allows leaving out default files from the environment by overriding
> them with empty files in the board or BSP.
> 
> Signed-off-by: Jan Luebbe 
> ---
can we move it to the buildir and keep it

and no need to have a uniq name everytime
>  scripts/genenv | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/genenv b/scripts/genenv
> index 374db6d..3e91062 100755
> --- a/scripts/genenv
> +++ b/scripts/genenv
> @@ -24,7 +24,7 @@ for i in $*; do
>  done
>  )
>  
> -find $tempdir -name '.svn' -o -name '*~' | xargs --no-run-if-empty rm -r
> +find $tempdir -name '.svn' -o -name '*~' -o -size 0 | xargs 
> --no-run-if-empty rm -r
>  
>  $objtree/scripts/bareboxenv -s $tempdir $target
>  
> -- 
> 1.8.2.rc2
> 
> 
> ___
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox

___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


[PATCH] scripts: Makefile: do not use obj-* variables for userspace tools

2013-05-28 Thread Jan Luebbe
When using obj-?, it erroneously tries to link a built-in.o. Instead
use the extra-? variable.

Signed-off-by: Jan Luebbe 
---
 scripts/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/Makefile b/scripts/Makefile
index f062fc0..e375530 100644
--- a/scripts/Makefile
+++ b/scripts/Makefile
@@ -30,7 +30,7 @@ subdir-   += basic kconfig setupmbr
 quiet_cmd_csingle  = CC  $@
   cmd_csingle  = $(CC) -Wp,-MD,$(depfile) $(CFLAGS) -o $@ $<
 
-obj-$(CONFIG_BAREBOXENV_TARGET)+= bareboxenv-target
+extra-$(CONFIG_BAREBOXENV_TARGET) += bareboxenv-target
 
 scripts/bareboxenv-target: scripts/bareboxenv.c FORCE
$(call if_changed_dep,csingle)
-- 
1.8.2.rc2


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


[PATCH] ARM: pbl: Always call pbl make

2013-05-28 Thread Sascha Hauer
We always must decend into the pbl build. Otherwise it doesn't get
rebuilt if only sourcefiles from the pbl are changed.

Signed-off-by: Sascha Hauer 
---
 arch/arm/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 90a4713..8f0d23e 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -257,7 +257,7 @@ KBUILD_IMAGE := barebox.zynq
 endif
 
 pbl := arch/arm/pbl
-$(pbl)/zbarebox.S $(pbl)/zbarebox.bin $(pbl)/zbarebox: barebox.bin
+$(pbl)/zbarebox.S $(pbl)/zbarebox.bin $(pbl)/zbarebox: barebox.bin FORCE
$(Q)$(MAKE) $(build)=$(pbl) $@
 
 archclean:
-- 
1.8.2.rc2


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


[PATCH] ARM: i.MX53 vincell: Fix lowlevel startup

2013-05-28 Thread Sascha Hauer
This is a i.MX53 board, not i.MX51.

Signed-off-by: Sascha Hauer 
---
 arch/arm/boards/guf-vincell/lowlevel.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boards/guf-vincell/lowlevel.c 
b/arch/arm/boards/guf-vincell/lowlevel.c
index ee7aafd..534e506 100644
--- a/arch/arm/boards/guf-vincell/lowlevel.c
+++ b/arch/arm/boards/guf-vincell/lowlevel.c
@@ -132,7 +132,7 @@ void __bare_init __naked barebox_arm_reset_vector(void)
/* Skip SDRAM initialization if we run from RAM */
r = get_pc();
if (r > 0x7000 && r < 0xf000)
-   imx51_barebox_entry(0);
+   imx53_barebox_entry(0);
 
/* Setup a preliminary stack */
r = 0xf800 + 0x6 - 16;
@@ -146,5 +146,5 @@ void __bare_init __naked barebox_arm_reset_vector(void)
 
imx_esdctlv4_init();
 
-   imx51_barebox_entry(0);
+   imx53_barebox_entry(0);
 }
-- 
1.8.2.rc2


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


Re: [PATCH] scripts: genenv: remove empty files from tempdir

2013-05-28 Thread Uwe Kleine-König
Hello,

On Tue, May 28, 2013 at 09:45:46AM +0200, Jan Luebbe wrote:
> This allows leaving out default files from the environment by overriding
> them with empty files in the board or BSP.
> 
> Signed-off-by: Jan Luebbe 
> ---
>  scripts/genenv | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/genenv b/scripts/genenv
> index 374db6d..3e91062 100755
> --- a/scripts/genenv
> +++ b/scripts/genenv
> @@ -24,7 +24,7 @@ for i in $*; do
>  done
>  )
>  
> -find $tempdir -name '.svn' -o -name '*~' | xargs --no-run-if-empty rm -r
> +find $tempdir -name '.svn' -o -name '*~' -o -size 0 | xargs 
> --no-run-if-empty rm -r
Maybe use -empty instead of -size 0?

Other than that this is broken for funny filenames.

find "$tempdir" -name '.svn' -o -name '*~' -o -size 0 -print0 | xargs 
--no-run-if-empty --null rm -r

would work, but depends on GNU find and xargs. I don't know if that is a
problem. Alternatively use:

find "$tempdir" -depth -name '.svn' -o -name '*~' -o -size 0 -execdir 
rm -r {} +

(Obviously this doesn't make your patch worse, I'm just pointing out
another possible improvement.) And note my suggestions are untested.

Best regards
Uwe

-- 
Pengutronix e.K.   | Uwe Kleine-König|
Industrial Linux Solutions | http://www.pengutronix.de/  |

___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


[PATCH] scripts: genenv: remove empty files from tempdir

2013-05-28 Thread Jan Luebbe
This allows leaving out default files from the environment by overriding
them with empty files in the board or BSP.

Signed-off-by: Jan Luebbe 
---
 scripts/genenv | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/genenv b/scripts/genenv
index 374db6d..3e91062 100755
--- a/scripts/genenv
+++ b/scripts/genenv
@@ -24,7 +24,7 @@ for i in $*; do
 done
 )
 
-find $tempdir -name '.svn' -o -name '*~' | xargs --no-run-if-empty rm -r
+find $tempdir -name '.svn' -o -name '*~' -o -size 0 | xargs --no-run-if-empty 
rm -r
 
 $objtree/scripts/bareboxenv -s $tempdir $target
 
-- 
1.8.2.rc2


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox