kernel: maintain stack alignment
[minix3.git] / releasetools / gen_uEnv.txt.sh
blob6cd7552dcc7a98de2c0fb1f8abf9f7d4f86262f4
1 #!/bin/sh
3 #generate a u-boot u-env.
4 list="0x80200000 kernel.bin
5 0x82000000 ds.elf
6 0x82800000 rs.elf
7 0x83000000 pm.elf
8 0x83800000 sched.elf
9 0x84000000 vfs.elf
10 0x84800000 memory.elf
11 0x85000000 log.elf
12 0x85800000 tty.elf
13 0x86000000 mfs.elf
14 0x86800000 vm.elf
15 0x87000000 pfs.elf
16 0x87800000 init.elf
17 0x88000000 cmdline.txt"
20 # PREFIX for loading file over tftp to allow hosting multiple
21 # version/devices.
22 NETBOOT_PREFIX=""
23 NETBOOT="no"
24 BOOT="mmcbootcmd"
26 while getopts "p:n?" c
28 case "$c" in
29 \?)
30 echo "Usage: $0 [-p netboot_prefix] -n" >&2
31 exit 1
34 # genrate netbooting uEnv.txt
35 BOOT="netbootcmd"
36 NETBOOT="yes"
39 NETBOOT_PREFIX=$OPTARG
41 esac
42 done
44 fill_cmd() {
45 #load == load method like fatload mmc 0:1
46 #prefix is an optional directory containing the ending /
47 load=$1
48 prefix=$2
49 export IFS=" "
50 echo $list | while true
52 if ! read -r mem addr
53 then
54 break
56 #e.g. ; fatloat mmc 0:1 0x82000000 mydir/ds.elf
57 echo -n "; $load $mem $prefix$addr"
58 done
62 echo "# Set the command to be executed"
63 echo "uenvcmd=run $BOOT"
64 echo
65 echo "# With cmdline/bootargs in cmdline.txt"
66 echo "mmcbootcmd=echo starting from MMC ; mmc part 0; mw.b 0x88000000 0 16384 $(fill_cmd "fatload mmc 0:1" "") ; dcache off ; icache off ; go 0x80200000"
67 echo
68 echo "# Netbooting."
69 echo "serverip=192.168.12.10"
70 echo "ipaddr=192.168.12.62"
71 echo "usbnet_devaddr=e8:03:9a:24:f9:10"
72 echo "usbethaddr=e8:03:9a:24:f9:11"
73 echo "netbootcmd=echo starting from TFTP; mw.b 0x88000000 0 16384 $(fill_cmd "tftp" "$NETBOOT_PREFIX") ; dcache off ; icache off ; go 0x80200000"
74 exit 0