etc/services - sync with NetBSD-8
[minix.git] / releasetools / gen_uEnv.txt.sh
blobd83db0758dc1ea0a8332e44ce9864ead6a82336e
1 #!/usr/bin/env bash
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 tty.elf
12 0x85800000 mib.elf
13 0x86000000 vm.elf
14 0x86800000 pfs.elf
15 0x87000000 mfs.elf
16 0x87800000 init.elf"
19 # PREFIX for loading file over tftp to allow hosting multiple
20 # version/devices.
21 NETBOOT_PREFIX=""
22 NETBOOT="no"
23 BOOT="mmcbootcmd"
25 #default for the beagleboard-xM
26 CONSOLE=tty02
27 #verbosity
28 VERBOSE=0
29 HZ=1000
31 while getopts "c:v:h:p:n?" c
33 case "$c" in
34 \?)
35 echo "Usage: $0 [-p netboot_prefix] -n [-c consoletty] [-v level] " >&2
36 exit 1
39 # genrate netbooting uEnv.txt
40 BOOT="netbootcmd"
41 NETBOOT="yes"
44 NETBOOT_PREFIX=$OPTARG
47 CONSOLE=$OPTARG
50 VERBOSE=$OPTARG
53 # system hz
54 HZ=$OPTARG
56 esac
57 done
59 fill_cmd() {
60 #load == load method like fatload mmc 0:1
61 #prefix is an optional directory containing the ending /
62 load=$1
63 prefix=$2
64 export IFS=" "
65 echo $list | while true
67 if ! read -r mem addr
68 then
69 break
71 #e.g. ; fatloat mmc 0:1 0x82000000 mydir/ds.elf
72 echo -n "; $load $mem $prefix$addr"
73 done
77 echo "# Set the command to be executed"
78 echo "uenvcmd=run $BOOT"
79 echo "bootargs=console=$CONSOLE rootdevname=c0d0p1 verbose=$VERBOSE hz=$HZ"
80 echo
81 echo 'bootminix=setenv bootargs \$bootargs board_name=\$board_name ; echo \$bootargs; go 0x80200000 \\\"$bootargs\\\"'
82 echo
83 echo "mmcbootcmd=echo starting from MMC ; mmc part 0; $(fill_cmd "fatload mmc 0:1" "") ; run bootminix"
84 echo
85 echo "# Netbooting."
86 echo "serverip=192.168.12.10"
87 echo "ipaddr=192.168.12.62"
88 echo "usbnet_devaddr=e8:03:9a:24:f9:10"
89 echo "usbethaddr=e8:03:9a:24:f9:11"
90 echo "netbootcmd=echo starting from TFTP; $(fill_cmd "tftp" "$NETBOOT_PREFIX") ; run bootminix"
91 exit 0