[PATCH 07/11] add a generic default environment

Uwe Kleine-König u.kleine-koenig at pengutronix.de
Sat Jun 19 16:14:51 EDT 2010


Hello Sascha,

On Thu, Jun 17, 2010 at 03:20:59PM +0200, Sascha Hauer wrote:
> diff --git a/defaultenv/bin/boot b/defaultenv/bin/boot
> new file mode 100644
> index 0000000..6a508fb
> --- /dev/null
> +++ b/defaultenv/bin/boot
> @@ -0,0 +1,109 @@
> +#!/bin/sh
> +
> +. /env/config
> +
> +if [ x$1 = xnand ]; then
> +	rootfs_loc=nand
> +	kernel_loc=nand
> +elif [ x$1 = xnor ]; then
> +	rootfs_loc=nor
> +	kernel_loc=nor
> +elif [ x$1 = xnet ]; then
> +	rootfs_loc=net
> +	kernel_loc=net
> +fi
I'm not sure if barebox supports the case statement.  Even if not you
can simplify that to

	if [ "x$1" = "xnand" ] || [ "x$1" = "xnor" ] || [ "x$1" = "xnet" ]; then
		rootfs_loc="$1";
		kernel_loc="$1";
	fi

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |



More information about the barebox mailing list