ch06s09.html 4.4 KB

12345678910111213141516171819202122232425262728293031323334
  1. <html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Update a Device</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"><meta name="keywords" content="Intellon, Atheros, Qualcomm, HomePlug, powerline, communications, INT6000, INT6300, INT6400, AR7400, AR7420"><link rel="home" href="index.html" title="Qualcomm Atheros Open Powerline Toolkit"><link rel="up" href="ch06.html" title="Chapter 6.  Scripting"><link rel="prev" href="ch06s08.html" title="Initialize a Device"><link rel="next" href="ch06s10.html" title="Generating Powerline Traffic"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">
  2. Update a Device
  3. </th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch06s08.html">Prev</a> </td><th width="60%" align="center">Chapter 6. 
  4. Scripting
  5. </th><td width="20%" align="right"> <a accesskey="n" href="ch06s10.html">Next</a></td></tr></table><hr></div><div class="section" title="Update a Device"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="scripting-update-device"></a>
  6. Update a Device
  7. </h2></div></div></div><p>
  8. In some cases we want to replace the runtime firmware or runtime parameters stored in NVRAM. Program <a class="ulink" href="int6k.7.html" target="_top">int6k</a> can be used for this purpose when runtime firmware is running.
  9. </p><p>
  10. A device update may be necessary when new runtime firmware or new runtime parameters or both must be programmed into <acronym class="acronym">NVRAM</acronym>. It is only possible when <acronym class="acronym">NVRAM</acronym> is present and the runtime firmware is running.
  11. </p><pre class="programlisting">
  12. int6k -i ${NIC1} -P ${PIB} -N ${NVM} -F
  13. if [ ${?} != 0 ]; then
  14. exit 1
  15. fi
  16. </pre><p>
  17. The example above uses <a class="ulink" href="int6k.7.html" target="_top">int6k</a> to download a <acronym class="acronym">PIB</acronym> file (<strong class="userinput"><code>-P</code></strong>) and <acronym class="acronym">NVM</acronym> file (<strong class="userinput"><code>-N</code></strong>) then flash <acronym class="acronym">NVRAM</acronym> (<strong class="userinput"><code>-F</code></strong>). Symbol <code class="varname">NIC1</code> must be defined earlier in the script, perhaps in file <a class="link" href="ch06s03.html#scripting-hardware-definitions" title="Example 6.1.  hardware.sh">hardware.sh</a>. Symbols PIB and NVM must also be defined earlier in the script, perhaps in file <a class="link" href="ch06s03.html#scripting-firmware-definitions" title="Example 6.2.  firmware.sh">firmware.sh</a>.
  18. </p><p>
  19. Program <a class="ulink" href="int6k.7.html" target="_top">int6k</a> returns a non-zero value on error. We can check the return code and exit the script on error to avoid subsequent errors. We could, of course, suppress normal output (<strong class="userinput"><code>-q</code></strong>) and print our own error message using the Linux <strong class="userinput"><code>echo</code></strong> utility.
  20. </p><p>
  21. In some cases, you may want to preserve the current firmware on a device and update only the <acronym class="acronym">PIB</acronym>. Program <a class="ulink" href="int6k.7.html" target="_top">int6k</a> can be used for this purpose, as well.
  22. </p><pre class="programlisting">
  23. int6k -i ${NIC1} -P ${PIB} -C 2
  24. if [ ${?} != 0 ]; then
  25. exit 1
  26. fi
  27. </pre><p>
  28. The example above downloads a <acronym class="acronym">PIB</acronym> file (<strong class="userinput"><code>-P</code></strong>) and commits (<strong class="userinput"><code>-C</code></strong>) the <acronym class="acronym">PIB</acronym> only to <acronym class="acronym">NVRAM</acronym>. There are a variety of device flash scenarios and each requires some varation on one of the examples shown here.
  29. </p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch06s08.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch06.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch06s10.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">
  30. Initialize a Device
  31.  </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 
  32. Generating Powerline Traffic
  33. </td></tr></table></div></body></html>