Difference between revisions of "IoTGateway/BSP/Linux/Quark/Yocto LBV1 User Guide"
From ESS-WIKI
(→To build all image files) |
|||
(30 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | + | {{DISPLAYTITLE:Yocto Linux BSP Ver.1 User Guide for Quark series}} | |
<!-- | <!-- | ||
{| align="right" | {| align="right" | ||
Line 6: | Line 6: | ||
--> | --> | ||
− | =Getting Started= | + | = Getting Started = |
− | |||
− | |||
− | |||
− | + | == <span style="color:#0070c0">Conventions</span> == | |
− | |||
− | :<span style="color:purple">'''${ | + | :<span style="color:purple">'''${IMAGE_PACK}'''</span> : prebuilt image pack |
− | ::e.g. | + | ::e.g. U221LIV1050_quark_2015-05-22.zip |
− | :<span style="color:purple">'''${ | + | :<span style="color:purple">'''${IMAGE_DIR}'''</span> : the directory prebuilt image pack extracted to |
− | ::e.g. | + | ::e.g. ~/U221LIV1050_quark_2015-05-22 |
− | :<span style="color:purple">'''${ | + | :<span style="color:purple">'''${BSP_PACK}'''</span> : BSP pack |
− | ::e.g. | + | ::e.g. U221LBV1050_2015-05-22.zip |
− | :<span style="color:purple">'''${ | + | :<span style="color:purple">'''${BSP_HOME}'''</span> : the directory BSP pack extracted to |
− | ::e.g. | + | ::e.g. ~/LBV1050/meta-clanton_v1.0.4/ |
− | :<span style="color:purple">'''${SD_MOUNT}'''</span> : mount point of SD card in Ubuntu | + | :<span style="color:purple">'''${SD_MOUNT}'''</span> : mount point of SD card in Ubuntu |
::e.g. /media/sdf1 | ::e.g. /media/sdf1 | ||
− | :<span style="color:purple">'''${POKY}'''</span> : Yocto poky version | + | :<span style="color:purple">'''${POKY}'''</span> : Yocto poky version |
− | ::e.g. 1. | + | ::e.g. 1.4.2 |
:debug console / serial console | :debug console / serial console | ||
Line 38: | Line 34: | ||
::terminal program (e.g. gnome-terminal, xfce4-terminal ...) | ::terminal program (e.g. gnome-terminal, xfce4-terminal ...) | ||
− | ==<span style="color:#0070c0 | + | == <span style="color:#0070c0">Prerequisites</span> == |
− | ===<span style="color:#0070c0 | + | |
+ | === <span style="color:#0070c0">To install Docker Engine on your platform</span> === | ||
+ | |||
:Please refer to [https://docs.docker.com/engine/installation/ Docker Installation Guide] for details | :Please refer to [https://docs.docker.com/engine/installation/ Docker Installation Guide] for details | ||
− | ===<span style="color:#0070c0 | + | === <span style="color:#0070c0">To pull [https://hub.docker.com/r/advrisc/u12.04-quarklbv2/ ubuntu 12.04 image from Docker Hub] & run the image</span> === |
+ | |||
:<code>$ docker pull advrisc/u12.04-quarklbv2</code> | :<code>$ docker pull advrisc/u12.04-quarklbv2</code> | ||
− | :<code>$ docker run --name quarkLBV1050 | + | :<code>$ docker run --name quarkLBV1050 -it advrisc/u12.04-quarklbv2 /bin/bash</code> |
+ | |||
+ | === <span style="color:#0070c0">To copy BSP from local filesystem to the container</span> === | ||
+ | |||
+ | :<code>$ docker cp <span style="color:purple">'''${BSP_PACK}'''</span> quarkLBV1050:/home/adv/</code> | ||
+ | |||
+ | === <span style="color:#0070c0">To copy files from the container's filesystem to local machine</span> === | ||
− | + | :<code>$ docker cp quarkLBV1050:/home/adv/<span style="color:#7030a0">'''${BSP_HOME}'''</span>/yocto_build/tmp/deploy/images/ ~</code> | |
− | :<code> $ docker cp <span style="color: | ||
− | + | == <span style="color:#0070c0">Introducing BSP</span> == | |
− | |||
− | |||
:The BSP is based on Yocto Project with Intel enhanced features for Quark, plus specific target board features from Advantech Inc.. | :The BSP is based on Yocto Project with Intel enhanced features for Quark, plus specific target board features from Advantech Inc.. | ||
− | ===<span style="color:#0070c0 | + | === <span style="color:#0070c0">Naming Rule</span> === |
+ | |||
:The tarball/prebuilt image name is consist of the model name followed by "LB" or "LI" plus version number and released date. | :The tarball/prebuilt image name is consist of the model name followed by "LB" or "LI" plus version number and released date. | ||
− | :For example, U221LBV1050_2015-05-22.zip which "U221" stands for <span style="color:#ff0000 | + | :For example, U221LBV1050_2015-05-22.zip which "U221" stands for <span style="color:#ff0000">'''U'''</span>BC-<span style="color:#ff0000">'''221'''</span>, "LB" is acronym of <span style="color:#ff0000">'''L'''</span>inux <span style="color:#ff0000">'''B'''</span>SP, "V1050" stands for <span style="color:#ff0000">'''V'''</span>ersion <span style="color:#ff0000">'''1'''</span>.<span style="color:#ff0000">'''050'''</span><nowiki>.</nowiki> |
+ | |||
+ | |||
+ | :For example, U221LIV1050_quark_2015-05-22.zip which "LI" is acronym for prebuilt <span style="color:#ff0000">'''L'''</span>inux <span style="color:#ff0000">'''I'''</span>mage. | ||
− | + | === <span style="color:#0070c0">BSP pack</span> === | |
− | |||
:Unpack BSP pack to home directory by performing the following command: | :Unpack BSP pack to home directory by performing the following command: | ||
− | ::<code>$ unzip <span style="color:#7030a0 | + | ::<code>$ unzip <span style="color:#7030a0">'''${BSP_PACK}'''</span> -d ~/</code> |
:The description of some important folders list below: | :The description of some important folders list below: | ||
− | ::<span style="color:#7030a0 | + | ::<span style="color:#7030a0">'''${BSP_HOME}'''</span>/ |
− | :::'''meta-advantech/''' : meta layer by Advantech | + | :::'''meta-advantech/''' : meta layer by Advantech |
− | :::'''meta-intel/''' : meta layer by Intel | + | :::'''meta-intel/''' : meta layer by Intel |
− | :::'''meta-clanton-*/''' : meta layer by Intel | + | :::'''meta-clanton-*/''' : meta layer by Intel |
− | :::'''setup.sh''' : to setup one new build environment | + | :::'''setup.sh''' : to setup one new build environment |
+ | |||
+ | === <span style="color:#0070c0">Prebuilt image pack</span> === | ||
− | |||
:Perform the following command to unpack prebuilt-image-pack to home directory | :Perform the following command to unpack prebuilt-image-pack to home directory | ||
− | ::<code>$ unzip <span style="color: | + | ::<code>$ unzip <span style="color:purple">'''${IMAGE_PACK}'''</span> -d ~/</code> |
:Prepare one FAT32 formatted SD card, and mount it to mount point | :Prepare one FAT32 formatted SD card, and mount it to mount point | ||
− | ::<code>$ cp -a <span style="color: | + | ::<code>$ cp -a <span style="color:purple">'''${IMAGE_DIR}'''</span>/sdcard/* <span style="color:#7030a0">'''${SD_MOUNT}'''</span>/</code> |
+ | |||
+ | == <span style="color:#0070c0">Build Instructions</span> == | ||
+ | |||
+ | === <span style="color:#0070c0">To create one new build environment</span> === | ||
− | |||
− | |||
:Perform the following commands in terminal console | :Perform the following commands in terminal console | ||
− | ::<code>$ cd <span style="color:#7030a0 | + | ::<code>$ cd <span style="color:#7030a0">'''${BSP_HOME}'''</span>/</code> |
::<code>$ ./setup.sh</code> | ::<code>$ ./setup.sh</code> | ||
− | ::<code>$ source poky/oe-init-build-env <span style="color:# | + | ::<code>$ source poky/oe-init-build-env yocto_build</code> |
+ | |||
+ | === <span style="color:#0070c0">To continue an exist build environment</span> === | ||
− | |||
:Perform the following commands in terminal console | :Perform the following commands in terminal console | ||
− | ::<code>$ cd <span style="color:#7030a0 | + | ::<code>$ cd <span style="color:#7030a0">'''${BSP_HOME}'''</span>/</code> |
− | ::<code>$ source poky/oe-init-build-env <span style="color:# | + | ::<code>$ source poky/oe-init-build-env yocto_build</code> |
+ | |||
+ | === <span style="color:#0070c0">To build all image files</span> === | ||
− | |||
:To create/continue a build environment | :To create/continue a build environment | ||
:Perform the following command in terminal console | :Perform the following command in terminal console | ||
::<code>$ bitbake image-full</code> | ::<code>$ bitbake image-full</code> | ||
− | :The following files will be located in directory "./tmp/deploy/images/" while building process finished successfully. | + | :The following files will be located in the directory "./tmp/deploy/images/" while building process finished successfully. |
− | <tt> | + | |
− | + | ||
− | ::bzImage | + | |
− | ::core-image-minimal-initramfs-clanton.cpio.gz | + | ::<tt>boot/grub/grub.conf</tt> |
− | ::grub.efi | + | ::<tt>bzImage</tt> |
− | ::image-full-clanton.ext3 | + | ::<tt>core-image-minimal-initramfs-clanton.cpio.gz</tt> |
− | </ | + | ::<tt>grub.efi</tt> |
+ | ::<tt>image-full-clanton.ext3</tt> | ||
+ | |||
+ | |||
+ | |||
+ | === <span style="color:#0070c0">To build toolchain installer</span> === | ||
− | |||
:To create/continue a build environment | :To create/continue a build environment | ||
:Perform the following command in terminal console | :Perform the following command in terminal console | ||
::<code>$ bitbake image-full -c populate_sdk</code> | ::<code>$ bitbake image-full -c populate_sdk</code> | ||
− | :The installer, | + | :The installer, clanton-tiny-uclibc-x86_64-i586-toolchain-<span style="color:#7030a0">'''${POKY}'''</span>.sh, will be located in the directory "./tmp/deploy/sdk". |
+ | |||
+ | === <span style="color:#0070c0">To build grub</span> === | ||
− | |||
:To create/continue a build environment | :To create/continue a build environment | ||
:Perform the following command in terminal console | :Perform the following command in terminal console | ||
::<code>$ bitbake grub</code> | ::<code>$ bitbake grub</code> | ||
− | :The file, grub.efi, will be located in directory, ./tmp/deploy/images/ | + | :The file, grub.efi, will be located in the directory, ./tmp/deploy/images/. |
+ | |||
+ | === <span style="color:#0070c0">To build linux kernel</span> === | ||
− | |||
:To create/continue a build environment | :To create/continue a build environment | ||
:Perform the following command in terminal console | :Perform the following command in terminal console | ||
::to show up menuconfig | ::to show up menuconfig | ||
− | :::<code>$ bitbake linux-yocto- | + | :::<code>$ bitbake linux-yocto-clanton -c menuconfig</code> |
::to do build | ::to do build | ||
− | :::<code>$ bitbake linux-yocto- | + | :::<code>$ bitbake linux-yocto-clanton</code> |
− | :The file, bzImage, will be located in directory, ./tmp/deploy/images/ | + | :The file, bzImage, will be located in the directory, ./tmp/deploy/images/. |
+ | |||
+ | === <span style="color:#0070c0">To build initramfs</span> === | ||
− | |||
:To create/continue a build environment | :To create/continue a build environment | ||
:Perform the following command in terminal console | :Perform the following command in terminal console | ||
::<code>$ bitbake core-image-minimal-initramfs</code> | ::<code>$ bitbake core-image-minimal-initramfs</code> | ||
− | :The file, core-image-minimal-initramfs- | + | :The file, core-image-minimal-initramfs-clanton.cpio.gz, will be located in the directory, ./tmp/deploy/images/. |
=Customization= | =Customization= | ||
− | ==<span style="color:#0070c0 | + | == <span style="color:#0070c0">Setting up SDK</span> == |
+ | |||
:Please follow the section,[[#To_build_toolchain_installer|to build toolchain installer]], to build one toolchain installer first. | :Please follow the section,[[#To_build_toolchain_installer|to build toolchain installer]], to build one toolchain installer first. | ||
:Perform the following command in terminal console | :Perform the following command in terminal console | ||
− | ::<code>$ cd <span style="color:#7030a0 | + | ::<code>$ cd <span style="color:#7030a0">'''${BSP_HOME}'''</span>/yocto_build/tmp/deploy/sdk</code> |
− | ::<code>$ sudo ./ | + | ::<code>$ sudo ./clanton-tiny-uclibc-x86_64-i586-toolchain-<span style="color:#7030a0">'''${POKY}'''</span>.sh</code> |
:Enter directory or press Enter while following question shows up: | :Enter directory or press Enter while following question shows up: | ||
− | + | ||
− | :: | + | |
− | </big></tt> | + | |
+ | :: | ||
+ | {| style="color:white; background:black" | ||
+ | |- | ||
+ | | <tt><big>Enter target directory for SDK (default: /opt/clanton-tiny/1.4.2):</big></tt> | ||
+ | |} | ||
+ | |||
+ | |||
+ | |||
:Just press Enter while following question shows up: | :Just press Enter while following question shows up: | ||
− | + | ||
− | :: | + | |
− | </big></tt> | + | |
+ | :: | ||
+ | {| style="color:white; background:black" | ||
+ | |- | ||
+ | | <tt><big>You are about to install the SDK to "/opt/clanton-tiny/1.4.2". Proceed[Y/n]?</big></tt> | ||
+ | |} | ||
+ | |||
+ | |||
+ | |||
+ | |||
:While following message shows up means the SDK is ready. | :While following message shows up means the SDK is ready. | ||
− | + | ||
− | ::{| style="color:white;background:black" | + | |
− | |Extracting SDK...done | + | |
+ | :: | ||
+ | {| style="color:white; background:black" | ||
+ | |- | ||
+ | | <tt><big>Extracting SDK...done</big></tt> | ||
|- | |- | ||
− | |Setting it up...done | + | | <tt><big>Setting it up...done</big></tt> |
|- | |- | ||
− | |SDK has been successfully set up and is ready to be used. | + | | <tt><big>SDK has been successfully set up and is ready to be used.</big></tt> |
|} | |} | ||
− | |||
==<span style="color:#0070c0;">Setting up cross compiling environment</span>== | ==<span style="color:#0070c0;">Setting up cross compiling environment</span>== | ||
:SDK has been set up (ref. [[#Setting_up_SDK|Setting up SDK]]) | :SDK has been set up (ref. [[#Setting_up_SDK|Setting up SDK]]) | ||
:Perform the following command in terminal console | :Perform the following command in terminal console | ||
− | ::<code>$ source /opt/ | + | ::<code>$ source /opt/clanton-tiny/<span style="color:#7030a0;">'''${POKY}'''</span>/environment-setup-i586-poky-linux-uclibc</code> |
Latest revision as of 19:28, 26 November 2016
Contents
Getting Started
Conventions
- ${IMAGE_PACK} : prebuilt image pack
- e.g. U221LIV1050_quark_2015-05-22.zip
- ${IMAGE_DIR} : the directory prebuilt image pack extracted to
- e.g. ~/U221LIV1050_quark_2015-05-22
- ${BSP_PACK} : BSP pack
- e.g. U221LBV1050_2015-05-22.zip
- ${BSP_HOME} : the directory BSP pack extracted to
- e.g. ~/LBV1050/meta-clanton_v1.0.4/
- ${SD_MOUNT} : mount point of SD card in Ubuntu
- e.g. /media/sdf1
- ${POKY} : Yocto poky version
- e.g. 1.4.2
- debug console / serial console
- serial terminal program (e.g. minicom, putty, teraterm ...) that serial port is configured to 115200 8N1
- terminal console
- terminal program (e.g. gnome-terminal, xfce4-terminal ...)
Prerequisites
To install Docker Engine on your platform
- Please refer to Docker Installation Guide for details
To pull ubuntu 12.04 image from Docker Hub & run the image
$ docker pull advrisc/u12.04-quarklbv2
$ docker run --name quarkLBV1050 -it advrisc/u12.04-quarklbv2 /bin/bash
To copy BSP from local filesystem to the container
$ docker cp ${BSP_PACK} quarkLBV1050:/home/adv/
To copy files from the container's filesystem to local machine
$ docker cp quarkLBV1050:/home/adv/${BSP_HOME}/yocto_build/tmp/deploy/images/ ~
Introducing BSP
- The BSP is based on Yocto Project with Intel enhanced features for Quark, plus specific target board features from Advantech Inc..
Naming Rule
- The tarball/prebuilt image name is consist of the model name followed by "LB" or "LI" plus version number and released date.
- For example, U221LBV1050_2015-05-22.zip which "U221" stands for UBC-221, "LB" is acronym of Linux BSP, "V1050" stands for Version 1.050.
- For example, U221LIV1050_quark_2015-05-22.zip which "LI" is acronym for prebuilt Linux Image.
BSP pack
- Unpack BSP pack to home directory by performing the following command:
$ unzip ${BSP_PACK} -d ~/
- The description of some important folders list below:
- ${BSP_HOME}/
- meta-advantech/ : meta layer by Advantech
- meta-intel/ : meta layer by Intel
- meta-clanton-*/ : meta layer by Intel
- setup.sh : to setup one new build environment
- ${BSP_HOME}/
Prebuilt image pack
- Perform the following command to unpack prebuilt-image-pack to home directory
$ unzip ${IMAGE_PACK} -d ~/
- Prepare one FAT32 formatted SD card, and mount it to mount point
$ cp -a ${IMAGE_DIR}/sdcard/* ${SD_MOUNT}/
Build Instructions
To create one new build environment
- Perform the following commands in terminal console
$ cd ${BSP_HOME}/
$ ./setup.sh
$ source poky/oe-init-build-env yocto_build
To continue an exist build environment
- Perform the following commands in terminal console
$ cd ${BSP_HOME}/
$ source poky/oe-init-build-env yocto_build
To build all image files
- To create/continue a build environment
- Perform the following command in terminal console
$ bitbake image-full
- The following files will be located in the directory "./tmp/deploy/images/" while building process finished successfully.
- boot/grub/grub.conf
- bzImage
- core-image-minimal-initramfs-clanton.cpio.gz
- grub.efi
- image-full-clanton.ext3
To build toolchain installer
- To create/continue a build environment
- Perform the following command in terminal console
$ bitbake image-full -c populate_sdk
- The installer, clanton-tiny-uclibc-x86_64-i586-toolchain-${POKY}.sh, will be located in the directory "./tmp/deploy/sdk".
To build grub
- To create/continue a build environment
- Perform the following command in terminal console
$ bitbake grub
- The file, grub.efi, will be located in the directory, ./tmp/deploy/images/.
To build linux kernel
- To create/continue a build environment
- Perform the following command in terminal console
- to show up menuconfig
$ bitbake linux-yocto-clanton -c menuconfig
- to do build
$ bitbake linux-yocto-clanton
- to show up menuconfig
- The file, bzImage, will be located in the directory, ./tmp/deploy/images/.
To build initramfs
- To create/continue a build environment
- Perform the following command in terminal console
$ bitbake core-image-minimal-initramfs
- The file, core-image-minimal-initramfs-clanton.cpio.gz, will be located in the directory, ./tmp/deploy/images/.
Customization
Setting up SDK
- Please follow the section,to build toolchain installer, to build one toolchain installer first.
- Perform the following command in terminal console
$ cd ${BSP_HOME}/yocto_build/tmp/deploy/sdk
$ sudo ./clanton-tiny-uclibc-x86_64-i586-toolchain-${POKY}.sh
- Enter directory or press Enter while following question shows up:
Enter target directory for SDK (default: /opt/clanton-tiny/1.4.2): |
- Just press Enter while following question shows up:
You are about to install the SDK to "/opt/clanton-tiny/1.4.2". Proceed[Y/n]? |
- While following message shows up means the SDK is ready.
Extracting SDK...done |
Setting it up...done |
SDK has been successfully set up and is ready to be used. |
Setting up cross compiling environment
- SDK has been set up (ref. Setting up SDK)
- Perform the following command in terminal console
$ source /opt/clanton-tiny/${POKY}/environment-setup-i586-poky-linux-uclibc