Changes between Version 11 and Version 12 of linux/ubi


Ignore:
Timestamp:
03/05/2019 10:33:28 PM (6 years ago)
Author:
Bobby Jones
Comment:

Add split update section

Legend:

Unmodified
Added
Removed
Modified
  • linux/ubi

    v11 v12  
    327327'''Note that operating on the ubi device as described here destroys the wear-leveling information contained in the UBI therefore it is recommended to work at the ubi volume layer to replace ubifs volumes as described below'''
    328328
     329[=#SplitMethod]
     330==== Updating UBI with low RAM devices:
     331For some devices, the size of the NAND flash exceeds the size of RAM. In this scenario the instructions from the prior section would fail as you would run out of RAM space before you could finish retrieving the file to program the NAND flash with.
     332
     333To work around this limitation Gateworks has created an installable U-Boot script that will apply UBI files containing a single partition image. This can be particularly useful for updating the firmware of a running target.
     334
     335To update using a split UBI:
     336 '''1. Split your UBI
     337  In most situations the RAM of your device will be smaller than the image file required to update your system, therefore it is necessary to split the image file and apply the resulting compressed parts in a piece wise update. The below example uses the {{{split}}} command to split the input file into parts that are reasonably smaller than the RAM size of the board which will be consuming the update.
     338 {{{#!bash
     339FILE=xenial-large.ubi
     340# Split file every 200M with suffix ".part" and decimal increment
     341split -d -b 200M ${FILE} ${FILE}.part
     342for i in $(ls ${FILE}.*); do
     343 mv $i ${FILE}.$(echo $i | cut -d'.' -f3)
     344done
     345
     346# Result will be multiple files such as xenial-large.ubi.partXX that are <= 200M and
     347# which adhere to the naming convention required by the script (ends with .partXX in sequential order)
     348}}} 
     349 '''2. Install the U-Boot script
     350  On the target machine, source the [http://trac.gateworks.com/raw-attachment/wiki/linux/ubi/nand_split_update.scr nand_split_update.scr] U-Boot script attached to this page (or copy its contents with an editor). For example via tftp:
     351{{{#!bash
     352setenv serverip 192.168.1.100
     353tftp nand_split_update.scr
     354source $loadaddr
     355}}}
     356 '''3. Configure your U-Boot environment
     357  From the script's usage:
     358{{{
     359The following environment variables need to be set in order for this script to run:
     360
     361    splitfile    - full path file name prefix of the splitted files (eg file.ubi for file.ubi.part00)
     362}}}
     363  An example configuration:
     364{{{#!bash
     365setenv splitfile xenial-large.ubi          # ubi file from example above
     366}}}
     367
     368 '''4. Run the added script with {{{run nand_split_update}}}
     369
     370
     371
    329372
    330373[=#uboot-ubifs]