From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-qy0-f177.google.com ([209.85.216.177]) by bombadil.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1P0tVZ-000219-Rk for barebox@lists.infradead.org; Wed, 29 Sep 2010 10:03:30 +0000 Received: by qyk34 with SMTP id 34so1078430qyk.15 for ; Wed, 29 Sep 2010 03:03:28 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <201009291123.19306.jbe@pengutronix.de> References: <201009291108.18378.jbe@pengutronix.de> <201009291123.19306.jbe@pengutronix.de> Date: Wed, 29 Sep 2010 15:33:27 +0530 Message-ID: From: Gaurav Singh List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: barebox-bounces@lists.infradead.org Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: Re: Failing to load Barebox Environment To: Juergen Beisert Cc: barebox@lists.infradead.org Just a question regarding the host generated environement file. In common/environment.c - the host specific envfs_save function is setting size =3D (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 =3D ENVFS_32(super.size); buf =3D xmalloc(size); buf_free =3D buf; ret =3D 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 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,-(roo= t) >> >> jbe > > Ups, sorry: 0x200000 !=3D 256k (didn't count the '0' right...) > > EVB2065> addpart /dev/nand0 2M(barebox)ro,2M(env),2M(kernel)ro,-(root) > > jbe > > -- > Pengutronix e.K. =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0| Juergen Beisert =A0 =A0 =A0 =A0 =A0 =A0 | > Linux Solutions for Science and Industry =A0 =A0 =A0| Phone: +49-8766-939= 228 =A0 =A0 | > Vertretung Sued/Muenchen, Germany =A0 =A0 =A0 =A0 =A0 =A0 | Fax: =A0 +49-= 5121-206917-5555 | > Amtsgericht Hildesheim, HRA 2686 =A0 =A0 =A0 =A0 =A0 =A0 =A0| http://www.= pengutronix.de/ =A0| > _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox