[aadk-commits] dbailey: uClinux/trunk r366 - /uClinux/trunk/uClinux-dist/vendors/Digium/S800...

aadk-commits at lists.digium.com aadk-commits at lists.digium.com
Sat Apr 21 14:12:30 MST 2007


Author: dbailey
Date: Sat Apr 21 16:12:29 2007
New Revision: 366

URL: http://svn.digium.com/view/aadk?view=rev&rev=366
Log:
Flashupdate now checks for MD5 checksum append to the end of the image
create-sounds path spec has been corrected

Modified:
    uClinux/trunk/uClinux-dist/vendors/Digium/S800I/scripts/create_sounds
    uClinux/trunk/uClinux-dist/vendors/Digium/S800I/scripts/flashupdate

Modified: uClinux/trunk/uClinux-dist/vendors/Digium/S800I/scripts/create_sounds
URL: http://svn.digium.com/view/aadk/uClinux/trunk/uClinux-dist/vendors/Digium/S800I/scripts/create_sounds?view=diff&rev=366&r1=365&r2=366
==============================================================================
--- uClinux/trunk/uClinux-dist/vendors/Digium/S800I/scripts/create_sounds (original)
+++ uClinux/trunk/uClinux-dist/vendors/Digium/S800I/scripts/create_sounds Sat Apr 21 16:12:29 2007
@@ -1,6 +1,6 @@
 #!/bin/sh
-SOUNDS_CORE_VERSION=current
-SOUNDS_EXTRA_VERSION=current
+SOUNDS_CORE_VERSION=1.4.6 
+SOUNDS_EXTRA_VERSION=1.4.5
 SOUNDS_LANGUAGE=en
 SOUNDS_FORMAT=ulaw
 if mount | grep -q var/lib/asterisk/sounds; then
@@ -18,7 +18,7 @@
 wget ftp://ftp.digium.com/pub/telephony/sounds/releases/asterisk-extra-sounds-${SOUNDS_LANGUAGE}-${SOUNDS_FORMAT}-${SOUNDS_EXTRA_VERSION}.tar.gz -O - | gzip -dc | tar xvf -
 mkdir moh
 cd moh
-wget ftp://ftp.digium.com/pub/telephony/sounds/releases/asterisk-moh-freeplay-${SOUNDS_FORMAT}.tar.gz -O - | gzip -dc | tar xvf -
+wget ftp://ftp.digium.com/pub/telephony/sounds/asterisk-moh-freeplay-${SOUNDS_FORMAT}.tar.gz -O - | gzip -dc | tar xvf -
 
 sync; sync; sync
 

Modified: uClinux/trunk/uClinux-dist/vendors/Digium/S800I/scripts/flashupdate
URL: http://svn.digium.com/view/aadk/uClinux/trunk/uClinux-dist/vendors/Digium/S800I/scripts/flashupdate?view=diff&rev=366&r1=365&r2=366
==============================================================================
--- uClinux/trunk/uClinux-dist/vendors/Digium/S800I/scripts/flashupdate (original)
+++ uClinux/trunk/uClinux-dist/vendors/Digium/S800I/scripts/flashupdate Sat Apr 21 16:12:29 2007
@@ -18,6 +18,9 @@
 PID=$$
 SAVEDFILENAME=/tmp/image-${PID}.bin
 NVRAMFILENAME=/tmp/nvram-${PID}.txt
+MD5FILENAME=/tmp/image-${PID}.MD5
+IMAGEFILENAME=/tmp/image-${PID}.img
+
 if [ "$1" = "" ]; then
 	echo "Usage: ${SCRIPTNAME} <imageURL>"
 	echo "       OR ${SCRIPTNAME} tftp <hostname> [<filename>]"
@@ -74,34 +77,54 @@
 fi
 
 # Commit the image to FLASH 
+
+#Check MD5 checksum to verify the image 
+echo "Verifying the MD5 checksum..."
 FILESIZE=`ls -l ${SAVEDFILENAME} | cut -c 30-42 | xargs basename`
