Skip to contentSkip to conversation

Strange MTD problem (ARM)

Buildroot Joachim Pihl 2 participants 6 messages Dec 7, 2009

lore
Share & tools
lore
#0 lore raw

This may not be related to Buildroot, but I am completely stumped:

# ls -al /dev/mtdblock*
brw-r-----    1 root     root      31,   0 Dec  3 12:26 mtdblock0
brw-r-----    1 root     root      31,   1 Dec  3 12:26 mtdblock1
brw-r-----    1 root     root      31,   2 Dec  3 12:26 mtdblock2
brw-r-----    1 root     root      31,   3 Dec  3 12:26 mtdblock3
#
#
#
# cp mtdblock2 /dev/mtdblock2
#
# ls -al /dev/mtdblock*
brw-r-----    1 root     root      31,   0 Dec  3 12:26 mtdblock0
brw-r-----    1 root     root      31,   1 Dec  3 12:26 mtdblock1
-rw-r--r--    1 root     root      6815744 Dec  7 17:58 mtdblock2
brw-r-----    1 root     root      31,   3 Dec  3 12:26 mtdblock3
#

Running 2009.11 on PXA255 with a 2.6.27.39 preemptible kernel, EABI, running the same patches used for 2.6.27.10 (OABI and non-preemptible) where it worked.

mtd_debug write /dev/mtd2 0 0x680000 mtdblock2 works, results does not seems correct for /dev/mtd1.

Does anyone know where to look, so far I strike out on the google searches.

Signature · 13 lines
Joachim Pihl
Senior R&D Engineer
Nevion Europe

Tel: +47 33 48 94 66
Fax: +47 33 48 99 98
Mobile: +47 91 33 98 91
jpihl at nevion.com
www.nevion.com

------------------------------------------------------
The Global Video Transport Leader
------------------------------------------------------
#1 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Joachim" == Joachim Pihl <[email protected]> writes:

Joachim> This may not be related to Buildroot, but I am completely stumped:

I take it that this is with busybox cp and not coreutils? You might have better luck asking on the busybox list.

Joachim> # cp mtdblock2 /dev/mtdblock2

So you want cp to detect that the target is a special file and not unlink it, but instead do something like cat mtdblock2 >/dev/mtdblock2 ?

Why not simply use cat instead?

Signature · 1 line
Bye, Peter Korsgaard
#2 lore raw
Quoted 7 lines · Peter Korsgaard
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Joachim" == Joachim Pihl <[email protected]> writes:

Joachim> This may not be related to Buildroot, but I am completely
stumped:

I take it that this is with busybox cp and not coreutils? You might have better luck asking on the busybox list.

This is with busybox, yes. Will repost to the busybox list and see what comes up.

Quoted 6 lines

Joachim> # cp mtdblock2 /dev/mtdblock2

So you want cp to detect that the target is a special file and not unlink it, but instead do something like cat mtdblock2 >/dev/mtdblock2 ?

Why not simply use cat instead?

Actually, I have never thought of that, but will that start from the beginning of the MTD block? We have used "cp mtdblock2 /dev/mtdblock2" for 7 years in the product, this is the first time I have seen it fail.

Signature · 13 lines
Joachim Pihl
Senior R&D Engineer
Nevion

Tel: +47 33 48 94 66
Fax: +47 33 48 99 98
Mobile: +47 91 33 98 91
jpihl at nevion.com
www.nevion.com

-----------------------------------
The Global Video Transport Leader
-----------------------------------
#3 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Joachim" == Joachim Pihl <[email protected]> writes:

Hi,

Quoted 2 lines
Quoted 2 lines

I take it that this is with busybox cp and not coreutils? You might have better luck asking on the busybox list.

Joachim> This is with busybox, yes. Will repost to the busybox list and see Joachim> what comes up.

Ok.

Quoted 1 line
Quoted 1 line

Why not simply use cat instead?

Joachim> Actually, I have never thought of that, but will that start from the Joachim> beginning of the MTD block?

Yes it will.

Joachim> We have used "cp mtdblock2 /dev/mtdblock2" for 7 years in the Joachim> product, this is the first time I have seen it fail.

OK. FYI, busybox nowadays also has the flashcp applet from mtd-utils which does the right thing.

Signature · 1 line
Bye, Peter Korsgaard
#4 lore raw
Quoted 7 lines · Peter Korsgaard
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Joachim" == Joachim Pihl <[email protected]> writes:

Joachim> We have used "cp mtdblock2 /dev/mtdblock2" for 7 years in the Joachim> product, this is the first time I have seen it fail.

OK. FYI, busybox nowadays also has the flashcp applet from mtd-utils which does the right thing.

Thanks, that solved the problem. Will simply replace "cp mtdblock2 /dev/mtdblock2" with "flashcp mtdblock2 /dev/mtd2" and all is well.

Signature · 13 lines
Joachim Pihl
Senior R&D Engineer
Nevion

Tel: +47 33 48 94 66
Fax: +47 33 48 99 98
Mobile: +47 91 33 98 91
jpihl at nevion.com
www.nevion.com

-----------------------------------
The Global Video Transport Leader
-----------------------------------
#5 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Joachim" == Joachim Pihl <[email protected]> writes:

Hi,

Quoted 2 lines
Quoted 2 lines

OK. FYI, busybox nowadays also has the flashcp applet from mtd-utils which does the right thing.

Joachim> Thanks, that solved the problem. Will simply replace "cp mtdblock2 Joachim> /dev/mtdblock2" with "flashcp mtdblock2 /dev/mtd2" and all is well.

Ok, but please still bring it up on the busybox list if it is a cp regression.

Signature · 1 line
Bye, Peter Korsgaard