replacepart.pl
--------------

Task:
- list the parts of a firmware file
- add/remove/delete a Smart-IPC part of the firmware file
- change the tag of the firmware file


Requirements:
- perl >= 5.6.1
- works both under Linux and Windows (tested in Windows with
  perl distribution from http://www.activestate.com/)


Warning:
- in all versions up to 1.2.0 (273) the firmware update for the RICCs
  and the OSD is untested - don't try to update these firmware file parts!

Notes:
- you always need as starting point a firmware file from peppercon
- this firmware file can contain firmware updates for the peppercon board,
  but it can be empty, too
- the firmware file consists of several parts, one part for each piece of hardware (e.g. the firmware file
  for our product consists of up to 4 parts)
- for every piece of hardware of the smart ipc switch (master, osd, ricc-usb, ricc-ps/2, ricc-sun) can
  exists an additional firmware part
- the delivered utility can do following:
  * add or replace a firmware part for master, osd, ricc-usb, ...
  * delete a firmware part for master, osd, ...
  * change the tag of the firmware
  * list the actual parts a firmware file
- replacepart.pl changes the firmware file itself, so please be sure to have a copy!

Usage:
- get help
-----------------------
#./replacepart.pl

Usage: 

  replacepart.pl [-d] [-p <part_file>] [-n <part_type>] [-t <tag>] <firmware_file>

    -d              - delete part
    -p <part_file>  - replace or add part with <part_file>
    -n <part_type>  - part type, which should be replaced/deleted/added 
                      0 MASTER
                      1 OSD
                      2 RICC_USB
                      3 RICC_PS2
                      4 RICC_SUN
    -t <tag>        - change firmware tag
    <firmware_file> - the existing firmware file to change

-------------------------




- display only the contents of a firmware file:
-------------------------
./replacepart.pl fwsmart.bin
ver:         010200
min_req_ver: 010000
build_nr:    255
tag:         Beta
product:     smartipc
  size:      37607
  type:      3 ( SmartIPC Firmware )
  subtype:   0 ( MASTER )
--------------------------
this firmware file consists only of one part:
the firmware file of the MASTER of the SmartIPC switch


- change tag from "Beta" "Standard Release 1":
---------------------------
./replacepart.pl -t "Standard Release 1" fwsmart.bin
[...]
Resulting firmware file:
ver:         010200
min_req_ver: 010000
build_nr:    255
tag:         Standard Release 1
product:     smartipc
  size:      37607
  type:      3 ( SmartIPC Firmware )
  subtype:   0 ( MASTER )
----------------------------




- add a part for the USB-RICC to the firmware file
  (RICC-USB = type 2 - see help for complete list)
----------------------------
./replacepart.pl -n 2 -p riccusb.bin fwsmart.bin
[...]
will replace subtype 2 with file riccusb.bin

Resulting firmware file:
ver:         010200
min_req_ver: 010000
build_nr:    255
tag:         Standard Release 1
product:     smartipc
  size:      37607
  type:      3 ( SmartIPC Firmware )
  subtype:   0 ( MASTER )
  size:      2400
  type:      3 ( SmartIPC Firmware )
  subtype:   2 ( RICC_USB )
---------------------------
now there are 2 firmware parts - one for the master and one for an USB ricc



- delete a part (e.g. the Master)
---------------------------
ver:         010200
min_req_ver: 010000
build_nr:    255
tag:         Standard Release 1
product:     smartipc
  size:      37607
  type:      3 ( SmartIPC Firmware )
  subtype:   2 ( RICC_USB )
---------------------------
after this the firmware contains only the usb ricc firmware part


- to add all parts for the smartipc switch, you have to call the tool as many times as you have different parts
--------------------------
./replacepart.pl -n 0 -p master.bin fwsmart.bin
./replacepart.pl -n 1 -p osdfile.bin fwsmart.bin
./replacepart.pl -n 2 -p riccusb.bin fwsmart.bin
./replacepart.pl -n 3 -p riccps2.bin fwsmart.bin
./replacepart.pl -n 4 -p riccsun.bin fwsmart.bin
--------------------------
these commands add all possible firmware files the the smartipc switch


