Template:Yocto Build Release TI: Difference between revisions

From Variscite Wiki
No edit summary
 
(18 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 =
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 |&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 =
Line 49: Line 56:
'''Download the latest source code (recommended):'''
'''Download the latest source code (recommended):'''


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


or
or
Line 56: Line 62:
'''Download a release tag:'''
'''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 -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.
{{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/tisdk
{{#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 source code dependencies'''<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 =
Line 106: Line 127:
  = {{AM62-recovery-image
  = {{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
Line 113: Line 138:
}}
}}


= Recovery SD card and eMMC partition table =
{{#switch: {{#var:SOC}}
 
| am62
The Recovery SD card and eMMC partition table is as follows:
= {{AM62-partition-table}}
 
}}
{| class="wikitable" style="background-color:#FFF; color:#172B4D;"
|- style="font-weight:bold;"
! Device
! Boot
! Start (Sectors)
! End (Sectors)
! Start (MB)
! Sectors
! Size
! Type
|-
| /dev/mmcblk1p1
| *
| 2048
| 83967
| 1
| 81920
| 40
| W95 FAT32 (LBA)
|-
| U-Boot Env
|
| 88064
| 90111
| 43
| 2048
| 1
| U-Boot Raw
|-
| /dev/mmcblk1p2
|
| 90112
| 15239167
| 44
| 15149056
| 7397
| Linux
|}
</includeonly>
</includeonly>

Latest revision as of 14:27, 11 August 2024