mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "Eric Bénard" <eric@eukrea.com>
To: s.hauer@pengutronix.de
Cc: barebox@lists.infradead.org
Subject: [PATCH 6/7] eukrea_cpuimx25: switch to default environement
Date: Fri,  7 Jan 2011 17:35:32 +0100	[thread overview]
Message-ID: <1294418133-5256-6-git-send-email-eric@eukrea.com> (raw)
In-Reply-To: <1294418133-5256-1-git-send-email-eric@eukrea.com>

Signed-off-by: Eric Bénard <eric@eukrea.com>
---
 arch/arm/boards/eukrea_cpuimx25/env/bin/_update    |   36 -------------
 arch/arm/boards/eukrea_cpuimx25/env/bin/boot       |   53 --------------------
 arch/arm/boards/eukrea_cpuimx25/env/bin/hush_hack  |    1 -
 arch/arm/boards/eukrea_cpuimx25/env/bin/init       |   43 ----------------
 arch/arm/boards/eukrea_cpuimx25/env/bin/init_board |   18 +++++++
 .../boards/eukrea_cpuimx25/env/bin/update_kernel   |    8 ---
 .../arm/boards/eukrea_cpuimx25/env/bin/update_root |    8 ---
 arch/arm/boards/eukrea_cpuimx25/env/config         |   53 ++++++++++++++------
 8 files changed, 55 insertions(+), 165 deletions(-)
 delete mode 100644 arch/arm/boards/eukrea_cpuimx25/env/bin/_update
 delete mode 100644 arch/arm/boards/eukrea_cpuimx25/env/bin/boot
 delete mode 100644 arch/arm/boards/eukrea_cpuimx25/env/bin/hush_hack
 delete mode 100644 arch/arm/boards/eukrea_cpuimx25/env/bin/init
 create mode 100644 arch/arm/boards/eukrea_cpuimx25/env/bin/init_board
 delete mode 100644 arch/arm/boards/eukrea_cpuimx25/env/bin/update_kernel
 delete mode 100644 arch/arm/boards/eukrea_cpuimx25/env/bin/update_root

