# Yocto build environment The purpose of this article is to record the steps of the build process of Yocto. **** # Index - [Yocto build environment](#yocto-build-environment) - [Index](#index) - [Reference Documents and Software Kits](#reference-documents-and-software-kits) - [Yocto \& TCC Comparison matrix](#yocto--tcc-comparison-matrix) - [Pre-requisite for the Build System](#pre-requisite-for-the-build-system) - [VMware Workstation Pro](#vmware-workstation-pro) - [Ubuntu Desktop image](#ubuntu-desktop-image) - [RSA key chcek](#rsa-key-chcek) - [Python version check](#python-version-check) - [GCC version chcek](#gcc-version-chcek) - [Installing the Required Toolchain](#installing-the-required-toolchain) - [Getting Started with the BSP](#getting-started-with-the-bsp) - [Adding Optional Components](#adding-optional-components) - [Proprietary Component setting for adl-s mr5](#proprietary-component-setting-for-adl-s-mr5) - [Proprietary Component setting for rpl-s pv](#proprietary-component-setting-for-rpl-s-pv) - [Proprietary Component setting for tgl-u mr8](#proprietary-component-setting-for-tgl-u-mr8) - [Proprietary Component setting for tgl-h mr6](#proprietary-component-setting-for-tgl-h-mr6) - [Yocto Project\*-based Build Target](#yocto-project-based-build-target) - [Pack Yocto Project\*-based Image](#pack-yocto-project-based-image) - [Prepare a Bootable Image with USB\* Flash Drive](#prepare-a-bootable-image-with-usb-flash-drive) **** # Reference Documents and Software Kits | Tag name | GD | RN | GSG | PP | RPM | ---------------------: | :--------------: | :--------------: | :---------------:| :--------------: | :--------------: | | release-133_adl_s-mr5 | [627373][627373] | [637079][637079] | [637080][637080] | [751007][751007] | | | release-133_adl_p-mr4 | [632294][632294] | [641839][641839] | [641840][641840] | [751007][751007] | [761630][761630] | | release-130_tgl_u-mr8 | [615561][615561] | [732574][732574] | [635120][635120] | [759479][759479] | | | release-130_tgl_h-mr6 | [615561][615561] | [734357][734357] | [636836][636836] | [759479][759479] | | | release-125_adl_ps-mr2 | [642842][642842] | [714319][714319] | [713542][713542] | [761615][761615] | [761630][761630] | | release-124_rpl_s-pv | [765911][765911] | [768981][768981] | [768983][768983] | [740785][740785] | [724016][724016] | | no Yocto rpl_p | [730563][730563] | | | | | - GD : Gold Deck - RN : Release Notes - GSG : Get Started Guide - PP : Proprietary Package - RPM : RedHat Package Manager [627373]: https://cdrdv2.intel.com/v1/dl/getContent/627373 [637079]: https://cdrdv2.intel.com/v1/dl/getContent/637079 [637080]: https://cdrdv2.intel.com/v1/dl/getContent/637080 [751007]: https://www.intel.com/content/www/us/en/secure/design/confidential/software-kits/kit-details.html?kitId=751007 [632294]: https://cdrdv2.intel.com/v1/dl/getContent/632294 [641839]: https://cdrdv2.intel.com/v1/dl/getContent/641839 [641840]: https://cdrdv2.intel.com/v1/dl/getContent/641840 [761630]: https://www.intel.com/content/www/us/en/secure/design/confidential/software-kits/kit-details.html?kitId=761630 [615561]: https://cdrdv2.intel.com/v1/dl/getContent/615561 [732574]: https://cdrdv2.intel.com/v1/dl/getContent/732574 [635120]: https://cdrdv2.intel.com/v1/dl/getContent/635120 [759479]: https://www.intel.com/content/www/us/en/secure/design/confidential/software-kits/kit-details.html?kitId=759479 [734357]: https://cdrdv2.intel.com/v1/dl/getContent/734357 [636836]: https://cdrdv2.intel.com/v1/dl/getContent/636836 [642842]: https://cdrdv2.intel.com/v1/dl/getContent/642842 [714319]: https://cdrdv2.intel.com/v1/dl/getContent/714319 [713542]: https://cdrdv2.intel.com/v1/dl/getContent/713542 [761615]: https://www.intel.com/content/www/us/en/secure/design/confidential/software-kits/kit-details.html?kitId=761615 [765911]: https://cdrdv2.intel.com/v1/dl/getContent/765911 [768981]: https://cdrdv2.intel.com/v1/dl/getContent/768981 [768983]: https://cdrdv2.intel.com/v1/dl/getContent/768983 [740785]: https://www.intel.com/content/www/us/en/secure/design/confidential/software-kits/kit-details.html?kitId=740785 [724016]: https://cdrdv2.intel.com/v1/dl/getContent/724016 [730563]: https://cdrdv2.intel.com/v1/dl/getContent/730563 # Yocto & TCC Comparison matrix | Tag name | TCC in GD | Yocto in GD | RT in GSG | TCC in GSG | | ---------------------: | :-------: | :---------: | :-------: | :--------: | | release-133_adl_s-mr5 | * | * | * | * | | release-133_adl_p-mr4 | | * | | | | release-130_tgl_u-mr8 | * | * | * | * | | release-130_tgl_h-mr6 | * | * | * | * | | release-125_adl_ps-mr2 | | * | | | | release-124_rpl_s-pv | * | * | * | | | no Yocto rpl_p | * | | | | - TCC : Time Coordinated Computing - RT : Real-time # Pre-requisite for the Build System | Tag name | RAM | SSD | USB | Ubuntu | Python3 | GCC | | ---------------------: | ---- | ----- | ---- | :-------: | :-------:| :---: | | release-133_adl_s-mr5 | 32GB | 500GB | 64GB | 18.04 LTS | 3.6.9 | 8.2 | | release-133_adl_p-mr4 | 32GB | 500GB | 64GB | 18.04 LTS | 3.6.9 | 8.2 | | release-130_tgl_u-mr8 | 32GB | 500GB | 64GB | 18.04 LTS | 3.6.9 | 8.2 | | release-130_tgl_h-mr6 | 32GB | 500GB | 64GB | 18.04 LTS | 3.6.9 | 8.2 | | release-125_adl_ps-mr2 | 32GB | 500GB | 64GB | 18.04 LTS | 3.6.9 | 8.2 | | release-124_rpl_s-pv | 32GB | 500GB | 64GB | 18.04 LTS | 3.8.10 | 8.2 | | no Yocto rpl_p | | | | | | | - GCC : GNU Compiler Collection ## VMware Workstation Pro <https://www.vmware.com/go/getworkstation-win> <https://download3.vmware.com/software/WKST-1702-WIN/VMware-workstation-full-17.0.2-21581411.exe> - NV6RH-2RH50-0JD79-0T9N2-A22M2 - 4V4RR-6VH8P-HJ488-1KCNK-CYH22 - 1C4TU-D81E1-MJ4L9-0V8Q4-CA0Q8 ## Ubuntu Desktop image <https://releases.ubuntu.com/18.04/ubuntu-18.04.6-desktop-amd64.iso> Recommend <https://releases.ubuntu.com/20.04/ubuntu-20.04.6-desktop-amd64.iso> <https://releases.ubuntu.com/22.04/ubuntu-22.04.2-desktop-amd64.iso> ## RSA key chcek If you do not have ssh key for github, proceed to the next steps: ```Bash ssh-keygen -t rsa -b 4096 -C "your_email@example.com" cat ~/.ssh/id_rsa.pub ``` Then copy/paste/add it to [Github keys](https://github.com/settings/keys "Github"). ```Bash ssh -i ~/.ssh/id_rsa -o IdentityAgent=none -T git@github.com git config --global user.email "your_email@example.com" git config --global user.name "FIRST_NAME LAST_NAME" ``` ## Python version check If your python version is not match, proceed to the next steps: ```Bash python --version git clone https://github.com/waketzheng/carstino ~/carstino/ cd ~/carstino sudo python3 upgrade_py.py -v 39 sudo update-alternatives --install /usr/bin/python python /usr/local/bin/python3.9 1 ``` ## GCC version chcek If your gcc version is not match, proceed to the next steps: ```Bash gcc --version g++ --version sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt-get install --reinstall ca-certificates sudo -E add-apt-repository ppa:ppaname/ppa sudo apt-get update sudo apt-get install gcc-9 g++-9 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-9 sudo update-alternatives --config gcc ``` # Installing the Required Toolchain Here are the packages needed to build an image from [thispage](https://docs.yoctoproject.org/ref-manual/system-requirements.html#required-packages-for-the-build-host "packages"). ```Bash sudo apt-get update sudo apt-get upgrade sudo apt-get -y install gawk wget git diffstat unzip texinfo gcc build-essential chrpath socat cpio python3 python3-pip python3-pexpect xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev python3-subunit mesa-common-dev zstd liblz4-tool file locales ``` | Tag name | Additional Packages | | ---------------------: | ------------------------------------------------------------------ | | release-133_adl_s-mr5 | curl git-core libncurses5-dev patchutils | | release-133_adl_p-mr4 | curl git-core libncurses5-dev patchutils | | release-130_tgl_u-mr8 | curl git-core libncurses5-dev patchutils | | release-130_tgl_h-mr6 | curl git-core libncurses5-dev patchutils | | release-125_adl_ps-mr2 | curl git-core libncurses5-dev patchutils xterm pylint3 | | release-124_rpl_s-pv | curl git-core libncurses5-dev patchutils xterm elfutils libelf-dev | | no Yocto rpl_p | | ```Bash sudo apt-get -y install curl git-core libncurses5-dev patchutils xterm pylint3 elfutils libelf-dev ``` Download and install the git-lfs in the host machine: ```Bash curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo -E bash sudo apt-get install git-lfs ``` # Getting Started with the BSP 1.Create a bin/ directory in your home directory and include your path: ```Bash mkdir ~/bin PATH=~/bin:$PATH ``` 2.Get the repo source and make it executable: ```Bash curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo chmod a+x ~/bin/repo ``` 3.Make a new directory: ```Bash mkdir ~/<tag_name> cd ~/<tag_name>/ ``` 4.Git clone the repo manifest. This manifest will help you to clone all required repositories to create the base BSP: ```Bash repo init -u https://github.com/intel/iotg-yocto-ese-manifest.git -b refs/tags/<tag_name> -g all ``` 5.Pull the repository meta-layers (-j8 for simultaneous downloads, increase/decrease per your needs) and Make a branch: ```Bash repo sync -c -j8 --force-sync repo sync repo forall managed/* -c git branch -f BUILD HEAD ``` 6.Optimize compile performance ```Bash cd ~/<tag_name>/build/conf/ sed -i -e '$a\\n' ./local.conf sed -i -e '$aPARALLEL_MAKE = "-j4"' ./local.conf sed -i -e '$aBB_NUMBER_THREADS = "4"' ./local.conf sed -i -e '$a\\n' ./local.conf cat ./local.conf cd ~ ``` # Adding Optional Components | Tag name | | | | | | ---------------------: | ---------- | --------------- | ------------------- | -------------- | | release-133_adl_s-mr5 | bmap-tools | iotg-tsn-ref-sw | meta-intel-wireless | | | release-133_adl_p-mr4 | bmap-tools | | meta-intel-wireless | meta-intel-ipu | | release-130_tgl_u-mr8 | bmap-tools | iotg-tsn-ref-sw | meta-intel-wireless | meta-intel-ipu | | release-130_tgl_h-mr6 | bmap-tools | iotg-tsn-ref-sw | meta-intel-wireless | | | release-125_adl_ps-mr2 | bmap-tools | | meta-intel-wireless | meta-intel-ipu | | release-124_rpl_s-pv | bmap-tools | iotg-tsn-ref-sw | meta-intel-wireless | | | no Yocto rpl_p | | | | | | Tag name | | | | | | ---------------------: | --------------------- | ----------- | -------- | --------- | | release-133_adl_s-mr5 | | | | meta-ptcm | | release-133_adl_p-mr4 | meta-intel-cellular | | | | | release-130_tgl_u-mr8 | meta-intel-cellular | iosm-driver | mdm-ctrl | meta-ptcm | | release-130_tgl_h-mr6 | meta-intel-cellular | iosm-driver | mdm-ctrl | meta-ptcm | | release-125_adl_ps-mr2 | | | | | | release-124_rpl_s-pv | intel-socwatch-driver | | | | | no Yocto rpl_p | | | | | ## Proprietary Component setting for adl-s mr5 ```Bash cd ~/<tag_name>/build/conf/ sed -i 's#\s\s\\# ${TOPDIR}/../proprietary/meta-intel-wireless \\\n \\#g' ./bblayers.conf sed -i 's#\s\s\\# ${TOPDIR}/../proprietary/meta-ptcm \\\n \\#g' ./bblayers.conf cat ./bblayers.conf cd ~ cd ~/<tag_name>/intel-embedded-system-enabling/meta-intel-embedded-system-enabling/meta-intel-distro/conf/include/ sed -i -e '$a\\n' ./ese-x86-common.inc sed -i -e '$aIMAGE_INSTALL:append = " bmap-tools"' ./ese-x86-common.inc sed -i -e '$a\\n' ./ese-x86-common.inc sed -i -e '$aIMAGE_INSTALL:append = " iotg-tsn-ref-sw"' ./ese-x86-common.inc sed -i -e '$a\\n' ./ese-x86-common.inc sed -i -e '$aIMAGE_INSTALL:append = " ptcm"' ./ese-x86-common.inc sed -i -e '$aPTCM_INSTALL = "1"' ./ese-x86-common.inc sed -i -e '$a\\n' ./ese-x86-common.inc cat ./ese-x86-common.inc cd ~ cd ~/<tag_name>/proprietary/ for f in *.tar.gz; do tar -xvzf "$f"; done cd ~ ``` ## Proprietary Component setting for rpl-s pv ```Bash cd ~/rpl_s-pv/build/conf/ sed -i 's#\s\s\\# ${TOPDIR}/../proprietary/meta-intel-socwatch \\\n \\#g' ./bblayers.conf sed -i 's#\s\s\\# ${TOPDIR}/../proprietary/meta-intel-wireless \\\n \\#g' ./bblayers.conf cat ./bblayers.conf cd ~ cd ~/rpl_s-pv/intel-embedded-system-enabling/meta-intel-embedded-system-enabling/meta-intel-distro/conf/include/ sed -i -e '$a\\n' ./ese-x86-common.inc sed -i -e '$aIMAGE_INSTALL:append = " bmap-tools"' ./ese-x86-common.inc sed -i -e '$aIMAGE_INSTALL:append = " devmem2"' ./ese-x86-common.inc sed -i -e '$a\\n' ./ese-x86-common.inc sed -i -e '$aIMAGE_INSTALL:append = " iotg-tsn-ref-sw"' ./ese-x86-common.inc sed -i -e '$a\\n' ./ese-x86-common.inc sed -i -e '$aKERNEL_PROVIDERS_EXTRA_MODULES[5.19] += " intel-socwatch-driver"' ./ese-x86-common.inc sed -i -e '$a\\n' ./ese-x86-common.inc cat ./ese-x86-common.inc cd ~ cd ~/rpl_s-pv/proprietary/ for f in *.tar.gz; do tar -xvzf "$f"; done for f in *.zip; do unzip "$f" -d ~/rpl_s-pv/proprietary/; done cd ~ ``` ## Proprietary Component setting for tgl-u mr8 ```Bash cd ~/tgl_u-mr8/build/conf/ sed -i 's#\s\s\\# ${TOPDIR}/../proprietary/meta-intel-wireless \\\n \\#g' ./bblayers.conf sed -i 's#\s\s\\# ${TOPDIR}/../proprietary/meta-intel-cellular \\\n \\#g' ./bblayers.conf sed -i 's#\s\s\\# ${TOPDIR}/../proprietary/meta-intel-ipu \\\n \\#g' ./bblayers.conf sed -i 's#\s\s\\# ${TOPDIR}/../proprietary/meta-ptcm \\\n \\#g' ./bblayers.conf cat ./bblayers.conf cd ~ cd ~/tgl_u-mr8/intel-embedded-system-enabling/meta-intel-embedded-system-enabling/meta-intel-distro/conf/include/ sed -i -e '$a\\n' ./ese-x86-common.inc sed -i -e '$aIMAGE_INSTALL:append = " bmap-tools"' ./ese-x86-common.inc sed -i -e '$a\\n' ./ese-x86-common.inc sed -i -e '$aIMAGE_INSTALL:append = " iotg-tsn-ref-sw"' ./ese-x86-common.inc sed -i -e '$a\\n' ./ese-x86-common.inc sed -i -e '$aIMAGE_INSTALL:append = " packagegroup-meta-intel-cellular"' ./ese-x86-common.inc sed -i -e '$aKERNEL_PROVIDERS_EXTRA_MODULES[5.10] += " iosm-driver"' ./ese-x86-common.inc sed -i -e '$aKERNEL_PROVIDERS_EXTRA_MODULES[5.10] += " mdm-ctrl"' ./ese-x86-common.inc sed -i -e '$a\\n' ./ese-x86-common.inc sed -i -e '$aIMAGE_INSTALL:append = " ptcm"' ./ese-x86-common.inc sed -i -e '$aPTCM_INSTALL = "1"' ./ese-x86-common.inc sed -i -e '$a\\n' ./ese-x86-common.inc sed -i -e '$aIMAGE_INSTALL:append = " ipu6fw"' ./ese-x86-common.inc sed -i -e '$aIMAGE_INSTALL:append = " intel-ipu6-conf"' ./ese-x86-common.inc sed -i -e '$a\\n' ./ese-x86-common.inc cat ./ese-x86-common.inc cd ~ cd ~/tgl_u-mr8/proprietary/ for f in *.zip; do unzip "$f" -d ~/tgl_u-mr8/proprietary/; done for f in *.tar.gz; do tar -xvzf "$f"; done cd ~ ``` ## Proprietary Component setting for tgl-h mr6 ```Bash cd ~/tgl_h-mr6/build/conf/ sed -i 's#\s\s\\# ${TOPDIR}/../proprietary/meta-intel-wireless \\\n \\#g' ./bblayers.conf sed -i 's#\s\s\\# ${TOPDIR}/../proprietary/meta-intel-cellular \\\n \\#g' ./bblayers.conf sed -i 's#\s\s\\# ${TOPDIR}/../proprietary/meta-ptcm \\\n \\#g' ./bblayers.conf cat ./bblayers.conf cd ~ cd ~/tgl_h-mr6/intel-embedded-system-enabling/meta-intel-embedded-system-enabling/meta-intel-distro/conf/include/ sed -i -e '$a\\n' ./ese-x86-common.inc sed -i -e '$aIMAGE_INSTALL:append = " bmap-tools"' ./ese-x86-common.inc sed -i -e '$a\\n' ./ese-x86-common.inc sed -i -e '$aIMAGE_INSTALL:append = " iotg-tsn-ref-sw"' ./ese-x86-common.inc sed -i -e '$a\\n' ./ese-x86-common.inc sed -i -e '$aIMAGE_INSTALL:append = " packagegroup-meta-intel-cellular"' ./ese-x86-common.inc sed -i -e '$aKERNEL_PROVIDERS_EXTRA_MODULES[5.10] += " iosm-driver"' ./ese-x86-common.inc sed -i -e '$aKERNEL_PROVIDERS_EXTRA_MODULES[5.10] += " mdm-ctrl"' ./ese-x86-common.inc sed -i -e '$a\\n' ./ese-x86-common.inc sed -i -e '$aIMAGE_INSTALL:append = " ptcm"' ./ese-x86-common.inc sed -i -e '$aPTCM_INSTALL = "1"' ./ese-x86-common.inc sed -i -e '$a\\n' ./ese-x86-common.inc cat ./ese-x86-common.inc cd ~ cd ~/tgl_h-mr6/proprietary/ for f in *.zip; do unzip "$f" -d ~/tgl_h-mr6/proprietary/; done for f in *.tar.gz; do tar -xvzf "$f"; done cd ~ ``` # Yocto Project*-based Build Target | Tag name | LTS Kernel | Real-time (RT) Kernel | | ---------------------: | --------------------------------------- | ------------------------------------------ | | release-133_adl_s-mr5 | bitbake mc:x86-2021:core-image-sato-sdk | bitbake mc:x86-rt-2021:core-image-sato-sdk | | release-133_adl_p-mr4 | bitbake mc:x86-2021:core-image-sato-sdk | | | release-130_tgl_u-mr8 | bitbake mc:x86-2020:core-image-sato-sdk | bitbake mc:x86-rt-2020:core-image-sato-sdk | | release-130_tgl_h-mr6 | bitbake mc:x86-2020:core-image-sato-sdk | bitbake mc:x86-rt-2020:core-image-sato-sdk | | release-125_adl_ps-mr2 | bitbake mc:x86-2021:core-image-sato-sdk | | | release-124_rpl_s-pv | bitbake mc:x86-next:core-image-sato-sdk | bitbake mc:x86-rt-next:core-image-sato-sdk | | no Yocto rpl_p | | | ```Bash cd ~/<tag_name>/build/ source ../intel-embedded-system-enabling/oe-init-build-env . bitbake mc:x86-rt-2021:core-image-sato-sdk ``` # Pack Yocto Project*-based Image ```Bash cd ~ curl -Lo bmaptool https://github.com/01org/bmap-tools/releases/download/v3.4/bmaptool && chmod +x bmaptool sudo apt install p7zip-full p7zip-rar echo "./bmaptool" > listfiles.txt echo "./*<tag_name>/build/tmp-*-glibc/deploy/images/intel-corei7-64/core-image-sato-sdk-intel-corei7-64-*.wic" >> listfiles.txt echo "./*<tag_name>/build/tmp-*-glibc/deploy/images/intel-corei7-64/core-image-sato-sdk-intel-corei7-64-*.wic.bmap" >> listfiles.txt echo "./*<tag_name>/build/conf/local.conf" >> listfiles.txt echo "./*<tag_name>/build/conf/bblayers.conf" >> listfiles.txt echo "./*<tag_name>/proprietary/" >> listfiles.txt echo "./*<tag_name>/intel-embedded-system-enabling/meta-intel-embedded-system-enabling/meta-intel-distro/conf/include/ese-x86-common.inc" >> listfiles.txt cat ~/listfiles.txt 7z a ~/<tag_name>.7z @listfiles.txt ``` # Prepare a Bootable Image with USB* Flash Drive ```Bash cd ~ curl -Lo bmaptool https://github.com/01org/bmap-tools/releases/download/v3.4/bmaptool && chmod +x bmaptool python -m pip install six cd ~/<tag_name>/build/tmp-x86-rt-xxxx-glibc/deploy/images/intel-corei7-64/ sudo ~/bmaptool copy --bmap ./core-image-sato-xxx-<date>.wic.bmap <path>/core-image-sato-<date>.wic /dev/sdc ```