summaryrefslogtreecommitdiffstats
path: root/board/pcm038/env/bin/boot
blob: cd8a5c9392011c5c97c9b310b33757af9461d046 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/sh

. /env/config

if [ x$1 = xflash ]; then
	root=flash
	kernel=flash
fi

if [ x$1 = xnet ]; then
	root=net
	kernel=net
fi

addpart /dev/nor0 $mtdparts

if [ $root = flash ]; then
	bootargs="$bootargs root=$rootpart rootfstype=jffs2"
else
	if [ x$ip = xdhcp ]; then
		bootargs="$bootargs ip=dhcp"
	else
		bootargs="$bootargs ip=$eth0.ipaddr:$eth0.serverip:$eth0.gateway:$eth0.netmask:::"
	fi
	bootargs="$bootargs root=/dev/nfs nfsroot=$eth0.serverip:$nfsroot,v3,tcp"
fi

bootargs="$bootargs mtdparts=physmap-flash.0:$mtdparts"

if [ $kernel = net ]; then
	if [ x$ip = xdhcp ]; then
		dhcp
	fi
	tftp $uimage uImage
	bootm uImage
else
	bootm /dev/nor0.kernel
fi