Template:Yocto Build Release TI: Difference between revisions
From Variscite Wiki
(32 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 = | ||
{{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 16: | Line 28: | ||
automake bison \ | automake bison \ | ||
flex libssl-dev bc u-boot-tools \ | flex libssl-dev bc u-boot-tools \ | ||
diffstat \ | |||
texinfo gawk chrpath dos2unix \ | texinfo gawk chrpath dos2unix \ | ||
wget unzip socat doxygen libc6:i386 \ | wget unzip socat doxygen libc6:i386 \ | ||
Line 22: | Line 34: | ||
libz1:i386 g++-multilib \ | libz1:i386 g++-multilib \ | ||
git python3-distutils python3-apt | git python3-distutils python3-apt | ||
For Ubuntu 20.04 and older: | |||
$ sudo apt install python | |||
For Ubuntu 22.04 and newer,: | |||
$ sudo apt install python-is-python3 | |||
By default Ubuntu uses “dash” as the default shell for /bin/sh. You must reconfigure to use bash by running the following command: | By default Ubuntu uses “dash” as the default shell for /bin/sh. You must reconfigure to use bash by running the following command: | ||
Line 29: | 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 = | ||
Download the source code: | '''Download the latest source code (recommended):''' | ||
$ git clone {{#var:OE_LAYERSETUP_GIT}} ~/var-ti-yocto | |||
or | |||
'''Download a release tag:''' | |||
$ git clone {{#var:OE_LAYERSETUP_GIT}} ~/var-ti-yocto -b {{#var:RELEASE_NAME}} | |||
{{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. | |||
To learn more, please see Variscite's [[Docker_Build_Environment | Docker Build Environment]] guide. | |||
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: | |||
* | {{#ifexpr: {{#var:YOCTO_VERSION}} >= 4.1 | | ||
$ cd | $ 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/build with /workdir/build. | |||
}} | |||
* Download the source code dependencies'''<br> | |||
$ 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: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 = | ||
{{#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 | |||
}} | |||
}} | |||
{{#switch: {{#var:SOC}} | |||
| am62 | |||
= {{AM62-partition-table}} | |||
}} | |||
</includeonly> | </includeonly> |