[AIOT] Build OS Image Source Code Information Yocto 3.2 for PE100A

1. Flash image

  • ASUS PE100A - Yocto 3.2 BSP flash image SOP

1. Getting an image

i. Get a published Yocto image from AIoT official webpage

ii. Build an image from source code:

Please refer to "PE100A Yocto-3.2 BSP build SOP" for instructions

  • Note:

If you build from build.sh, then you can find bootloader, raw image, and flash boot in Image-imx8mq-pe100a_DEBUG folder.

If you build from manual command, you can find image and tool in below folder:

a. Bootloader:

build_imx8mq-pe100a/tmp/deploy/images/imx8mq-pe100a/imx-boot-imx8mq-pe100a-4G.bin-flash_evk
 

b. Raw Image:

build_imx8mq-pe100a/tmp/deploy/images/imx8mq-pe100a/imx-image-full-imx8mq-pe100a.wic.bz2
 

c. flash tool:

sources/meta-asus-local/tools/flash_tool/*
 

Please copy all of them to another folder and rename

 

2. Flash image to eMMC

  • Case 1. Device without an OS image (Open Box)

Although PE100A is shipped without any OS by default, it enters into fastboot mode when it’s booted up.

Flash image:

i. Power the device with an adaptor.

ii. The device will stay in fastboot mode as shown below.

iii. Connect the device and host computer (PC or NB) with USB Type-C® cable.

iv. Enter image folder and double click flashall.cmd (Windows) / flashall.sh (Linux) to start image flashing.

If you use Ubuntu and flashall.sh to download image, your Ubuntu server may encounter this problem:

error while loading shared libraries: libssl.so.10: cannot open shared object file: No such file or directory
 
  • Solution:

a. Edit the source list sudo nano /etc/apt/sources.list to add the following line:

deb http://security.ubuntu.com/ubuntu xenial-security main
 

b. Then sudo apt update and sudo apt install libssl1.0.0.

Ref: http://itectec.com/ubuntu/ubuntu-ubuntu-20-04-libssl-so-1-0-0-cannot-open-shared-object-file-no-such-file-or-directory/

v. The device will reboot to Yocto OS automatically once the process is completed.

  • Case 2. Flash an image in fastboot mode

Use "reboot-bootloader" command to make device enter fastboot mode so then the OS image can be flashed directly.

Flash image:

i. Power the device with an adaptor, and wait for the device to boot into Debian OS.

ii. Open a terminal windows and enter reboot-bootloader command

iii. The device will stay in fastboot mode

iv. Connect the device and host computer (PC or NB) with USB Type-C® cable.

v. Enter image folder and double click flashall.cmd (Windows) / flashall.sh (Linux) to start image flashing.

If you use Ubuntu and flashall.sh to download image, your Ubuntu server may encounter this problem:

error while loading shared libraries: libssl.so.10: cannot open shared object file: No such file or directory
 
  • Solution:

Edit the source list sudo nano /etc/apt/sources.list to add the following line:

deb http://security.ubuntu.com/ubuntu xenial-security main
 

Then sudo apt update and sudo apt install libssl1.0.0.

Ref: http://itectec.com/ubuntu/ubuntu-ubuntu-20-04-libssl-so-1-0-0-cannot-open-shared-object-file-no-such-file-or-directory

Case 3. Flash an image in serial download mode (For unbricking)

If device is in brick state or is with an empty eMMC, we can use "serial download mode" to flash an image.

Flash image

i. Toggle boot_mode switch to “Serial downloader” + “eMMC boot ”

DIP

1

2

3

4

ON/OFFOFFONOFFON

 

 

 

 

 

 

ii. Power the device with an adapter.

iii. Connect the device and host computer (PC or NB) with USB Type-C® cable

iv. Enter image folder and double click flashall.cmd (Windows) / flashall.sh (Linux) to start image flashing.

If you use Ubuntu and flashall.sh to download image, your Ubuntu server may encounter this problem:

error while loading shared libraries: libssl.so.1.0.0: cannot open shared object file: No such file or directory
 
  • Solution:

a. Edit the source list sudo nano /etc/apt/sources.list to add the following line:

deb http://security.ubuntu.com/ubuntu xenial-security main
 

b. Then sudo apt update and sudo apt install libssl1.0.0.

Ref: http://itectec.com/ubuntu/ubuntu-ubuntu-20-04-libssl-so-1-0-0-cannot-open-shared-object-file-no-such-file-or-directory/

v. Remove the power adapter and toggle boot mode switch to “Internal boot” + “eMMC boot”

 

The device will reboot to Debian OS automatically once the process is completed.

2. Build image SOP

  • ASUS PE100A - Yocto 3.2 BSP build SOP

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-pe100a-5.10.9-1.0.5.xml

$ repo init -u http://github.com/ASUS-IPC/manifest.git -m asus-pe100a-5.10.9-1.0.5.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 PE100A.

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

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

Bootloader Image:

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

Full Raw Image:

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