Yocto environment construction record

Main reference: " i.MX Yocto Project User's Guide" Rev.0, 10/2016

0, update source

Back up the original:

sudo cp /etc/apt/sources.list  /etc/apt/sources.list.bak

Use Ali's source

hedy@ubuntu:~$ cat /etc/apt/sources.list
#aliyun
deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
 
#ubuntu 
deb http://archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
 
#ubuntu other
deb http://archive.canonical.com/ubuntu/ trusty partner
deb http://extras.ubuntu.com/ubuntu/ trusty main
hedy@ubuntu:~$ 

1. Unable to install the package

hedy@ubuntu:~$ sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package texinfo is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  info install-info

Package git-core is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package gcc-multilib is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Unable to locate package gawk
E: Package 'git-core' has no installation candidate
E: Package 'texinfo' has no installation candidate
E: Package 'gcc-multilib' has no installation candidate
E: Unable to locate package build-essential

solve:

Because of the newly installed ubuntu system, there is no update reason.

Enter the command: sudo apt-get update

Reinstall

2. The repo cannot be downloaded

Use someone else's downloaded one, and copy it directly.
Repo download: link .

3. Cannot download the source code

hedy@ubuntu:~/fsl-arm-yocto-bsp$ repo init -u git://git.freescale.com/imx/fsl-arm-yocto-bsp.git -b imx-4.1-krogoth
gpg: keyring `/home/hedy/.repoconfig/gnupg/secring.gpg' created
gpg: keyring `/home/hedy/.repoconfig/gnupg/pubring.gpg' created
gpg: /home/hedy/.repoconfig/gnupg/trustdb.gpg: trustdb created
gpg: key 920F5C65: public key "Repo Maintainer <[email protected]>" imported
gpg: key 692B382C: public key "Conley Owens <[email protected]>" imported
gpg: Total number processed: 2
gpg:               imported: 2  (RSA: 1)

fatal: Cannot get https://gerrit.googlesource.com/git-repo/clone.bundle
fatal: error [Errno 101] Network is unreachable

Solution:
This problem occurs because the Google server cannot be accessed normally in Tianchao.

Modify the repo file to:

#REPO_URL = 'https://gerrit.googlesource.com/git-repo'

To

REPO_URL = 'https://mirrors.ustc.edu.cn/aosp/git-repo'

4. Download source code is unsuccessful

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got 'hedy@ubuntu.(none)')

solve:

Run

  git config --global user.email "[email protected]"
  git config --global user.name "Your Name"

5. Repo init error resolution

 First install the i.MX NXP BSP repo
$: repo init -u git://git.freescale.com/imx/fsl-arm-yocto-bsp.git -b imx-4.1-krogoth

Download the Yocto Project NXP Layers:
$: repo sync

If errors on repo init, remove the .repo directory and try repo init again.

Note that this downloads the latest release for 4.1.15-2.1.0 plus patches after.

To download only the 4.1.15-2.1.0 release use this for repo init command
$: repo init -u git://git.freescale.com/imx/fsl-arm-yocto-bsp.git -b imx-4.1-krogoth -m imx-4.1.15-2.1.0.xml

6, compilation error

WARNING: linux-imx-4.1.15-r0 do_fetch: Failed to fetch URL git://git.freescale.com/imx/linux-imx.git;protocol=git;branch=imx_4.1.15_2.0.0_ga, attempting MIRRORS if available
ERROR: linux-imx-4.1.15-r0 do_fetch: Fetcher failure: Fetch command failed with exit code 128, output:
Cloning into bare repository '/home/hedy/fsl-arm-yocto-bsp/downloads//git2/git.freescale.com.imx.linux-imx.git'...
fatal: read error: Connection timed out
fatal: early EOF
fatal: index-pack failed

ERROR: linux-imx-4.1.15-r0 do_fetch: Function failed: Fetcher failure for URL: 'git://git.freescale.com/imx/linux-imx.git;protocol=git;branch=imx_4.1.15_2.0.0_ga'. Unable to fetch URL from any source.
ERROR: Logfile of failure stored in: /home/hedy/fsl-arm-yocto-bsp/build-fb/tmp/work/imx6qsabreauto-poky-linux-gnueabi/linux-imx/4.1.15-r0/temp/log.do_fetch.56902
ERROR: Task 50 (/home/hedy/fsl-arm-yocto-bsp/sources/meta-fsl-bsp-release/imx/meta-bsp/recipes-kernel/linux/linux-imx_4.1.15.bb, do_fetch) failed with exit code '1'
NOTE: Tasks Summary: Attempted 2009 tasks of which 0 didn't need to be rerun and 1 failed.
Waiting for 0 running tasks to finish:

