• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1]
Author Topic: Re-install original File system  (Read 3779 times)
jdonth
Jr. Member
**

Karma: 0
Posts: 75

Azle, Texas


View Profile
« on: April 15, 2009, 08:52:52 AM »

I would like to reinstall the original jffs2 image but am not sure how to do this and don't want to make a brick.

Can it be done from Windows via TeraTerm?

Anyone have instructions? The Marvell docs are confusing for me.
~Joe Donth
Logged

...I've always depended on the kindness of strangers

lyzby
Newbie
*

Karma: 0
Posts: 48


View Profile
« Reply #1 on: April 15, 2009, 05:10:42 PM »

Here's another person wanting to do that.  Where is the Ubuntu binary image?  For that matter, where is the source--when I tried to "apt-get" linux-headers, it wanted the plug's version, which is not in the Ubuntu repository.  So is the repository used by Marvell to compile the image available?
Logged

Gothnet
Newbie
*

Karma: 0
Posts: 33


View Profile
« Reply #2 on: April 20, 2009, 02:31:37 PM »

Yup, I want to do this too.

For the record, the original image is provided on the CD in SheevaPlug_Filesystem.zip (I think, there's certainly an ubuntu jffs2 in there which would seem right).


My problem is that after an update I am no longer able to log in. I've tried every root password I can think of, no luck. I altered the boot arguments to go to single user mode, no luck getting in. I added init=/bin/bash to the kernel arguments and got a shell, remounted / as rw but password manipulation failed. I then removed the root password hash from /etc/shadow and rebooted. Still wouldn't let me in.

So, first question, can anyone think of anything I haven't tried to get into the system?

Next I tried following the tftp/nfs booting. I have a tftp server running fine on my laptop and managed to get the system to boot the kernel image that way. But then NFS mount failed with a permission error. After more testing and fixing I managed to get the nfs system exported properly and can now mount the rootfs fine on other systems. I followed the guide from the documentation on CD and did all this -


SheevaPlug U-Boot Settings
On the SheevaPlug reference board follow the steps below to boot from NFS.
Marvell>> set ipaddr 10.81.xxx.yyy
Marvell>> set serverip 10.81.xxx.zzz
Marvell>> set rootpath /home/Ubuntu-SheevaPlug
Marvell>> set image_name uImage.sheeva.20090225
Marvell>> set console 'console=ttyS0,115200
mtdparts=nand_flash:0x400000@0x10000
0(uImage)ro,0x1f800000@0x500000(rootfs)rw'
Marvell>> set bootargs_root 'root=/dev/nfs rw'
Marvell>> set bootargs_end ‘:::DB88FXX81:eth0:none’
Marvell>> set bootcmd 'tftpboot 0x2000000 $(image_name);setenv bootargs
$(console) $(bootargs_root) nfsroot=$(serverip):$(rootpath)
ip=$(ipaddr):$(serverip)$(bootargs_end); bootm 0x2000000'
Marvell>> saveenv



Changing the ip addresses and NFS paths as necessary, and skipping the saveenv as I didn't want to screw up the uboot environment if I got them wrong. But after the kernel boots the plug fails with:


Looking up port of RPC 100003/2 on 192.168.1.101
eth0: link up, full duplex, speed 1 Gbps
Looking up port of RPC 100005/1 on 192.168.1.101
Root-NFS: Server returned error -13 while mounting /home/dave/sheeva/netboot/rootfsv1.0
VFS: Unable to mount root fs via NFS, trying floppy.
VFS: Cannot open root device "nfs" or unknown-block(2,0)
Please append a correct "root=" boot option; here are the available partitions:
1f00       1024 mtdblock0 (driver?)
1f01       2048 mtdblock1 (driver?)
1f02     521216 mtdblock2 (driver?)
b300   16052224 mmcblk0 driver: mmcblk
  b301   14996646 mmcblk0p1
  b302    1052257 mmcblk0p2
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)




Help? Anyone?

Is there something I'm missing?

Is there a way to flash the jffs2 file directly using uboot, rather than this cumbersome tftp/nfs boot to linux followed by a flash?

I've used other uboot ARM devices (I was one of the suckers that bought an openmoko freerunner), and whilst flasdhing a hundred or so MB over serial may take a while (15+ min) I would find it preferable to having to use an OS to update the NAND. Anyone tried this? I know you can use bubt to update the kernel.

Thanks for any/all help. I love my little ARM devices and I'm hoping the plug will replace one of my aging NSLU2's pretty soon. But for that I need to get (back) to an OS that works.
Logged

Gothnet
Newbie
*

Karma: 0
Posts: 33


View Profile
« Reply #3 on: April 20, 2009, 04:40:01 PM »

AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGH!

