cp problem

Dieter Kiermaier dk-arm-linux at gmx.de
Wed Oct 14 10:01:23 UTC 2009


Am Mittwoch 14 Oktober 2009 11:29:48 schrieb Denys Vlasenko:
> On Wed, Oct 14, 2009 at 9:21 AM, Dieter Kiermaier <dk-arm-linux at gmx.de> wrote:
> > Am Mittwoch 14 Oktober 2009 07:52:19 schrieb Davide Rizzo:
> >
> > Hi Davide, hi list,
> >
> > first of all, lets say hi. I'm Dieter, an embedded developer from Germany and I'm new to the list.
> >
> >
> >> Hi folks,
> >> I experienced a problem that starts from 1.15
> >> In my embedded system I used "cp kernelimagename /dev/mtdblock1" to upgrade
> >> the kernel compressed image in flash.
> 
> Why not "cat kernelimagename >/dev/mtdblock1"?
> Why do you pretend you are *copying* a file?
> 
> >> /dev/mtdblockX is a block device node to address mtd partitions. I use jffs2
> >> on nand flash.
> >> I know this is not correct because I should use nandwrite, copying directly
> >> to partition doesn't care of bad blocks in nand jffs2 but it works if you
> >> don't have any bad block in the destination area (99% of cases).
> >> Anyway, I think this argument is the same also for others not fault-tolerant
> >> medias, that can be operated with cp to a device node
> >> Starting from busybox 1.15, it does no more copy the image to partition, but
> >> it overwrites the device node with the file itself.
> >> Is this correct ?
> >
> > I can confirm this bug with busybox 1.6.0, too!
> >
> > Yesterday I've posted it on #uclibc but got no answer.
> > --- snip ---
> > [15:41] <dieter__> Hi, I've got a strange problem with busybox cp applet.
> > [15:41] <dieter__> If I cp a image to a /dev/fb0 on a arm linux system with busybox cp nothing happens.
> > [15:41] <dieter__> with standalone cp application everything works fine.
> > [15:42] <dieter__> busybox version is 1.6.0 :(
> > [15:42] <dieter__> Does someone has any tips for me?
> > --- snap ---
> >
> > So it looks like this bug (if so) was introduced earlier in busybox?
> 
> You need to disable FEATURE_NON_POSIX_CP in the .config

Many thanks for clarifying this!

Is it unusual to cp data to a device?
I've thought that the unix convention "everything is file" means exactly this.


Dieter


> 
> --
> vda
> 




More information about the busybox mailing list