Summary: 1 task failed:
  /home/hedy/fsl-arm-yocto-bsp/sources/meta-fsl-bsp-release/imx/meta-bsp/recipes-kernel/linux/linux-imx_4.1.15.bb, do_fetch
Summary: There were 41 WARNING messages shown.
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.
hedy@ubuntu:~/fsl-arm-yocto-bsp/build-fb$ 

Solution:
Yocto will compile while downloading. If the network environment is not good, various errors will occur.

Can download all the required packages and does not compile
sometimes we may need to first download all the required packages down, such as home or other off-line time to compile, which we can use the following command to complete:

bitbake fsl-image-qt5 -c fetchall

Compile again:

bitbake fsl-image-qt5

7, bitbake fsl-image-qt5 results

hedy@ubuntu:~/fsl-arm-yocto-bsp/build-fb$ bitbake fsl-image-qt5
Loading cache: 100% |##########################################################| ETA:  00:00:00
Loaded 2792 entries from dependency cache.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION        = "1.30.0"
BUILD_SYS         = "x86_64-linux"
NATIVELSBSTRING   = "Ubuntu-14.04"
TARGET_SYS        = "arm-poky-linux-gnueabi"
MACHINE           = "imx6qsabreauto"
DISTRO            = "fsl-imx-fb"
DISTRO_VERSION    = "4.1.15-2.1.0"
TUNE_FEATURES     = "arm armv7a vfp  neon        callconvention-hard        cortexa9"
TARGET_FPU        = "hard"
meta              
meta-poky         = "HEAD:f5da2a5913319ad6ac2141438ba1aa17576326ab"
meta-oe           
meta-multimedia   = "HEAD:247b1267bbe95719cd4877d2d3cfbaf2a2f4865a"
meta-fsl-arm      = "HEAD:be78894e4682f111575470fb23e51e6ba523508d"
meta-fsl-arm-extra = "HEAD:3dfb82fc7e703eae9891b3ffda0e9393701f2396"
meta-fsl-demos    = "HEAD:a165068f8a0d1cf29aabe4b4053f28be1c2aa492"
meta-bsp          
meta-sdk          = "HEAD:823b26a67261270d2bf22d511e6190641a8a90cf"
meta-browser      = "HEAD:77736988073a5d90fcff9d0005c8477332ede387"
meta-gnome        
meta-networking   
meta-python       
meta-filesystems  = "HEAD:247b1267bbe95719cd4877d2d3cfbaf2a2f4865a"
meta-qt5          = "HEAD:ccae79be69c5268df3b47e4e14cea0591c39a531"

NOTE: Preparing RunQueue
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
WARNING: lttng-modules-2.7.1+gitAUTOINC+45e0ebd91f-r0 do_package: lttng-modules: no modules were created; this may be due to CONFIG_TRACEPOINTS not being enabled in your kernel.
WARNING: gstreamer1.0-plugins-bad-qt-1.8.1-r0 do_configure: QA Issue: gstreamer1.0-plugins-bad-qt: configure was passed unrecognised options: --disable-libssh2 [unknown-configure-option]
WARNING: gstreamer1.0-plugins-bad-qt-1.8.1-r0 do_package_qa: QA Issue: gstreamer1.0-plugins-bad-qt-qmlgl rdepends on libgstgl-1.0, but it isn't a build dependency, missing gstreamer1.0-plugins-bad in DEPENDS or PACKAGECONFIG? [build-deps]
NOTE: Tasks Summary: Attempted 5838 tasks of which 2258 didn't need to be rerun and all succeeded.

Summary: There were 3 WARNING messages shown.
hedy@ubuntu:~/fsl-arm-yocto-bsp/build-fb$ 

8. Kernel source code directory

hedy@ubuntu:~/fsl-arm-yocto-bsp/build-fb$ tree -d -L 1 tmp/work-shared/imx6qsabreauto/kernel-source/
tmp/work-shared/imx6qsabreauto/kernel-source/
├── arch
├── block
├── crypto
├── Documentation
├── drivers
├── firmware
├── fs
├── include
├── init
├── ipc
├── kernel
├── lib
├── mm
├── net
├── samples
├── scripts
├── security
├── sound
├── tools
├── usr
└── virt

21 directories
hedy@ubuntu:~/fsl-arm-yocto-bsp/build-fb$
hedy@ubuntu:~/fsl-arm-yocto-bsp/build-fb$ bitbake -e linux-imx  | grep ^S=
S="/home/hedy/fsl-arm-yocto-bsp/build-fb/tmp/work/imx6qsabreauto-poky-linux-gnueabi/linux-imx/4.1.15-r0/git"
hedy@ubuntu:~/fsl-arm-yocto-bsp/build-fb$ 

9. Mirror directory


hedy@ubuntu:~/fsl-arm-yocto-bsp/build-fb$ ls tmp/deploy/images/imx6qsabreauto/
fsl-image-qt5-imx6qsabreauto-20181224080941.rootfs.ext4
fsl-image-qt5-imx6qsabreauto-20181224080941.rootfs.manifest
fsl-image-qt5-imx6qsabreauto-20181224080941.rootfs.sdcard
fsl-image-qt5-imx6qsabreauto-20181224080941.rootfs.tar.bz2
fsl-image-qt5-imx6qsabreauto.ext4
fsl-image-qt5-imx6qsabreauto.manifest
fsl-image-qt5-imx6qsabreauto.sdcard
fsl-image-qt5-imx6qsabreauto.tar.bz2
modules--4.1.15-r0-imx6qsabreauto-20181224080941.tgz
modules-imx6qsabreauto.tgz
README_-_DO_NOT_DELETE_FILES_IN_THIS_DIRECTORY.txt
u-boot.imx
u-boot-imx6qsabreauto.imx
u-boot-imx6qsabreauto.imx-sd
u-boot.imx-sd
u-boot-sd-2016.03-r0.imx
zImage
zImage--4.1.15-r0-imx6qsabreauto-20181224080941.bin
zImage--4.1.15-r0-imx6q-sabreauto-20181224080941.dtb
zImage--4.1.15-r0-imx6q-sabreauto-ecspi-20181224080941.dtb
zImage--4.1.15-r0-imx6q-sabreauto-enetirq-20181224080941.dtb
zImage--4.1.15-r0-imx6q-sabreauto-flexcan1-20181224080941.dtb
zImage--4.1.15-r0-imx6q-sabreauto-gpmi-weim-20181224080941.dtb
zImage-imx6qsabreauto.bin
zImage-imx6q-sabreauto.dtb
zImage-imx6q-sabreauto-ecspi.dtb
zImage-imx6q-sabreauto-enetirq.dtb
zImage-imx6q-sabreauto-flexcan1.dtb
zImage-imx6q-sabreauto-gpmi-weim.dtb
hedy@ubuntu:~/fsl-arm-yocto-bsp/build-fb$ 

10. u-boot source code directory

hedy@ubuntu:~/fsl-arm-yocto-bsp/build-fb$ bitbake -e u-boot-imx  | grep ^S=
S="/home/hedy/fsl-arm-yocto-bsp/build-fb/tmp/work/imx6qsabreauto-poky-linux-gnueabi/u-boot-imx/2016.03-r0/git"
hedy@ubuntu:~/fsl-arm-yocto-bsp/build-fb$ 

11. The rootfs directory

hedy@ubuntu:~/fsl-arm-yocto-bsp/build-fb$ ls  tmp/work/imx6qsabreauto-poky-linux-gnueabi/fsl-image-qt5/1.0-r0/rootfs/
bin  boot  dev  etc  home  lib  media  mnt  opt  proc  run  sbin  sys  tmp  unit_tests  usr  var
hedy@ubuntu:~/fsl-arm-yocto-bsp/build-fb$ 

12. Kernel, u-boot download address

hedy@ubuntu:~/fsl-arm-yocto-bsp/build-fb$ bitbake -e linux-imx | grep ^SRC_URI=
SRC_URI="git://git.freescale.com/imx/linux-imx.git;protocol=git;branch=imx_4.1.15_2.0.0_ga"
hedy@ubuntu:~/fsl-arm-yocto-bsp/build-fb$ 

hedy@ubuntu:~/fsl-arm-yocto-bsp/build-fb$ bitbake -e u-boot-imx | grep ^SRC_URI=
SRC_URI="git://git.freescale.com/imx/uboot-imx.git;protocol=git;branch=imx_v2016.03_4.1.15_2.0.0_ga"
hedy@ubuntu:~/fsl-arm-yocto-bsp/build-fb$ 

13. Recompile the kernel

bitbake -c menuconfig -v linux-imx    //同 make menuconfig 
bitbake linux-imx -C compile  //编译内核
bitbake linux-imx -c compile_kernelmodules -f -v  // 编译内核模块
bitbake -c deploy -f -v linux-imx  //布署到image目录

Rootfs will be regenerated when bitbake fsl-image-qt5 is executed

14. Compile u-boot separately

bitbake -c compile -f -v u-boot-imx
bitbake -c deploy -f -v u-boot-imx

15. View packages that can be compiled

hedy@ubuntu:~/fsl-arm-yocto-bsp/build-fb$ bitbake -s |grep meta
gst-meta-base                                       :0.10-r13                          
gstreamer1.0-meta-base                                :1.0-r0                          
meta-environment-extsdk-imx6qsabreauto                   :1.0-r8                          
meta-environment-imx6qsabreauto                       :1.0-r8                          
meta-ide-support                                      :1.0-r3                          
meta-toolchain                                        :1.0-r7                          
meta-toolchain-qt5                                    :1.0-r0                          
meta-world-pkgdata                                    :1.0-r0                          
hedy@ubuntu:~/fsl-arm-yocto-bsp/build-fb$ 

16, bitbake meta-toolchain-qt5 results

hedy@ubuntu:~/fsl-arm-yocto-bsp/build-fb$ bitbake meta-toolchain-qt5
Loading cache: 100% |############################################################| ETA:  00:00:00
Loaded 2792 entries from dependency cache.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION        = "1.30.0"
BUILD_SYS         = "x86_64-linux"
NATIVELSBSTRING   = "Ubuntu-14.04"
TARGET_SYS        = "arm-poky-linux-gnueabi"
MACHINE           = "imx6qsabreauto"
DISTRO            = "fsl-imx-fb"
DISTRO_VERSION    = "4.1.15-2.1.0"
TUNE_FEATURES     = "arm armv7a vfp  neon        callconvention-hard        cortexa9"
TARGET_FPU        = "hard"
meta              
meta-poky         = "HEAD:f5da2a5913319ad6ac2141438ba1aa17576326ab"
meta-oe           
meta-multimedia   = "HEAD:247b1267bbe95719cd4877d2d3cfbaf2a2f4865a"
meta-fsl-arm      = "HEAD:be78894e4682f111575470fb23e51e6ba523508d"
meta-fsl-arm-extra = "HEAD:3dfb82fc7e703eae9891b3ffda0e9393701f2396"
meta-fsl-demos    = "HEAD:a165068f8a0d1cf29aabe4b4053f28be1c2aa492"
meta-bsp          
meta-sdk          = "HEAD:823b26a67261270d2bf22d511e6190641a8a90cf"
meta-browser      = "HEAD:77736988073a5d90fcff9d0005c8477332ede387"
meta-gnome        
meta-networking   
meta-python       
meta-filesystems  = "HEAD:247b1267bbe95719cd4877d2d3cfbaf2a2f4865a"
meta-qt5          = "HEAD:ccae79be69c5268df3b47e4e14cea0591c39a531"

NOTE: Preparing RunQueue
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
WARNING: nativesdk-elftosb-10.12.01-r4 do_fetch: Failed to fetch URL http://repository.timesys.com/buildsources/e/elftosb/elftosb-10.12.01/elftosb-10.12.01.tar.gz, attempting MIRRORS if available
NOTE: Tasks Summary: Attempted 3675 tasks of which 2679 didn't need to be rerun and all succeeded.

Summary: There was 1 WARNING message shown.
hedy@ubuntu:~/fsl-arm-yocto-bsp/build-fb$ ls tmp/deploy/
images/   licenses/ rpm/      sdk/      
hedy@ubuntu:~/fsl-arm-yocto-bsp/build-fb$ ls tmp/deploy/sdk/fsl-imx-fb-glibc-x86_64-meta-toolchain-qt5-cortexa9hf-neon-toolchain-4.1.15-2.1.0.
fsl-imx-fb-glibc-x86_64-meta-toolchain-qt5-cortexa9hf-neon-toolchain-4.1.15-2.1.0.host.manifest
fsl-imx-fb-glibc-x86_64-meta-toolchain-qt5-cortexa9hf-neon-toolchain-4.1.15-2.1.0.sh
fsl-imx-fb-glibc-x86_64-meta-toolchain-qt5-cortexa9hf-neon-toolchain-4.1.15-2.1.0.target.manifest
hedy@ubuntu:~/fsl-arm-yocto-bsp/build-fb$ 

17, bitbake meta-toolchain results

hedy@ubuntu:~/fsl-arm-yocto-bsp/build-fb$ bitbake meta-toolchain
Loading cache: 100% |#############################################################################| ETA:  00:00:00
Loaded 2792 entries from dependency cache.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION        = "1.30.0"
BUILD_SYS         = "x86_64-linux"
NATIVELSBSTRING   = "Ubuntu-14.04"
TARGET_SYS        = "arm-poky-linux-gnueabi"
MACHINE           = "imx6qsabreauto"
DISTRO            = "fsl-imx-fb"
DISTRO_VERSION    = "4.1.15-2.1.0"
TUNE_FEATURES     = "arm armv7a vfp  neon        callconvention-hard        cortexa9"
TARGET_FPU        = "hard"
meta              
meta-poky         = "HEAD:f5da2a5913319ad6ac2141438ba1aa17576326ab"
meta-oe           
meta-multimedia   = "HEAD:247b1267bbe95719cd4877d2d3cfbaf2a2f4865a"
meta-fsl-arm      = "HEAD:be78894e4682f111575470fb23e51e6ba523508d"
meta-fsl-arm-extra = "HEAD:3dfb82fc7e703eae9891b3ffda0e9393701f2396"
meta-fsl-demos    = "HEAD:a165068f8a0d1cf29aabe4b4053f28be1c2aa492"
meta-bsp          
meta-sdk          = "HEAD:823b26a67261270d2bf22d511e6190641a8a90cf"
meta-browser      = "HEAD:77736988073a5d90fcff9d0005c8477332ede387"
meta-gnome        
meta-networking   
meta-python       
meta-filesystems  = "HEAD:247b1267bbe95719cd4877d2d3cfbaf2a2f4865a"
meta-qt5          = "HEAD:ccae79be69c5268df3b47e4e14cea0591c39a531"

NOTE: Preparing RunQueue
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
NOTE: Tasks Summary: Attempted 1989 tasks of which 1975 didn't need to be rerun and all succeeded.
hedy@ubuntu:~/fsl-arm-yocto-bsp/build-fb$ ls tmp/deploy/sdk/fsl-imx-fb-glibc-x86_64-meta-toolchain-
fsl-imx-fb-glibc-x86_64-meta-toolchain-cortexa9hf-neon-toolchain-4.1.15-2.1.0.host.manifest
fsl-imx-fb-glibc-x86_64-meta-toolchain-cortexa9hf-neon-toolchain-4.1.15-2.1.0.sh
fsl-imx-fb-glibc-x86_64-meta-toolchain-cortexa9hf-neon-toolchain-4.1.15-2.1.0.target.manifest
fsl-imx-fb-glibc-x86_64-meta-toolchain-qt5-cortexa9hf-neon-toolchain-4.1.15-2.1.0.host.manifest
fsl-imx-fb-glibc-x86_64-meta-toolchain-qt5-cortexa9hf-neon-toolchain-4.1.15-2.1.0.sh
fsl-imx-fb-glibc-x86_64-meta-toolchain-qt5-cortexa9hf-neon-toolchain-4.1.15-2.1.0.target.manifest

Useful references:

https://blog.csdn.net/fei534358549/article/details/50276489
https://blog.csdn.net/cking0906/article/details/76099025
https://blog.csdn.net/encourage2011/article/details/72454582
https://blog.csdn.net/rocky_zhm/article/details/4826665
https://blog.csdn.net/woyimibayi/article/details/52788790

Yocto practical skills:
https://blog.csdn.net/sy373466062/column/info/yocto
imx6q Compile and download guide:
https://blog.csdn.net/wince_lover/article/details/51456745

CSDN bitbake user guide
https://blog.csdn.net/lu_embedded/article/details/80634368

Yocto practical skills
https://www.kancloud.cn/digest/yocto/138628

http://blog.sina.com.cn/s/blog_7880d3350102wvio.html
https://www.kancloud.cn/digest/yocto/138623

BitBake User Manual on Yocto Project:
https://www.yoctoproject.org/docs/1.6/bitbake-user-manual/bitbake-user-manual.html

Guess you like

Origin blog.csdn.net/amwha/article/details/85101484