1. Internal SD
2. External SD
3. Usb drive
Here's how it works, the new boot searches for a uboot script file called "boot.scr" on each of the above devices. The boot.scr is loaded and executed from the first device it encounters containing the file. We assume the device contains an ext2/3/4 partition and the boot.scr is located in /. Within the boot.scr file the variable 'boot_normal' has to be set to contain the uboot commands to run next, the contents of this variable are then executed.
You can download multi-uboot from here and 'dd' to an sd card that will reside in the internal sd card slot. Potentially this can be a very small SD card if you have no intentions of hosting a rootfs on it.
sudo dd if=u-boot_multi_boot.imx bs=1k seek=1 of=/dev/<internal SD card device> && sync
Lets start with an example, lets say we want to execute our ubuntu image from the external SD card. I am assuming the ubuntu rootfs exists on an sd card . First we create a text file I call them 'boot.cmd' (you can give it any name) containing the uboot commands to run as shown below:
setenv console 'ttymxc3,115200'
setenv root '/dev/mmcblk1p1 rootwait'
setenv rootfstype 'ext4'
setenv kernel 'uImage'
setenv video 'mxcfb0:dev=hdmi,1280x720M@60,if=RGB24'
setenv extra ''
setenv boot_normal 'setenv bootargs console=${console} root=${root} rootfstype=${rootfstype} video=${video} ${extra}; mmc dev 1; ext2load mmc 1:1 0x10800000 /boot/uImage; bootm'
For the above :
1. 'root' is set to the external sd card (/dev/mmcblk1p1).
2. 'video' contains the video resolution we want the kernel to set. Note setting the resolution may disable sound. So you could remove the video variable from the file to let the kernel detect the resolution using EDID. There is also a kernel patch from wolfgar that fixes the sound when the resolution is set to 720p or 1080. You can download precompiled kernel and modules with the patch. Copy kernel (uImage) to /boot and untar modules_3.0.35-02708-g899792c-dirty.tar.gz and copy modules directory to /lib/modules.
3. 'boot_normal' is told to use the external sd slot by 'mmc dev 1' and then to load the kernel located at /boot/uImage.
Next the text file has to be converted to a uboot script image file using the mkimage command to create the boot.scr file.
mkimage -A arm -O linux -T script -n "boot" -d boot.cmd boot.scr
Copy the boot.src to the root directory of your external sd card containing the rootfs.
Ensure internal sd slot has a the sd card containing the mutli-boot uboot on in it and does not contain a /boot.scr. Place the sd card containing the rootfs in the external sd card slot and boot.
Here are some example script files (remember to rename compiled file to boot.scr) :
Note the source files contain a mistake that should be fixed:
setenv fbmem "fbmem=28M";
SHOULD BE
setenv fbmem '';
1. Boot from external SD (no video set)
2. Boot from from USB (assumes a single mass storage device is available).