9
0
Fork 0

ipe337: Make the default environment more sophisticated

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Sascha Hauer 2007-10-24 11:53:02 +02:00
parent 5614e5c6d6
commit c7655ebd43
5 changed files with 97 additions and 9 deletions

View File

@ -0,0 +1,35 @@
. /env/config
if [ x$1 = "xflash" ]; then
root=flash
kernel=flash
fi
if [ x$1 = "xnet" ]; then
root=net
kernel=net
fi
if [ "$root" = flash ]; then
bootargs="$bootargs root=/dev/mtdblock4 rootfstype=jffs2"
else
if [ "$ip" = dhcp ]; then
bootargs="$bootargs ip=dhcp"
else
bootargs="$bootargs ip=$eth0.ip:$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 [ $ip = dhcp ]; then
dhcp
fi
tftp $uimage uImage
bootm uImage
else
bootm /dev/nor0.kernel
fi

View File

@ -0,0 +1,14 @@
PATH=/env/bin
export PATH
. /env/config
echo -n "Hit any key to stop autoboot: "
timeout -a 1
if [ $? != 0 ]; then
echo "type update_kernel <imagename> to update kernel into flash"
echo "type udate_root <imagename> to update rootfs into flash"
exit
fi
boot

View File

@ -0,0 +1,20 @@
. /env/config
if [ -z /dev/nor0.kernel ]; then
echo "Please add a partition /dev/nor0.kernel containing the kernel image"
exit 1
fi
image=uImage-ipe337
if [ $# = 1 ]; then
image=$1
fi
if [ x$ip = xdhcp ]; then
dhcp
fi
unprotect /dev/nor0.kernel
erase /dev/nor0.kernel
tftp "$image" /dev/nor0.kernel

View File

@ -0,0 +1,20 @@
. /env/config
if [ -z $rootdev ]; then
echo "$rootdev not set. Please set to your device containing the root image"
exit 1
fi
image=root-ipe337.jffs2
if [ $# = 1 ]; then
image=$1
fi
if [ x$ip = xdhcp ]; then
dhcp
fi
unprotect "$rootdev"
erase "$rootdev"
tftp $image "$rootdev"

View File

@ -1,14 +1,14 @@
echo /env/config
eth0.serverip=192.168.23.2
eth0.mac=80:87:78:74:73:63
eth0.ethaddr=80:87:78:74:73:63
mtdparts="128k(uboot)ro,128k(ubootenv),1536k(kernel),-(jffs2)"
kerneldev="/dev/nor0.2"
jffs2dev="/dev/nor0.3"
mtdparts="128k(uboot)ro,128k(ubootenv),128k(alternate),1536k(kernel),-(root)"
ip=dhcp
eth0.ip=192.168.25.2
eth0.netmask=255.255.255.0
eth0.gateway=192.168.25.1
nfsroot="/home/sha/octopus/blackfin/OSELAS.BSP-Pipetronix-ipe337-trunk/root"
uimage=uImage-bfin
@ -17,10 +17,9 @@ jffs2=root-bfin.jffs2
bootargs="console=ttyBF0,115200"
# can be either 'net' or 'flash'
kernel=net
root=net
kernel=flash
root=flash
if [ ! -e dev/nor0.0 ]; then
addpart nor0:$mtdparts
addpart /dev/nor0 $mtdparts
fi