[U-Boot] status of patch to store environment to mmc/sd

Hi Terry,
I came across a patch[1] from you to add support to save the environment to mmc/sd. What is the status of the patch?
I am unable to find it in mainline u-boot or Stefano's u-boot-imx.git.
I ran across this when trying mainline u-boot on a mx51evk where it won't let me change the default environment since there is no 'saveenv' command. I guess I can just change the environment in source and recompile.
Regards, Amit
[1] http://www.mail-archive.com/u-boot@lists.denx.de/msg31675.html

Stefano,
Any further comment on this patch? Does it still require more work that we can take on?
Regards, Amit
On Tue, Sep 7, 2010 at 2:29 PM, Amit Kucheria amit.kucheria@verdurent.com wrote:
Hi Terry,
I came across a patch[1] from you to add support to save the environment to mmc/sd. What is the status of the patch?
I am unable to find it in mainline u-boot or Stefano's u-boot-imx.git.
I ran across this when trying mainline u-boot on a mx51evk where it won't let me change the default environment since there is no 'saveenv' command. I guess I can just change the environment in source and recompile.
Regards, Amit
[1] http://www.mail-archive.com/u-boot@lists.denx.de/msg31675.html

Amit Kucheria wrote:
Stefano,
Any further comment on this patch? Does it still require more work that we can take on?
Hi Amit,
as I know there is a newer version of the patch [V6] as the one you reported:
http://article.gmane.org/gmane.comp.boot-loaders.u-boot/78772/match=patch+v6...
There is no further comments to this patch, as I can see.
The patch must not be merged into the u-boot-imx branch, because this is common code, not specific for imx, and should be merged directly into the mainline by Wolfgang.
I let Wolfgang to answer us if he sees some more issue with the patch.
Best regards, Stefano

Dear Stefano Babic,
Amit Kucheria wrote:
Stefano,
Any further comment on this patch? Does it still require more work that we can take on?
Hi Amit,
as I know there is a newer version of the patch [V6] as the one you reported:
http://article.gmane.org/gmane.comp.boot-loaders.u-boot/78772/match=patch+v6...
There is no further comments to this patch, as I can see.
The patch must not be merged into the u-boot-imx branch, because this is common code, not specific for imx, and should be merged directly into the mainline by Wolfgang.
I let Wolfgang to answer us if he sees some more issue with the patch.
Just looking at the patch I see that it writes the env to fixed blocks on the SD/MMC card. This will work of course. BUT usually (IMHO) such cards are used with partitions/filesystems. How do you make sure the blocks don't overwrite files or don't get overwritten by files?
One can, of course, prepare the card with a small partition spanning the env blocks. But even then the code should check if the partition exists and use the block info from the partition entry...
Should the env not be saved in a file? Which is probably a bit beyond possibility to read when not yet relocated...
Reinhard

Reinhard Meyer wrote:
Dear Stefano Babic,
Hi Reinhard,
Just looking at the patch I see that it writes the env to fixed blocks on the SD/MMC card. This will work of course. BUT usually (IMHO) such cards are used with partitions/filesystems.
Not always. In the specific case reported by Amit, the mx.51 processor can boot from a SD card, that must not contain partitions at least for the early sectors, where it is supposed there is the u-boot's code.
Usage of partitions is not forbidden, however. The partitions must only start after the space required by u-boot and (as supported by the patch in question) by the environment.
How do you make sure the blocks don't overwrite files or don't get overwritten by files?
Writing a correct partition table: the first partition must start after u-boot code and environment, used as raw-blocks. There is then no possibility for files to overwrite the environment or the code.
One can, of course, prepare the card with a small partition spanning the env blocks.
As I said, it is not required to have a partition for the environment, because this is read only as raw-block. It is only required to skip the first blocks (or the block set in the config file).
Should the env not be saved in a file? Which is probably a bit beyond possibility to read when not yet relocated...
Reading the environment from a file should be in a separate patch and made much more general ;-)
It is not related to a specific storage. We could have a filesystem even on other storages (SPI-Flash, NAND, HD...) and "reading from file" should IMHO hide the underlying storage media.
Best regards, Stefano

On Thu, Sep 9, 2010 at 4:35 PM, Stefano Babic sbabic@denx.de wrote:
Reinhard Meyer wrote:
[snip]
How do you make sure the blocks don't overwrite files or don't get overwritten by files?
Writing a correct partition table: the first partition must start after u-boot code and environment, used as raw-blocks. There is then no possibility for files to overwrite the environment or the code.
Right. This is our usage model currently, that the patch in question solves.
One can, of course, prepare the card with a small partition spanning the env blocks.
As I said, it is not required to have a partition for the environment, because this is read only as raw-block. It is only required to skip the first blocks (or the block set in the config file).
Should the env not be saved in a file? Which is probably a bit beyond possibility to read when not yet relocated...
Reading the environment from a file should be in a separate patch and made much more general ;-)
It is not related to a specific storage. We could have a filesystem even on other storages (SPI-Flash, NAND, HD...) and "reading from file" should IMHO hide the underlying storage media.
Reading from filesystems brings up the obvious question - which filesystems should we support?
And it is definitely a separate patch. The feature that this patch is enabling can exist independent of filesystem support.
Regards, Amit

Dear Amit Kucheria,
In message AANLkTi=peKHk5qWxM_JA5bm1A9=2QSkfQvy-h2Nw2sG=@mail.gmail.com you wrote:
It is not related to a specific storage. We could have a filesystem even on other storages (SPI-Flash, NAND, HD...) and "reading from file" should IMHO hide the underlying storage media.
Reading from filesystems brings up the obvious question - which filesystems should we support?
Well, reading from file system in only one part of the issue - you also need write support or you cannot implement "saveenv". And at the moment YAFFS is the only file system with write support, IIRC.
And it is definitely a separate patch. The feature that this patch is enabling can exist independent of filesystem support.
Indeed.
Best regards,
Wolfgang Denk

-----Original Message----- From: u-boot-bounces@lists.denx.de [mailto:u-boot-bounces@lists.denx.de] On Behalf Of Wolfgang Denk Sent: Friday, September 10, 2010 4:43 PM To: Amit Kucheria Cc: u-boot@lists.denx.de; R65388@freescale.com Subject: Re: [U-Boot] status of patch to store environment to mmc/sd
Dear Amit Kucheria,
In message AANLkTi=peKHk5qWxM_JA5bm1A9=2QSkfQvy-h2Nw2sG=@mail.gmail.com you wrote:
It is not related to a specific storage. We could have a filesystem
even
on other storages (SPI-Flash, NAND, HD...) and "reading from file" should IMHO hide the underlying storage media.
Reading from filesystems brings up the obvious question - which filesystems should we support?
Well, reading from file system in only one part of the issue - you also need write support or you cannot implement "saveenv". And at the moment YAFFS is the only file system with write support, IIRC.
And it is definitely a separate patch. The feature that this patch is enabling can exist independent of filesystem support.
[Ghorai] This patch is very important for the platform where we don't have any other storage device; e.g. omap4 development platforms does not have any NAND/NOR to save the env. And need to use this patch.
Indeed.
Best regards,
Wolfgang Denk
-- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de I'm a programmer: I don't buy software, I write it. -- Tom Christiansen _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
participants (5)
-
Amit Kucheria
-
Ghorai, Sukumar
-
Reinhard Meyer
-
Stefano Babic
-
Wolfgang Denk