Template:Yocto Build Release TI: Difference between revisions
From Variscite Wiki
(19 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 [ | 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 = | ||
Line 42: | 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 | | |||
= 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 = | ||
Line 49: | Line 56: | ||
'''Download the latest source code (recommended):''' | '''Download the latest source code (recommended):''' | ||
$ git clone {{#var:OE_LAYERSETUP_GIT}} ~/var-ti-yocto | |||
$ git clone {{#var:OE_LAYERSETUP_GIT}} | |||
or | or | ||
Line 56: | Line 62: | ||
'''Download a release tag:''' | '''Download a release tag:''' | ||
$ git clone {{#var:OE_LAYERSETUP_GIT}} ~/var-ti-yocto -b {{#var:RELEASE_NAME}} | |||
$ git clone {{#var:OE_LAYERSETUP_GIT}} | |||
{{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 64: | 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/ | {{#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 | Follow the remaining steps to build an image, replacing the path ~/var-ti-yocto/build with /workdir/build. | ||
}} | }} | ||
* Download the source code dependencies'''<br> | * Download the source code dependencies'''<br> | ||
$ cd | $ 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 | $ 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 | {{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= | $ 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 | 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 | {{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 = | ||
Line 104: | Line 125: | ||
| am62-yocto-dunfell-5.10.168_08.06.00.42-v1.1 | | 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-yocto-dunfell-5.10.168_08.06.00.42-v1.0 | ||
= {{ | = {{AM62-recovery-image | ||
| var-recovery-recipe = var-recovery-sd-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 | | #default | ||
= {{ | = {{AM62-recovery-image | ||
| var-recovery-recipe = var-recovery-image | | var-recovery-recipe = var-recovery-image | ||
}} | }} | ||
}} | }} | ||
{{#switch: {{#var:SOC}} | |||
| am62 | |||
= {{AM62-partition-table}} | |||
}} | |||
{ | |||
| | |||
</includeonly> | </includeonly> |