# Configuration startup

c_count=""
c_seq=1

# $1 = name, $2 = configuration value
function c_add() {
  echo setenv config_$1 \'$2\'
  echo ca${c_seq}="config_$1"
  if [ -z "$c_count" ]; then
    c_count="$c_seq"
  else
    c_count="$c_count $c_seq"
  fi
  echo setenv c$c_seq \"run config_$1\; run showdefs\"
  c_seq=$[ $c_seq + 1 ]
}


cat << EOF

base_bootargs="$ABC_BASEARGS"
opt_bootargs="$ABC_OPTARGS"
saved_bootargs="$ABC_OPTARGS"

if test -n \\'\$findfdt\\'; then echo "Using findfdt to set u_dtb"; run findfdt; fi

setenv config_default 'u_k_addr=""; u_ramfs_addr=""; u_dtb_addr=""; skip_dtb=""; pass_dtb=1; u_dtb="\$fdtfile"; u_extraargs=""; u_iodevs="mmc usb scsi ide"; u_fs="ext2 fat"; u_boot=bootm; u_devpart="0:1 0:2"; u_dir="/ /boot/"; systemd_args=""'
run config_default

setenv bootcmd_old \\"\$bootcmd\\"
u_kernel=""

EOF
