After experimenting awhile with my Sheeva Plug, I managed to screw up the contents of /dev/mtd2, so I needed to reflash the NAND.
u-Boot (in /dev/mtd0) and uImage (in /dev/mtd1) remain intact.
Booting from tftp worked just fine, so did booting from USB flash drive (two partitions, 1st vfat partition with uImage, 2nd ext2 partition with rootfs from ubuntu.9.04.tar.gz
, taken from http://plugcomputer.org/index.php/resources/downloads?func=select&id=2
Here is what I did to restore /dev/mtd2:
1. setenv console 'console=ttyS0,115200 mtdparts=nand_mtd:0x100000@0x000000(u-boot),0x200000@0x100000(uImage),0x1fd00000@0x500000(rootfs)rw'
2. Boot from tftp
3. sh-3.2# cat /proc/mtd
dev: size erasesize name
mtd0: 00100000 00020000 "u-boot"
mtd1: 00200000 00020000 "uImage"
mtd2: 1fd00000 00020000 "rootfs"
were put to /sos
directory on tftp root on the host
5. # flash_erase /dev/mtdblock1
# flash_eraseall /dev/mtd1
# flash_erase /dev/mtdblock2
# flash_eraseall /dev/mtd2
6. # cat /sos/uImage.sheeva.040309 > /dev/mtdblock1
7. # nandwrite -m /dev/mtd2 /sos/ubuntu-9.0.5.Release.jffs2
8. # mount -t jffs2 /dev/mtdblock2 /mnt
Here comes the surprise: /dev/mtd2 mounts OK, but it is almost empty! Only 3% is used (and originally it was about 35% full!)
But I decided to give it a try anyway
9. #umount /mnt
11. Stopped the boot, got u-Boot prompt
12. >> setenv bootargs 'console=ttyS0,115200 mtdparts=nand_flash:0x200000@0x100000(uImage)ro,0x1fd00000@0x300000(rootfs)ro root=/dev/mtdblock2'
>> setenv bootcmd 'nand read.e 0x800000 0x100000 0x400000; bootm 0x800000'
...and, of course, after the kernel loads I get:VFS: Mounted root (jffs2 filesystem).
Freeing init memory: 124K
Warning: unable to open an initial console.
Kernel panic - not syncing: No init found. Try passing init= option to kernel.
What else shall I expect? I already knew, that my rootfs is almost empty and there were no /sbin/init
Indeed, I downloaded the .jffs2 filesystem again and repeated the reflashing... with the same result.
What am I doing wrong??? Any help will be greatly appreciated. Thank you.