ProductionSWSubmissionRules: Difference between revisions

From Variscite Wiki
Line 40: Line 40:
<br>
<br>
* Files bigger than 50MB should be split to 50MB files.
* Files bigger than 50MB should be split to 50MB files.
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e.g. to split a big rootfs.tar.gz file run:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'''Example 1''': To split a big rootfs.tar.gz file run:
  $ split -b 50M -d rootfs.tar.gz rootfs.tar.gz.
  $ split -b 50M -d rootfs.tar.gz rootfs.tar.gz.
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The resulted files will be:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The resulted files will be:
Line 48: Line 48:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;and to untar the resulted files in the script:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;and to untar the resulted files in the script:
  cat rootfs.tar.gz* | tar xzp -C <destination directory>
  cat rootfs.tar.gz* | tar xzp -C <destination directory>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'''Example 2''': To split a big rootfs.ubi file run:
$ split -b 50M -d rootfs.ubi rootfs.ubi.
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The resulted files will be:
rootfs.ubi.00
rootfs.ubi.01
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;and to install the resulted files to the NAND flash in the script:
totalsize=0
for filesize in $(stat -c %s rootfs.ubi*); do
totalsize=$(expr $totalsize + $filesize)
done
cat rootfs.ubi* | ubiformat /dev/mtdX -y -S $totalsize -f -
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(while /dev/mtdX is the destination mtd partition for the ubi image)

Revision as of 15:38, 25 June 2019

Production SW submission rules

For submission of bootloaders only

Just provide the SPL and U-Boot images

For submission of SW which contains filesystems

  • Provide a complete and tested installation .sh script for all of the images.

     This script should be run from an SD card on the target, from the same directory as the provided images.

  • The script should not print any special characters, including underlines or colors.


  • The script should print "PASS" at the end, after a successful run.


  • The script should be able to run from a read-only filesystem.

     Note that kobs-ng attempts to creates a temporary file in the directory it is called from, so if your script uses kobs-ng it should call it from /tmp.
     e.g.

SPL_PATH=`pwd`
cd /tmp
kobs-ng init -x ${SPL_PATH}/${SPL_IMAGE} --search_exponent=1 -v > /dev/null
cd -


  • fw_setenv can't be used in the script.

     If you need to customize the U-Boot environment, you can do one of the following:
     a. Change the default environment in the U-Boot code (under include/configs/<board name>.h)
         In this case, build the customized U-Boot using Yocto, to make sure the change is also taken by u-boot-fw-utils (in case you have it in your image).
     b. Provide a U-Boot environment image and write it to the SOM storage in your installation script.
         In this case, make sure not to save the runtime environment variables (such as ethaddr which holds the Ethernet MAC address):
         When using the U-Boot command line, you should reset the environment to the default one by running "env default -a" before setting your variables and saving the environment to storage.
         Alternatively, you can use fw_setenv on your board to set and save the environment to storage.

  • If a UBI filesystem (for NAND flash) is used, it should be provided as a .ubi file.


  • If a custom mtd (NAND flash) partition table is used, it should be provided as a text file called mtdparts.txt, in the following format:
size(label),size(label),...

     while "-" can be used as the size of the last partition to denote "remaining size until the end of the NAND flash".
     e.g.

2m(spl),2m(uboot),2m(uboot-env),8m(kernel),-(rootfs)


  • The content of a non-UBI filesystem should be provided as a .tar.gz file.


  • Files bigger than 50MB should be split to 50MB files.

     Example 1: To split a big rootfs.tar.gz file run:

$ split -b 50M -d rootfs.tar.gz rootfs.tar.gz.

     The resulted files will be:

rootfs.tar.gz.00
rootfs.tar.gz.01
…

     and to untar the resulted files in the script:

cat rootfs.tar.gz* | tar xzp -C <destination directory>


     Example 2: To split a big rootfs.ubi file run:

$ split -b 50M -d rootfs.ubi rootfs.ubi.

     The resulted files will be:

rootfs.ubi.00
rootfs.ubi.01
…

     and to install the resulted files to the NAND flash in the script:

totalsize=0
for filesize in $(stat -c %s rootfs.ubi*); do
	totalsize=$(expr $totalsize + $filesize)
done
cat rootfs.ubi* | ubiformat /dev/mtdX -y -S $totalsize -f -

     (while /dev/mtdX is the destination mtd partition for the ubi image)