OK, I tried all that and many other things, then as I was messign around from init=/bin/bash with a debian chroot, I came across the same passwd authentication token manipulation error. After a while I discovered that I could fix it by passwd -d root and then passwd root.

So, if you think your image is broken, won't let you in and you'll just have to start again, try adding init=/bin/bash to the bootargs and deleting/remaking the root password. It fixed something bad for me. Still don't know the cause though.
Logged

jdonth
Jr. Member
**

Karma: 0
Posts: 75

Azle, Texas


View Profile
« Reply #4 on: April 21, 2009, 08:05:52 AM »

Yup, I want to do this too.

For the record, the original image is provided on the CD in SheevaPlug_Filesystem.zip (I think, there's certainly an ubuntu jffs2 in there which would seem right).


My problem is that after an update I am no longer able to log in. I've tried every root password I can think of, no luck. I altered the boot arguments to go to single user mode, no luck getting in. I added init=/bin/bash to the kernel arguments and got a shell, remounted / as rw but password manipulation failed. I then removed the root password hash from /etc/shadow and rebooted. Still wouldn't let me in.

So, first question, can anyone think of anything I haven't tried to get into the system?

Next I tried following the tftp/nfs booting. I have a tftp server running fine on my laptop and managed to get the system to boot the kernel image that way. But then NFS mount failed with a permission error. After more testing and fixing I managed to get the nfs system exported properly and can now mount the rootfs fine on other systems. I followed the guide from the documentation on CD and did all this -


SheevaPlug U-Boot Settings
On the SheevaPlug reference board follow the steps below to boot from NFS.
Marvell>> set ipaddr 10.81.xxx.yyy
Marvell>> set serverip 10.81.xxx.zzz
Marvell>> set rootpath /home/Ubuntu-SheevaPlug
Marvell>> set image_name uImage.sheeva.20090225
Marvell>> set console 'console=ttyS0,115200
mtdparts=nand_flash:0x400000@0x10000
0(uImage)ro,0x1f800000@0x500000(rootfs)rw'
Marvell>> set bootargs_root 'root=/dev/nfs rw'
Marvell>> set bootargs_end ‘:::DB88FXX81:eth0:none’
Marvell>> set bootcmd 'tftpboot 0x2000000 $(image_name);setenv bootargs
$(console) $(bootargs_root) nfsroot=$(serverip):$(rootpath)
ip=$(ipaddr):$(serverip)$(bootargs_end); bootm 0x2000000'
Marvell>> saveenv



Changing the ip addresses and NFS paths as necessary, and skipping the saveenv as I didn't want to screw up the uboot environment if I got them wrong. But after the kernel boots the plug fails with:


Looking up port of RPC 100003/2 on 192.168.1.101
eth0: link up, full duplex, speed 1 Gbps
Looking up port of RPC 100005/1 on 192.168.1.101
Root-NFS: Server returned error -13 while mounting /home/dave/sheeva/netboot/rootfsv1.0
VFS: Unable to mount root fs via NFS, trying floppy.
VFS: Cannot open root device "nfs" or unknown-block(2,0)
Please append a correct "root=" boot option; here are the available partitions:
1f00       1024 mtdblock0 (driver?)
1f01       2048 mtdblock1 (driver?)
1f02     521216 mtdblock2 (driver?)
b300   16052224 mmcblk0 driver: mmcblk
  b301   14996646 mmcblk0p1
  b302    1052257 mmcblk0p2
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)




Help? Anyone?

Is there something I'm missing?

Is there a way to flash the jffs2 file directly using uboot, rather than this cumbersome tftp/nfs boot to linux followed by a flash?

I've used other uboot ARM devices (I was one of the suckers that bought an openmoko freerunner), and whilst flasdhing a hundred or so MB over serial may take a while (15+ min) I would find it preferable to having to use an OS to update the NAND. Anyone tried this? I know you can use bubt to update the kernel.

Thanks for any/all help. I love my little ARM devices and I'm hoping the plug will replace one of my aging NSLU2's pretty soon. But for that I need to get (back) to an OS that works.

Here is the procedure I use to reflash the jffs2 image via tfpt/nfs:
Code:

#----- Configure the Linux Boot machine for the SheevaPlug -----
# My Linix boot box is a Ubuntu machine so
#  your firewall, tftp and nfs server restart my be different
# My Linux box is at address 192,168,1,91
# My SheevaPlug is at 192.168.1.103

# Make sure your firewall will allow access by your SheevaPlug
#  Either open access from your SheevaPlug IP address or open
#  the following ports: 32771, 111, 2049, 69
ufw allow from 192.168.1.103

# Set up your /etc/exports file for NFS
echo "/home/rootfsv1.0 *(rw,sync,no_root_squash)" >> /etc/exports
echo "/tftpboot *(rw,sync,no_root_squash)" >> /etc/exports
exportfs -ra

