Template:Yocto Build Release TI: Difference between revisions

From Variscite Wiki
 
(26 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<includeonly>{{#vardefine:UBUNTU_COMPAT|18.04/20.04}}<!--
<includeonly>
{{#ifexpr: {{#var:YOCTO_VERSION}} >= 4.1 |
  {{#vardefine:UBUNTU_COMPAT|22.04}}
  |
  {{#vardefine:UBUNTU_COMPAT|18.04/20.04}}
  }}<!--
-->
-->
{{PageHeader|{{#var:HARDWARE_NAME}} - Yocto {{#var:YOCTO_NAME}} {{#var:YOCTO_VERSION}}}}
{{PageHeader|{{#var:HARDWARE_NAME}} - Yocto {{#var:YOCTO_NAME}} {{#var:YOCTO_VERSION}}}}


= Introduction =
= Introduction =
This guide walks through the process for building Variscite's reference Yocto image from source code. It is derived from TI's guide [https://software-dl.ti.com/processor-sdk-linux/esd/AM62X/{{#var:TI_RELEASE_}}/exports/docs/linux/Overview_Building_the_SDK.html?highlight=bitbake Overview Building the SDK]
This guide walks through the process for building Variscite's reference Yocto image from source code. It is derived from TI's guide [{{#var:TI_RELEASE_OVERVIEW_BUILD}} Overview Building the SDK]


= Installing required packages =
= Installing required packages =
{{Note|'''Note:''' Variscite provides Docker containers that can be used for a development environment as an alternative to using a virtual machine or a dedicated computer.
To learn more, please see Variscite's [[Docker_Build_Environment | Docker Build Environment]] guide.
If you are using docker, you can skip this section.
}}


Please make sure your host PC is running Ubuntu {{#var:UBUNTU_COMPAT}} 64-bit and is up to date:
Please make sure your host PC is running Ubuntu {{#var:UBUNTU_COMPAT}} 64-bit and is up to date:
Line 35: Line 47:
Be sure to select “No” when you are asked to use dash as the default system shell.
Be sure to select “No” when you are asked to use dash as the default system shell.


{{#ifexpr: {{#var:YOCTO_VERSION}} < 4.1 |&nbsp;
= Install Toolchains to home directory =
= Install Toolchains to home directory =
{{K3_TOOLCHAIN_INSTALL}}
{{K3_TOOLCHAIN_INSTALL}}
}}


= Download Yocto {{#var:YOCTO_NAME}} and setup environment =
= Download Yocto {{#var:YOCTO_NAME}} and setup environment =


Download the source code:
'''Download the latest source code (recommended):'''
 
$ git clone {{#var:OE_LAYERSETUP_GIT}} ~/var-ti-yocto
 
or
 
'''Download a release tag:'''


  $ mkdir ~/var-ti-yocto && cd ~/var-ti-yocto
  $ git clone {{#var:OE_LAYERSETUP_GIT}} ~/var-ti-yocto -b {{#var:RELEASE_NAME}}
$ git clone {{#var:OE_LAYERSETUP_GIT}} tisdk


{{Note|'''Optional:''' Variscite provides Docker containers that can be used for a development environment as an alternative to using a virtual machine or a dedicated computer.
{{Note|'''Optional:''' Variscite provides Docker containers that can be used for a development environment as an alternative to using a virtual machine or a dedicated computer.
Line 50: Line 69:
If you choose to use docker, launch a new container with the host build directory mounted to /workdir/build and the toolchains mounted to the home directory:
If you choose to use docker, launch a new container with the host build directory mounted to /workdir/build and the toolchains mounted to the home directory:


  $ cd ~/var-ti-yocto/tisdk/build
{{#ifexpr: {{#var:YOCTO_VERSION}} >= 4.1 |
  $ ~/var-host-docker-containers/run.sh  -u 20.04 -w $(pwd) $(for dir in ~/gcc-arm*; do echo -n "-v $dir:/home/vari/$(basename $dir) "; done)
  $ cd ~/var-ti-yocto
$ ~/var-host-docker-containers/run.sh  -u 22.04 -w $(pwd) {{#ifexpr: {{#var:YOCTO_VERSION}} < 4.1 | $(for dir in ~/gcc-arm*; do echo -n "-v $dir:/home/vari/$(basename $dir) "; done)}}
  |
$ cd ~/var-ti-yocto
  $ ~/var-host-docker-containers/run.sh  -u 20.04 -w $(pwd) {{#ifexpr: {{#var:YOCTO_VERSION}} < 4.1 | $(for dir in ~/gcc-arm*; do echo -n "-v $dir:/home/vari/$(basename $dir) "; done)}}
}}


Follow the remaining steps to build an image, replacing the path ~/var-ti-yocto/tisdk/build with /workdir/build.
Follow the remaining steps to build an image, replacing the path ~/var-ti-yocto/build with /workdir/build.
}}
}}


* '''Download the latest revision (recommended)'''<br>
* Download the source code dependencies'''<br>
  $ cd tisdk
  $ cd ~/var-ti-yocto
  $ ./oe-layertool-setup.sh -f {{#var:OE_LAYERSETUP_MANIFEST_PATH}}
  $ ./oe-layertool-setup.sh -f {{#var:OE_LAYERSETUP_MANIFEST_PATH}}
<!--
<!--
* '''Download a release tag'''<br>
* '''Download a release tag'''<br>
  $ cd tisdk
  $ cd ~/var-ti-yocto
  $ git checkout {{#var:RELEASE_NAME}}
  $ git checkout {{#var:RELEASE_NAME}}
  $ ./oe-layertool-setup.sh -f {{#var:OE_LAYERSETUP_MANIFEST_PATH}}
  $ ./oe-layertool-setup.sh -f {{#var:OE_LAYERSETUP_MANIFEST_PATH}}
-->
-->
{{#varexists:CORE_SECDEV_K3_GIT |
Fetch the core-secdev-k3 Security Dev Tool:
Fetch the core-secdev-k3 Security Dev Tool:
{{GIT_FETCH|NAME=CORE_SECDEV_K3|WORKDIR=~/var-ti-yocto/tisdk/build|USE_COMMIT=y}}
{{GIT_FETCH|NAME=CORE_SECDEV_K3|WORKDIR=~/var-ti-yocto/build|USE_COMMIT=y}}
 
| }}


Next, setup the environment. The above commands are only required for the very first build setup: whenever restarting a newer build session (from a different terminal or in a different time), you can skip the full setup and just run:
Next, setup the environment. The above commands are only required for the very first build setup: whenever restarting a newer build session (from a different terminal or in a different time), you can skip the full setup and just run:


{{AM62_SETUP_ENV_RETURN}}
{{#switch: {{#var:SOC}}
| am33
= {{AM33_SETUP_ENV_RETURN}}
| #default
= {{#ifexpr: {{#var:YOCTO_VERSION}} < 4.1 | {{AM62_SETUP_ENV_RETURN}} | {{AM62_SETUP_ENV_RETURN_YOCTO_TOOLCHAIN}} }}
}}


= Build GUI demo image =
= Build GUI demo image =


  $ MACHINE=am62x-var-som bitbake var-default-image
  $ MACHINE={{#var:MACHINE_NAME}} bitbake var-default-image
 
= Build thin demo image =
This image is based on var-default-image, but the size is strongly reduced removing the biggest packages (mainly LTP, multimedia, Qt5)
 
$ MACHINE={{#var:MACHINE_NAME}} bitbake var-thin-image


= Create a bootable SD card =
= Create a bootable SD card =


The wic image fully supports booting from an SD Card. Use the command below to write it to an SD Card:
The wic image fully supports booting from an SD card. Use the command below to write it to an SD card:


  $ {{#var:UNZIP}} {{#var:DEPLOY_DIR}}/images/{{#var:MACHINE_NAME}}/{{#var:DEFAULT_IMAGE_BB_NAME}}-{{#var:MACHINE_NAME}}.wic.zst | sudo dd of=/dev/sdX bs=1M && sync
  $ {{#var:UNZIP}} {{#var:DEPLOY_DIR}}/images/{{#var:MACHINE_NAME}}/{{#var:DEFAULT_IMAGE_BB_NAME}}-{{#var:MACHINE_NAME}}.wic.zst | sudo dd of=/dev/sdX bs=1M && sync
{{note|'''NOTE''': The wic image does not support all features booting from eMMC. For example, /etc/fw_env.config is configured for the SD Card (/dev/mmcblk1) |info}}
{{note|'''NOTE''': The wic image does not support all features booting from eMMC. For example, /etc/fw_env.config is configured for the SD card (/dev/mmcblk1) |info}}


= Create a Recovery SD card =
= Create a Recovery SD card =


As mentioned above, the wic image only supports booting from an SD card. To flash an image to eMMC, Variscite provides an image '''var-recovery-sd-image''', which inherits '''var-default-image''' and adds the following files needed for installing to eMMC:
{{#switch: {{#var:RELEASE_NAME}}
| am62-yocto-dunfell-5.10.168_08.06.00.42-v1.2
| am62-yocto-dunfell-5.10.168_08.06.00.42-v1.1
| am62-yocto-dunfell-5.10.168_08.06.00.42-v1.0
= {{AM62-recovery-image
    | var-recovery-recipe = var-recovery-sd-image
  }}
| am33-yocto-dunfell-5.10.100_08.02.00.24-v1.0
= {{AM33-recovery-image
    | var-recovery-recipe = var-recovery-image
  }}
| #default
= {{AM62-recovery-image
    | var-recovery-recipe = var-recovery-image
  }}
}}


{{AM62_RECOVERY_SD_FILES}}
{{#switch: {{#var:SOC}}
 
| am62
By default, the image will be named '''var-recovery-sd-image-am62x-var-som.wic.zst'''. It can be overridden adding the '''RECOVERY_SD_NAME''' variable to local.conf. For example:
  = {{AM62-partition-table}}
 
}}
echo 'RECOVERY_SD_NAME="{{#var:RECOVERY_SD_NAME_BASE}}"' >> conf/local.conf
 
Build the image:
 
  $ MACHINE=am62x-var-som bitbake var-recovery-sd-image
 
Write it to an SD Card:
 
$ {{#var:UNZIP}} {{#var:DEPLOY_DIR}}/images/{{#var:MACHINE_NAME}}/var-recovery-sd-image-{{#var:MACHINE_NAME}}.wic.zst | sudo dd of=/dev/sdX bs=1M && sync
Or, if the image name was overidden with RECOVERY_SD_NAME:
$ {{#var:UNZIP}} {{#var:DEPLOY_DIR}}/images/{{#var:MACHINE_NAME}}/{{#var:RECOVERY_SD_NAME}} | sudo dd of=/dev/sdX bs=1M && sync
<!--
Note: Some SD card duplicator machines do not support 64-bit filesystems. To build a recovery SD card image with 32-bit filesystems, add '''MKE2FS_NO_64="y"''' to '''conf/local.conf''' and rebuild the image:
 
$ echo 'KE2FS_NO_64="y"' >> conf/local.conf
-->
</includeonly>
</includeonly>

Latest revision as of 14:27, 11 August 2024