phunix/releasetools/gen_uEnv.txt.sh
David van Moolenbroek e4e21ee1b2 Add MIB service, sysctl(2) support
The new MIB service implements the sysctl(2) system call which, as
we adopt more NetBSD code, is an increasingly important part of the
operating system API.  The system call is implemented in the new
service rather than as part of an existing service, because it will
eventually call into many other services in order to gather data,
similar to ProcFS.  Since the sysctl(2) functionality is used even
by init(8), the MIB service is added to the boot image.

MIB stands for Management Information Base, and the MIB service
should be seen as a knowledge base of management information.

The MIB service implementation of the sysctl(2) interface is fairly
complete; it incorporates support for both static and dynamic nodes
and imitates many NetBSD-specific quirks expected by userland.  The
patch also adds trace(1) support for the new system call, and adds
a new test, test87, which tests the fundamental operation of the
MIB service rather thoroughly.

Change-Id: I4766b410b25e94e9cd4affb72244112c2910ff67
2016-01-13 20:32:37 +01:00

92 lines
1.8 KiB
Bash
Executable File

#!/usr/bin/env bash
#generate a u-boot u-env.
list="0x80200000 kernel.bin
0x82000000 ds.elf
0x82800000 rs.elf
0x83000000 pm.elf
0x83800000 sched.elf
0x84000000 vfs.elf
0x84800000 memory.elf
0x85000000 tty.elf
0x85800000 mib.elf
0x86000000 vm.elf
0x86800000 pfs.elf
0x87000000 mfs.elf
0x87800000 init.elf"
#
# PREFIX for loading file over tftp to allow hosting multiple
# version/devices.
NETBOOT_PREFIX=""
NETBOOT="no"
BOOT="mmcbootcmd"
#default for the beagleboard-xM
CONSOLE=tty02
#verbosity
VERBOSE=0
HZ=1000
while getopts "c:v:h:p:n?" c
do
case "$c" in
\?)
echo "Usage: $0 [-p netboot_prefix] -n [-c consoletty] [-v level] " >&2
exit 1
;;
n)
# genrate netbooting uEnv.txt
BOOT="netbootcmd"
NETBOOT="yes"
;;
p)
NETBOOT_PREFIX=$OPTARG
;;
c)
CONSOLE=$OPTARG
;;
v)
VERBOSE=$OPTARG
;;
h)
# system hz
HZ=$OPTARG
;;
esac
done
fill_cmd() {
#load == load method like fatload mmc 0:1
#prefix is an optional directory containing the ending /
load=$1
prefix=$2
export IFS=" "
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"
echo "bootargs=console=$CONSOLE rootdevname=c0d0p1 verbose=$VERBOSE hz=$HZ"
echo
echo 'bootminix=setenv bootargs \$bootargs board_name=\$board_name ; echo \$bootargs; go 0x80200000 \\\"$bootargs\\\"'
echo
echo "mmcbootcmd=echo starting from MMC ; mmc part 0; $(fill_cmd "fatload mmc 0:1" "") ; run bootminix"
echo
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"
echo "netbootcmd=echo starting from TFTP; $(fill_cmd "tftp" "$NETBOOT_PREFIX") ; run bootminix"
exit 0