04-22-2011 11:09 PM
Hi all,
I'm working on a small MicroBlaze system and am setting up MTD for access to the Intel flash device we have on the board. That seems to have gone well - mkdev recognizes the node, queries the flash appropriately, and sets up entries in the /dev.
Now that we've got the basic driver up and running we're trying to cross-compile the mtd-utils package and put it into the initrd image so that we've got it available at boot time. Here's a basic overview of the workflow so far:
- Download and cross-compile zlib
- Download and cross-compile lzo
- Download and cross-compile mtd-utils (note that I had a lot of problems cross-compiling ubifs, but I don't think that should make a big difference for the basic MTD tools or j2ffs).
All of the cross-compilation steps were essentially those detailed here:
http://elinux.org/CompilingMTDUtils
Once I had that done, I extracted the initrd_minimal.cpio.gz image as follows:
# gunzip initrd_minimal.cpio.gz
# mkdir temp
# cd temp
# cpio -id < ../initrd_minimal.cpio
Once I had that I created an sbin and lib directory under root and copied in the resulting objects. Then I rebuilt the ramdisk using
# find . | cpio --create --format='newc' > ../initrd_minimal.cpio
# cd ..
# gzip initrd_minimal.cpio
Then rebuilt the kernel using the new initrd. Everything boots fine and I can see the files in the file system, but they won't execute - I just get /bin/sh: flash_info not found... Not entirely sure what's happening.
I've verified that they're built as MicroBlaze binaries and they seem to be in the file system ok, so I'm a little stumped. To be fair, there are a lot of places I can make mistakes along the way here and I've been looking at it for a while, but it seems like a relatively straightforward process...
If anyone's done it before and run into similar problems, or might have an alternate initrd or set of instructions I could reference I'd appreciate it!
Thanks,
Rob
04-25-2011 09:17 PM
Actually, taking a step back over the weekend helped me realize what was going on. I was using the minimal image but was compiling the mtd-utils binaries for dynamic linking, so the libraries weren't present.
Everything's working great now!
Cheers,
Rob
04-25-2011 09:17 PM
Actually, taking a step back over the weekend helped me realize what was going on. I was using the minimal image but was compiling the mtd-utils binaries for dynamic linking, so the libraries weren't present.
Everything's working great now!
Cheers,
Rob
04-26-2011 05:25 PM