I don’t fully understand what options are available in the u-boot environment. I’ve read a bunch of the documentation, but got confused, and then saw things in the environment that led me to believe that it might have more operation possible.
Is it possible to set up the u-boot environment so that the unattended beagleboard will boot a particular set of parameters if an MMC is in the mmc slot, and a different set if there is no MMC?
I set up the NAND so that it has the standard partitions of
~ # cat /proc/mtd
dev: size erasesize name
mtd0: 00080000 00020000 “X-Loader”
mtd1: 001e0000 00020000 “U-Boot”
mtd2: 00020000 00020000 “U-Boot Env”
mtd3: 00400000 00020000 “Kernel”
mtd4: 0f980000 00020000 “File System”
and I properly populate the kernel and file system partitions. Right now I’ve got the environment set so that it boots from my MMC,
What I’d like is that if there is no MMC card, the root filesystem is loaded from the NAND, but if there’s a MMC card inserted, I’d like it to load the root file system from the MMC. I’ve installed the u-boot utilities in the current running angstrom system, and can examine the and modify the current boot environment as shown below.
~ # opkg info u-boot-fw-utils
Package: u-boot-fw-utils
Version: 2010.03+r65+gitrca6e1c136ddb720c3bb2cc043b99f7f06bc46c55-r65.6
Depends: libc6
Provides:
Status: unknown ok not-installed
Section: bootloaders
Architecture: beagleboard
MD5Sum: 032998614beb8a2ab4c9d79e3c5ab6e4
Size: 10334
Filename: u-boot-fw-utils_2010.03+r65+gitrca6e1c136ddb720c3bb2cc043b99f7f06bc46c55-r65.6_beagleboard.ipk
Description: U-Boot - the Universal Boot Loader
~ # opkg install u-boot-fw-utils
Installing u-boot-fw-utils (2010.03+r65+gitrca6e1c136ddb720c3bb2cc043b99f7f06bc46c55-r65.6) to root…
Downloading http://www.angstrom-distribution.org/feeds/unstable/ipk/glibc/armv7a/machine/beagleboard/u-boot-fw-utils_2010.03+r65+gitrca6e1c136ddb720c3bb2cc043b99f7f06bc46c55-r65.6_beagleboard.ipk.
Configuring u-boot-fw-utils.
~ # opkg info u-boot-fw-utils
Package: u-boot-fw-utils
Version: 2010.03+r65+gitrca6e1c136ddb720c3bb2cc043b99f7f06bc46c55-r65.6
Depends: libc6
Provides:
Status: install user installed
Section: bootloaders
Architecture: beagleboard
MD5Sum: 032998614beb8a2ab4c9d79e3c5ab6e4
Size: 10334
Filename: u-boot-fw-utils_2010.03+r65+gitrca6e1c136ddb720c3bb2cc043b99f7f06bc46c55-r65.6_beagleboard.ipk
Description: U-Boot - the Universal Boot Loader
Installed-Time: 1289051817
~ # opkg files u-boot-fw-utils
Package u-boot-fw-utils (2010.03+r65+gitrca6e1c136ddb720c3bb2cc043b99f7f06bc46c55-r65.6) is installed on root and has the following files:
/sbin/fw_setenv
/etc/fw_env.config
/sbin/fw_printenv
~ # fw_printenv
bootdelay=3
baudrate=115200
loadaddr=0x80200000
rdaddr=0x81600000
usbtty=cdc_acm
console=ttyS2,115200n8
optargs=
bootscr=boot.scr
camera=lbcm3m1
vram=12M
dvimode=640x480MR-16@60
defaultdisplay=dvi
mmcdev=1
mmcroot=/dev/mmcblk0p2 rw
mmcrootfstype=ext3 rootwait
nandroot=/dev/mtdblock4 rw
nandrootfstype=jffs2
ramroot=/dev/ram0 rw
ramrootfstype=ext2
mmcargs=setenv bootargs console=${console} ${optargs} mpurate=${mpurate} buddy=${buddy} camera=${camera} vram=${vram} omapfb.mode=dvi:${dvimode} omapdss.def_disp=${defaultdisplay} root=${mmcroot} rootfstype=${mmcrootfstype}
nandargs=setenv bootargs console=${console} ${optargs} mpurate=${mpurate} buddy=${buddy} camera=${camera} vram=${vram} omapfb.mode=dvi:${dvimode} omapdss.def_disp=${defaultdisplay} root=${nandroot} rootfstype=${nandrootfstype}
loadbootscript=fatload mmc ${mmcdev} ${loadaddr} ${bootscr}
ramargs=setenv bootargs console=${console} ${optargs} mpurate=${mpurate} buddy=${buddy} camera=${camera} vram=${vram} omapfb.mode=dvi:${dvimode} omapdss.def_disp=${defaultdisplay} root=${ramroot} rw ramdisk_size=65536 initrd=${rdaddr},64M rootfstype=${ramrootfstype}
loadramdisk=fatload mmc ${mmcdev} ${rdaddr} ramdisk.gz
bootscript=echo Running bootscript from mmc …; source ${loadaddr}
loaduimage=fatload mmc ${mmcdev} ${loadaddr} uImage
mmcboot=echo Booting from mmc …; run mmcargs; bootm ${loadaddr}
nandboot=echo Booting from nand …; run nandargs; nand read ${loadaddr} 280000 400000; bootm ${loadaddr}
ramboot=echo Booting from ramdisk …; run ramargs; bootm ${loadaddr}
dieid#=53560004000000000403730514012009
buddy=none
beaglerev=Cx
mpurate=720
bootargs=console=ttyS2,115200n8 root=/dev/mmcblk0p2 rw rootwait
bootcmd=mmc init;fatload mmc 0 80300000 uImage;bootm 80300000