-echo "Downloaded firmware ${SAVEDFILENAME} is size ${FILESIZE}"
+NUMBLOCKS=`expr $FILESIZE / 32`
+NUMBLOCKS=`expr $NUMBLOCKS - 1 `
+dd if=${SAVEDFILENAME} of=${MD5FILENAME} bs=32 skip=${NUMBLOCKS}
+dd if=${SAVEDFILENAME} of=${IMAGEFILENAME} bs=32 count=${NUMBLOCKS}
 
+TEST=`md5sum ${IMAGEFILENAME} | cut -c 1-32`
+GOLD=`cat ${MD5FILENAME}`
+
+if [ $TEST = $GOLD  ]; then
+	FILESIZE=`ls -l ${IMAGEFILENAME} | cut -c 30-42 | xargs basename`
+	
+	echo "Downloaded firmware ${SAVEDFILENAME} program size is ${FILESIZE}"
 # Save a copy of the environment
-nvram dump ${NVRAMFILENAME}
+	nvram dump ${NVRAMFILENAME}
+	
+	echo "Writing firmware to FLASH -- DO NOT REBOOT!!!!..."
+	dd bs=65536 if=${IMAGEFILENAME} of=${MTDPART} conv=sync 2>/dev/null
+	echo -n "Verifying FLASH..."
+	if cmp ${IMAGEFILENAME} ${MTDPART} 2>&1 | grep -q -i EOF; then
+		echo "PASSED"
+	else
+		echo "FAILED"
+		cmp ${IMAGEFILENAME} ${MTDPART}
+	fi
+	rm -f ${SAVEDFILENAME}
+	rm -f ${IMAGEFILENAME}
+	rm -f ${MD5FILENAME}
+	echo "Finished writing firmware to FLASH..."
+	echo "Updating environment..."
+	case ${SCRIPTNAME} in
+		"flashupdate" )
+# Place the size of image into u-boot environment so it knows # bytes to load 
+			cat ${NVRAMFILENAME} | grep -v "readsize=" > ${NVRAMFILENAME}.new
+			printf "readsize=%x\\n" ${FILESIZE} >> ${NVRAMFILENAME}.new
+			mv ${NVRAMFILENAME}.new ${NVRAMFILENAME}
+			;;
+		* )
+# Don't need to do anything special for the rest.
+			;;
+	esac
+	nvram store ${NVRAMFILENAME}
+	rm -f ${NVRAMFILENAME}
+else
+	echo "MD5 checksum did not verify! FLASH programming aborted"
+fi
 
-echo "Writing firmware to FLASH -- DO NOT REBOOT!!!!..."
-dd bs=65536 if=${SAVEDFILENAME} of=${MTDPART} conv=sync 2>/dev/null
-echo -n "Verifying FLASH..."
-if cmp ${SAVEDFILENAME} ${MTDPART} 2>&1 | grep -q -i EOF; then
-	echo "PASSED"
-else
-	echo "FAILED"
-	cmp ${SAVEDFILENAME} ${MTDPART}
-fi
-rm -f ${SAVEDFILENAME}
-echo "Finished writing firmware to FLASH..."
-echo "Updating environment..."
-case ${SCRIPTNAME} in
-	"flashupdate" )
-		# Place the size of image into u-boot environment so it knows # bytes to load 
-		cat ${NVRAMFILENAME} | grep -v "readsize=" > ${NVRAMFILENAME}.new
-		printf "readsize=%x\\n" ${FILESIZE} >> ${NVRAMFILENAME}.new
-		mv ${NVRAMFILENAME}.new ${NVRAMFILENAME}
-		;;
-	* )
-		# Don't need to do anything special for the rest.
-		;;
-esac
-nvram store ${NVRAMFILENAME}
-rm -f ${NVRAMFILENAME}
+sync



More information about the aadk-commits mailing list