# Restart your nfs server
/etc/init.d/nfs-kernel-server restart;
exportfs

#----- Copy (or wget) the required files from your source to the Linux Box -----
# First the tftp boot file
mkdir /tfptboot
copy "C:\Devel\SheevaPlug\SheevaPlug_LSP1\Image\uImage.sheeva.040309" to /tftpboot

copy "C:\Devel\SheevaPlug\SheevaPlug_Host_SWsupportPackageLinuxHost\LinuxHost\Linux Host Filesystem - rootfs.tar.bz2" to "/home"
cd /home
tar -xvf "/home/Linux Host Filesystem - rootfs.tar.bz2"
copy "C:\Devel\SheevaPlug\SheevaPlug_FileSystem\SheevaPlug_FileSystem\ubuntu-9.0.5.Release.jffs2" to "/home/rootfsv1.0"

###### IF YOU ARE GOING TO FLASH THE uIMAGE, too #####
cp /tftpboot/uImage.sheeva.040309 /home/rootfsv1.0/uImage.sheeva.040309
#####################################################

#----- SheevaPlug U-Boot settings for NFS booting -----
# Boot the plug and interrupt auto-boot sequence
#Marvell>>
set ipaddr '192.168.1.103'
set serverip '192.168.1.91'
set rootpath '/home/rootfsv1.0'
set image_name 'uImage.sheeva.040309'
set bootargs_root 'root=/dev/nfs rw'
set bootargs_end ':::DB88FXX81:eth0:none'

set console 'console=ttyS0,115200 mtdparts=nand_flash:0x100000@0x000000(u-boot),0x400000@0x100000(uImage),0x1f800000@0x500000(rootfs)rw'
set bootcmd 'tftpboot 0x2000000 $(image_name);setenv bootargs $(console) $(bootargs_root) nfsroot=$(serverip):$(rootpath) ip=$(ipaddr):$(serverip)$(bootargs_end); bootm 0x2000000'
saveenv
reset

#... After successful reboot, make sure all is well ....
cat /proc/mtd
# you should see THREE mtd partitions

# Make sure you have the tools
find / -name flash_eraseall
find / -name nandwrite

#----- Flash the new partition(s) -----
###### OPTIONAL, The uImage #######
flash_eraseall -j /dev/mtd1
nandwrite -p /dev/mtd1 /uImage.sheeva.040309
###################################

#----- rootfs ---------
flash_eraseall -j /dev/mtd2
nandwrite -p /dev/mtd2 /ubuntu-9.0.5.Release.jffs2

mkdir /temp-mount
mount -t jffs2 /dev/mtdblock2 /temp-mount
# Make sure it looks good. "df" should be ~30% full
# If it is 3% you have a bad jffs2 image
ls /temp-mount
df
umount /temp-mount
rm /temp-mount
reboot

#----- Return the U_Boot settings to boot from NAND
# Interrupt the autoboot sequence
# Marvell>>
setenv bootargs 'console=ttyS0,115200 mtdparts=nand_flash:0x400000@0x100000(uImage)ro,0x1fc00000@0x500000(rootfs)ro root=/dev/mtdblock2'
setenv bootcmd 'nand read.e 0x800000 0x100000 0x400000; bootm 0x800000'
saveenv
reset

« Last Edit: April 22, 2009, 07:03:02 AM by jdonth » Logged

...I've always depended on the kindness of strangers

plugcomp
Newbie
*

Karma: 0
Posts: 18


View Profile
« Reply #5 on: April 21, 2009, 08:59:50 AM »

I Would also suggest to do the following:

check your bootargs command in the uboot
Marvell>> print bootargs

This should give you a message saying no bootargs defined. If you find some parameters in bootargs, then  it is a good idea to clear your bootargs. Do the following in the uboot:

Marvell>> setenv bootargs
Marvell>> setenv console
Marvell>> saveenv
Marvell>> reset

Again enter the uboot prompt, and just set the console parameters. Donot change the other variables such as bootargs_root, bootcmd etc.

Marvell>> set console 'console=ttyS0,115200 mtdparts=nand_mtd:0x100000@0x000000(uboot),0x300000@0x100000(uImage),0x1fc00000@0x400000(rootfs)rw'
Logged

mavr15
Newbie
*

Karma: 0
Posts: 8


View Profile
« Reply #6 on: April 21, 2009, 09:22:11 AM »

I am restored kernel and jfffs2 images, operations finished without error. But at kernel starup i see some errors.

Buffer I/O error on device mtdblock0, logical block 0, and

missing modulles

FATAL: Could not load /lib/modules/2.6.22.18/modules.dep: No such file or directory

But plug work.
Logged

Pages: [1]
Print
Jump to: