In case anyone is interested; for a barebox x86 project I wrote a library that overrides fopen/fclose/open/close/etc a while back, which allows read access to the environment sector if properly configured. I managed to get it working on arm/mips with mtdblock as well. In the near future I'd like to write a kernel driver to read the filesystem properly, this was more of an experiment. Cheers, Michel On 03/26/2014 12:33 PM, Alexander Aring wrote: > On Wed, Mar 26, 2014 at 12:31:03PM +0100, Alexander Aring wrote: >> On Wed, Mar 26, 2014 at 04:44:30PM +0530, Ashutosh Singh wrote: >>> Thanks Alex, >>> >>> The script is quite helpful. >>> But since i am saving my barebox.env in nand and want to mount, modify >>> and write it back to nand. >>> Do you have a safer solution so that complete env data won't corrupted. >> 1. You need to save the bareboxenv as image, the right place would be >> /tmp which is tmpfs and this uses ram for storing data. You need inotify >> support in kernel and I am sure tmpfs also supports inotify. You also need >> the inotify userspace utilities. >> >> 2. The image should write via nandwrite from mtd-utils [1]. Look for >> the nandwrite manpage. nandwrite should write the tmp-image from bbenv >> to your nand mtd device. >> > 3. To read the image from bbenv partition you should also not use > bareboxenv tool directly. Use nanddump for that and then use > bareboxenv to extract these files to /tmp/bbenv or whatever. > > _______________________________________________ > barebox mailing list > barebox@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/barebox