diff --git a/arch/arm/boards/eukrea_cpuimx25/env/bin/_update b/arch/arm/boards/eukrea_cpuimx25/env/bin/_update
deleted file mode 100644
index 014bce3..0000000
--- a/arch/arm/boards/eukrea_cpuimx25/env/bin/_update
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/bin/sh
-
-if [ -z "$part" -o -z "$image" ]; then
-	echo "define \$part and \$image"
-	exit 1
-fi
-
-if [ ! -e "$part" ]; then
-	echo "Partition $part does not exist"
-	exit 1
-fi
-
-if [ $# = 1 ]; then
-	image=$1
-fi
-
-if [ x$ip = xdhcp ]; then
-	dhcp
-fi
-
-ping $eth0.serverip
-if [ $? -ne 0 ] ; then
-	echo "update aborted"
-	exit 1
-fi
-
-unprotect $part
-
-echo
-echo "erasing partition $part"
-erase $part
-
-echo
-echo "flashing $image to $part"
-echo
-tftp $image $part
diff --git a/arch/arm/boards/eukrea_cpuimx25/env/bin/boot b/arch/arm/boards/eukrea_cpuimx25/env/bin/boot
deleted file mode 100644
index 2d9b3af..0000000
--- a/arch/arm/boards/eukrea_cpuimx25/env/bin/boot
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/bin/sh
-
-. /env/config
-
-if [ x$1 = xjffS2 ]; then
-	root=jffs2
-	kernel=nand
-fi
-
-if [ x$1 = xubifs ]; then
-	root=ubifs
-	kernel=nand
-fi
-
-if [ x$1 = xnet ]; then
-	root=net
-	kernel=net
-fi
-
-if [ x$ip = xdhcp ]; then
-	bootargs="$bootargs ip=dhcp"
-else
-	if [ x$ip = xoff ]; then
-		bootargs="$bootargs ip=off"
-	else
-		bootargs="$bootargs ip=$eth0.ipaddr:$eth0.serverip:$eth0.gateway:$eth0.netmask:::"
-	fi
-fi
-
-if [ x$root = xjffs2 ]; then
-	bootargs="$bootargs root=/dev/mtdblock$rootpartnum_nand rootfstype=jffs2"
-fi
-
-if [ x$root = xubifs ]; then
-	bootargs="$bootargs root=ubi0:$ubiroot ubi.mtd=$rootpartnum_nand rootfstype=ubifs"
-fi
-
-if [ x$root = xnet ]; then
-	bootargs="$bootargs root=/dev/nfs nfsroot=$eth0.serverip:$nfsroot,v3,tcp"
-fi
-
-bootargs="$bootargs mtdparts=mxc_nand:$nand_parts"
-
-if [ $kernel = net ]; then
-	if [ x$ip = xdhcp ]; then
-		dhcp
-	fi
-	tftp $uimage uImage || exit 1
-	bootm uImage
-else
-	bootm /dev/nand0.kernel.bb
-fi
-
diff --git a/arch/arm/boards/eukrea_cpuimx25/env/bin/hush_hack b/arch/arm/boards/eukrea_cpuimx25/env/bin/hush_hack
deleted file mode 100644
index 5fffa92..0000000
--- a/arch/arm/boards/eukrea_cpuimx25/env/bin/hush_hack
+++ /dev/null
@@ -1 +0,0 @@
-nand -a /dev/nand0.*
diff --git a/arch/arm/boards/eukrea_cpuimx25/env/bin/init b/arch/arm/boards/eukrea_cpuimx25/env/bin/init
deleted file mode 100644
index 4732875..0000000
--- a/arch/arm/boards/eukrea_cpuimx25/env/bin/init
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/bin/sh
-
-PATH=/env/bin
-export PATH
-
-. /env/config
-if [ -e /dev/nand0 ]; then
-	addpart /dev/nand0 $nand_parts
-
-	# Uh, oh, hush first expands wildcards and then starts executing
-	# commands. What a bug!
-	source /env/bin/hush_hack
-fi
-
-if [ -f /env/logo.bmp ]; then
-	bmp /env/logo.bmp
-	fb0.enable=1
-elif [ -f /env/logo.bmp.lzo ]; then
-	unlzo /env/logo.bmp.lzo /logo.bmp
-	bmp /logo.bmp
-	fb0.enable=1
-fi
-
-if [ -z $eth0.ethaddr ]; then
-	while [ -z $eth0.ethaddr ]; do
-		readline "no MAC address set for eth0. please enter the one found on your board: " eth0.ethaddr
-	done
-	echo -a /env/config "eth0.ethaddr=$eth0.ethaddr"
-	saveenv
-fi
-
-echo
-echo -n "Hit any key to stop autoboot: "
-timeout -a $autoboot_timeout
-if [ $? != 0 ]; then
-	echo
-	echo "type update_kernel [<imagename>] to update kernel into flash"
-	echo "type update_root [<imagename>] to update rootfs into flash"
-	echo
-	exit
-fi
-
-boot
diff --git a/arch/arm/boards/eukrea_cpuimx25/env/bin/init_board b/arch/arm/boards/eukrea_cpuimx25/env/bin/init_board
new file mode 100644
index 0000000..72b4ab3
--- /dev/null
+++ b/arch/arm/boards/eukrea_cpuimx25/env/bin/init_board
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+if [ -f /env/logo.bmp ]; then
+	bmp /env/logo.bmp
+	fb0.enable=1
+elif [ -f /env/logo.bmp.lzo ]; then
+	unlzo /env/logo.bmp.lzo /logo.bmp
+	bmp /logo.bmp
+	fb0.enable=1
+fi
+
+if [ -z $eth0.ethaddr ]; then
+	while [ -z $eth0.ethaddr ]; do
+		readline "no MAC address set for eth0. please enter the one found on your board: " eth0.ethaddr
+	done
+	echo -a /env/config "eth0.ethaddr=$eth0.ethaddr"
+	saveenv
+fi
diff --git a/arch/arm/boards/eukrea_cpuimx25/env/bin/update_kernel b/arch/arm/boards/eukrea_cpuimx25/env/bin/update_kernel
deleted file mode 100644
index c2d2cc3..0000000
--- a/arch/arm/boards/eukrea_cpuimx25/env/bin/update_kernel
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-. /env/config
-
-image=$uimage
-part=/dev/nand0.kernel.bb
-
-. /env/bin/_update $1
diff --git a/arch/arm/boards/eukrea_cpuimx25/env/bin/update_root b/arch/arm/boards/eukrea_cpuimx25/env/bin/update_root
deleted file mode 100644
index dd89a5a..0000000
--- a/arch/arm/boards/eukrea_cpuimx25/env/bin/update_root
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-. /env/config
-
-image=$rootfs
-part=/dev/nand0.root.bb
-
-. /env/bin/_update $1
diff --git a/arch/arm/boards/eukrea_cpuimx25/env/config b/arch/arm/boards/eukrea_cpuimx25/env/config
index 3e41ec8..927010c 100644
--- a/arch/arm/boards/eukrea_cpuimx25/env/config
+++ b/arch/arm/boards/eukrea_cpuimx25/env/config
@@ -1,27 +1,48 @@
 #!/bin/sh
 
-# can be either 'net' or 'jffs2' or 'ubifs'
-kernel=nand
-root=ubifs
+# otg port mode : can be 'host' or 'device'
+otg_mode="device"
 
-basedir=cpuimx25
-uimage=$basedir/uImage
-rootfs=$basedir/rootfs
-
-autoboot_timeout=1
-
-nfsroot=""
-bootargs="console=ttymxc0,115200"
-
-nand_parts="256k(barebox)ro,128k(bareboxenv),2432k(kernel),-(root)"
-rootpartnum_nand=3
-ubiroot="eukrea-cpuimx25-rootfs"
+machine=eukrea-cpuimx25
 
 # use 'dhcp' to do dhcp in barebox and in kernel
-ip=off
+# use 'none' if you want to skip kernel ip autoconfiguration
+ip=none
 
 # or set your networking parameters here
 #eth0.ipaddr=a.b.c.d
 #eth0.netmask=a.b.c.d
 #eth0.gateway=a.b.c.d
 #eth0.serverip=a.b.c.d
+
+# can be either 'net' or 'nand'
+kernel_loc=nand
+# can be either 'net', 'nand' or 'initrd'
+rootfs_loc=nand
+
+# rootfs
+rootfs_type=ubifs
+rootfsimage=$machine/rootfs.$rootfs_type
+
+# kernel
+kernelimage_type=uimage
+kernelimage=$machine/uImage-${machine}.bin
+
+# barebox and it's env
+bareboximage=$machine/barebox-${machine}.bin
+bareboxenvimage=$machine/bareboxenv-${machine}.bin
+
+nfsroot="$eth0.serverip:/srv/nfs/$machine"
+
+autoboot_timeout=1
+
+bootargs="console=ttymxc0,115200 otg_mode=$otg_mode"
+
+nand_parts="256k(barebox)ro,128k(bareboxenv),3M(kernel),-(root)"
+rootfs_mtdblock_nand=3
+nand_device="mxc_nand"
+ubiroot="$machine-rootfs"
+device_type="nand"
+
+# set a fancy prompt (if support is compiled in)
+PS1="\e[1;32mbarebox@\e[1;31m\h:\w\e[0m "
-- 
1.7.3.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2011-01-07 16:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-07 16:35 [PATCH 1/7] _update_help: fix script name Eric Bénard
2011-01-07 16:35 ` [PATCH 2/7] defaultenv/bin/boot: make ubi root's name configurable Eric Bénard
2011-01-07 16:35 ` [PATCH 3/7] defaultenv/bin/update: let /env/config set default values Eric Bénard
2011-01-07 16:35 ` [PATCH 4/7] update: add bareboxenv update possibility Eric Bénard
2011-01-07 16:35 ` [PATCH 5/7] eukrea_cpuimx25: add led support Eric Bénard
2011-01-07 16:35 ` Eric Bénard [this message]
2011-01-07 16:35 ` [PATCH 7/7] eukrea_cpuimx25: update defconfig Eric Bénard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1294418133-5256-6-git-send-email-eric@eukrea.com \
    --to=eric@eukrea.com \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox