r1664 - trunk/src/host/qemu-neo1973/openmoko

andrew at sita.openmoko.org andrew at sita.openmoko.org
Thu Apr 5 23:07:48 CEST 2007


Author: andrew
Date: 2007-04-05 23:07:47 +0200 (Thu, 05 Apr 2007)
New Revision: 1664

Modified:
   trunk/src/host/qemu-neo1973/openmoko/Makefile
   trunk/src/host/qemu-neo1973/openmoko/download.sh
   trunk/src/host/qemu-neo1973/openmoko/env
   trunk/src/host/qemu-neo1973/openmoko/flash.sh
Log:
Take script compatibility-related suggestions from various people on IRC 
and wiki into account.
Correct button assignment message.
Add optional parameter to openmoko/flash.sh with search path for images.


Modified: trunk/src/host/qemu-neo1973/openmoko/Makefile
===================================================================
--- trunk/src/host/qemu-neo1973/openmoko/Makefile	2007-04-05 11:36:50 UTC (rev 1663)
+++ trunk/src/host/qemu-neo1973/openmoko/Makefile	2007-04-05 21:07:47 UTC (rev 1664)
@@ -21,6 +21,7 @@
 SPLASH=splashimg.pl
 SPLASHIMG=System_boot.png
 FLASHIMG=openmoko-flash.image
+SHELL=bash
 
 splash.gz: splash
 	gzip -c < $^ > $@
@@ -40,7 +41,7 @@
 
 $(FLASHIMG):
 	# Making an empty/erased flash image.  Need a correct echo behavior.
-	echo -en \\0377\\0377\\0377\\0377\\0377\\0377\\0377\\0377 > .8b
+	$(echo) -en \\0377\\0377\\0377\\0377\\0377\\0377\\0377\\0377 > .8b
 	cat .8b .8b > .16b # OOB is 16 bytes
 	cat .16b .16b .16b .16b .16b .16b .16b .16b > .512b
 	cat .16b .16b .16b .16b .16b .16b .16b .16b >> .512b

Modified: trunk/src/host/qemu-neo1973/openmoko/download.sh
===================================================================
--- trunk/src/host/qemu-neo1973/openmoko/download.sh	2007-04-05 11:36:50 UTC (rev 1663)
+++ trunk/src/host/qemu-neo1973/openmoko/download.sh	2007-04-05 21:07:47 UTC (rev 1664)
@@ -1,4 +1,4 @@
-#! /bin/bash
+#! /usr/bin/env bash
 # Chooses and downloads some OpenMoko image snapshots for flash.sh to use.
 #
 # Copyright (C) 2007 OpenMoko, Inc.
@@ -25,26 +25,26 @@
 cd $script_dir
 
 echo "    "Retrieving available builds list...
-files=`lynx -dump -listonly $download_dir | grep http | sed "s,[0-9 \t\.]*$download_dir\([a-zA-Z0-9_\.-]\)[ \t]*,\1,"`
+files=`lynx -dump $download_dir | grep http | sed "s,[0-9 \t\.]*$download_dir\([a-zA-Z0-9_\.-]\)[ \t]*,\1,"`
 
 most_recent () {
-	echo > .list
+	${echo} > .list
 	for name in $files; do
 		if [[ "$name" == $1 ]]; then
-			echo "$name" > .list
+			${echo} "$name" > .list
 		fi
 	done
 	export $2=`sort .list | tail -n 1`
 	rm -rf .list
-	[ -z "${!2}" ] && ( echo not found; exit -1 )
-	echo ${!2}
+	[ -z "${!2}" ] && ( ${echo} not found; exit -1 )
+	${echo} ${!2}
 }
 
-echo -n "    "Kernel is...\ 
+${echo} -n "    "Kernel is...\ 
 most_recent "$kernel_wildcard" kernel_image || exit -1
-echo -n "    "Root filesystem is...\ 
+${echo} -n "    "Root filesystem is...\ 
 most_recent "$rootfs_wildcard" rootfs_image || exit -1
-echo -n "    "U-boot is...\ 
+${echo} -n "    "U-boot is...\ 
 most_recent "$uboot_wildcard" uboot_image || exit -1
 
 sleep 2

Modified: trunk/src/host/qemu-neo1973/openmoko/env
===================================================================
--- trunk/src/host/qemu-neo1973/openmoko/env	2007-04-05 11:36:50 UTC (rev 1663)
+++ trunk/src/host/qemu-neo1973/openmoko/env	2007-04-05 21:07:47 UTC (rev 1664)
@@ -7,7 +7,11 @@
 qemu_relative="arm-softmmu/qemu-system-arm -M neo -m 130"
 qemu="$src_dir/$qemu_relative"
 flash_image=openmoko-flash.image
-make=gmake
+make=make
+which gmake && make=gmake
+echo=echo
+which gecho && echo=gecho
+export make echo
 
 kernel_addr=0x32000000
 splash_addr=0x36000000

Modified: trunk/src/host/qemu-neo1973/openmoko/flash.sh
===================================================================
--- trunk/src/host/qemu-neo1973/openmoko/flash.sh	2007-04-05 11:36:50 UTC (rev 1663)
+++ trunk/src/host/qemu-neo1973/openmoko/flash.sh	2007-04-05 21:07:47 UTC (rev 1664)
@@ -1,4 +1,4 @@
-#! /bin/bash
+#! /usr/bin/env bash
 # Generates a ready to use OpenMoko NAND flash image.  Vaguely based
 # on devirginator and http://wiki.openmoko.org/wiki/NAND_bad_blocks.
 #
@@ -23,6 +23,12 @@
 
 . openmoko/env
 
+if [[ "$1" != "" ]]; then
+	img_dir="$1"
+else
+	img_dir="$script_dir"
+fi
+
 cd $script_dir
 
 if ! which pngtopnm || ! which ppmtorgb3; then
@@ -36,7 +42,9 @@
 # Find the most recent OpenMoko images in the current directory.
 # We assume they have numeric date or some build number in their names.
 most_recent () {
-	export $2="`ls -1 $1 | sort | tail -n 1`"
+	cd $src_dir
+	export $2="`basename \`ls -d -1 $img_dir/$1 | sort | tail -n 1\``"
+	cd $script_dir
 	export $3="`python -c \"print hex(\`stat -c %s ${!2}\`)\"`"
 	[ -n "${!3}" ]
 }
@@ -78,8 +86,7 @@
 }
 
 # Set up BBT, u-boot environment, boot menu and program u-boot binary.
-uboot $uboot_image 20 "
-
+uboot $uboot_image 40 "               
 setenv dontask y
 nand createbbt
 setenv bootcmd 'setenv bootargs \${bootargs_base} \${mtdparts}; bootm $kernel_addr'
@@ -93,18 +100,15 @@
 saveenv"
 
 # Program bootsplash.
-uboot splash.gz 10 "
-
+uboot splash.gz 10 "               
 nand write.e $kernel_addr splash $splash_size"
 
 # Program the kernel binary.
-uboot $kernel_image 10 "
-
+uboot $kernel_image 10 "               
 nand write.e $kernel_addr kernel $kernel_size"
 
 # Program the root filesystem.
-uboot $rootfs_image 15 "
-
+uboot $rootfs_image 20 "               
 nand write.jffs2 $kernel_addr rootfs $rootfs_size"
 
 echo
@@ -115,5 +119,5 @@
 echo
 echo "    "Append \'-snapshot\' to make the flash image read-only so that every
 echo "    "time emulation starts in the original unmodified state.
-echo "    "[Space] for AUX button, [Enter] for POWER.
+echo "    "[Enter] for AUX button, [Space] for POWER.
 echo





More information about the commitlog mailing list