r4127 - trunk/src/host/devirginator

werner at sita.openmoko.org werner at sita.openmoko.org
Thu Feb 28 11:15:50 CET 2008


Author: werner
Date: 2008-02-28 11:15:47 +0100 (Thu, 28 Feb 2008)
New Revision: 4127

Modified:
   trunk/src/host/devirginator/environment.in
   trunk/src/host/devirginator/mknor
   trunk/src/host/devirginator/setup.sh
Log:
setup.sh: added support to passing cpp-style definitions with the option -D to
  cpp and envedit.pl
environment.in, mknor: renamed option NOR to NOR_ENV, to avoid conflict with 
  use of the word "NOR" in text



Modified: trunk/src/host/devirginator/environment.in
===================================================================
--- trunk/src/host/devirginator/environment.in	2008-02-28 09:42:58 UTC (rev 4126)
+++ trunk/src/host/devirginator/environment.in	2008-02-28 10:15:47 UTC (rev 4127)
@@ -61,7 +61,7 @@
 ##### Appearance and mode of interaction ######################################
 
 
-#ifdef NOR
+#ifdef NOR_ENV
 
 bootdelay=5
 boot_menu_timeout=60
@@ -100,7 +100,7 @@
   ext2load mmc MMC_NUM 0x32000000 /boot/${sd_image_name};
   bootm 0x32000000
 
-#ifdef NOR
+#ifdef NOR_ENV
 
 menu_3=
   Copy u-boot from NOR to NAND:

Modified: trunk/src/host/devirginator/mknor
===================================================================
--- trunk/src/host/devirginator/mknor	2008-02-28 09:42:58 UTC (rev 4126)
+++ trunk/src/host/devirginator/mknor	2008-02-28 10:15:47 UTC (rev 4127)
@@ -58,7 +58,7 @@
   ../splash/splashimg.pl -pnm - |
   gzip -9 >_splash
 
-./envedit.pl -D GTA02 -D NOR -f environment.in -o _env
+./envedit.pl -D GTA02 -D NOR_ENV -f environment.in -o _env
 
 ./blink.pl \
   /home/moko/2624/u-boot/u-boot.udfu at 0 \

Modified: trunk/src/host/devirginator/setup.sh
===================================================================
--- trunk/src/host/devirginator/setup.sh	2008-02-28 09:42:58 UTC (rev 4126)
+++ trunk/src/host/devirginator/setup.sh	2008-02-28 10:15:47 UTC (rev 4127)
@@ -95,7 +95,8 @@
 
 cppify()
 {
-    sed '/^#[a-z]/{n;};s/#.*$//' | cpp -D$U_PLATFORM -D$U_PLATFORM$U_BOARD
+    sed '/^#[a-z]/{n;};s/#.*$//' | 
+      cpp -D$U_PLATFORM -D$U_PLATFORM$U_BOARD $defines
 }
 
 
@@ -121,11 +122,12 @@
 usage()
 {
 cat <<EOF 1>&2
-usage: $0 [-c config_file] [-l] [-t] [variable=value ...]
+usage: $0 [-c config_file] [-l] [-t] [-Dvar[=value]] [variable=value ...]
 
   -c config_file  use the specified file (default: $DEFAULT_CONFIG)
   -l              use locally cached files (in tmp/), if present
   -t              make a tarball of all the downloaded and generated files
+  -D var[=value]  pass a cpp-style -D option to cpp and envedit.pl
 EOF
     exit 1
 }
@@ -134,6 +136,7 @@
 tarball=false
 local=false
 config=$DEFAULT_CONFIG
+defines=
 
 while [ ! -z "$*" ]; do
     case "$1" in
@@ -142,6 +145,10 @@
 		config=$1;;
 	-t)	tarball=true;;
 	-l)	local=true;;
+	-D)	shift
+		[ ! -z "$1" ] || usage
+		defines="$defines -D $1"
+		;;
 	*=*)	eval "$1";;
 	*)	usage;;
     esac
@@ -397,7 +404,7 @@
       "reset halt" wait_halt resume exit
     sleep 5
     ./envedit.pl $env_size_opt -i tmp/env.old -o tmp/env.new \
-       -D $U_PLATFORM -D $U_PLATFORM$U_BOARD -f tmp/environment
+       -D $U_PLATFORM -D $U_PLATFORM$U_BOARD $defines -f tmp/environment
     $DFU_UTIL $usb_id -a u-boot_env -D tmp/env.new
     ./openocdcmd.pl $OPENOCD_HOST $OPENOCD_PORT "reset run" exit
 fi





More information about the commitlog mailing list