mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Alexander Aring <alex.aring@gmail.com>
To: Ashutosh Singh <embedded.ashu@gmail.com>
Cc: barebox@lists.infradead.org
Subject: Re: Can i access the barebox env from linux
Date: Wed, 26 Mar 2014 12:31:05 +0100	[thread overview]
Message-ID: <20140326113103.GA9427@omega.Speedport_W_921V_1_24_000> (raw)
In-Reply-To: <CA+dawz1a0EVA5OvDGZjpchV13R8J5+hKS8hVOtmmi2HFef5spQ@mail.gmail.com>

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.



I know the nandwrite will make a better badblock handling... but if you
set your bbenv size exactly the eraseblock size so it doesn't matter...
because after badblock marking that eraseblock you don't have any bbenv
partition anymore :/

nandwrite uses the mtd api to write and I suppose they do something more
than only badblock handling, ECC calculation.... Nevertheless you should
ever use nandwrite to write images to your nand /dev/*.nand partition.

I don't have any time now to change the script for nandwrite and extract
to /tmp/bbenv/, etc..., sorry. We should do it right and implement a C
solution for that. :-) I don't have time to do that also, maybe at weekend.

I don't have also no nand device here, I need to use the nandsim module.
This will take some time to setup.


Sorry, but try to change the script yourself and then share it with us. I
will take a look and review it.

- Alex

[1] http://git.infradead.org/mtd-utils.git

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

  reply	other threads:[~2014-03-26 11:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-26  5:55 Ashutosh Singh
2014-03-26  6:26 ` Sascha Hauer
2014-03-26  6:57   ` Alexander Aring
2014-03-26 11:14     ` Ashutosh Singh
2014-03-26 11:31       ` Alexander Aring [this message]
2014-03-26 11:33         ` Alexander Aring
2014-03-26 11:53           ` Michel Stam
2014-03-26 11:58             ` Alexander Aring
2014-03-26 12:14               ` Michel Stam
     [not found]           ` <CA+dawz2HSTYcR4Lv_0Q_ECELh2i9kq6vnZTEdnD8e+qu4pyamA@mail.gmail.com>
     [not found]             ` <20140328091854.GA20774@omega.Speedport_W_921V_1_24_000>
     [not found]               ` <CA+dawz3gfhFv3mtAOjXVoooE5WqJb6sH1qbMmPw--OD-p_N4Qg@mail.gmail.com>
     [not found]                 ` <20140328095241.GB21559@omega.Speedport_W_921V_1_24_000>
2014-03-31  0:12                   ` Alexander Aring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140326113103.GA9427@omega.Speedport_W_921V_1_24_000 \
    --to=alex.aring@gmail.com \
    --cc=barebox@lists.infradead.org \
    --cc=embedded.ashu@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox