x86 Yocto BSP v1.2 Quick Start Guide

From ESS-WIKI
Revision as of 10:27, 21 September 2022 by Alec.liao (talk | contribs) (Created page with " {{DISPLAYTITLE:x86 Yocto BSP v1.2 Quick Start Guide}} <div style="float:right; position:fixed; margin:0 1em 0 0; top5100px; right:10px; max-height: 400px; overflow: aut...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


Host Machine

Recommended Host Machine specification:

• Intel® Core™ i7 processor (4 cores).

• Linux OS of choice for the Yocto Project build is Ubuntu 18.04 LTS OS or higher.

• Minimum of 32 GB Random Access Memory (RAM) and 800GB disk space.

• Minimum of SWAP size no less than your RAM size.

• High-speed network connectivity.

Install docker

sudo apt update
sudo apt install docker.io
systemctl status docker ## check if docker service is active
sudo usermod -aG docker $USER
sudo reboot
docker version ## check docker version
Please refer to Docker Installation Guide for details

Install pre-built docker image

If you want to build docker image from scratch, please skip this section.

Please refer to this page to get the pre-built docker image tarball(password is ProvidedByAdvantech).

Then do the following command.(Remember to replace the ${DATE} with the exact date code)

docker load --input adv-x86-yocto-1.2-docker-image_${DATE}.tar.gz

Unpack Yocto BSP

You should replace the following ${BSP_TARBALL} with the exact tarball name.

tar xvf ${BSP_TARBALL} -C ~/

Build Docker Image

(The alternative way is to install the pre-built docker image.)

cd ~/adv-x86-yocto-1.2
scripts/build_docker_image.sh

Put Download Files (optional)

Please refer to this page to get downloads tarball(password is ProvidedByAdvantech).

Then do the following command to restore downloads to the specific directory.(Remember to replace the ${DATE} with the exact date code)

tar xvf adv-x86-yocto-1.2-downloads_${DATE}.tar -C ~/adv-x86-yocto-1.2/yocto/build/

Build Yocto Image

Start docker container

cd ~/adv-x86-yocto-1.2
./scripts/docker_run.sh

Start building yocto image

source ../intel-embedded-system-enabling/oe-init-build-env ./
bitbake -k mc:x86-adv-gui:advantech-image-gui

Or the script:

./init_build_vol.sh
Please refer to FAQ.

Stop docker container

exit ## or logout

You can get the below files from the directory, ~/adv-x86-yocto-1.2/yocto/build/tmp-x86-adv-gui-glibc/deploy/images/intel-corei7-64/.

advantech-image-gui-intel-corei7-64.wic
advantech-image-gui-intel-corei7-64.wic.bz2
advantech-image-gui-intel-corei7-64.wic.bmap

Create Install Image

Get the Create_Install_Image.sh(password is ProvidedByAdvantech), put it to the home directory and do the following commands

chmod +x ~/Create_Install_Image.sh
~/Create_Install_Image.sh

And you will get the compressed install image.

advantech-image-gui-intel-corei7-64_install.wic.bz2

Create USB installer

  1. Put the advantech-image-gui-intel-corei7-64_install.wic.bz2 to windows computer.
  2. Extract advantech-image-gui-intel-corei7-64_install.wic.bz2 to advantech-image-gui-intel-corei7-64_install.wic.
  3. Plug USB drive to your computer.
  4. Download balenaEtcher.
  5. Execute balenaEtcher, click “Flash from file“ to select the wic file, advantech-image-gui-intel-corei7-64_install.wic.
    Flash usb s5-1.png

    Flash usb s5-2.png
  6. Click “Change“ to select the USB drive which you want to flash, then click “Select(X)“
    Flash usb s6-1.png

    Flash usb s6-2.png
  7. Click “Flash!“
    Flash usb s7.png
  8. While the “Flash Complete!” shows up, click “X” to close balenaEtcher.
    Flash usb s8.png

Install to Target Device

  1. Plug USB installer to this system and boot from USB drive.
  2. Open the Install_to_Target_Device.txt on desktop for easily copy&paste command to "Terminal".
    Install to target s2.png

    Install to target s2-2.png
  3. Click "Terminal Emulator".
    Install to target s3.png
  4. Input the following command to show all disks .
    lsblk -ndo name,size,type
    
  5. Input the following command to set which disk you would like to install.
    TARGET=XXX ## XXX means exact disk you would like to install, e.g. sda
    
  6. Input the following command to flash image to target disk.
    sudo bmaptool copy --bmap advantech-image-gui-intel-corei7-64.wic.bmap advantech-image-gui-intel-corei7-64.wic.bz2 /dev/$TARGET
    

    Install to target s6.png
  7. While system shows "bmaptool: info : 100% copied", turn off target device and remove USB drive.
    Install to target s7.png
  8. After reboot, system boot into Yocto.

Enable secure boot

  1. Boot to BIOS, go to “Security-> Secure Boot-> Key Management”.
    Check all “Secure Boot variable” is “No Keys”. If all of them are not “No Keys”.
    Select “Reset To Setup Mode-> Yes”, system will auto reboot and clear all keys.
    Secure boot 1-1.png

    Secure boot 1-2.png
  2. Reboot system to OS, during boot menu, select “chainload efi-secure-boot-lockdown” then press enter.
    Secure boot 2.png
  3. After sytem created Cert, it will reboot automactically.
    Secure boot 3.png
  4. Boot to BIOS again, go to “Security-> Secure Boot” enable “Secure Boot.”
    Go to “Save & Exit” select “Save Changes and Exit”, system will auto reboot.
    Secure boot 4.png
  5. Reboot system to OS, open Terminal and use command “sudo mokutil –sb-state”. You will see “SecureBoot enabled”.
    Secure boot 5.png