mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Teresa Remmet <t.remmet@phytec.de>
To: iw3gtf@arcor.de
Cc: barebox@lists.infradead.org
Subject: Re: why UBI static volumes are flagged as DEVFS_IS_CHARACTER_DEV
Date: Thu, 06 Oct 2016 10:17:27 +0200	[thread overview]
Message-ID: <1475741847.3468.20.camel@lws-tremmet.phytec.de> (raw)
In-Reply-To: <1382352141.1327180.1475673795806.JavaMail.ngmail@webmail09.arcor-online.net>

Hello Giorgio,

Am Mittwoch, den 05.10.2016, 15:23 +0200 schrieb iw3gtf@arcor.de:
> Hi,
> 
> I noticed that the commit id c087e0804f0290e9886899e8a3cccb07c4ce088b flagged static
> UBI volumes as DEVFS_IS_CHARACTER_DEV.
> 
> A consequence of this flag is that commands like:
> 
> # cp /dev/nand0.ubi_volumes.ubi.my_static_vol file
> 
> will not work because the cp command will see a src file (the static UBI volume) with a size
> of -1 (FILE_SIZE_STREAM) and keep on reading from the volume until a flood of
> "UBI assert failed in ubi_eba_read_leb at 359" asserts comes out of the console.
> 
> I tried to comment out the flag assignment, just to see what happen:
> 
> int ubi_volume_cdev_add(struct ubi_device *ubi, struct ubi_volume *vol)
> {
> ...
> 	cdev->size = vol->used_bytes;
> 
> //	if (vol->vol_type == UBI_STATIC_VOLUME)
> //		cdev->flags = DEVFS_IS_CHARACTER_DEV;
> 
> 	cdev->dev = &vol->dev;
> ...
> 
> and then the cp command worked than as expected.
> 
> Could someone shortly confirm that the DEVFS_IS_CHARACTER_DEV flag for static UBI volumes
> is really needed (to avoid some other problems that my superficial test does not triggers) ?

the size of a static ubi volume device is equal to the image size you
flashed. When you create a new static ubi volume the size is 0, as it is
empty.
We need the chardev flag to be able to update the static ubi volume or
barebox will complain that there is not enough space.

Regards,
Teresa

> 
> giorgio
> 
> 
> Giorgio, iw3gtf@arcor.de
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox



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

  reply	other threads:[~2016-10-06  8:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-05 13:23 iw3gtf
2016-10-06  8:17 ` Teresa Remmet [this message]
2016-10-07  7:27   ` Sascha Hauer
2016-10-10  8:17     ` Teresa Remmet
2016-10-06  9:20 ` Aw: " iw3gtf

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=1475741847.3468.20.camel@lws-tremmet.phytec.de \
    --to=t.remmet@phytec.de \
    --cc=barebox@lists.infradead.org \
    --cc=iw3gtf@arcor.de \
    /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