mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* Envfs embedded in barebox.bin
       [not found] <15dd21bf-86c1-4ca8-a830-caef28d617ee@zimbra1-e1.priv.proxad.net>
@ 2011-11-17 15:05 ` robert.jarzmik
  2011-11-17 15:49   ` Sascha Hauer
  0 siblings, 1 reply; 3+ messages in thread
From: robert.jarzmik @ 2011-11-17 15:05 UTC (permalink / raw)
  To: barebox

Hi,

I'm working on a very specific board, where I lack :
 - a serial console (all UARTs are wired to GSM/Bluetooth/GPS chips)
 - a JTAG adapter
 - internal MTD access (I have not ported the MTD driver from linux kernel yet)
 - a USB ethernet / console access (put I didn't port the pxa27x_udc yet)

What I have is :
 - a smartphone screen (framebuffer of PXA270)

I launch barebox.bin using a tool which does it well : disable MMU, flush cache, copy barebox.bin to start of RAM, and transfer control to it.

My issue is that while I'm developping my board code, I have no feedback (because no console available).
I'd like to run some hush scripts, and the only available way (so far) is to embed the envfs into barebox.bin.

What I'm attempting is basically to :
 (1) ld -b binary barebox_default_env -o barebox_default_env.o
 (2) add barebox_default_env.o in Makefile, target barebox-common
 (3) add in my board code (board.c) the creation of env0 device:
     devfs_add_partition("ram0", _binary_barebox_default_env_start,
                         _binary_barebox_default_env_size,
                         PARTITION_FIXED, "env0")

I'm feeling like reinventing the wheel there. Have I missed another clean way of including my board default envfs into barebox.bin ?
Of course, that will only last until I port the correct drivers to have access to my MTD ...

Cheers.

--
Robert

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

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

* Re: Envfs embedded in barebox.bin
  2011-11-17 15:05 ` Envfs embedded in barebox.bin robert.jarzmik
@ 2011-11-17 15:49   ` Sascha Hauer
  2011-11-17 16:02     ` robert.jarzmik
  0 siblings, 1 reply; 3+ messages in thread
From: Sascha Hauer @ 2011-11-17 15:49 UTC (permalink / raw)
  To: robert.jarzmik; +Cc: barebox

On Thu, Nov 17, 2011 at 04:05:19PM +0100, robert.jarzmik@free.fr wrote:
> Hi,
> 
> I'm working on a very specific board, where I lack :
>  - a serial console (all UARTs are wired to GSM/Bluetooth/GPS chips)
>  - a JTAG adapter
>  - internal MTD access (I have not ported the MTD driver from linux kernel yet)
>  - a USB ethernet / console access (put I didn't port the pxa27x_udc yet)
> 
> What I have is :
>  - a smartphone screen (framebuffer of PXA270)
> 
> I launch barebox.bin using a tool which does it well : disable MMU, flush cache, copy barebox.bin to start of RAM, and transfer control to it.
> 
> My issue is that while I'm developping my board code, I have no feedback (because no console available).

So you are doing LED debugging? That's brave ;)

> I'd like to run some hush scripts, and the only available way (so far) is to embed the envfs into barebox.bin.
> 
> What I'm attempting is basically to :
>  (1) ld -b binary barebox_default_env -o barebox_default_env.o
>  (2) add barebox_default_env.o in Makefile, target barebox-common
>  (3) add in my board code (board.c) the creation of env0 device:
>      devfs_add_partition("ram0", _binary_barebox_default_env_start,
>                          _binary_barebox_default_env_size,
>                          PARTITION_FIXED, "env0")

Most boards have this in the config:

CONFIG_DEFAULT_ENVIRONMENT=y
CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
CONFIG_DEFAULT_ENVIRONMENT_PATH="defaultenv arch/arm/boards/guf-vincell/env"

This means that the content of defaultenv/ and arch/arm/boards/guf-vincell/env
is embedded into the binary (common/Makefile) and gets mounted during
startup (common/startup.c line 113)

Sascha

-- 
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-5555 |

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

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

* Re: Envfs embedded in barebox.bin
  2011-11-17 15:49   ` Sascha Hauer
@ 2011-11-17 16:02     ` robert.jarzmik
  0 siblings, 0 replies; 3+ messages in thread
From: robert.jarzmik @ 2011-11-17 16:02 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

----- Mail original -----
De: "Sascha Hauer" <s.hauer@pengutronix.de>
> My issue is that while I'm developping my board code, I have no feedback (because no console available).
So you are doing LED debugging? That's brave ;)

That's crazy. It is the method I used to bring this board into the linux kernel, and I still have my good morse over a LED code, with which I debugged early initcalls in the kernel. But that's very very tedious :)

> Most boards have this in the config:
> CONFIG_DEFAULT_ENVIRONMENT=y
> CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
> CONFIG_DEFAULT_ENVIRONMENT_PATH="defaultenv arch/arm/boards/guf-vincell/env"
> This means that the content of defaultenv/ and arch/arm/boards/guf-vincell/env
> is embedded into the binary (common/Makefile) and gets mounted during
> startup (common/startup.c line 113)

Ah, this is the wheel I was speaking of :)
I had missed the "CONFIG_DEFAULT_ENVIRONMENT_GENERIC" part, and I didn't see anything in the linker (as it actually is in a generated .h file ...).

Great, thanks for the info, I just recompiled, and a hexdump shows my environment within barbox.bin.

Cheers.

--
Robert

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

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

end of thread, other threads:[~2011-11-17 16:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <15dd21bf-86c1-4ca8-a830-caef28d617ee@zimbra1-e1.priv.proxad.net>
2011-11-17 15:05 ` Envfs embedded in barebox.bin robert.jarzmik
2011-11-17 15:49   ` Sascha Hauer
2011-11-17 16:02     ` robert.jarzmik

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