mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 11/11] pca100: use generic default env
Date: Mon, 14 Jun 2010 11:48:41 +0200	[thread overview]
Message-ID: <1276508921-3264-12-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1276508921-3264-1-git-send-email-s.hauer@pengutronix.de>

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/configs/pca100_defconfig          |    2 +-
 board/phycard-i.MX27/env/bin/_update       |   36 -----------------
 board/phycard-i.MX27/env/bin/boot          |   40 -------------------
 board/phycard-i.MX27/env/bin/hush_hack     |    1 -
 board/phycard-i.MX27/env/bin/init          |   37 ------------------
 board/phycard-i.MX27/env/bin/update_kernel |   15 -------
 board/phycard-i.MX27/env/bin/update_root   |   16 --------
 board/phycard-i.MX27/env/config            |   57 +++++++++++++++++++++-------
 8 files changed, 44 insertions(+), 160 deletions(-)
 delete mode 100644 board/phycard-i.MX27/env/bin/_update
 delete mode 100644 board/phycard-i.MX27/env/bin/boot
 delete mode 100644 board/phycard-i.MX27/env/bin/hush_hack
 delete mode 100644 board/phycard-i.MX27/env/bin/init
 delete mode 100644 board/phycard-i.MX27/env/bin/update_kernel
 delete mode 100644 board/phycard-i.MX27/env/bin/update_root

diff --git a/arch/arm/configs/pca100_defconfig b/arch/arm/configs/pca100_defconfig
index f0a9512..52a5d93 100644
--- a/arch/arm/configs/pca100_defconfig
+++ b/arch/arm/configs/pca100_defconfig
@@ -110,7 +110,7 @@ CONFIG_CONSOLE_ACTIVATE_FIRST=y
 # CONFIG_OF_FLAT_TREE is not set
 CONFIG_PARTITION=y
 CONFIG_DEFAULT_ENVIRONMENT=y
-CONFIG_DEFAULT_ENVIRONMENT_PATH="board/phycard-i.MX27/env/"
+CONFIG_DEFAULT_ENVIRONMENT_PATH="defaultenv board/phycard-i.MX27/env"
 
 #
 # Debugging
