[AIOT] Build OS Image Yocto 3.2 for IMX8P-IM-A

1. Create an Ubuntu machine environment

Using one of the following versions is recommended: 20.04

2. Download Yocto source code from github (http://github.com/ASUS-IPC/manifest)

$ git config --global user.name "Your Name"
$ git config --global user.email "Your Email"
 
$ mkdir ~/bin (this step may not be needed if the bin folder already exists)
 
$ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
$ export PATH=~/bin:$PATH
$ mkdir ~/asus-yocto-3.2
$ cd ~/asus-yocto-3.2
 
$ repo init -u http://github.com/ASUS-IPC/manifest.git -m $manifest_name
 

Ex. for asus-imx8p-im-a-5.10.9-2.0.14.xml

$ repo init -u http://github.com/ASUS-IPC/manifest.git -m asus-imx8p-im-a-5.10.9-2.0.14.xml
$ repo sync -j4
 

3. Setup Docker

  • Uninstall old versions
$ sudo apt-get remove docker docker-engine docker.io containerd runc
 
  • Install Docker Engine - Community
$ sudo apt-get update
$ sudo apt-get install apt-transport-http ca-certificates curl gnupg-agent software-properties-common
$ curl -fsSL http://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
$ sudo apt-key fingerprint 0EBFCD88
$ sudo add-apt-repository "deb [arch=amd64] http://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
$ sudo apt-get update
$ sudo apt-get install docker-ce docker-ce-cli containerd.io
$ sudo docker run hello-world
 

http://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/

  • Manage Docker as a non-root user

If you don’t want to preface the docker command with sudo, create a Unix group called docker and add users to it.

$ sudo groupadd docker
$ sudo usermod -aG docker $USER
$ sudo reboot
  
$ docker run hello-world
 

http://docs.docker.com/install/linux/linux-postinstall/

4. Docker build:

Go to to the directory where the downloaded the code base is located in, and execute the script. This will take a while as it installs the necessary packages on the host and builds the Docker image.

$ cd ~/asus-yocto-3.2
$ ./docker_builder/docker-builder-run.sh
 

Once the step above is finished, you are in the shell of the newly started Docker container. You can issue the following command to build all the images for yocto. Below was sample command for ASUS IMX8P-IM-A.

$ DISTRO=fsl-imx-xwayland MACHINE=imx8mq-im-a EULA=1 source imx-setup-release.sh -b build_imx8mq-im-a
$ bitbake imx-image-full
 

5. After build successfully, you can find all image at below path

Bootloader Image:

$ build_imx8mq-im-a/tmp/deploy/images/imx8mq-im-a/imx-boot-imx8mq-im-a-4G.bin-flash_evk
 

Full Raw Image:

$ build_imx8mq-im-a/tmp/deploy/images/imx8mq-im-a/imx-image-full-imx8mq-im-a.wic.bz2