2014-10-10 11:19:08 +02:00
|
|
|
#!/usr/bin/env bash
|
2013-05-22 09:12:13 +02:00
|
|
|
|
|
|
|
#generate a u-boot u-env.
|
|
|
|
list="0x80200000 kernel.bin
|
2013-05-23 10:45:38 +02:00
|
|
|
0x82000000 ds.elf
|
|
|
|
0x82800000 rs.elf
|
|
|
|
0x83000000 pm.elf
|
|
|
|
0x83800000 sched.elf
|
|
|
|
0x84000000 vfs.elf
|
|
|
|
0x84800000 memory.elf
|
2013-09-21 17:35:15 +02:00
|
|
|
0x85000000 tty.elf
|
|
|
|
0x85800000 mfs.elf
|
|
|
|
0x86000000 vm.elf
|
|
|
|
0x86800000 pfs.elf
|
|
|
|
0x87000000 init.elf"
|
2013-05-22 09:12:13 +02:00
|
|
|
|
|
|
|
#
|
|
|
|
# PREFIX for loading file over tftp to allow hosting multiple
|
|
|
|
# version/devices.
|
|
|
|
NETBOOT_PREFIX=""
|
|
|
|
NETBOOT="no"
|
|
|
|
BOOT="mmcbootcmd"
|
|
|
|
|
2013-12-13 11:18:02 +01:00
|
|
|
#default for the beagleboard-xM
|
2014-10-10 11:19:08 +02:00
|
|
|
CONSOLE=tty02
|
2013-12-13 11:18:02 +01:00
|
|
|
#verbosity
|
2014-09-01 16:17:18 +02:00
|
|
|
VERBOSE=0
|
2013-12-13 11:18:02 +01:00
|
|
|
HZ=1000
|
|
|
|
|
|
|
|
while getopts "c:v:h:p:n?" c
|
2013-05-22 09:12:13 +02:00
|
|
|
do
|
2014-10-10 11:19:08 +02:00
|
|
|
case "$c" in
|
|
|
|
\?)
|
|
|
|
echo "Usage: $0 [-p netboot_prefix] -n [-c consoletty] [-v level] " >&2
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
n)
|
2013-05-22 09:12:13 +02:00
|
|
|
# genrate netbooting uEnv.txt
|
2014-10-10 11:19:08 +02:00
|
|
|
BOOT="netbootcmd"
|
|
|
|
NETBOOT="yes"
|
2013-05-22 09:12:13 +02:00
|
|
|
;;
|
2014-10-10 11:19:08 +02:00
|
|
|
p)
|
|
|
|
NETBOOT_PREFIX=$OPTARG
|
2013-05-22 09:12:13 +02:00
|
|
|
;;
|
2014-10-10 11:19:08 +02:00
|
|
|
c)
|
|
|
|
CONSOLE=$OPTARG
|
2013-12-13 11:18:02 +01:00
|
|
|
;;
|
2014-10-10 11:19:08 +02:00
|
|
|
v)
|
|
|
|
VERBOSE=$OPTARG
|
2013-12-13 11:18:02 +01:00
|
|
|
;;
|
2014-10-10 11:19:08 +02:00
|
|
|
h)
|
|
|
|
# system hz
|
2013-12-13 11:18:02 +01:00
|
|
|
HZ=$OPTARG
|
|
|
|
;;
|
2013-05-22 09:12:13 +02:00
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
2013-05-29 14:10:22 +02:00
|
|
|
fill_cmd() {
|
2013-05-22 09:12:13 +02:00
|
|
|
#load == load method like fatload mmc 0:1
|
|
|
|
#prefix is an optional directory containing the ending /
|
|
|
|
load=$1
|
|
|
|
prefix=$2
|
2014-10-10 11:19:08 +02:00
|
|
|
export IFS=" "
|
2013-05-22 09:12:13 +02:00
|
|
|
echo $list | while true
|
|
|
|
do
|
|
|
|
if ! read -r mem addr
|
|
|
|
then
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
#e.g. ; fatloat mmc 0:1 0x82000000 mydir/ds.elf
|
|
|
|
echo -n "; $load $mem $prefix$addr"
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
echo "# Set the command to be executed"
|
|
|
|
echo "uenvcmd=run $BOOT"
|
2014-02-28 16:56:40 +01:00
|
|
|
echo "bootargs=console=$CONSOLE rootdevname=c0d0p1 verbose=$VERBOSE hz=$HZ"
|
2013-12-13 11:18:02 +01:00
|
|
|
echo
|
|
|
|
echo 'bootminix=setenv bootargs \$bootargs board_name=\$board_name ; echo \$bootargs; go 0x80200000 \\\"$bootargs\\\"'
|
2014-10-10 11:19:08 +02:00
|
|
|
echo
|
2014-05-26 16:47:50 +02:00
|
|
|
echo "mmcbootcmd=echo starting from MMC ; mmc part 0; $(fill_cmd "fatload mmc 0:1" "") ; run bootminix"
|
2014-10-10 11:19:08 +02:00
|
|
|
echo
|
2013-05-22 09:12:13 +02:00
|
|
|
echo "# Netbooting."
|
|
|
|
echo "serverip=192.168.12.10"
|
|
|
|
echo "ipaddr=192.168.12.62"
|
|
|
|
echo "usbnet_devaddr=e8:03:9a:24:f9:10"
|
|
|
|
echo "usbethaddr=e8:03:9a:24:f9:11"
|
2014-05-26 16:47:50 +02:00
|
|
|
echo "netbootcmd=echo starting from TFTP; $(fill_cmd "tftp" "$NETBOOT_PREFIX") ; run bootminix"
|
2013-05-22 09:12:13 +02:00
|
|
|
exit 0
|