• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1]
Author Topic: Booting from NAND flash  (Read 1577 times)
Wol
Newbie
*

Karma: 0
Posts: 3


View Profile
« on: August 11, 2009, 08:39:50 AM »

Hi all.

The original post I had is below, which I seem to have fixed now, but gives some prelimiary information.

I have a booting system from the NAND flash with a initrd file. The kernel now boots and waits a painfully (several mins) long time at the "waiting for root filesystem" line but finds it, or something, in the end, and continues until it gives me:

Quote from: The error
Checking root file system...fsck 1.41.3 (12-Oct-2008)
e2fsck 1.41.3 (12-Oct-2008)
fsck.ext3: Superblock invalid, trying backup blocks...
fsck.ext3: Bad magic number in super-block while trying to open /lib/init/rw/rootdev

The superblock could not be read or does not describe a correct ext2
filesystem.  If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>

fsck died with exit status 8
failed (code Cool.
An automatic file system check (fsck) of the root filesystem failed.
A manual fsck must be performed, then the system restarted.
The fsck should be performed in maintenance mode with the root filesystem mounted in read-only mode. failed!
The root filesystem is currently mounted in read-only mode. A maintenance shell will now be started.
After performing system maintenance, press CONTROL-D to terminate the maintenance shell and restart the system. (warning).
Give root password for maintenance
(or type Control-D to continue):

I'm guessing this is because its trying to use the NAND directly, rather than doing the thing where its copied into RAM and mounted there? I'm guessing that I'm missing something blatantly obvious but my mind doesnt seem to want to put its finger on it at the moment :-S


Quote from: my previous problem
I'm currently trying to move the kernel/initrd from the usb boot device to the NAND flash on a sheevaplug so that it can boot standalone from any other devices.

I've got four partitions on the flash setup, one for the uboot, one for the kernel, one for the initrd, and one for the filesystem.

"mtdparts=orion_nand:0x200000@0x100000(uImage)ro,0x500000@0x300000(uInitrd)ro,0x1f800000@0x800000(rootfs)rw"

From booting off the USB drive, I've flash-erase / flash-eraseall'd the kernel/initrd/rootfs partitions, nandwrite -p'd the kernel and initrd onto each partition and managed to load them up again in uboot with the "nand read.e" command into two areas of memory (currently 0x800000 and 0xA00000). The root filesystem has been flashed from the jffs2 image and ive managed to mount that again using "mount -t jffs2 /dev/mtdblock2 /mnt/flash2". The version of the kernel/initrd is the one from : http://www.cyrius.com/debian/kirkwood/sheevaplug/unpack.html, which I've managed to get working fine on the usb device, but not from the NAND.

The problem I'm getting is that when i try and boot using "bootm 0x800000 0xA00000", it detects the two files and CRC checks them okay, but then it gets stuck at the "booting kernel" stage after decompressing.

I've then tried to reflash the uImage.sheeva.20090319 image (linux 2.6.22.18) on the CD back onto the device and thats now giving the same problem.

I have the mainlineLinux and arcNumber params set. The bootargs param is set to "$(console) root=/dev/mtdblock2 rootdelay=10 $(mtd_partitions)". $(mtd_partitions) is the line shown above. Im then manually executing the "nand read.e ..." commands.

I've searched around on the internet, but not sure if I'm missing something like I have to use a specific RAM address for initrds, or whether I have to also pass something in the bootargs for the initrd if booting from NAND.

Any help would be appreciated! Cheers!
« Last Edit: August 11, 2009, 10:40:47 AM by Wol » Logged

Pages: [1]
Print
Jump to: