bbb_bootmode_default=root


bbb_part_root=2
bbb_part_rootalt=3

bbb_fs_root=ufs:/dev/ufs/bbbemmcroot
bbb_fs_rootalt=ufs:/dev/ufs/bbbemmcrootalt


BBBcmd0=echo; echo '----------------------------------------------------------------------'; echo; echo 'Environment variables:'; echo

BBBcmd1=echo "bootcount=$bootcount"

BBBcmd2=if test -n "$bbb_bootmode_default"; then if test "$bbb_bootmode_default" = root; then setenv bbb_part "$bbb_part_root"; setenv vfs_root_mountfrom "$bbb_fs_root"; elif test "$bbb_bootmode_default" = rootalt; then setenv bbb_part "$bbb_part_rootalt"; setenv vfs_root_mountfrom "$bbb_fs_rootalt"; fi; fi; echo "bbb_bootmode_default=$bbb_bootmode_default"
BBBcmd3=if test -n "$bbb_bootmode"        ; then if test "$bbb_bootmode"         = root; then setenv bbb_part "$bbb_part_root"; setenv vfs_root_mountfrom "$bbb_fs_root"; elif test "$bbb_bootmode"         = rootalt; then setenv bbb_part "$bbb_part_rootalt"; setenv vfs_root_mountfrom "$bbb_fs_rootalt"; fi; fi; echo "bbb_bootmode=$bbb_bootmode"

BBBcmd4=if test -n "$fatdev"; then if test "$fatdev" = 'mmc 0'; then setenv bbb_dev mmc0; elif test "$fatdev" = 'mmc 1'; then setenv bbb_dev mmc1; fi; fi; echo "bbb_dev=$bbb_dev"

BBBcmd5=echo "bbb_part=$bbb_part"
BBBcmd6=env exists bbb_dev && env exists bbb_part && setenv loaderdev "$bbb_dev:$bbb_part"; env delete bbb_dev bbb_part; echo "loaderdev=$loaderdev"
BBBcmd7=echo "fdt_file=$fdt_file"
BBBcmd8=echo "vfs_root_mountfrom=$vfs_root_mountfrom"

BBBcmd9=echo; echo '----------------------------------------------------------------------'; echo; echo 'Use "setenv bbb_bootmode [ root | rootalt ]" to override boot mode'; echo; echo '----------------------------------------------------------------------'; echo


BBBcmd=run BBBcmd0 BBBcmd1 BBBcmd2 BBBcmd3 BBBcmd4 BBBcmd5 BBBcmd6 BBBcmd7 BBBcmd8 BBBcmd9; env delete BBBcmd0 BBBcmd1 BBBcmd2 BBBcmd3 BBBcmd4 BBBcmd5 BBBcmd6 BBBcmd7 BBBcmd8 BBBcmd9


UserFatboot=run BBBcmd; env delete BBBcmd preboot bootcmd Preboot SetupFdtfile SetupFatdev SetupUenv Netboot Fatboot UserFatboot
