How to build Yocto project image

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to build Yocto project image

Jump to solution
13,208 Views
petertseng
Contributor IV

Hi i.MX Community,

I download  Freescale Yocto Project:

$ mkdir fsl-release-bsp
$ cd fsl-release-bsp
$ repo init -u git://git.freescale.com/imx/fsl-arm-yocto-bsp.git -b imx-4.1.15-1.0.0_ga
$ repo sync

I need to build an image that does not used GUI or QT5.

But the document (Freescale_Yocto_Project_User's_Guide.pdf) only provides how to build X11 and QT5 image.

How to build a sample image?  (like core-image-minimal or core-image-base)

Hope for your help!

Regards,

0 Kudos
1 Solution
5,048 Views
anjojohn
Contributor IV

Hi Peter,

After "bitbake u-boot" command, Is the u-boot binary

(u-boot-imx6qsabresd.imx) present in build/tmp/deploy//images ?

And the emmc configuration for u-boot is it present ?

View solution in original post

0 Kudos
18 Replies
5,048 Views
lilleli
Contributor I

Hi i.MX Community,

 I build yocto image ,below erro!

bitbake core-image-minimal
Loading cache: 100% |############################################| Time: 0:00:02
Loaded 3049 entries from dependency cache.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION = "1.32.0"
BUILD_SYS = "x86_64-linux"
NATIVELSBSTRING = "Ubuntu-14.04"
TARGET_SYS = "arm-poky-linux-gnueabi"
MACHINE = "imx6ull14x14evk"
DISTRO = "fsl-imx-x11"
DISTRO_VERSION = "4.9.11-1.0.0"
TUNE_FEATURES = "arm armv7ve vfp thumb neon callconvention-hard cortexa7"
TARGET_FPU = "hard"
meta
meta-poky = "HEAD:78890ea22750804e3e9113e76f7ca3d7234c8342"
meta-oe
meta-multimedia = "HEAD:fe5c83312de11e80b85680ef237f8acb04b4b26e"
meta-freescale = "HEAD:a398b50b7fc084a9e68cc3000c218d5028522a25"
meta-freescale-3rdparty = "HEAD:68314612e236cab1da82d72a0da62635a3523f84"
meta-freescale-distro = "HEAD:cd5c7a2539f40004f74126e9fdf08254fd9a6390"
meta-bsp
meta-sdk = "HEAD:daba3340ecd8b358e0c6c415baeee0fcae95c525"
meta-browser = "HEAD:10f6e3778d823ee1be106c126216c6f941088fbf"
meta-gnome
meta-networking
meta-python
meta-filesystems = "HEAD:fe5c83312de11e80b85680ef237f8acb04b4b26e"
meta-qt5 = "HEAD:ff073f04109900fc07bf81e2f1df63c626caf342"

Initialising tasks: 100% |#######################################| Time: 0:00:04
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
ERROR: util-linux-native-2.28.1-r0 do_compile: oe_runmake failed
ERROR: util-linux-native-2.28.1-r0 do_compile: Function failed: do_compile (log file is located at /home/fsl/fsl-release-bsp/fsl-release-bsp/build-gateway/tmp/work/x86_64-linux/util-linux-native/2.28.1-r0/temp/log.do_compile.7660)
ERROR: Logfile of failure stored in: /home/fsl/fsl-release-bsp/fsl-release-bsp/build-gateway/tmp/work/x86_64-linux/util-linux-native/2.28.1-r0/temp/log.do_compile.7660
Log data follows:
| DEBUG: Executing shell function do_compile
| NOTE: make -j 1 ARCH=x86_64 CPU= CPUOPT= OPT=-isystem/home/fsl/fsl-release-bsp/fsl-release-bsp/build-gateway/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe
| ERROR: oe_runmake failed
| make all-recursive
| make[1]: Entering directory `/home/fsl/fsl-release-bsp/fsl-release-bsp/build-gateway/tmp/work/x86_64-linux/util-linux-native/2.28.1-r0/build'
| Making all in po
| make[2]: Entering directory `/home/fsl/fsl-release-bsp/fsl-release-bsp/build-gateway/tmp/work/x86_64-linux/util-linux-native/2.28.1-r0/build/po'
| make[2]: Nothing to be done for `all'.
| make[2]: Leaving directory `/home/fsl/fsl-release-bsp/fsl-release-bsp/build-gateway/tmp/work/x86_64-linux/util-linux-native/2.28.1-r0/build/po'
| make[2]: Entering directory `/home/fsl/fsl-release-bsp/fsl-release-bsp/build-gateway/tmp/work/x86_64-linux/util-linux-native/2.28.1-r0/build'
| gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../util-linux-2.28.1 -include config.h -I../util-linux-2.28.1/include -DLOCALEDIR=\"/home/fsl/fsl-release-bsp/fsl-release-bsp/build-gateway/tmp/sysroots/x86_64-linux/usr/share/locale\" -D_PATH_LOCALSTATEDIR=\"/home/fsl/fsl-release-bsp/fsl-release-bsp/build-gateway/tmp/sysroots/x86_64-linux/var\" -isystem/home/fsl/fsl-release-bsp/fsl-release-bsp/build-gateway/tmp/sysroots/x86_64-linux/usr/include -fsigned-char -fno-common -Wall -Werror=sequence-point -Wextra -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wno-missing-field-initializers -Wredundant-decls -Wsign-compare -Wtype-limits -Wuninitialized -Wunused-but-set-parameter -Wunused-but-set-variable -Wunused-parameter -Wunused-result -Wunused-variable -Wnested-externs -Wpointer-arith -Wstrict-prototypes -Wformat-security -Wimplicit-function-declaration -isystem/home/fsl/fsl-release-bsp/fsl-release-bsp/build-gateway/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe -c -o schedutils/chrt.o ../util-linux-2.28.1/schedutils/chrt.c
| In file included from /usr/include/x86_64-linux-gnu/sys/syscall.h:31:0,
| from ../util-linux-2.28.1/schedutils/chrt.c:63:
| ../util-linux-2.28.1/schedutils/chrt.c: In function ‘sched_setattr’:
| ../util-linux-2.28.1/schedutils/chrt.c:88:17: error: ‘__NR_sched_setattr’ undeclared (first use in this function)
| return syscall(SYS_sched_setattr, pid, attr, flags);
| ^
| ../util-linux-2.28.1/schedutils/chrt.c:88:17: note: each undeclared identifier is reported only once for each function it appears in
| ../util-linux-2.28.1/schedutils/chrt.c: In function ‘sched_getattr’:
| ../util-linux-2.28.1/schedutils/chrt.c:93:17: error: ‘__NR_sched_getattr’ undeclared (first use in this function)
| return syscall(SYS_sched_getattr, pid, attr, size, flags);
| ^
| ../util-linux-2.28.1/schedutils/chrt.c: In function ‘sched_setattr’:
| ../util-linux-2.28.1/schedutils/chrt.c:89:1: warning: control reaches end of non-void function [-Wreturn-type]
| }
| ^
| ../util-linux-2.28.1/schedutils/chrt.c: In function ‘sched_getattr’:
| ../util-linux-2.28.1/schedutils/chrt.c:94:1: warning: control reaches end of non-void function [-Wreturn-type]
| }
| ^
| make[2]: *** [schedutils/chrt.o] Error 1
| make[2]: Leaving directory `/home/fsl/fsl-release-bsp/fsl-release-bsp/build-gateway/tmp/work/x86_64-linux/util-linux-native/2.28.1-r0/build'
| make[1]: *** [all-recursive] Error 1
| make[1]: Leaving directory `/home/fsl/fsl-release-bsp/fsl-release-bsp/build-gateway/tmp/work/x86_64-linux/util-linux-native/2.28.1-r0/build'
| make: *** [all] Error 2
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_compile (log file is located at /home/fsl/fsl-release-bsp/fsl-release-bsp/build-gateway/tmp/work/x86_64-linux/util-linux-native/2.28.1-r0/temp/log.do_compile.7660)
ERROR: Task (virtual:native:/home/fsl/fsl-release-bsp/fsl-release-bsp/sources/poky/meta/recipes-core/util-linux/util-linux_2.28.1.bb:do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 621 tasks of which 606 didn't need to be rerun and 1 failed.

Summary: 1 task failed:
virtual:native:/home/fsl/fsl-release-bsp/fsl-release-bsp/sources/poky/meta/recipes-core/util-linux/util-linux_2.28.1.bb:do_compile
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.

0 Kudos
5,049 Views
petertseng
Contributor IV

Hi John,

I get the following error after execution.

$ source setup-environment build
$ bitbake core-image-minimal
WARNING: Unable to get checksum for linux-toradex SRC_URI entry defconfig: file could not be found00:00:00
Parsing recipes: 100% |###################################################################| Time: 00:00:58
Parsing of 1689 .bb files complete (0 cached, 1689 parsed). 2214 targets, 163 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION = "1.28.0"
BUILD_SYS = "x86_64-linux"
NATIVELSBSTRING = "Ubuntu-14.04"
TARGET_SYS = "arm-poky-linux-gnueabi"
MACHINE = "imx6qsabresd"
DISTRO = "poky"
DISTRO_VERSION = "2.0.1"
TUNE_FEATURES = "arm armv7a vfp thumb neon callconvention-hard cortexa9"
TARGET_FPU = "vfp-neon"
meta
meta-yocto = "HEAD:dd0ba9ea4a11ab15348d4fe3574e4b28784db82f"
meta-oe
meta-multimedia = "HEAD:ad6133a2e95f4b83b6b3ea413598e2cd5fb3fd90"
meta-fsl-arm = "HEAD:35b8b9bd9863de208ab60e33b55f10ee43e2619b"
meta-fsl-arm-extra = "HEAD:e200df91b70da254461c59082ddd5db0a3c415a2"
meta-fsl-demos = "HEAD:2231e946e7a94d096394f2b2477e8184c9bbde7b"

NOTE: Preparing RunQueue
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
WARNING: Failed to fetch URL ftp://invisible-island.net/ncurses/current/ncurses-5.9-20150329.tgz, attempting MIRRORS if available
WARNING: Failed to fetch URL http://zlib.net/pigz/pigz-2.3.3.tar.gz, attempting MIRRORS if available
ERROR: Error: The image creation script '/home/peter/workspace/fsl-release-bsp/build/tmp/work/imx6qsabresd-poky-linux-gnueabi/core-image-minimal/1.0-r0/temp/create_image.sdcard' returned 1:
0+0 records in
0+0 records out
0 bytes (0 B) copied, 6.3969e-05 s, 0.0 kB/s
Model: (file)
Disk /home/peter/workspace/fsl-release-bsp/build/tmp/deploy/images/imx6qsabresd/core-image-minimal-imx6qsabresd-20161102062918.rootfs.sdcard: 25.2MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number Start End Size Type File system Flags
1 4194kB 12.6MB 8389kB primary lba
2 12.6MB 21.0MB 8389kB primary

dd: failed to open '/home/peter/workspace/fsl-release-bsp/build/tmp/deploy/images/imx6qsabresd/u-boot-imx6qsabresd.imx': No such file or directory
WARNING: exit code 1 from a shell command.

ERROR: Function failed: do_rootfs
ERROR: Logfile of failure stored in: /home/peter/workspace/fsl-release-bsp/build/tmp/work/imx6qsabresd-poky-linux-gnueabi/core-image-minimal/1.0-r0/temp/log.do_rootfs.41335
ERROR: Task 7 (/home/peter/workspace/fsl-release-bsp/sources/poky/meta/recipes-core/images/core-image-minimal.bb, do_rootfs) failed with exit code '1'
NOTE: Tasks Summary: Attempted 1882 tasks of which 9 didn't need to be rerun and 1 failed.
No currently running tasks (1882 of 1883)

Summary: 1 task failed:
/home/peter/workspace/fsl-release-bsp/sources/poky/meta/recipes-core/images/core-image-minimal.bb, do_rootfs
Summary: There were 3 WARNING messages shown.
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.

Thanks,

Peter Tseng

0 Kudos
5,049 Views
anjojohn
Contributor IV

please check if the u-boot image has been build under the directory

build/tmp/deploy/images/

Have you modified the core-image-minimal.bb file ? please list the modification if had done any

0 Kudos
5,049 Views
petertseng
Contributor IV

Hi John,

The UBOOT is not in this directory (build/tmp/deploy/images/).

I have added in local.conf file:

UBOOT_CONFIG = "emmc"

0 Kudos
5,049 Views
anjojohn
Contributor IV

Please build the u-boot, "bitbake u-boot".

has the "emmc" configuration for uboot is present ?

0 Kudos
5,049 Views
petertseng
Contributor IV

Hi John,

There are still some errors.

$ bitbake u-boot
Loading cache: 100% |#####################################################################| ETA: 00:00:00
Loaded 2215 entries from dependency cache.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION = "1.28.0"
BUILD_SYS = "x86_64-linux"
NATIVELSBSTRING = "Ubuntu-14.04"
TARGET_SYS = "arm-poky-linux-gnueabi"
MACHINE = "imx6qsabresd"
DISTRO = "poky"
DISTRO_VERSION = "2.0.1"
TUNE_FEATURES = "arm armv7a vfp thumb neon callconvention-hard cortexa9"
TARGET_FPU = "vfp-neon"
meta
meta-yocto = "HEAD:dd0ba9ea4a11ab15348d4fe3574e4b28784db82f"
meta-oe
meta-multimedia = "HEAD:ad6133a2e95f4b83b6b3ea413598e2cd5fb3fd90"
meta-fsl-arm = "HEAD:35b8b9bd9863de208ab60e33b55f10ee43e2619b"
meta-fsl-arm-extra = "HEAD:e200df91b70da254461c59082ddd5db0a3c415a2"
meta-fsl-demos = "HEAD:2231e946e7a94d096394f2b2477e8184c9bbde7b"

NOTE: Preparing RunQueue
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
NOTE: Tasks Summary: Attempted 372 tasks of which 372 didn't need to be rerun and all succeeded.


$ bitbake core-image-minimal
Loading cache: 100% |#####################################################################| ETA: 00:00:00
Loaded 2215 entries from dependency cache.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION = "1.28.0"
BUILD_SYS = "x86_64-linux"
NATIVELSBSTRING = "Ubuntu-14.04"
TARGET_SYS = "arm-poky-linux-gnueabi"
MACHINE = "imx6qsabresd"
DISTRO = "poky"
DISTRO_VERSION = "2.0.1"
TUNE_FEATURES = "arm armv7a vfp thumb neon callconvention-hard cortexa9"
TARGET_FPU = "vfp-neon"
meta
meta-yocto = "HEAD:dd0ba9ea4a11ab15348d4fe3574e4b28784db82f"
meta-oe
meta-multimedia = "HEAD:ad6133a2e95f4b83b6b3ea413598e2cd5fb3fd90"
meta-fsl-arm = "HEAD:35b8b9bd9863de208ab60e33b55f10ee43e2619b"
meta-fsl-arm-extra = "HEAD:e200df91b70da254461c59082ddd5db0a3c415a2"
meta-fsl-demos = "HEAD:2231e946e7a94d096394f2b2477e8184c9bbde7b"

NOTE: Preparing RunQueue
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
ERROR: Error: The image creation script '/home/peter/workspace/fsl-release-bsp/build/tmp/work/imx6qsabresd-poky-linux-gnueabi/core-image-minimal/1.0-r0/temp/create_image.sdcard' returned 1:
0+0 records in
0+0 records out
0 bytes (0 B) copied, 5.5098e-05 s, 0.0 kB/s
Model: (file)
Disk /home/peter/workspace/fsl-release-bsp/build/tmp/deploy/images/imx6qsabresd/core-image-minimal-imx6qsabresd-20161103015104.rootfs.sdcard: 25.2MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number Start End Size Type File system Flags
1 4194kB 12.6MB 8389kB primary lba
2 12.6MB 21.0MB 8389kB primary

dd: failed to open '/home/peter/workspace/fsl-release-bsp/build/tmp/deploy/images/imx6qsabresd/u-boot-imx6qsabresd.imx': No such file or directory
WARNING: exit code 1 from a shell command.

ERROR: Function failed: do_rootfs
ERROR: Logfile of failure stored in: /home/peter/workspace/fsl-release-bsp/build/tmp/work/imx6qsabresd-poky-linux-gnueabi/core-image-minimal/1.0-r0/temp/log.do_rootfs.3106
ERROR: Task 7 (/home/peter/workspace/fsl-release-bsp/sources/poky/meta/recipes-core/images/core-image-minimal.bb, do_rootfs) failed with exit code '1'
NOTE: Tasks Summary: Attempted 1882 tasks of which 1881 didn't need to be rerun and 1 failed.
No currently running tasks (1881 of 1883)

Summary: 1 task failed:
/home/peter/workspace/fsl-release-bsp/sources/poky/meta/recipes-core/images/core-image-minimal.bb, do_rootfs
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.

0 Kudos
5,049 Views
anjojohn
Contributor IV

Hi Peter,

After "bitbake u-boot" command, Is the u-boot binary

(u-boot-imx6qsabresd.imx) present in build/tmp/deploy//images ?

And the emmc configuration for u-boot is it present ?

0 Kudos
5,049 Views
petertseng
Contributor IV

Hi John,

After I removed
UBOOT_CONFIG = "emmc"
get the following results

$ bitbake u-boot
WARNING: Unable to get checksum for linux-toradex SRC_URI entry defconfig: file could not be found00:00:00
Parsing recipes: 100% |###################################################################| Time: 00:00:37
Parsing of 1689 .bb files complete (0 cached, 1689 parsed). 2214 targets, 163 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION = "1.28.0"
BUILD_SYS = "x86_64-linux"
NATIVELSBSTRING = "Ubuntu-14.04"
TARGET_SYS = "arm-poky-linux-gnueabi"
MACHINE = "imx6qsabresd"
DISTRO = "poky"
DISTRO_VERSION = "2.0.1"
TUNE_FEATURES = "arm armv7a vfp thumb neon callconvention-hard cortexa9"
TARGET_FPU = "vfp-neon"
meta
meta-yocto = "HEAD:dd0ba9ea4a11ab15348d4fe3574e4b28784db82f"
meta-oe
meta-multimedia = "HEAD:ad6133a2e95f4b83b6b3ea413598e2cd5fb3fd90"
meta-fsl-arm = "HEAD:35b8b9bd9863de208ab60e33b55f10ee43e2619b"
meta-fsl-arm-extra = "HEAD:e200df91b70da254461c59082ddd5db0a3c415a2"
meta-fsl-demos = "HEAD:2231e946e7a94d096394f2b2477e8184c9bbde7b"

NOTE: Preparing RunQueue
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
NOTE: Tasks Summary: Attempted 372 tasks of which 363 didn't need to be rerun and all succeeded.

Summary: There was 1 WARNING message shown.

$ bitbake core-image-minimal
Loading cache: 100% |#####################################################################| ETA: 00:00:00
Loaded 2215 entries from dependency cache.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION = "1.28.0"
BUILD_SYS = "x86_64-linux"
NATIVELSBSTRING = "Ubuntu-14.04"
TARGET_SYS = "arm-poky-linux-gnueabi"
MACHINE = "imx6qsabresd"
DISTRO = "poky"
DISTRO_VERSION = "2.0.1"
TUNE_FEATURES = "arm armv7a vfp thumb neon callconvention-hard cortexa9"
TARGET_FPU = "vfp-neon"
meta
meta-yocto = "HEAD:dd0ba9ea4a11ab15348d4fe3574e4b28784db82f"
meta-oe
meta-multimedia = "HEAD:ad6133a2e95f4b83b6b3ea413598e2cd5fb3fd90"
meta-fsl-arm = "HEAD:35b8b9bd9863de208ab60e33b55f10ee43e2619b"
meta-fsl-arm-extra = "HEAD:e200df91b70da254461c59082ddd5db0a3c415a2"
meta-fsl-demos = "HEAD:2231e946e7a94d096394f2b2477e8184c9bbde7b"

NOTE: Preparing RunQueue
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
NOTE: Tasks Summary: Attempted 1883 tasks of which 1881 didn't need to be rerun and all succeeded.

But in the "build/tmp/deploy/images/" directory does not UBOOT image.

Regards,

0 Kudos
5,049 Views
anjojohn
Contributor IV

Your build is complete. I guess the u-boot configuration for emmc is not

present.

u-boot binary is in your "build/tmp/deploy/<machine-name>/images"

directory

0 Kudos
5,049 Views
petertseng
Contributor IV

Hi John,

I found the U-BOOT image link file in this path:

build/tmp/deploy/images/imx6qsabresd/u-boot.imx

If I want to recompile it also need to download from the Internet?

0 Kudos
5,049 Views
anjojohn
Contributor IV

No need to download again. The downloaded source will be in your download/ directory. No internet will be needed after first compilation.

For cleaning

 bitbake -c clean u-boot

or

bitbake-c cleansstate uboot  

Then make the u-boot again.

0 Kudos
5,049 Views
petertseng
Contributor IV

Hi John,

If I successfully build the image file in the ubuntu 14.04.1  machine needs to execute command:

    $ bitbake u-boot

Now, I can successfully build the image file in the ubuntu 14.04.4 machine.

But I do not need additional execute this command.

What is the difference between these two ubuntu versions?

Which version do you recommend to build?

Regards,

0 Kudos
5,049 Views
anjojohn
Contributor IV

Hi Peter,

There is no difference, the first command

bitbake u-boot

tells bitbake to make only u-boot, no other packages. This command is used

when you want to recompile u-boot after some modification.

On the other hand bitbkake core-image-minimal tells bitbake to make a

target which is an entire working build including u-boot, kernel and rootfs

with programs.

u-boot is a recipe and core-image-minimal is a target name.

0 Kudos
5,049 Views
anjojohn
Contributor IV

Hi Peter,

Please see the .bb files for core-image-minimal and fsl-image-multimedia.

make a new target image with your name project name. Inherit the core-image-minimal bb file and add your additional packages through "CORE_IMAGE_EXTRA_INSTALL" or adding those to the local.conf file in your build directory. 

0 Kudos
5,049 Views
petertseng
Contributor IV

Hi John,

Can you please provide a detailed method of operation?

0 Kudos
5,049 Views
anjojohn
Contributor IV

Hi Peter,

In my target bb file i have like

inherit core-image

CORE_IMAGE_EXTRA_INSTALL += " \
packagegroup-fsl-gstreamer \
packagegroup-fsl-tools-gpu \
packagegroup-fslc-gstreamer1.0 \

this will not contain the x11 or wayland. please take a look at the 

meta-fsl-demos/recipes-fsl/images/fsl-image-multimedia.bb

0 Kudos
5,047 Views
petertseng
Contributor IV

Hi John,

Where is the .bb files for core-image-minimal and fsl-image-multimedia?

Regards,

0 Kudos
5,047 Views
anjojohn
Contributor IV

sources/meta-fsl-demos/recipes-fsl/images/fsl-image-multimedia.bb

sources/poky/meta/recipes-core/images/core-image-minimal.bb

0 Kudos