r1227 - trunk/src/host/devirginator

werner at sita.openmoko.org werner at sita.openmoko.org
Fri Mar 2 23:53:47 CET 2007


Author: werner
Date: 2007-03-02 23:53:34 +0100 (Fri, 02 Mar 2007)
New Revision: 1227

Modified:
   trunk/src/host/devirginator/Makefile
   trunk/src/host/devirginator/openocd.in
   trunk/src/host/devirginator/setup.sh
Log:
setup.sh, Makefile: use an explicit list of files to include, not just all that
  happens to be in tmp/
Makefile, setup.sh: changed tarball directory from devirginator-... to 
  devirginate-...
Makefile: added tarball dependencies
setup.sh, openocd.in: replaced all absolute path names with relative ones



Modified: trunk/src/host/devirginator/Makefile
===================================================================
--- trunk/src/host/devirginator/Makefile	2007-03-02 21:55:50 UTC (rev 1226)
+++ trunk/src/host/devirginator/Makefile	2007-03-02 22:53:34 UTC (rev 1227)
@@ -23,7 +23,8 @@
 
 DIR=devirginator
 SCRIPTS=crc32.pl envedit.pl openocdcmd.pl scriptify.pl devirginate
-TARBALL=devirginate-$(TARBALL_VERSION).tar.gz
+TARDIR=devirginate-$(TARBALL_VERSION)
+TARBALL=$(TARDIR).tar.gz
 
 .PHONY:		tarball
 
@@ -51,12 +52,14 @@
 
 tarball:	$(TARBALL)
 
-$(TARBALL):
+$(TARBALL):	$(SCRIPTS) $(TMP_FILES)
 		@[ ! -z "$(TARBALL_VERSION)" ] || \
 		  { echo "Please set TARBALL_VERSION"; exit 1; }
-		cd .. && ln -sf $(DIR) $(DIR)-$(TARBALL_VERSION) && \
+		@[ ! -z "$(TMP_FILES)" ] || \
+		  { echo "Please set TMP_FILES"; exit 1; }
+		cd .. && ln -sf $(DIR) $(TARDIR) && \
 		  tar cfz $(DIR)/$(TARBALL) \
-		    $(SCRIPTS:%=$(DIR)-$(TARBALL_VERSION)/%) \
-		    $(DIR)-$(TARBALL_VERSION)/tmp/ || \
-		  { rm -f $(DIR)-$(TARBALL_VERSION); exit 1; }
-		rm -f $(DIR)-$(TARBALL_VERSION)
+		    $(SCRIPTS:%=$(TARDIR)/%) \
+		    $(TMP_FILES:%=$(TARDIR)/%) || \
+		  { rm -f $(TARDIR); exit 1; }
+		rm -f $(TARDIR)

Modified: trunk/src/host/devirginator/openocd.in
===================================================================
--- trunk/src/host/devirginator/openocd.in	2007-03-02 21:55:50 UTC (rev 1226)
+++ trunk/src/host/devirginator/openocd.in	2007-03-02 22:53:34 UTC (rev 1227)
@@ -34,9 +34,9 @@
 
 # load u-boot, the initial command, the command script, and the smiley
 load_binary $UBOOT 0x32000000
-load_binary $PWD/tmp/preboot_override 0x32100000
-load_binary $PWD/tmp/u-boot.out 0x32200000
-load_binary $PWD/tmp/smiley.gz 0x32300000
+load_binary tmp/preboot_override 0x32100000
+load_binary tmp/u-boot.out 0x32200000
+load_binary tmp/smiley.gz 0x32300000
 
 # enable the initial command
 mww 0x32000040 0x32100000

Modified: trunk/src/host/devirginator/setup.sh
===================================================================
--- trunk/src/host/devirginator/setup.sh	2007-03-02 21:55:50 UTC (rev 1226)
+++ trunk/src/host/devirginator/setup.sh	2007-03-02 22:53:34 UTC (rev 1227)
@@ -35,6 +35,7 @@
 	    base="`basename \"$2\"`"
 	    cp "$2" "tmp/$base"
 	    eval $1=\"tmp/$base\"
+	    add_file "tmp/$base"
 	fi
 	return
     fi
@@ -57,12 +58,9 @@
     base="`basename \"$n\"`"
     cd tmp
     wget -N "$n" || { rm -f $base; exit 1; }
-    if $tarball; then
-	eval $1=\"tmp/$base\"
-    else
-	eval $1=\"$PWD/$base\"
-    fi
+    eval $1=\"tmp/$base\"
     cd ..
+    add_file "tmp/$base"
 }
 
 
@@ -74,6 +72,13 @@
 }
 
 
+add_file()
+{
+    [ -f "$1" ] || { echo "$1: not found" 2>&1; exit 1; }
+    tmp_files="$1 $tmp_files"
+}
+
+
 # --- Configuration defaults --------------------------------------------------
 
 
@@ -230,6 +235,7 @@
        eval "echo $l"
     done
 } <openocd.in >tmp/script.ocd
+add_file tmp/script.ocd
 
 
 # --- Stage 1: First u-boot command(s) ----------------------------------------
@@ -239,18 +245,20 @@
   >tmp/preboot_override.scrub
 setenv scrub true; autoscr 0x32200000!
 EOF
+add_file tmp/preboot_override.scrub
 
-
 sed 's/#.*//;/^ *$/d' <<EOF | tr '\n' ';' | tr '!' '\000' \
   >tmp/preboot_override.noscrub
 autoscr 0x32200000!
 EOF
+add_file tmp/preboot_override.noscrub
 
 
 # --- Stage 1: u-boot script --------------------------------------------------
 
 
 perl ./scriptify.pl u-boot.in >tmp/u-boot.out
+add_file tmp/u-boot.out
 
 
 # --- Stage 1: smiley splash screen -------------------------------------------
@@ -260,18 +268,21 @@
 make smiley.gz
 mv smiley.gz tmp/
 rm -f smiley.png smiley.ppm
+add_file tmp/smiley.gz
 
 
 # --- Stage 2: the default environment ----------------------------------------
 
 
 cp environment.in tmp/environment
+add_file tmp/environment
 
 
 # --- Stage 2: official splash screen -----------------------------------------
 
 
 ../splash/splashimg.pl "$SPLASH" | gzip -9 >tmp/splash.gz
+add_file tmp/splash.gz
 
 
 # --- "devirginate" shell script ----------------------------------------------
@@ -327,7 +338,7 @@
 	ln -sf preboot_override.noscrub tmp/preboot_override
     fi
     ./openocdcmd.pl $OPENOCD_HOST $OPENOCD_PORT \
-      "script $PWD/tmp/script.ocd" exit
+      "script tmp/script.ocd" exit
 fi
 
 if \$stage2; then
@@ -354,7 +365,7 @@
 
 
 if $tarball; then
-    make tarball TARBALL_VERSION="$TARBALL_VERSION"
+    make tarball TARBALL_VERSION="$TARBALL_VERSION" TMP_FILES="$tmp_files"
 cat <<EOF
 -------------------------------------------------------------------------------
 
@@ -364,7 +375,7 @@
 
 - copy the file devirginate-${TARBALL_VERSION}.tar.gz to the new machine
 - tar xfz devirginate-${TARBALL_VERSION}.tar.gz
-- cd devirginator-${TARBALL_VERSION}
+- cd devirginate-${TARBALL_VERSION}
 
 To set up a device,
 





More information about the commitlog mailing list