ProductionSWSubmissionRules: Difference between revisions

From Variscite Wiki
(Created page with "{{PageHeader|Production SW submission rules}} __toc__ = For submission of bootloaders only = Just provide the SPL and U-Boot images = For submission of SW which contains fil...")
 
 
(18 intermediate revisions by the same user not shown)
Line 2: Line 2:


= For submission of bootloaders only =
= For submission of bootloaders only =
Just provide the SPL and U-Boot images
Just provide the bootloader image/s.<br>
<br>
(In case of mx6/mx6ul/mx7 it should be SPL and U-Boot images - Otherwise, it should be a combined bootloader image)


= For submission of SW which contains filesystems =
= For submission of SW which contains filesystems =
Line 11: Line 13:
<br>
<br>
* The script should print "PASS" at the end, after a successful run.
* The script should print "PASS" at the end, after a successful run.
<br>
* The script should be able to run from a read-only filesystem.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e.g.<br>
SPL_PATH=`pwd`
cd /tmp
kobs-ng init -x ${SPL_PATH}/${SPL_IMAGE} --search_exponent=1 -v > /dev/null
cd -
<br>
<br>
* fw_setenv can't be used in the script.
* fw_setenv can't be used in the script.
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If you need to customize the U-Boot environment, you can do one of the following:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If you need to customize the U-Boot environment, you can do one of the following:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'''a'''. Change the default environment in the U-Boot code (under include/configs/<board name>.h)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'''a'''. Change the default environment in the U-Boot code (under include/configs/<board name>.h)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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).<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'''b'''. Provide a U-Boot environment image and write it to the SOM storage in your installation script.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'''b'''. Provide a U-Boot environment image and write it to the SOM storage in your installation script.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;In this case, make sure not to save the runtime environment variables (such as ethaddr which holds the Ethernet MAC address):<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;In this case, make sure not to save the runtime environment variables (such as ethaddr which holds the Ethernet MAC address):<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Alternatively, you can use fw_setenv on your board to set and save the environment to storage.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Alternatively, you can use fw_setenv on your board to set and save the environment to storage.<br>
<br>
* Burning of One-Time Programmable e-fuses in the SOC is not allowed, neither during the SOM production (by the submitted script), nor automatically during the first boot after production (by the submitted SW).
<br>
<br>
* If a UBI filesystem (for NAND flash) is used, it should be provided as a .ubi file.
* If a UBI filesystem (for NAND flash) is used, it should be provided as a .ubi file.
Line 24: Line 37:
* 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:
* 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),...
  size(label),size(label),...
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;while "-" can be used as the size of the last partition, to denote "remaining size until the end of the NAND flash".<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;while "-" can be used as the size of the last partition to denote "remaining size until the end of the NAND flash".<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e.g.
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e.g.
  2m(spl),2m(uboot),2m(uboot-env),8m(kernel),-(rootfs)
  2m(spl),2m(uboot),2m(uboot-env),8m(kernel),-(rootfs)
Line 30: Line 43:
* The content of a non-UBI filesystem should be provided as a .tar.gz file.
* The content of a non-UBI filesystem should be provided as a .tar.gz file.
<br>
<br>
* Files bigger than 50M should be split to 50M 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 37: Line 50:
  rootfs.tar.gz.01
  rootfs.tar.gz.01
  …
  …
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;and to untar the resulted files in the scirpt:
&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)
<br>
<br>

Latest revision as of 19:14, 8 March 2023

Production SW submission rules

For submission of bootloaders only

Just provide the bootloader image/s.

(In case of mx6/mx6ul/mx7 it should be SPL and U-Boot images - Otherwise, it should be a combined bootloader image)

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.

  • Burning of One-Time Programmable e-fuses in the SOC is not allowed, neither during the SOM production (by the submitted script), nor automatically during the first boot after production (by the submitted SW).


  • 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)