Here's a switchable booting system for plugs with the original JFFS2 filesystem (
and original kernel) on NAND. It is
not appropriate if you have an upgraded kernel. If you have an upgraded kernel, a better solution should be available and I'll post that in a few days once I've got it all written down and tested.
* You MUST upgrade U-Boot in order to be able to boot from SD card. We recommend version 3.4.23.
See
http://www.cyrius.com/debian/kirkwood/sheevaplug/uboot-upgrade.html* Set up a TFTP server.
In U-Boot:
setenv serverip 10.42.43.1 # IP of your TFTP server
setenv ipaddr 10.42.43.2
bubt uboot.bin
In the example code, U-Boot image is hosted on your TFTP server with name uboot.bin
When the upgrade process will ask whether you want to change the environment:
**Warning**
If U-Boot Endiannes is going to change (LE->BE or BE->LE),
Then Env parameters should be overridden..
Override Env parameters? (y/n) n
Make sure to answer "n" here. After rebooting, enter the following commands at the U-Boot prompt to change and add some environment variables:
setenv bootargs_console 'console=ttyS0,115200'
setenv bootargs_root_jffs2 'root=/dev/mtdblock2 ro'
setenv mtdpartitions_jffs2 'mtdparts=nand_mtd:0x400000@0x100000(uImage),0x1fb00000@0x500000(rootfs) rw root=/dev/mtdblock1 rw ip=10.4.50.4:10.4.50.5:10.4.50.5:255.255.255.0:DB88FXX81:eth0:none'
setenv jffs2_config 'setenv arcNumber;setenv mainlineLinux no;setenv bootargs_root $(bootargs_root_jffs2);setenv bootcmd run bootcmd_jffs2;saveenv;reset'
setenv bootcmd_jffs2 'setenv bootargs $(bootargs_console) $(mtdpartitions_jffs2); nand read.e 0x00800000 0x00100000 0x00400000; bootm 0x00800000'
setenv bootargs_root_mmc 'root=/dev/mmcblk0p2 rootdelay=5'
setenv mmc_config 'setenv arcNumber 2097;setenv mainlineLinux yes;setenv bootcmd run bootcmd_mmc;saveenv;reset'
setenv bootcmd_mmc 'setenv bootargs $(bootargs_console) $(bootargs_root_mmc); mmcinit; ext2load mmc 0:1 0x800000 /uImage; bootm 0x00800000'
saveenv
reset
At this point, your plug will continue to boot from the JFFS2 filesystem on NAND.
To activate the SD card boot, type the following at the U-Boot prompt:
run mmc_config
The plug will boot from SD card until you change it back to NAND boot, whcih you can do with the following code:
run jffs2_config
The plug can't be multibooted in the way that our UBIFS configurations do (where if there is an SD card present, the plug will boot from the SD card, if not, it will boot from NAND). In this "switchable" scenario however, you can (easily) switch from one boot method to the other.
The SD card should have a uImage (kernel) on partition #1, and rootfs on partition #2. Our images prepared in this way are
here (or you can manually create / roll your own).
This solution can work for eSATA plugs but there are some additional considerations regarding suitable kernels and arcNumber. We'll be preparing some new SD card images over the next few days that will simplify the options for this switchable / multibooting system. I will post relevant information (possibly in a new thread) when we do that.
The environment variables that are at the heart of this solution can be changed / improved to a genuine multibooting system if you have an upgraded kernel on
both SD card and NAND. (It is the difference between the kernels, and the requirements of the arcNumber and mainlineLinux environment variables that make this whole setup a bit tricky). I will post instructions on how to upgrade the NAND kernel and the relevant environment variable changes for that scenario, hopefully in just a few days.
2010-11-03:
Edited to indicate recommended version of U-Boot.