OESF | ELSI | pdaXrom | OpenZaurus | Zaurus Themes | Community Links | Ibiblio

IPB

Welcome Guest ( Log In | Register )

2 Pages V   1 2 >  
Reply to this topicStart new topic
> Howto Mount A Systc100.dbk, Solved - script attached.
johnsutton
post Nov 21 2006, 04:38 AM
Post #1





Group: Members
Posts: 32
Joined: 28-April 05
From: Wales
Member No.: 7,019



There must be a way using dd to cut up the image and then use the loopback device to mount the various parts of the SYSTC100.DBK nand backup image once it is held on another (linux) system. It is just a matter of knowing where to cut it and what type is the filesystem(s), surely?. This would be very handy to be able to fish out the config info from an old system to put back into a newly flashed system. Anybody know how to do it?
-----------------------------------------
Attached script solves this problem for the C1000. Probably fairly easy to adapt for other models.
Ho hum:

THE FOLLOWING ERROR(S) WERE FOUND
Upload failed. You are not permitted to upload a file with that file extension.

So I can't upload it ;-( Tried with .sh and no extension at all. Any ideas?
-----------------------------------------
Succeeded - see post #14

This post has been edited by johnsutton: Jan 26 2007, 02:13 AM
Go to the top of the page
 
+Quote Post
daniel3000
post Nov 21 2006, 05:01 AM
Post #2





Group: Members
Posts: 1,002
Joined: 28-April 05
From: Germany
Member No.: 7,027



On addition, if we know the structure of these files, we can maybe make NAND backups compatible between SL-C1000, SL-C3100 and Sl-C3200.
If I want to duplicate a setup (or restore a C3100 backup on a C3200), I currently have to install the ROM the conservative way, then copy the file structure 1:1 using tar. Using NAND backup files would make it easier and faster and safer.

daniel
Go to the top of the page
 
+Quote Post
InSearchOf
post Nov 21 2006, 07:01 AM
Post #3





Group: Admin
Posts: 1,210
Joined: 20-January 06
From: York, Pennsylvania
Member No.: 8,961



QUOTE(daniel3000 @ Nov 21 2006, 08:01 AM)
On addition, if we know the structure of these files, we can maybe make NAND backups compatible between SL-C1000, SL-C3100 and Sl-C3200.
If I want to duplicate a setup (or restore a C3100 backup on a C3200), I currently have to install the ROM the conservative way, then copy the file structure 1:1 using tar. Using NAND backup files would make it easier and faster and safer.

daniel
*


why do you do a NAND backup? restore the NAND of your including your file structure?

Late
Go to the top of the page
 
+Quote Post
Stubear
post Nov 21 2006, 04:13 PM
Post #4





Group: Members
Posts: 1,164
Joined: 17-December 03
From: Melbourne, AUSTRALIA
Member No.: 1,219



Here's a script I adapted to strip the error-checking info out of the nand backup file.

After that you are left with a jffs2 image (including all partitions), that can be mounted under linux if you have the right kernel modules installed.

There was a thread a while ago where someone made some changes that split the partitions out into separate files, but I can't seem to find it at the moment.

Daniel, the NAND is a direct copy of the whole flash rom, if the different models have different size flash roms then you won't be able to interchange NAND images.

Attached File  nand_ripper.txt ( 740bytes ) Number of downloads: 77


Stu
Go to the top of the page
 
+Quote Post
johnsutton
post Nov 22 2006, 09:16 AM
Post #5





Group: Members
Posts: 32
Joined: 28-April 05
From: Wales
Member No.: 7,019



Hello Stu

Thanks for the script. I've been trying to modify it for use with my C1000 image but have not succeeded as yet ;-( Some observations and questions:

1) The comments at the top talk about a 64mbyte chip and show some calculations:

# i have a 64mbyte flash (Toshiba TH58512FT
# Manufacture ID: 0x98, Chip ID: 0x76)
# filesize of nand_dump is then:
# 528*4096 +(64*1024*1024) + 16

but these numbers do not correspond to the filesize defined and used later on:

$filesize=138543120/16;

This seems to refer to a 128mbyte flash? But it is 7168 blocks longer than my c1000 image - 138428432.

2) The script treats the image as being made up of 1024 (16byte) blocks followed by 33 blocks of errorcheck info, i.e. 1057 blocks total. However, the filesize value above is an integral number of 1057 blocks plus 1 BUT in addition the first 2 blocks are skipped. This means that the last 1024 block in the file can only be followed by 32 blocks of errorcheck rather than 33?

3) The fact that the first 2 blocks are skipped seems very odd because the first block in my image looks very like the jffs2 fs signature. I say this because I can find 3 of them in the image as a whole:

[root@diva pdaxrom]# strings SYSTC100.DBK | grep JFFS2
[I]JFFS2TOP:
[I]JFFS2TOP:****
[I]JFFS2TOP:

and the first of these is at offset 0. So if I throw away the first 2 blocks (32 bytes) then it looks to me like I am throwing away the fs signature, which surely can't be right?

I'd appreciate any help here!
TIA
John
Go to the top of the page
 
+Quote Post
Stubear
post Nov 23 2006, 05:19 AM
Post #6





Group: Members
Posts: 1,164
Joined: 17-December 03
From: Melbourne, AUSTRALIA
Member No.: 1,219



As I said, this is an adapted script. The original script was for a 64Mb nand (C700 I think, but might have been a 5500) so the comments at the start are from the original script, the file size is from the C760/C860 NAND files size.

I've just checked my C1000 NAND size and it's the same as what you report - never noticed that before. Sharp probably changed the layout of the NAND.

Running hexdump on SYSC100.DBK gives

CODE
00000000  5b 49 5d 4a 46 46 53 32  54 4f 50 3a 00 00 68 00  |[I]JFFS2TOP:..h.|
00000010  00 00 00 00 5b 47 4c 5d  20 20 20 20 20 20 20 20  |....[GL]        |
00000020  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
*
00021020  00 00 02 00 5b 47 4c 5d  20 20 20 20 20 20 20 20  |....[GL]        |


Which might explain why I haven't been able to mount the resulting image without errors.

I'll have to see if I can come up with a new script for stripping the C1000 NAND. Hopefully the structure is similar to the previous NANDs.

Stu
Go to the top of the page
 
+Quote Post
johnsutton
post Nov 24 2006, 02:23 AM
Post #7





Group: Members
Posts: 32
Joined: 28-April 05
From: Wales
Member No.: 7,019



Stu
Is this idea possible at all? When I try to mount a (would be) jffs2 fs over loopback I get this in the system log:

Nov 24 10:11:46 diva kernel: JFFS2 version 2.1. © 2001 Red Hat, Inc., designed by Axis Communications AB.
Nov 24 10:11:46 diva kernel: jffs2: attempt to mount non-MTD device 07:00

which seems to indicate that unless the jffs2 image is sitting on an appropriate physical medium then it is just not going to work? But your previous posts clearly indicate that you have done exactly this in the past. How? Are there some special options you can pass to the mount so as to force it?
Go to the top of the page
 
+Quote Post
karlto
post Nov 24 2006, 12:40 PM
Post #8





Group: Members
Posts: 343
Joined: 3-October 05
From: NZ
Member No.: 8,243



QUOTE(johnsutton @ Nov 24 2006, 11:23 PM)
Stu
Is this idea possible at all?  When I try to mount a (would be) jffs2 fs over loopback I get this in the system log:

Nov 24 10:11:46 diva kernel: JFFS2 version 2.1. © 2001 Red Hat, Inc., designed by Axis Communications AB.
Nov 24 10:11:46 diva kernel: jffs2: attempt to mount non-MTD device 07:00

which seems to indicate that unless the jffs2 image is sitting on an appropriate physical medium then it is just not going to work?  But your previous posts clearly indicate that you have done exactly this in the past.  How?  Are there some special options you can pass to the mount so as to force it?
*

You can't mount a jffs2 image over loopback:

http://www.handhelds.org/hypermail/familiar/62/6232.html

(I'm sure someone has covered this in the forum here, but I couldn't find it, so the link above is the first one I found with Google...)
Go to the top of the page
 
+Quote Post
Meanie
post Nov 26 2006, 04:54 AM
Post #9





Group: Members
Posts: 2,808
Joined: 21-March 05
From: Sydney, Australia
Member No.: 6,686



I wonder what blkmtd.o in cacko does smile.gif
Go to the top of the page
 
+Quote Post
johnsutton
post Nov 27 2006, 07:33 AM
Post #10





Group: Members
Posts: 32
Joined: 28-April 05
From: Wales
Member No.: 7,019



QUOTE(Meanie @ Nov 26 2006, 01:54 PM)
I wonder what blkmtd.o in cacko does smile.gif
*


I've no idea but I can verify that the recipe contained at the URL posted by karlto does indeeed work (not withstanding some size issue which is probably addressable through an option to one (or more) of the modules concerned). So I am content that the job is doable and am rather hoping that Stu will do the serious legwork of trying to strip out the extraneous info in the nand backup image ;-)

But that sets me wondering... Surely it can only be in Sharp's best interest to enable the likes of us to do this kind of thing, so maybe the proper way to do this is just to contact Sharp and ask them for the tech spec of their backup format?

