13 Firmware Updates
Linux Software Developers Kit (SDK) User Guide
69
Features
Same process for updates via boot loader and within Linux.
Easily adjustable to customer’s needs.
Disaster recovery feature available.
Restrictions
Update from within Linux can only update kernel, ROMFS and partitions that are not
mounted.
Update from within Linux updates 64k flash areas incrementally; so if the update process
gets interrupted, the file system will be corrupted and must be caught by disaster recovery.
No authentication and encryption of firmware upgrade files is implemented.
Only relatively weak CRC against firmware corruption.
The upgrade process will likely require adjustments for production devices.
Implementation
The fw-upgrade application enables you to write firmware to flash via /var/firmware.img (pipe file).
If you enable CONFIG_USER_LANTRONIX_FW_UPGRADE, this application runs automatically
on a target.
To update the firmware, write the firmware image created by makeimage2.py (see below) to
/var/firmware.img. You can write it via any protocol like TFTP, FTP or HTTP.
makeimage2.py
makeimage2.py (provided under <install_dir>/host/usr/sbin/ and on the installation CD under the
firmware_update directory) wraps (file system) images in headers with information about the
address on the flash they should be written to and concatenates them all together in a single file.
To provide a basic protection against file corruption during the transfer, each data block is
protected by a CRC.
The boot loader also expects the kernel (and optionally the ROMFS partition) to be wrapped in its
own header. makeimage2.py also adds that one to the file identified as kernel.
Below are some example invocations of the makeimage2.py script.
1. Installing a compressed linux+ROMFS image and erasing the flash area used for the JFFS2
/usr/local partition:
For MatchPort AR
makeimage2.py images/imagez.bin:kernel:0x40000:ROMFS:
erase:0x400000:-1 /tmp/uclinux-kernel-and-romfs-and-erase-jffs2-
area.bin
For XPort Pro
makeimage2.py images/imagez.bin:kernel:0x40000:ROMFS:
erase:0x800000:-1 /tmp/uclinux-kernel-and-romfs-and-erase-jffs2-
area.bin
2. Installing an uncompressed linux+ROMFS image only, keeping the JFFS2 area untouched:
For MatchPort AR
makeimage2.py images/image.bin:kernel:0x40000:ROMFS: /tmp/uclinux-
kernel-and-romfs.bin