Re: Failing to load Barebox Environment

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Just a question regarding the host generated environement file.

In common/environment.c - the host specific envfs_save function is setting

size = (unsigned long)data.writep;

Now there is no way of ensuring that the size is padded to Page size.
The script bareboxenv seems not to use the pad parameter to change the
size parameter of the ENVFS superblock.
Now I know that we can't issue read commands which are not multiples
of Page size. But this is exactly what we are doing in envfs_load:

size = ENVFS_32(super.size);
buf = xmalloc(size);
buf_free = buf;
ret = read(envfd, buf, size);

I think this explains why my read is failing !

Regards
Gaurav






On Wed, Sep 29, 2010 at 2:53 PM, Juergen Beisert <jbe@xxxxxxxxxxxxxx> wrote:
> Juergen Beisert wrote:
>> Just a note:
>>
>> You configure:
>> > >> devfs_add_partition("nand0", 0x00000, 0x200000, PARTITION_FIXED,
>> > >> "self_raw"); dev_add_bb_dev("self_raw", "self0");
>> > >> devfs_add_partition("nand0", 0x200000, 0x200000, PARTITION_FIXED,
>> > >> "env_raw"); dev_add_bb_dev("env_raw", "env0");
>>
>> And then:
>> > EVB2065> addpart /dev/nand0 4M(barebox)ro,2M(kernel)ro,-(root)
>>
>> Both must match!
>>
>> Try instead:
>>
>> EVB2065> addpart /dev/nand0 256k(barebox)ro,256k(env),2M(kernel)ro,-(root)
>>
>> jbe
>
> Ups, sorry: 0x200000 != 256k (didn't count the '0' right...)
>
> EVB2065> addpart /dev/nand0 2M(barebox)ro,2M(env),2M(kernel)ro,-(root)
>
> jbe
>
> --
> Pengutronix e.K.                              | Juergen Beisert             |
> Linux Solutions for Science and Industry      | Phone: +49-8766-939 228     |
> Vertretung Sued/Muenchen, Germany             | Fax:   +49-5121-206917-5555 |
> Amtsgericht Hildesheim, HRA 2686              | http://www.pengutronix.de/  |
>

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



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux