mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* Update barebox on mmc without touching partition table
@ 2011-04-08  9:18 Thomas Mayer
  2011-04-08 13:21 ` Sascha Hauer
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Mayer @ 2011-04-08  9:18 UTC (permalink / raw)
  To: barebox

Hi,

to copy barebox to a mmc I use the command "dd if=barebox.bin 
of=/dev/sdb bs=512 seek=2 skip=2 && sync". So I don't touch the first 
0x400 bytes with contains the partition table and everything is fine.

But I want to write a little script to update barebox itself via tftp. 
So I create a partition "/dev/self0" (0x00000 to 0x40000) and update 
barebox with "tftp barebox.bin /dev/self0". The problem is that barebox 
write the first 0x400 bytes too and overwrite the partition table .

Is there any way to "seek" and "skip" with barebox?


Regards,
Thomas





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

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

* Re: Update barebox on mmc without touching partition table
  2011-04-08  9:18 Update barebox on mmc without touching partition table Thomas Mayer
@ 2011-04-08 13:21 ` Sascha Hauer
  2011-04-13  9:28   ` Thomas Mayer
  0 siblings, 1 reply; 6+ messages in thread
From: Sascha Hauer @ 2011-04-08 13:21 UTC (permalink / raw)
  To: Thomas Mayer; +Cc: barebox

Hi Thomas,

On Fri, Apr 08, 2011 at 11:18:36AM +0200, Thomas Mayer wrote:
> Hi,
> 
> to copy barebox to a mmc I use the command "dd if=barebox.bin
> of=/dev/sdb bs=512 seek=2 skip=2 && sync". So I don't touch the
> first 0x400 bytes with contains the partition table and everything
> is fine.
> 
> But I want to write a little script to update barebox itself via
> tftp. So I create a partition "/dev/self0" (0x00000 to 0x40000) and
> update barebox with "tftp barebox.bin /dev/self0". The problem is
> that barebox write the first 0x400 bytes too and overwrite the
> partition table .
> 
> Is there any way to "seek" and "skip" with barebox?

Not directly. What you can do is this:

tftp barebox.bin
memcpy -s barebox.bin -d /dev/self0 512 0

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] 6+ messages in thread

* Re: Update barebox on mmc without touching partition table
  2011-04-08 13:21 ` Sascha Hauer
@ 2011-04-13  9:28   ` Thomas Mayer
  2011-04-13  9:51     ` Marc Kleine-Budde
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Mayer @ 2011-04-13  9:28 UTC (permalink / raw)
  To: barebox

Hi Sasha,

thanks for your help!

Am 08.04.2011 15:21, schrieb Sascha Hauer:
> Hi Thomas,
>
> On Fri, Apr 08, 2011 at 11:18:36AM +0200, Thomas Mayer wrote:
>> Hi,
>>
>> to copy barebox to a mmc I use the command "dd if=barebox.bin
>> of=/dev/sdb bs=512 seek=2 skip=2&&  sync". So I don't touch the
>> first 0x400 bytes with contains the partition table and everything
>> is fine.
>>
>> But I want to write a little script to update barebox itself via
>> tftp. So I create a partition "/dev/self0" (0x00000 to 0x40000) and
>> update barebox with "tftp barebox.bin /dev/self0". The problem is
>> that barebox write the first 0x400 bytes too and overwrite the
>> partition table .
>>
>> Is there any way to "seek" and "skip" with barebox?
> Not directly. What you can do is this:
>
> tftp barebox.bin
> memcpy -s barebox.bin -d /dev/self0 512 0
It's working, but I have to use "1024" instead of "512". Also I have to 
change my partition init from
"devfs_add_partition("disk0", 0x000000, 0x040000, PARTITION_FIXED, 
"self0");"
to
devfs_add_partition("disk0", 0x000400, 0x040000, PARTITION_FIXED, "self0");


Regards,
Thomas

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

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