Are there any formal or informal points of contact between Sharp and the pdaxrom/openzaurus/cacko etc community?
Go to the top of the page
 
+Quote Post
kahm
post Nov 27 2006, 12:38 PM
Post #11





Group: Members
Posts: 657
Joined: 29-September 04
Member No.: 4,809



QUOTE(johnsutton @ Nov 27 2006, 09:33 AM)
But that sets me wondering...  Surely it can only be in Sharp's best interest to enable the likes of us to do this kind of thing, so maybe the proper way to do this is just to contact Sharp and ask them for the tech spec of their backup format?

Are there any formal or informal points of contact between Sharp and the pdaxrom/openzaurus/cacko etc community?
*


No, there aren't

Background - I recieved my 5000D directly from the VP of Sharp R&D who was the head of the Z project while he was visiting the telecommunicatinos research institue that I worked for at the time.

An engineer who worked with me who is a big fan of the Z recently contacted that VP. Turns out he's moved on to head the Sharp WZero3 project. Some interesting facts came to light from that conversation:

1) Sharp really had *no* idea what the open source community was about, and no idea why anyone would want the source code in the first place.
2) They picked linux because they just wanted an OS fast, and MS wasn't flexible enough.
3) They consider a Z a glorified Japanese dictionary.

We got in touch with the aide of the current head of the Z project, and found out some more:
4) They aren't interested in working with the community.
5) Further investment in the Z line isn't warranted.

Now, as far as 5 is concerned, I take that to mean that further investment outside of their current roadmap isn't going to happen, not that *no further* invesment is planned. (The aide's English wasn't the best, and my friend is somewhat blunt at the best of times.)

Unfortunately, their roadmap consists of making it a better dictionary, not a better handheld computer. sad.gif

In short, I doubt we'll get any further useful info out of Sharp.
Go to the top of the page
 
+Quote Post
johnsutton
post Jan 25 2007, 04:52 AM
Post #12





Group: Members
Posts: 32
Joined: 28-April 05
From: Wales
Member No.: 7,019



Attached script solves this problem for the C1000. Probably fairly easy to adapt for other models.
Ho hum:

THE FOLLOWING ERROR(S) WERE FOUND
Upload failed. You are not permitted to upload a file with that file extension.

So I can't upload it ;-( Tried with .sh and no extension at all. Any ideas?
Go to the top of the page
 
+Quote Post
daniel3000
post Jan 25 2007, 07:28 AM
Post #13





Group: Members
Posts: 1,002
Joined: 28-April 05
From: Germany
Member No.: 7,027



Append .txt as theextension, then it should work.
Whoever downloads and uses it, has to remove .txt, thoguh.

I'm curious how you have got it working! smile.gif

And:
What happens if you modify something inside the NAND image and then try to restore (i.e. flash) it?
Does this work? Or is there a CRC check over the NAND image after flashing or something like that?



daniel
Go to the top of the page
 
+Quote Post
johnsutton
post Jan 25 2007, 07:57 AM
Post #14





Group: Members
Posts: 32
Joined: 28-April 05
From: Wales
Member No.: 7,019



QUOTE(daniel3000 @ Jan 25 2007, 04:28 PM)
Append .txt as theextension, then it should work.
Whoever downloads and uses it, has to remove .txt, thoguh.

I'm curious how you have got it working!  smile.gif

And:
What happens if you modify something inside the NAND image and then try to restore (i.e. flash) it?
Does this work? Or is there a CRC check over the NAND image after flashing or something like that?



daniel
*


OK, am trying again with filename mountjffs.txt.

As for your question, the answer is no, because I haven't bothered to work out the checksum scheme. It would not be very difficult to do (I imagine) but I can'r really see the point in it?

What I don't understand is this: where is the "partition table" for the nand flash held? I would think that it is somewhere in the first 7Mb of the flash file, but I couldn't find it ;-( And so you will have to set the size of your root filesystem - called ROOTFS in the script - by hand rather than it being read and set automatically.
Attached File(s)
Attached File  mountjffs.txt ( 5.1K ) Number of downloads: 44
 
Go to the top of the page
 
+Quote Post
grog
post Jan 26 2007, 06:21 PM
Post #15





Group: Members
Posts: 692
Joined: 27-January 04
From: Canada
Member No.: 1,564



I'm trying to use your script to mount a nand from a C860 (systc860.dbk), and while the rootfs comes out to 256 (32768/128), the command 'wc -c /dev/mtdblock1' comes up 0. Any suggestions? thks
Go to the top of the page
 
+Quote Post

2 Pages V   1 2 >
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 22nd August 2014 - 05:46 AM