matrix utility apps: initial version
authorHao Zhang <hzhang@ti.com>
Thu, 25 Apr 2013 14:26:04 +0000 (10:26 -0400)
committerHao Zhang <hzhang@ti.com>
Thu, 25 Apr 2013 14:26:04 +0000 (10:26 -0400)
29 files changed:
LICENSE [new file with mode: 0644]
images/utilities-c66x.png [new file with mode: 0644]
images/utilities-icon.png [new file with mode: 0644]
utilities_submenu/utilities.desktop [new file with mode: 0644]
utility_eeprom/cgi-bin/eepromread.cgi [new file with mode: 0755]
utility_eeprom/cgi-bin/eepromwrite.cgi [new file with mode: 0755]
utility_eeprom/desc_utility_i2c.html [new file with mode: 0644]
utility_eeprom/i2c.html [new file with mode: 0644]
utility_eeprom/utility_i2c.desktop [new file with mode: 0644]
utility_eeprom/utility_i2c.sh [new file with mode: 0755]
utility_filesystem/cgi-bin/filesystemwrite.cgi [new file with mode: 0755]
utility_filesystem/desc_utility_filesystem.html [new file with mode: 0644]
utility_filesystem/filesystem.html [new file with mode: 0644]
utility_filesystem/utility_filesystem.desktop [new file with mode: 0644]
utility_filesystem/utility_filesystem.sh [new file with mode: 0755]
utility_flash/cgi-bin/flashread.cgi [new file with mode: 0755]
utility_flash/cgi-bin/flashwrite.cgi [new file with mode: 0755]
utility_flash/desc_utility_flash.html [new file with mode: 0644]
utility_flash/flash.html [new file with mode: 0644]
utility_flash/utility_flash.desktop [new file with mode: 0644]
utility_flash/utility_flash.sh [new file with mode: 0755]
utility_info/cgi-bin/info.cgi [new file with mode: 0755]
utility_info/desc_utility_info.html [new file with mode: 0644]
utility_info/utility_info.desktop [new file with mode: 0644]
utility_info/utility_info.sh [new file with mode: 0755]
utility_stats/cgi-bin/stats.cgi [new file with mode: 0755]
utility_stats/desc_utility_stats.html [new file with mode: 0644]
utility_stats/utility_stats.desktop [new file with mode: 0644]
utility_stats/utility_stats.sh [new file with mode: 0755]

diff --git a/LICENSE b/LICENSE
new file mode 100644 (file)
index 0000000..8744300
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,12 @@
+Document License
+
+This work is licensed under the Creative Commons Attribution-Share Alike 3.0
+United States License (CC BY-SA 3.0). To view a copy of this license, visit
+http://creativecommons.org/licenses/by-sa/3.0/us/  or send a letter to
+Creative Commons
+171 Second Street, Suite 300
+San Francisco, California, 94105, USA.
+Contributors to this document
+
+Copyright (C) 2011,2012 Texas Instruments Incorporated - http://www.ti.com/
diff --git a/images/utilities-c66x.png b/images/utilities-c66x.png
new file mode 100644 (file)
index 0000000..56f45d6
Binary files /dev/null and b/images/utilities-c66x.png differ
diff --git a/images/utilities-icon.png b/images/utilities-icon.png
new file mode 100644 (file)
index 0000000..0dbb0c2
Binary files /dev/null and b/images/utilities-icon.png differ
diff --git a/utilities_submenu/utilities.desktop b/utilities_submenu/utilities.desktop
new file mode 100644 (file)
index 0000000..ec8b566
--- /dev/null
@@ -0,0 +1,7 @@
+#!/usr/bin/env xdg-open
+[Desktop Entry]
+Name=Utilities
+GenericName=Utilities
+Icon=/usr/share/matrix-gui-2.0/apps/images/utilities-icon.png
+Type=Directory
+X-MATRIX-CategoryTarget=utilities
diff --git a/utility_eeprom/cgi-bin/eepromread.cgi b/utility_eeprom/cgi-bin/eepromread.cgi
new file mode 100755 (executable)
index 0000000..a9ccef8
--- /dev/null
@@ -0,0 +1,89 @@
+#!/bin/sh
+echo Content-type: text/html
+echo 
+echo 
+
+display_footer()
+{
+cat << EOM2
+<div style='clear: both;'>&nbsp;</div>
+</div>
+<div id='footer'><p id='legal'>( c ) 2013 Texas Instruments Incorporated&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p></div>
+</body>
+</html>
+EOM2
+}
+
+cat << EOM
+<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 'http://www.w3.org/TR/html4/loose.dtd'> <html xmlns='http://www.w3.org/1999/xhtml'>
+<head><meta http-equiv='Pragma' CONTENT='no-cache' /> <meta http-equiv='content-type' content='text/html; charset=utf-8' /> <title>C6x Linux Web Control Panel</title>
+</head>
+<body>
+<div id='wrapper'>
+<div id='logo'><h1>EEPROM Read</h1></div>
+<div id='header'>
+<div id='menu'>
+</div>
+</div>
+</div>
+<div id='page'>
+EOM
+TMPFILE=`mktemp`
+cat > $TMPFILE
+
+get_params()
+{
+busAddr=$(cat $TMPFILE | sed -n '4p' | sed 's/.$//')
+eepromdev=$(find /sys -name eeprom)
+readSz=65536
+echo $busAddr
+echo $eepromdev
+
+TMPFILE_DATA="../i2c_"$busAddr".bin"
+if [ "$busAddr" = "0x51" ] ; then
+devOffset=$readSz
+else
+devOffset=0
+fi
+echo $devOffset
+
+
+}
+
+check_params()
+{
+echo
+}
+
+#Read EEPROM 
+read_eeprom()
+{
+cat << EOM1
+<div id='content'>
+<p>Reading <i>$readSz</i> bytes from EEPROM Bus Address <i>$busAddr</i> ...</p>
+</div>
+EOM1
+dd of=$TMPFILE_DATA if=$eepromdev bs=1 count=$readSz skip=$devOffset 2> /dev/null
+sync
+}
+
+#Allow User to download the file
+file_download()
+{
+cat << EOM1
+<div id='content'>
+<input type="button" name="Button" value="Save EEPROM data" onClick="window.open('$TMPFILE_DATA', 'download'); return false;">
+</div>
+EOM1
+}
+
+get_params
+check_params
+read_eeprom
+file_download
+
+display_footer
+rm -f $TMPFILE
+rm -f $TMPFILE_DATA
+
+
diff --git a/utility_eeprom/cgi-bin/eepromwrite.cgi b/utility_eeprom/cgi-bin/eepromwrite.cgi
new file mode 100755 (executable)
index 0000000..caabb53
--- /dev/null
@@ -0,0 +1,99 @@
+#!/bin/sh
+echo Content-type: text/html
+echo 
+echo 
+
+display_footer()
+{
+cat << EOM2
+<div style='clear: both;'>&nbsp;</div>
+</div>
+<div id='footer'><p id='legal'>( c ) 2013 Texas Instruments Incorporated&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p></div>
+</body>
+</html>
+EOM2
+}
+
+cat << EOM
+<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 'http://www.w3.org/TR/html4/loose.dtd'> <html xmlns='http://www.w3.org/1999/xhtml'>
+<head><meta http-equiv='Pragma' CONTENT='no-cache' /> <meta http-equiv='content-type' content='text/html; charset=utf-8' /> <title>C6x Linux Web Control Panel</title>
+</head>
+<body>
+<div id='wrapper'>
+<div id='logo'><h1>EEPROM Write</h1></div>
+<div id='header'>
+<div id='menu'>
+</div>
+</div>
+</div>
+<div id='page'>
+EOM
+TMPFILE=`mktemp`
+cat > $TMPFILE
+get_params()
+{
+busAddr=$(cat $TMPFILE | sed -n '4p' | sed 's/.$//')
+eepromdev=$(find /sys -name eeprom)
+soffset=$(head -8 $TMPFILE | wc -c)
+eoffset=$(tail -1 $TMPFILE | wc -c)
+fsize=$(cat $TMPFILE | wc -c)
+osize=$(((($fsize-$eoffset)-$soffset)-2))
+eepromSz=65536
+if [ "$busAddr" = "0x51" ] ; then
+devOffset=$eepromSz
+else
+devOffset=0
+fi
+}
+
+# write eeprom
+write_eeprom()
+{
+wOffset=$devOffset
+cat << EOM1
+<div id='content'>
+<p>Writing EEPROM <i>$osize</i> bytes to <i>$eepromdev</i> ...</p>
+<p>This step would take few minutes ...</p>
+</div>
+EOM1
+dd if=$TMPFILE of=$eepromdev bs=1 count=$osize seek=$wOffset skip=$soffset 2> /dev/null
+sync
+rm -f $TMPFILE
+}
+
+check_params()
+{
+if [ $osize -eq 0 ] ; then
+cat << EOM1
+<div id='content'>
+<p>Bad Input file ...</p>
+</div>
+EOM1
+display_footer
+rm -f $TMPFILE
+exit
+fi
+if [ $osize -gt $eepromSz ] ; then
+cat << EOM1
+<div id='content'>
+<p>Input file Size greater than <i>$eepromSz</i> bytes ...</p>
+</div>
+EOM1
+display_footer
+rm -f $TMPFILE
+exit
+fi
+}
+
+get_params
+check_params
+write_eeprom
+
+cat << EOM2
+<div id='content'>
+<p>EEPROM programming complete</p>
+</div>
+EOM2
+
+display_footer
+
diff --git a/utility_eeprom/desc_utility_i2c.html b/utility_eeprom/desc_utility_i2c.html
new file mode 100644 (file)
index 0000000..ff3b9ff
--- /dev/null
@@ -0,0 +1,5 @@
+<h1> Utility application for EEPROM program/access demo </h1>
+
+<p> This demo will provide user interface to program/access the EEPROM.</p>
+
+
diff --git a/utility_eeprom/i2c.html b/utility_eeprom/i2c.html
new file mode 100644 (file)
index 0000000..e0ada92
--- /dev/null
@@ -0,0 +1,140 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<!--
+/*
+ * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions
+ *  are met:
+ *
+ *    Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ *    Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the
+ *    distribution.
+ *
+ *    Neither the name of Texas Instruments Incorporated nor the names of
+ *    its contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8" />
+<title>Keystone II Utility Applications</title>
+<SCRIPT TYPE="text/javascript">
+       function openpopup(url)
+       {
+           location.href=url;
+       }
+       function submitForm1()
+       {
+               if(document.pressed == 'Write EEPROM')
+               {
+                       document.iblUpgrade.action ="apps/utility_eeprom/cgi-bin/eepromwrite.cgi";
+               }
+               return true;
+       }
+
+       function submitForm2()
+       {
+               if(document.pressed == 'Read EEPROM')
+               {
+                       document.eepromRead.action ="apps/utility_eeprom/cgi-bin/eepromread.cgi";
+               }
+               return true;
+       }
+
+</SCRIPT>
+</head>
+<body>
+<div id="wrapper">
+       <div id="logo">
+               <h1>EEPROM Utility</h1>
+       </div>
+       <div id="header">
+               <div id="menu">
+               </div>
+       </div>
+</div>
+
+<div id="page">
+       <div id="content">
+               <hr>
+               <table cellpadding="6">
+                       <tr><td valign="center">
+                       <image src="apps/images/utilities-c66x.png">
+                       </td><td width="100%" align="justify">
+                       <h2>Program the EEPROM on the Platform</h2>
+                       <br>
+                       <p class="Description"><b>Description:</b> This page allows the user to read/write the I2C EEPROM. While programming IBL there is an option to restore the existing IBL configuration after the upgrade.</p>
+                       </td></tr>
+               </table>
+               <hr>
+               <br>
+               <div id="eepromwrite" style="width: 90%; margin-left: 25px; padding: 2px; border: 1px gray solid;">
+                       <form name="iblUpgrade" onsubmit="return submitForm1();" enctype="multipart/form-data" method="post">
+                       <table border="0" cellpadding="5" id="eepromwritetable" width="100%">
+                               <caption> <b> I2C EEPROM Write </b> </caption>
+                               <tr>
+                               <td width="30%" align="left">I2C Bus Address</td>
+                               <td align="left" width="60%">
+                               <input type="radio" value="0x50" name="busAddr"> 0x50
+                               <input type="radio" value="0x51" checked name="busAddr"> 0x51</td>
+                               </tr>
+                               <tr>
+                               <td width="30%" align="left">Image File</td>
+                               <td align="left" width="60%">
+                               <input type="file"  name="datafile" size="40px" value=""></td>
+                               </tr>
+                               <tr>
+                               <td width="91%" align="left" colspan="2"><input type="submit" onclick="document.pressed=this.value" value="Write EEPROM"></td>
+                               </tr>
+                       </table>
+                       </form>
+               </div>
+               <br>
+               <div id="eepromRead" style="width: 90%; margin-left: 25px; padding: 2px; border: 1px gray solid;">
+                       <form name="eepromRead" onsubmit="return submitForm2();" enctype="multipart/form-data" method="post">
+                       <table border="0" cellpadding="5" id="eepromreadtable" width="100%">
+                               <caption> <b> I2C EEPROM Read </b> </caption>
+                               <tr>
+                               <td width="30%" align="left">I2C Bus Address</td>
+                               <td align="left" width="60%">
+                               <input type="radio" value="0x50" name="busAddr"> 0x50
+                               <input type="radio" value="0x51" checked name="busAddr"> 0x51</td>
+                               </tr>
+                               <tr>
+                               <td width="30%" align="left"><input type="submit" value="Read EEPROM" onclick="document.pressed=this.value"> </td>
+                               </tr>
+                       </table>
+                       </form>
+               </div>
+               <br>
+               <br>
+               <br>
+       </div>
+
+       <div style="clear: both;">&nbsp;</div>
+</div>
+
+<div id="footer">
+       <p id="legal">( c ) 2013 Texas Instruments Incorporated&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
+</div>
+
+</body>
+</html>
diff --git a/utility_eeprom/utility_i2c.desktop b/utility_eeprom/utility_i2c.desktop
new file mode 100644 (file)
index 0000000..5e51410
--- /dev/null
@@ -0,0 +1,11 @@
+#!/usr/bin/env xdg-open
+[Desktop Entry]
+Name=EEPROM Utility 
+GenericName=Demo Application
+Icon=/usr/share/matrix-gui-2.0/apps/images/utilities-icon.png
+Type=Application
+Exec=/usr/share/matrix-gui-2.0/apps/utility_eeprom/utility_i2c.sh
+Categories=utilities
+ProgramType=console
+X-MATRIX-Description=/usr/share/matrix-gui-2.0/apps/utility_eeprom/desc_utility_i2c.html
+X-MATRIX-DisplayPriority=1
diff --git a/utility_eeprom/utility_i2c.sh b/utility_eeprom/utility_i2c.sh
new file mode 100755 (executable)
index 0000000..83485df
--- /dev/null
@@ -0,0 +1,37 @@
+#!/bin/sh
+# Module: utilities_main
+#
+# Description: This script is used to run the utilities application demo
+# 
+# Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
+#
+#  Redistribution and use in source and binary forms, with or withou
+#  modification, are permitted provided that the following conditions
+#  are met:
+#
+#  Redistributions of source code must retain the above copyright
+#  notice, this list of conditions and the following disclaimer.
+#  
+#  Redistributions in binary form must reproduce the above copyright
+#  notice, this list of conditions and the following disclaimer in the
+#  documentation and/or other materials provided with the
+#  distribution.
+#
+#  Neither the name of Texas Instruments Incorporated nor the names of
+#  its contributors may be used to endorse or promote products derived
+#  from this software without specific prior written permission.
+#
+#  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+cat apps/utility_eeprom/i2c.html
diff --git a/utility_filesystem/cgi-bin/filesystemwrite.cgi b/utility_filesystem/cgi-bin/filesystemwrite.cgi
new file mode 100755 (executable)
index 0000000..7f63dcf
--- /dev/null
@@ -0,0 +1,123 @@
+#!/bin/sh
+echo Content-type: text/html
+echo 
+echo 
+
+display_footer()
+{
+cat << EOM2
+<div style='clear: both;'>&nbsp;</div>
+</div>
+<div id='footer'><p id='legal'>( c ) 2013 Texas Instruments Incorporated&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p></div>
+</body>
+</html>
+EOM2
+}
+
+cat << EOM
+<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 'http://www.w3.org/TR/html4/loose.dtd'> <html xmlns='http://www.w3.org/1999/xhtml'>
+<head><meta http-equiv='Pragma' CONTENT='no-cache' /> <meta http-equiv='content-type' content='text/html; charset=utf-8' /> <title>C6x Linux Web Control Panel</title>
+</head>
+<body>
+<div id='wrapper'>
+<div id='logo'><h1>Add File</h1></div>
+<div id='header'>
+<div id='menu'>
+</div>
+</div>
+</div>
+<div id='page'>
+EOM
+TMPFILE=`mktemp`
+cat > $TMPFILE
+#get_params()
+#{
+file=$(cat $TMPFILE | sed -n '4p'| sed 's/.$//')
+soffset=$(head -8 $TMPFILE | wc -c)
+eoffset=$(tail -1 $TMPFILE | wc -c)
+fsize=$(cat $TMPFILE | wc -c)
+osize=$(((($fsize-$eoffset)-$soffset)-2))
+#}
+
+#write_file()
+#{
+cat << EOM1
+<div id='content'>
+<p>Writing <i>$osize</i> bytes to <i>$file</i> ...</p>
+</div>
+EOM1
+dd if=$TMPFILE of=$file skip=$soffset bs=1 count=$osize 2>/dev/null
+sync
+cat << EOM2
+<div id='content'>
+<p>Write to <i>$file</i> complete</p>
+</div>
+EOM2
+rm -f $TMPFILE
+#}
+
+check_params()
+{
+#check for 0 size file
+if [ $osize -eq 0 ] ; then
+cat << EOM1
+<div id='content'>
+<p>Bad Input file ...</p>
+</div>
+EOM1
+display_footer
+rm -f $TMPFILE
+exit
+fi
+
+#check for the dirname
+if [ -z "$file" ] ; then
+cat << EOM1
+<div id='content'>
+<p>Remote file not specified ...</p>
+<br>
+</div>
+EOM1
+display_footer
+rm -f $TMPFILE
+exit
+fi
+
+directory=$(dirname $file)
+if [ -d $directory ] ; then
+else
+cat << EOM1
+<div id='content'>
+<p>Could not find the path  <i>$directory</i> ...</p>
+<br>
+</div>
+EOM1
+display_footer
+rm -f $TMPFILE
+exit
+fi
+}
+
+#get_params
+#check_params
+#write_file
+
+cat << EOM1
+<div id='content'>
+<p>Write to <i>$file</i> complete</p>
+</div>
+EOM1
+
+#display_footer
+
+#display_footer()
+#{
+cat << EOM1
+<div style='clear: both;'>&nbsp;</div>
+</div>
+<div id='footer'><p id='legal'>( c ) 2013 Texas Instruments Incorporated&nbsp;&n
+</body>
+</html>
+EOM1
+#}
+
diff --git a/utility_filesystem/desc_utility_filesystem.html b/utility_filesystem/desc_utility_filesystem.html
new file mode 100644 (file)
index 0000000..7cc8c91
--- /dev/null
@@ -0,0 +1,5 @@
+<h1> Utility application for program filesystem demo </h1>
+
+<p> This demo will provide user interface to program the filesystem.</p>
+
+
diff --git a/utility_filesystem/filesystem.html b/utility_filesystem/filesystem.html
new file mode 100644 (file)
index 0000000..a5ca435
--- /dev/null
@@ -0,0 +1,101 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<!-- 
+/*
+ * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ 
+ * 
+ * 
+ *  Redistribution and use in source and binary forms, with or without 
+ *  modification, are permitted provided that the following conditions 
+ *  are met:
+ *
+ *    Redistributions of source code must retain the above copyright 
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ *    Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the 
+ *    documentation and/or other materials provided with the   
+ *    distribution.
+ *
+ *    Neither the name of Texas Instruments Incorporated nor the names of
+ *    its contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+ *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
+ *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
+ *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
+ *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
+ *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
+ *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
+ *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8" />
+<title>Keystone II Utility Applications</title>
+</head>
+<body>
+<div id="wrapper">
+       <div id="logo">
+               <h1>Filesystem Utility</h1>
+       </div>
+       <div id="header">
+               <div id="menu">
+               </div>
+       </div>
+</div>
+
+<div id="page">
+       <div id="content">
+               <hr>
+               <table cellpadding="6">
+                       <tr><td valign="center">
+                       <image src="apps/images/utilities-c66x.png">
+                       </td><td width="100%" align="justify">
+                       <h2>Write to filesystem on the Platform</h2>
+                       <br>
+                       <p class="Description"><b>Description:</b> This page allows the user to add file to filesystem.</p>
+                       </td></tr>
+               </table>
+
+               <hr>
+        <br>
+       
+               <div id="filesystemwrite" style="width: 90%; margin-left: 25px; padding: 2px; border: 1px gray solid;">
+                       <form action="apps/utility_filesystem/cgi-bin/filesystemwrite.cgi" enctype="multipart/form-data" method="post">
+                       <table border="0" cellpadding="5" id="filesystemwritetable" width="100%">
+                               <caption> <b> File Write </b> </caption>
+                               <tr>
+                                       <td width="20%" align="left">Remote Filename </td>
+                                       <td align="left" width="60%">
+                                       <input type="text"  name="fsFile" size="48" value=""></td>
+                               </tr>
+                               <tr>
+                                       <td width="20%" align="left">Local File</td>
+                                       <td align="left" width="60%">
+                                       <input type="file"  name="lfile" size="40px" value=""></td>
+                               </tr>
+                               <tr>
+                                       <td width="20%" align="left" colspan="2">
+                                       <input type="submit" value="Write File"></td>
+                               </tr>
+                       </table>
+                       </form>
+               </div>
+               <br>
+               <br>
+               <br>
+       </div>
+
+       <div style="clear: both;">&nbsp;</div>
+</div>
+
+<div id="footer">
+       <p id="legal">( c ) 2013 Texas Instruments Incorporated&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
+</div>
+
+</body>
+</html>
diff --git a/utility_filesystem/utility_filesystem.desktop b/utility_filesystem/utility_filesystem.desktop
new file mode 100644 (file)
index 0000000..587ce2e
--- /dev/null
@@ -0,0 +1,11 @@
+#!/usr/bin/env xdg-open
+[Desktop Entry]
+Name=Filesystem Utility 
+GenericName=Demo Application
+Icon=/usr/share/matrix-gui-2.0/apps/images/utilities-icon.png
+Type=Application
+Exec=/usr/share/matrix-gui-2.0/apps/utility_filesystem/utility_filesystem.sh
+Categories=utilities
+ProgramType=console
+X-MATRIX-Description=/usr/share/matrix-gui-2.0/apps/utility_filesystem/desc_utility_filesystem.html
+X-MATRIX-DisplayPriority=1
diff --git a/utility_filesystem/utility_filesystem.sh b/utility_filesystem/utility_filesystem.sh
new file mode 100755 (executable)
index 0000000..4bed969
--- /dev/null
@@ -0,0 +1,37 @@
+#!/bin/sh
+# Module: utilities_main
+#
+# Description: This script is used to run the utilities application demo
+# 
+# Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
+#
+#  Redistribution and use in source and binary forms, with or withou
+#  modification, are permitted provided that the following conditions
+#  are met:
+#
+#  Redistributions of source code must retain the above copyright
+#  notice, this list of conditions and the following disclaimer.
+#  
+#  Redistributions in binary form must reproduce the above copyright
+#  notice, this list of conditions and the following disclaimer in the
+#  documentation and/or other materials provided with the
+#  distribution.
+#
+#  Neither the name of Texas Instruments Incorporated nor the names of
+#  its contributors may be used to endorse or promote products derived
+#  from this software without specific prior written permission.
+#
+#  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+cat apps/utility_filesystem/filesystem.html
diff --git a/utility_flash/cgi-bin/flashread.cgi b/utility_flash/cgi-bin/flashread.cgi
new file mode 100755 (executable)
index 0000000..b6c2a99
--- /dev/null
@@ -0,0 +1,90 @@
+#!/bin/sh
+echo Content-type: text/html
+echo 
+echo 
+
+cat << EOM
+<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 'http://www.w3.org/TR/html4/loose.dtd'> <html xmlns='http://www.w3.org/1999/xhtml'>
+<head><meta http-equiv='Pragma' CONTENT='no-cache' /> <meta http-equiv='content-type' content='text/html; charset=utf-8' /> <title>C6x Linux Web Control Panel</title><link rel='stylesheet' href='/default.css' type='text/css' />
+</head>
+<body>
+<div id='wrapper'><div id='logo'><h1>Flash Read</h1>
+</div><div id='header'><div id='menu'><ul><li><a href='/flash.html'>Back</a></li>
+</ul></div></div></div>
+<div id='page'>
+EOM
+
+display_footer()
+{
+cat << EOM2
+<hr>
+<div style='clear: both;'>&nbsp;</div>
+</div>
+<div id='footer'><p id='legal'>( c ) 2013 Texas Instruments Incorporated&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p></div>
+</body>
+</html>
+EOM2
+}
+
+TMPFILE=`mktemp`
+cat > $TMPFILE
+
+get_params()
+{
+partition=$(cat $TMPFILE | sed -n '4p'| sed 's/.$//')
+mtddevname=$(cat /proc/mtd | awk -v pat="$partition" '$0 ~ pat {printf $1}' | sed 's/://')
+mtddev="/dev/"$mtddevname
+TMPFILE_DATA="../"$partition".bin"
+}
+
+check_params()
+{
+
+#check for the NAND partition
+if [ "$mtddevname" = "" ] ; then
+cat << EOM1
+<div id='content'>
+<p>Could not find Nand partition for <i>$partition</i> ...</p>
+<br>
+</div>
+EOM1
+display_footer
+rm -f $TMPFILE
+exit
+fi
+
+mtdsz="0x"$(cat /proc/mtd | awk -v pat="$partition" '$0 ~ pat {printf $2}')
+mtdsz=$(($mtdsz))
+}
+
+read_flash()
+{
+cat << EOM1
+<div id='content'>
+<p>Reading <i>$mtdsz</i> bytes from <i>$mtddev</i> ...</p>
+</div>
+EOM1
+nanddump -o -q -f $TMPFILE_DATA -l $mtdsz $mtddev
+sync
+}
+
+#Allow User to download the file
+file_download()
+{
+cat << EOM1
+<div id='content'>
+<input type="button" name="Button" value="Save NAND data" onClick="window.open('$TMPFILE_DATA', 'download'); return false;">
+</div>
+EOM1
+}
+
+get_params
+check_params
+read_flash
+file_download
+
+#cleanup
+rm -f $TMPFILE
+
+display_footer
+
diff --git a/utility_flash/cgi-bin/flashwrite.cgi b/utility_flash/cgi-bin/flashwrite.cgi
new file mode 100755 (executable)
index 0000000..2f17741
--- /dev/null
@@ -0,0 +1,117 @@
+#!/bin/sh
+echo Content-type: text/html
+echo 
+echo 
+
+cat << EOM
+<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 'http://www.w3.org/TR/html4/loose.dtd'> <html xmlns='http://www.w3.org/1999/xhtml'>
+<head><meta http-equiv='Pragma' CONTENT='no-cache' /> <meta http-equiv='content-type' content='text/html; charset=utf-8' /> <title>C6x Linux Web Control Panel</title><link rel='stylesheet' href='/default.css' type='text/css' />
+</head>
+<body>
+<div id='wrapper'><div id='logo'><h1>Flash Write</h1>
+</div><div id='header'><div id='menu'><ul><li><a href='/flash.html'>Back</a></li>
+</ul></div></div></div>
+<div id='page'>
+EOM
+
+display_footer()
+{
+cat << EOM2
+<hr>
+<div style='clear: both;'>&nbsp;</div>
+</div>
+<div id='footer'><p id='legal'>( c ) 2013 Texas Instruments Incorporated&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p></div>
+</body>
+</html>
+EOM2
+}
+TMPFILE=`mktemp`
+TMPFILE_DATA=`mktemp`
+cat > $TMPFILE
+partition=$(cat $TMPFILE | sed -n '4p'| sed 's/.$//')
+mtddevname=$(cat /proc/mtd | awk -v pat="$partition" '$0 ~ pat {printf $1}' | sed 's/://')
+mtddev="/dev/"$mtddevname
+soffset=$(head -8 $TMPFILE | wc -c)
+eoffset=$(tail -1 $TMPFILE | wc -c)
+fsize=$(cat $TMPFILE | wc -c)
+osize=$(((($fsize-$eoffset)-$soffset)-2))
+
+check_params()
+{
+#check for 0 size file
+if [ $osize -eq 0 ] ; then
+cat << EOM1
+<div id='content'>
+<p>Bad Input file ...</p>
+</div>
+EOM1
+display_footer
+rm -f $TMPFILE
+exit
+fi
+
+#check for the NAND partition
+if [ "$mtddevname" = "" ] ; then
+cat << EOM1
+<div id='content'>
+<p>Could not find Nand partition for <i>$partition</i> ...</p>
+<br>
+</div>
+EOM1
+display_footer
+rm -f $TMPFILE
+exit
+fi
+
+mtdsz="0x"$(cat /proc/mtd | awk -v pat="$partition" '$0 ~ pat {printf $2}')
+mtdsz=$(($mtdsz))
+if [ $osize -gt $mtdsz ] ; then
+cat << EOM1
+<div id='content'>
+<p>Input File too large (File Size=$osize, MTD Size=$mtdsz)</p>
+</div>
+EOM1
+display_footer
+rm -f $TMPFILE
+exit
+fi
+}
+
+erase_flash()
+{
+cat << EOM1
+<div id='content'>
+<p>Erasing mtd device <i>$mtddev</i> ...</p>
+<br>
+</div>
+EOM1
+flash_eraseall -q $mtddev
+}
+
+program_flash()
+{
+dd if=$TMPFILE of=$TMPFILE_DATA skip=$soffset bs=1 count=$osize 2> /dev/null
+cat << EOM1
+<div id='content'>
+<p>Writing <i>$osize</i> bytes to <i>$mtddev</i> ...</p>
+</div>
+EOM1
+nandwrite -q $mtddev $TMPFILE_DATA -p
+sync
+cat << EOM2
+<div id='content'>
+<p>Write to <i>$mtddev</i> complete</p>
+</div>
+EOM2
+}
+
+check_params
+erase_flash
+program_flash
+
+#cleanup
+rm -f $TMPFILE
+rm -f $TMPFILE_DATA
+
+display_footer
+
diff --git a/utility_flash/desc_utility_flash.html b/utility_flash/desc_utility_flash.html
new file mode 100644 (file)
index 0000000..4782938
--- /dev/null
@@ -0,0 +1,5 @@
+<h1> Utility application for NAND flash program/access demo </h1>
+
+<p> This demo will provide user interface to program/access the NAND flash.</p>
+
+
diff --git a/utility_flash/flash.html b/utility_flash/flash.html
new file mode 100644 (file)
index 0000000..fb9648a
--- /dev/null
@@ -0,0 +1,120 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<!-- 
+/*
+ * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ 
+ * 
+ * 
+ *  Redistribution and use in source and binary forms, with or without 
+ *  modification, are permitted provided that the following conditions 
+ *  are met:
+ *
+ *    Redistributions of source code must retain the above copyright 
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ *    Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the 
+ *    documentation and/or other materials provided with the   
+ *    distribution.
+ *
+ *    Neither the name of Texas Instruments Incorporated nor the names of
+ *    its contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+ *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
+ *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
+ *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
+ *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
+ *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
+ *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
+ *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8" />
+<title>Keystone II Utility Applications</title>
+</head>
+<body>
+<div id="wrapper">
+       <div id="logo">
+               <h1>Flash Utility</h1>
+       </div>
+       <div id="header">
+               <div id="menu">
+               </div>
+       </div>
+</div>
+
+<div id="page">
+       <div id="content">
+               <hr>
+               <table cellpadding="6">
+                       <tr><td valign="center">
+                       <image src="apps/images/utilities-c66x.png">
+                       </td><td width="100%" align="justify">
+                       <h2>Program NAND Flash on the Platform</h2>
+                       <br>
+                       <p class="Description"><b>Description:</b> This page allows the user to read/write kernel & filesystem to the NAND flash.</p>
+                       </td></tr>
+               </table>
+
+               <hr>
+        <br>
+       
+               <div id="flashwrite" style="width: 90%; margin-left: 25px; padding: 2px; border: 1px gray solid;">
+                       <form action="apps/utility_flash/cgi-bin/flashwrite.cgi" enctype="multipart/form-data" method="post">
+                       <table border="0" cellpadding="5" id="flashwritetable" width="100%">
+                               <caption> <b> Nand Flash Write </b> </caption>
+                               <tr>
+                                       <td width="20%" align="left"> Partition </td>
+                                       <td align="left" width="60%">
+                                       <input type="radio" value="params" name="mtd_partition"> Parameters 
+                                       <input type="radio" value="ubifs" checked name="mtd_partition"> FileSystem (e.g. UBI)</td> 
+                               </tr>
+                               <tr>
+                                       <td width="20%" align="left"> Image File</td>
+                                       <td align="left" width="60%">
+                                       <input type="file"  name="datafile" size="40px" value=""></td>
+                               </tr>
+                               <tr>
+                                       <td width="20%" align="left" colspan="2">
+                                       <input type="submit" value="Write"></td>
+                               </tr>
+                       </table>
+                       </form>
+               </div>
+               <br>
+               <div id="flashread" style="width: 90%; margin-left: 25px; padding: 2px; border: 1px gray solid;">
+                       <form action="apps/utility_flash/cgi-bin/flashread.cgi" enctype="multipart/form-data" method="post">
+                       <table border="0" cellpadding="5" id="flashreadtable" width="100%">
+                               <caption> <b> Nand Flash Read </b> </caption>
+                               <tr>
+                                       <td width="20%" align="left"> Partition </td>
+                                       <td align="left" width="60%">
+                                       <input type="radio" value="params" name="mtd_partition"> Parameters 
+                                       <input type="radio" value="ubifs" checked name="mtd_partition"> FileSystem (e.g. UBI)</td> 
+                               </tr>
+                               <tr>
+                                       <td width="20%" align="left" colspan="2">
+                                       <input type="submit" value="Read"></td>
+                               </tr>
+                       </table>
+                       </form>
+               </div>
+
+               <br>
+               <br>
+       </div>
+
+       <div style="clear: both;">&nbsp;</div>
+</div>
+
+<div id="footer">
+       <p id="legal">( c ) 2013 Texas Instruments Incorporated&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
+</div>
+
+</body>
+</html>
diff --git a/utility_flash/utility_flash.desktop b/utility_flash/utility_flash.desktop
new file mode 100644 (file)
index 0000000..c896ab6
--- /dev/null
@@ -0,0 +1,11 @@
+#!/usr/bin/env xdg-open
+[Desktop Entry]
+Name=Flash Utility 
+GenericName=Demo Application
+Icon=/usr/share/matrix-gui-2.0/apps/images/utilities-icon.png
+Type=Application
+Exec=/usr/share/matrix-gui-2.0/apps/utility_flash/utility_flash.sh
+Categories=utilities
+ProgramType=console
+X-MATRIX-Description=/usr/share/matrix-gui-2.0/apps/utility_flash/desc_utility_flash.html
+X-MATRIX-DisplayPriority=1
diff --git a/utility_flash/utility_flash.sh b/utility_flash/utility_flash.sh
new file mode 100755 (executable)
index 0000000..7494b29
--- /dev/null
@@ -0,0 +1,37 @@
+#!/bin/sh
+# Module: utilities_main
+#
+# Description: This script is used to run the utilities application demo
+# 
+# Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
+#
+#  Redistribution and use in source and binary forms, with or withou
+#  modification, are permitted provided that the following conditions
+#  are met:
+#
+#  Redistributions of source code must retain the above copyright
+#  notice, this list of conditions and the following disclaimer.
+#  
+#  Redistributions in binary form must reproduce the above copyright
+#  notice, this list of conditions and the following disclaimer in the
+#  documentation and/or other materials provided with the
+#  distribution.
+#
+#  Neither the name of Texas Instruments Incorporated nor the names of
+#  its contributors may be used to endorse or promote products derived
+#  from this software without specific prior written permission.
+#
+#  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+cat apps/utility_flash/flash.html
diff --git a/utility_info/cgi-bin/info.cgi b/utility_info/cgi-bin/info.cgi
new file mode 100755 (executable)
index 0000000..e046ac1
--- /dev/null
@@ -0,0 +1,142 @@
+#!/bin/sh
+
+echo Content-type: text/html
+echo 
+echo 
+cat << EOM
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8" />
+<title>Keystone II Utility Application System Infomation</title>
+</head>
+<body>
+<div id='wrapper'>
+<div id='logo'><h1>Information</h1></div>
+<div id='header'>
+<div id='menu'>
+</div>
+
+<div id='page'>
+<div id='content'>
+<hr>
+<table cellpadding='6'>
+<tr>
+<td valign='center'><image src='apps/images/utilities-c66x.png'></td>
+<td width='100%' align='justify'>
+<h2>Information</h2><br>
+<p class='Description'><b>Description:</b> This page displays the static system information. </p>
+</td>
+</tr>
+</table>
+<hr>
+</div>
+<br>
+EOM
+       
+cat << UPT1
+<div>
+<h3>System Up Time</h3>        
+<PRE>
+UPT1
+
+cat /proc/uptime
+
+cat << UPT2
+seconds
+</PRE>
+</div><br>
+UPT2
+
+cat << CPUINFO1 
+<div>
+<h3>CPU Info</h3>
+<PRE>
+CPUINFO1
+
+cat /proc/cpuinfo
+
+cat << CPUINFO2 
+</PRE>
+</div><br>
+CPUINFO2
+
+cat << SWINFO1 
+<div>
+<h3>Linux version</h3>
+<PRE>
+SWINFO1
+
+uname -srm
+
+cat << SWINFO2 
+</PRE>
+</div><br>
+SWINFO2
+
+TMPFILE=`mktemp`
+mount | awk ' {print "device ", $1," mounted on ",$3, " as ", $5, "filesystem"}' > $TMPFILE
+
+cat << MOUNTINFO1  
+<div>
+<h3>Mount Info</h3>
+<PRE>
+MOUNTINFO1
+
+cat $TMPFILE
+rm $TMPFILE
+
+cat << MOUNTINFO2 
+</PRE>
+</div><br>
+MOUNTINFO2
+
+cat << IFCONFIG1  
+<div>
+<h3>Network Interfaces</h3>
+<PRE>
+IFCONFIG1
+
+ifconfig
+
+cat << IFCONFIG2 
+</PRE>
+</div><br>
+IFCONFIG2
+
+cat << ROUTEINFO1  
+<div>
+<h3>Routing table</h3>
+<PRE>
+ROUTEINFO1
+
+route
+
+cat << ROUTEINFO2 
+</PRE>
+</div><br>
+ROUTEINFO2
+
+
+cat << MODINFO1  
+<div>
+<h3>Module Info</h3>
+<PRE>
+MODINFO1
+
+lsmod
+
+cat << MODINFO2 
+</PRE>
+</div><br>
+MODINFO2
+
+cat << EOF
+<hr>
+<div style='clear: both;'>&nbsp;</div>
+</div>
+<div id="footer">
+       <p id="legal">( c ) 2013 Texas Instruments Incorporated&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
+</div>
+</body>
+</html>
+EOF
+
diff --git a/utility_info/desc_utility_info.html b/utility_info/desc_utility_info.html
new file mode 100644 (file)
index 0000000..43264c2
--- /dev/null
@@ -0,0 +1,5 @@
+<h1> Utility application system statistics demo </h1>\r
+\r
+<p> This demo will show static system information.</p>\r
+\r
+\r
diff --git a/utility_info/utility_info.desktop b/utility_info/utility_info.desktop
new file mode 100644 (file)
index 0000000..cfab42e
--- /dev/null
@@ -0,0 +1,11 @@
+#!/usr/bin/env xdg-open
+[Desktop Entry]
+Name=System Infomation 
+GenericName=Demo Application
+Icon=/usr/share/matrix-gui-2.0/apps/images/utilities-icon.png
+Type=Application
+Exec=/usr/share/matrix-gui-2.0/apps/utility_info/utility_info.sh
+Categories=utilities
+ProgramType=console
+X-MATRIX-Description=/usr/share/matrix-gui-2.0/apps/utility_info/desc_utility_info.html
+X-MATRIX-DisplayPriority=1
diff --git a/utility_info/utility_info.sh b/utility_info/utility_info.sh
new file mode 100755 (executable)
index 0000000..572dda1
--- /dev/null
@@ -0,0 +1,37 @@
+#!/bin/sh
+# Module: utilities_main
+#
+# Description: This script is used to run the utilities application demo
+# 
+# Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
+#
+#  Redistribution and use in source and binary forms, with or withou
+#  modification, are permitted provided that the following conditions
+#  are met:
+#
+#  Redistributions of source code must retain the above copyright
+#  notice, this list of conditions and the following disclaimer.
+#  
+#  Redistributions in binary form must reproduce the above copyright
+#  notice, this list of conditions and the following disclaimer in the
+#  documentation and/or other materials provided with the
+#  distribution.
+#
+#  Neither the name of Texas Instruments Incorporated nor the names of
+#  its contributors may be used to endorse or promote products derived
+#  from this software without specific prior written permission.
+#
+#  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+source apps/utility_info/cgi-bin/info.cgi
diff --git a/utility_stats/cgi-bin/stats.cgi b/utility_stats/cgi-bin/stats.cgi
new file mode 100755 (executable)
index 0000000..208d7d6
--- /dev/null
@@ -0,0 +1,56 @@
+#!/bin/sh
+
+echo Content-type: text/html
+echo 
+echo 
+cat << EOM
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8" />
+<title>Keystone II Utility Application System Statistics</title>
+<META HTTP-EQUIV="REFRESH" CONTENT="60">
+</head>
+<body>
+<div id='wrapper'>
+<div id='logo'><h1>System Statistics</h1></div>
+<div id='header'>
+<div id='menu'>
+</div>
+
+<div id='page'>
+<div id='content'>
+<hr><table cellpadding='6'><tr>
+<td valign='center'><image src='apps/images/utilities-c66x.png'></td>
+<td width='100%' align='justify'>
+<h2>Statistics</h2><br>
+<p class='Description'><b>Description:</b> This page displays system statistics like Memory and CPU usage. This page refreshes itself every 60 seconds.</p>
+</td></tr></table><hr><br>
+</div>
+EOM
+
+TMPFILE=`mktemp`
+
+cat << TOPINFO1  
+<div>
+<h3>Memory & CPU Usage</h3>
+<PRE>
+TOPINFO1
+
+top -bn1 > $TMPFILE
+sed '1,10!d' $TMPFILE
+
+cat << TOPINFO2 
+</PRE>
+</div><br>
+TOPINFO2
+
+cat << EOF
+<hr>
+<div style="clear: both;">&nbsp;</div>
+</div>
+<div id="footer">
+       <p id="legal">( c ) 2013 Texas Instruments Incorporated&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
+</div>
+</body>
+</html>
+EOF
+
diff --git a/utility_stats/desc_utility_stats.html b/utility_stats/desc_utility_stats.html
new file mode 100644 (file)
index 0000000..1481b02
--- /dev/null
@@ -0,0 +1,5 @@
+<h1> Utility application system statistics demo </h1>
+
+<p> This demo will show system statistics.</p>
+
+
diff --git a/utility_stats/utility_stats.desktop b/utility_stats/utility_stats.desktop
new file mode 100644 (file)
index 0000000..0c9d2a6
--- /dev/null
@@ -0,0 +1,11 @@
+#!/usr/bin/env xdg-open
+[Desktop Entry]
+Name=System Statistics 
+GenericName=Demo Application
+Icon=/usr/share/matrix-gui-2.0/apps/images/utilities-icon.png
+Type=Application
+Exec=/usr/share/matrix-gui-2.0/apps/utility_stats/utility_stats.sh
+Categories=utilities
+ProgramType=console
+X-MATRIX-Description=/usr/share/matrix-gui-2.0/apps/utility_stats/desc_utility_stats.html
+X-MATRIX-DisplayPriority=1
diff --git a/utility_stats/utility_stats.sh b/utility_stats/utility_stats.sh
new file mode 100755 (executable)
index 0000000..ab1f566
--- /dev/null
@@ -0,0 +1,37 @@
+#!/bin/sh
+# Module: utilities_main
+#
+# Description: This script is used to run the utilities application demo
+# 
+# Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
+#
+#  Redistribution and use in source and binary forms, with or withou
+#  modification, are permitted provided that the following conditions
+#  are met:
+#
+#  Redistributions of source code must retain the above copyright
+#  notice, this list of conditions and the following disclaimer.
+#  
+#  Redistributions in binary form must reproduce the above copyright
+#  notice, this list of conditions and the following disclaimer in the
+#  documentation and/or other materials provided with the
+#  distribution.
+#
+#  Neither the name of Texas Instruments Incorporated nor the names of
+#  its contributors may be used to endorse or promote products derived
+#  from this software without specific prior written permission.
+#
+#  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+source apps/utility_stats/cgi-bin/stats.cgi