Yes, the second approach is the good one, I will try it. Here are my outputs:
[root@Linux /root]$cat /proc/mtd
dev: size erasesize name
mtd0: 04000000 00040000 "Physically mapped flash"
mtd1: 00100000 00040000 "zImage"
mtd2: 00300000 00040000 "ramdisk.gz"
mtd3: 03c00000 00040000 "User FS"
[root@Linux /root]$cat /proc/mounts
rootfs / rootfs rw 0 0
/dev/root / ext2 rw 0 0
/proc /proc proc rw 0 0
none /dev/pts devpts rw 0 0
/dev/mtdb3 /flash jffs2 rw 0 0
[root@Linux /root]$tar --version
tar: unrecognized option `--version'
BusyBox v0.60.3 (2002.06.05-19:04+0000) multi-call binary
Usage: tar -[cxtvO] [--exclude FILE] [-X FILE][-f TARFILE] [-C DIR] [FILE(s)] ...
Create, extract, or list files from a tar file.
Options:
c create
x extract
t list
File selection:
f name of TARFILE or "-" for stdin
O extract to stdout
exclude file to exclude
X file with names to exclude
C change to directory DIR before operation
v verbosely list files processed
[root@Linux /root]$gzip --version gzip: invalid option -- -
BusyBox v0.60.3 (2002.06.05-19:04+0000) multi-call binary
Usage: gzip [OPTION]... FILE
Compress FILE with maximum compression.
When FILE is '-', reads standard input. Implies -c.
Options:
-c Write output to standard output instead of FILE.gz
-d decompress
[root@Linux /root]$ls IR /
ls: IR: No such file or directory
/:
bin etc home linuxrc mnt proc root tmp var
dev flash lib lost+found nfs rd sbin usr xdrive
[root@Linux /root]$dmesg
360K data, 88K init)
Dentry cache hash table entries: 8192 (order: 4, 65536 bytes)
Inode cache hash table entries: 4096 (order: 3, 32768 bytes)
Mount-cache hash table entries: 1024 (order: 1, 8192 bytes)
Buffer-cache hash table entries: 4096 (order: 2, 16384 bytes)
Page-cache hash table entries: 16384 (order: 4, 65536 bytes)
POSIX conformance testing by UNIFIX
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Initializing RT netlink socket
sa1111_pcibuf: initializing SA-1111 DMA workaround
SA1111 Microprocessor Companion Chip: silicon revision 1, metal revision 1
Starting kswapd
JFFS version 1.0, (C) 1999, 2000 Axis Communications AB
JFFS2 version 2.1. (C) 2001 Red Hat, Inc., designed by Axis Communications AB.
ttyS0 at I/O 0xf0100000 (irq = 50) is a 16550A
ttyS1 at I/O 0xf0120000 (irq = 51) is a 16550A
ttyS2 at I/O 0xf0140000 (irq = 52) is a 16550A
ttyS3 at I/O 0xf0160000 (irq = 54) is a 16550A
ttySA0 at MEM 0x80050000 (irq = 17) is a SA1100
ttySA1 at MEM 0x80010000 (irq = 15) is a SA1100
ttySA2 at MEM 0x80030000 (irq = 16) is a SA1100
Console: switching to colour frame buffer device 80x30
initialize_kbd: Keyboard reset failed, no ACK
Keyboard timed out[1]
keyboard: Timeout - AT keyboard not present?
Keyboard timed out[1]
keyboard: Timeout - AT keyboard not present?
pty: 256 Unix98 ptys configured
UCB1200 generic module installed
ucb1200 touch screen driver initialized
ucb1200 adc driver initialized
UCB1200 audio driver version 2.2 initialized
UCB1200 audio driver Click-Avoid patch: TT <tthaele@papenmeier.de>
UCB1200 Mixer driver version 0.1 initialized. TT <tthaele@papenmeier.de>
smartio driver initialized. version 1.10, date:28-Jun-2002
SmartIO ID : 0x5002
Device Version : 5(0x35)
Device Type : 0x8535
SA1100 Real Time Clock driver v1.00
Uniform Multi-Platform E-IDE driver Revision: 6.31
ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xx
smc9194.c:v0.14 12/15/00 by Erik Stahlman (erik@vt.edu)
eth0: SMC91C96(r:9) at 0xf00e0000 IRQ:58 INTF:TP MEM:6144b ADDR: 00:60:0c:01:37:05
RAMDISK driver initialized: 16 RAM disks of 8192K size 1024 blocksize
loop: loaded (max 8 devices)
PPP generic driver version 2.4.2
Sound: SA1111 UDA1341: dsp id 3 mixer id 0
SA1111 audio out: SA-1111 SAC DMA channel 6 in use
DMA request for SAC output failed
physmap flash device: 4000000 at 8000000
Physically mapped flash: Found 2 x16 devices at 0x2000000 in 32-bit mode
0: offset=0x0,size=0x40000,blocks=128
1: offset=0x2000000,size=0x40000,blocks=128
Using buffer write method
SA1100 flash: probing 32-bit flash bus
SA1100 flash: Found 2 x16 devices at 0x2000000 in 32-bit mode
0: offset=0x0,size=0x40000,blocks=128
1: offset=0x2000000,size=0x40000,blocks=128
Using buffer write method
Using static partition definition
Creating 3 MTD partitions on "SA1100 flash":
0x00000000-0x00100000 : "zImage"
0x00100000-0x00400000 : "ramdisk.gz"
0x00400000-0x04000000 : "User FS"
Linux Kernel Card Services 3.1.22
options: [pm]
SA-1100 PCMCIA (CS release 3.1.22)
usb.c: registered new driver usbdevfs
usb.c: registered new driver hub
hcd/ohci-sa1111.c: starting SA-1111 OHCI USB Controller
hcd/ohci-sa1111.c: ohci-hcd (SA-1111) at 0xf4000400, irq 109
usb.c: new USB bus registered, assigned bus number 1
hub.c: USB hub found
hub.c: 1 port detected
usb.c: registered new driver hiddev
usb.c: registered new driver hid
hid-core.c: v1.8.1 Andreas Gal, Vojtech Pavlik <vojtech@suse.cz>
hid-core.c: USB HID support drivers
mice: PS/2 mouse device common for all mice
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 4096 bind 4096)
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
NetWinder Floating Point Emulator V0.95 (c) 1998-1999 Rebel.com
RAMDISK: Compressed image found at block 0
Freeing initrd memory: 3072K
EXT2-fs warning: checktime reached, running e2fsck is recommended
VFS: Mounted root (ext2 filesystem).
Freeing init memory: 88K
hub.c: USB new device connect on bus1/1, assigned device number 2
hub.c: USB hub found
hub.c: 4 ports detected
enable_irq(115) unbalanced from c032558c
Trying to free nonexistent resource <ce8b7000-ce8b700f>
hda: CF Card, ATA DISK drive
ide0 at 0xce8b7000-0xce8b7007,0xce8b700e on irq 115
hda: task_no_data_intr: status=0x51 { DriveReady SeekComplete Error }
hda: task_no_data_intr: error=0x04 { DriveStatusError }
hda: 3902976 sectors (1998 MB) w/1KiB Cache, CHS=242/255/63
Partition check:
hda: hda1
ide_cs: hda: Vcc = 3.3, Vpp = 0.0
VFS: Can't find ext2 filesystem on dev ide0(3,1).
cramfs: wrong magic
VFS: Can't find ext2 filesystem on dev ide0(3,1).
cramfs: wrong magic
AVR driver initialized. version 1.1, date:Aug 6 2004
VFS: Can't find ext2 filesystem on dev ide0(3,0).
cramfs: wrong magic
FAT: bogus logical sector size 64543
VFS: Can't find a valid FAT filesystem on dev 03:00.
JFFS: Trying to mount a non-mtd device.
jffs2: attempt to mount non-MTD device 03:00
VFS: Can't find ext2 filesystem on dev ide0(3,1).
cramfs: wrong magic