pari: branch aadk r668 - /branches/aadk/scripts/applyuimage
asterisk-gui-commits at lists.digium.com
asterisk-gui-commits at lists.digium.com
Mon Apr 16 08:22:28 MST 2007
Author: pari
Date: Mon Apr 16 10:22:28 2007
New Revision: 668
URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=668
Log:
appllyimage script (to be called after the uimage is uploaded from the GUI)
Added:
branches/aadk/scripts/applyuimage
Added: branches/aadk/scripts/applyuimage
URL: http://svn.digium.com/view/asterisk-gui/branches/aadk/scripts/applyuimage?view=auto&rev=668
==============================================================================
--- branches/aadk/scripts/applyuimage (added)
+++ branches/aadk/scripts/applyuimage Mon Apr 16 10:22:28 2007
@@ -1,0 +1,27 @@
+#!/bin/sh
+PID=$$
+#Commit the image to FLASH
+FILESIZE=`ls -l $1 | cut -c 30-42 | xargs basename`
+echo "Firmware $1 is size ${FILESIZE}"
+# echo "Stopping Asterisk..."
+# asterisk -rx "stop now"
+# echo "Unloading driver..."
+# rmmod sx00i
+echo "Writing firmware to FLASH -- DO NOT REBOOT!!!!..."
+dd bs=65536 if=$1 of=/dev/mtd3 conv=sync 2>/dev/null
+echo -n "Verifying FLASH..."
+if cmp $1 /dev/mtd3 2>&1 | grep -q -i EOF; then
+ echo "PASSED"
+else
+ echo "FAILED"
+ cmp $1 /dev/mtd3
+fi
+echo "Finished writing firmware to FLASH -- Updating NVRAM..."
+rm -f $1
+# Place the size of image into u-boot environment so it knows # bytes to load
+nvram dump /tmp/nvram-${PID}.txt
+cat /tmp/nvram-${PID}.txt | grep -v "readsize=" > /tmp/nvram-${PID}.new
+printf "readsize=%x\\n" ${FILESIZE} >> /tmp/nvram-${PID}.new
+nvram store /tmp/nvram-${PID}.new
+rm -f /tmp/nvram-${PID}.new
+rm -f /tmp/nvram-${PID}.txt
More information about the asterisk-gui-commits
mailing list