diff --git a/board/phycard-i.MX27/env/bin/_update b/board/phycard-i.MX27/env/bin/_update
deleted file mode 100644
index 014bce3..0000000
--- a/board/phycard-i.MX27/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/board/phycard-i.MX27/env/bin/boot b/board/phycard-i.MX27/env/bin/boot
deleted file mode 100644
index 56a0377..0000000
--- a/board/phycard-i.MX27/env/bin/boot
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/bin/sh
-
-. /env/config
-
-if [ x$1 = xnand ]; then
-	root=nand
-	kernel=nand
-fi
-
-if [ x$1 = xnet ]; then
-	root=net
-	kernel=net
-fi
-
-if [ x$ip = xdhcp ]; then
-	bootargs="$bootargs ip=dhcp"
-else
-	bootargs="$bootargs ip=$eth0.ipaddr:$eth0.serverip:$eth0.gateway:$eth0.netmask:::"
-fi
-
-if [ x$root = xnand ]; then
-	bootargs="$bootargs root=$rootpart_nand rootfstype=jffs2"
-else
-	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
-elif [ $kernel = nor ]; then
-	bootm /dev/nor0.kernel
-else
-	bootm /dev/nand0.kernel.bb
-fi
-
diff --git a/board/phycard-i.MX27/env/bin/hush_hack b/board/phycard-i.MX27/env/bin/hush_hack
deleted file mode 100644
index 5fffa92..0000000
--- a/board/phycard-i.MX27/env/bin/hush_hack
+++ /dev/null
@@ -1 +0,0 @@
-nand -a /dev/nand0.*
diff --git a/board/phycard-i.MX27/env/bin/init b/board/phycard-i.MX27/env/bin/init
deleted file mode 100644
index 3bfd194..0000000
--- a/board/phycard-i.MX27/env/bin/init
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/bin/sh
-
-PATH=/env/bin
-export PATH
-
-. /env/config
-if [ -e /dev/nor0 ]; then
-	addpart /dev/nor0 $nor_parts
-fi
-
-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 [ -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"
-fi
-
-echo
-echo -n "Hit any key to stop autoboot: "
-timeout -a $autoboot_timeout
-if [ $? != 0 ]; then
-	echo
-	echo "type update_kernel nand|nor [<imagename>] to update kernel into flash"
-	echo "type update_root nand|nor [<imagename>] to update rootfs into flash"
-	echo
-	exit
-fi
-
-boot
diff --git a/board/phycard-i.MX27/env/bin/update_kernel b/board/phycard-i.MX27/env/bin/update_kernel
deleted file mode 100644
index 05c822d..0000000
--- a/board/phycard-i.MX27/env/bin/update_kernel
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/sh
-
-. /env/config
-
-image=$uimage
-if [ x$1 = xnand ]; then
-	part=/dev/nand0.kernel.bb
-elif [ x$1 = xnor ]; then
-	part=/dev/nor0.kernel
-else
-	echo "usage: $0 nor|nand [imagename]"
-	exit 1
-fi
-
-. /env/bin/_update $2
diff --git a/board/phycard-i.MX27/env/bin/update_root b/board/phycard-i.MX27/env/bin/update_root
deleted file mode 100644
index eaf36eb..0000000
--- a/board/phycard-i.MX27/env/bin/update_root
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh
-
-. /env/config
-
-image=$uimage
-if [ x$1 = xnand ]; then
-	part=/dev/nand0.root.bb
-elif [ x$1 = xnor ]; then
-	part=/dev/nor0.root
-else
-	echo "usage: $0 nor|nand [imagename]"
-	exit 1
-fi
-
-. /env/bin/_update $2
-
diff --git a/board/phycard-i.MX27/env/config b/board/phycard-i.MX27/env/config
index 6a93580..d0670de 100644
--- a/board/phycard-i.MX27/env/config
+++ b/board/phycard-i.MX27/env/config
@@ -1,21 +1,11 @@
 #!/bin/sh
 
-# can be either 'net', 'nor' or 'nand''
-kernel=net
-root=net
-
-uimage=uImage-pca100
-jffs2=root-pca100.jffs2
-
-autoboot_timeout=3
-
-nfsroot="/tmp/root"
-bootargs="console=ttymxc0,115200"
-
-nand_parts="256k(barebox)ro,128k(bareboxenv),1536k(kernel),-(root)"
-rootpart_nand="/dev/mtdblock3"
+machine=pca100
+eth0.serverip=
+user=
 
 # use 'dhcp' to do dhcp in barebox and in kernel
+# use 'none' if you want to skip kernel ip autoconfiguration
 ip=dhcp
 
 # or set your networking parameters here
@@ -23,3 +13,42 @@ ip=dhcp
 #eth0.netmask=a.b.c.d
 #eth0.gateway=a.b.c.d
 #eth0.serverip=a.b.c.d
+
+# can be either 'net', 'nor' or 'nand'
+kernel_loc=net
+# can be either 'net', 'nor', 'nand' or 'initrd'
+rootfs_loc=net
+
+# can be either 'jffs2' or 'ubifs'
+rootfs_type=ubifs
+rootfsimage=root-$machine.$rootfs_type
+
+# The image type of the kernel. Can be uimage, zimage, raw, or raw_lzo
+kernelimage_type=zimage
+kernelimage=zImage-$machine
+#kernelimage_type=uimage
+#kernelimage=uImage-$machine
+#kernelimage_type=raw
+#kernelimage=Image-$machine
+#kernelimage_type=raw_lzo
+#kernelimage=Image-$machine.lzo
+
+if [ -n $user ]; then
+	kernelimage="$user"-"$kernelimage"
+	nfsroot="$eth0.serverip:/home/$user/nfsroot/$machine"
+	rootfsimage="$user"-"$rootfsimage"
+else
+	nfsroot="$eth0.serverip:/path/to/nfs/root"
+fi
+
+autoboot_timeout=3
+
+bootargs="console=ttymxc0,115200"
+
+nand_parts="256k(barebox)ro,128k(bareboxenv),2M(kernel),-(root)"
+rootfs_mtdblock_nand=7
+
+# set a fancy prompt (if support is compiled in)
+PS1="\e[1;32mbarebox@\e[1;31m\h:\w\e[0m "
+
+
-- 
1.7.1


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

      parent reply	other threads:[~2010-06-14  9:48 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-14  9:48 More patches Sascha Hauer
2010-06-14  9:48 ` [PATCH 01/11] pcm037: Add MMU support Sascha Hauer
2010-06-14  9:48 ` [PATCH 02/11] bootu: Allow passing in devices as parameter Sascha Hauer
2010-06-14  9:48 ` [PATCH 03/11] Allow to merge default environment from more than one directory Sascha Hauer
2010-06-14  9:48 ` [PATCH 04/11] include support for a simple pseudo number generator Sascha Hauer
2010-06-15  9:39   ` Peter Korsgaard
2010-06-15 11:54     ` Sascha Hauer
2010-06-17 13:17   ` Sascha Hauer
2010-06-17 13:26     ` Andy Pont
2010-06-17 14:14     ` Peter Korsgaard
2010-06-14  9:48 ` [PATCH 05/11] net: implement random_ether_addr Sascha Hauer
2010-06-14  9:48 ` [PATCH 06/11] net: use a random mac address if the current device does not have one Sascha Hauer
2010-06-14  9:48 ` [PATCH 07/11] add a generic default environment Sascha Hauer
2010-06-15  9:13   ` Uwe Kleine-König
2010-06-17 13:20   ` Sascha Hauer
2010-06-19 20:14     ` Uwe Kleine-König
2010-06-14  9:48 ` [PATCH 08/11] pcm038: use generic default env Sascha Hauer
2010-06-14  9:48 ` [PATCH 09/11] pcm043: " Sascha Hauer
2010-06-14  9:48 ` [PATCH 10/11] pcm037: " Sascha Hauer
2010-06-14  9:48 ` Sascha Hauer [this message]

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=1276508921-3264-12-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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