* Re: Update barebox on mmc without touching partition table
  2011-04-13  9:28   ` Thomas Mayer
@ 2011-04-13  9:51     ` Marc Kleine-Budde
  2011-04-13 10:55       ` Thomas Mayer
  0 siblings, 1 reply; 6+ messages in thread
From: Marc Kleine-Budde @ 2011-04-13  9:51 UTC (permalink / raw)
  To: Thomas Mayer; +Cc: barebox


[-- Attachment #1.1: Type: text/plain, Size: 1383 bytes --]

On 04/13/2011 11:28 AM, Thomas Mayer wrote:
>>> to copy barebox to a mmc I use the command "dd if=barebox.bin
>>> of=/dev/sdb bs=512 seek=2 skip=2&&  sync". So I don't touch the
>>> first 0x400 bytes with contains the partition table and everything
>>> is fine.
>>>
>>> But I want to write a little script to update barebox itself via
>>> tftp. So I create a partition "/dev/self0" (0x00000 to 0x40000) and
>>> update barebox with "tftp barebox.bin /dev/self0". The problem is
>>> that barebox write the first 0x400 bytes too and overwrite the
>>> partition table .
>>>
>>> Is there any way to "seek" and "skip" with barebox?
>> Not directly. What you can do is this:
>>
>> tftp barebox.bin
>> memcpy -s barebox.bin -d /dev/self0 512 0
> It's working, but I have to use "1024" instead of "512". Also I have to
> change my partition init from
> "devfs_add_partition("disk0", 0x000000, 0x040000, PARTITION_FIXED,
> "self0");"
> to
> devfs_add_partition("disk0", 0x000400, 0x040000, PARTITION_FIXED, "self0");

what about using:

memcpy -s barebox.bin -d /dev/self0 1024 1024

Marc
-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

[-- Attachment #2: Type: text/plain, Size: 149 bytes --]

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

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

* Re: Update barebox on mmc without touching partition table
  2011-04-13  9:51     ` Marc Kleine-Budde
@ 2011-04-13 10:55       ` Thomas Mayer
  2011-04-13 11:41         ` Marc Kleine-Budde
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Mayer @ 2011-04-13 10:55 UTC (permalink / raw)
  To: barebox

Hi Marc,

Am 13.04.2011 11:51, schrieb Marc Kleine-Budde:
> On 04/13/2011 11:28 AM, Thomas Mayer wrote:
>>>> to copy barebox to a mmc I use the command "dd if=barebox.bin
>>>> of=/dev/sdb bs=512 seek=2 skip=2&&   sync". So I don't touch the
>>>> first 0x400 bytes with contains the partition table and everything
>>>> is fine.
>>>>
>>>> But I want to write a little script to update barebox itself via
>>>> tftp. So I create a partition "/dev/self0" (0x00000 to 0x40000) and
>>>> update barebox with "tftp barebox.bin /dev/self0". The problem is
>>>> that barebox write the first 0x400 bytes too and overwrite the
>>>> partition table .
>>>>
>>>> Is there any way to "seek" and "skip" with barebox?
>>> Not directly. What you can do is this:
>>>
>>> tftp barebox.bin
>>> memcpy -s barebox.bin -d /dev/self0 512 0
>> It's working, but I have to use "1024" instead of "512". Also I have to
>> change my partition init from
>> "devfs_add_partition("disk0", 0x000000, 0x040000, PARTITION_FIXED,
>> "self0");"
>> to
>> devfs_add_partition("disk0", 0x000400, 0x040000, PARTITION_FIXED, "self0");
> what about using:
>
> memcpy -s barebox.bin -d /dev/self0 1024 1024
>
works too, with partition from 0x00000 to 0x040000.


Regards,
Thomas

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

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

* Re: Update barebox on mmc without touching partition table
  2011-04-13 10:55       ` Thomas Mayer
@ 2011-04-13 11:41         ` Marc Kleine-Budde
  0 siblings, 0 replies; 6+ messages in thread
From: Marc Kleine-Budde @ 2011-04-13 11:41 UTC (permalink / raw)
  To: Thomas Mayer; +Cc: barebox


[-- Attachment #1.1: Type: text/plain, Size: 438 bytes --]

On 04/13/2011 12:55 PM, Thomas Mayer wrote:
>> memcpy -s barebox.bin -d /dev/self0 1024 1024
>>
> works too, with partition from 0x00000 to 0x040000.

\o/

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

[-- Attachment #2: Type: text/plain, Size: 149 bytes --]

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

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

end of thread, other threads:[~2011-04-13 11:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-08  9:18 Update barebox on mmc without touching partition table Thomas Mayer
2011-04-08 13:21 ` Sascha Hauer
2011-04-13  9:28   ` Thomas Mayer
2011-04-13  9:51     ` Marc Kleine-Budde
2011-04-13 10:55       ` Thomas Mayer
2011-04-13 11:41         ` Marc Kleine-Budde

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