[SOLVED] ERROR: A native program mkfs.ext4 required to build the image was not found

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

[SOLVED] ERROR: A native program mkfs.ext4 required to build the image was not found

5,489 Views
maoi_by
Contributor II

Hi there,

I've faced an issue during build image with yocto. When I try to build core-image-minimal, I've got an error "ERROR: A native program mkfs.ext4 required to build the image was not found". I have no idea why the yocto can't find the e2fsprogs although the package exists in my ubuntu 18.04.4 LTS. There are some details below.

user@user:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.4 LTS
Release: 18.04
Codename: bionic

user@user:~$ uname -a
Linux user 5.3.0-28-generic #30~18.04.1-Ubuntu SMP Fri Jan 17 06:14:09 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

I've configured yocto in following way

$ mkdir ~/data/build/imx-yocto-bsp
$ cd ~/data/build/imx-yocto-bsp
$ repo init -u https://source.codeaurora.org/external/imx/imx-manifest
-b imx-linux-zeus -m imx-5.4.3-1.0.0.xml
$ repo sync

$ mkdir imx8qmmek-release

$ MACHINE=imx8qmmek source ./imx-setup-release.sh -b imx8qmmek-release

Then I switched rpm packages to deb and set default sdk as x86_64 in local.conf

local.conf file(Modifications highlighted by bold)

MACHINE ??= 'imx8qmmek'
DISTRO ?= 'fsl-imx-xwayland'
PACKAGE_CLASSES ?= 'package_deb'
EXTRA_IMAGE_FEATURES ?= "debug-tweaks"
USER_CLASSES ?= "buildstats image-mklibs image-prelink"
PATCHRESOLVE = "noop"
BB_DISKMON_DIRS ??= "\
STOPTASKS,${TMPDIR},1G,100K \
STOPTASKS,${DL_DIR},1G,100K \
STOPTASKS,${SSTATE_DIR},1G,100K \
STOPTASKS,/tmp,100M,100K \
ABORT,${TMPDIR},100M,1K \
ABORT,${DL_DIR},100M,1K \
ABORT,${SSTATE_DIR},100M,1K \
ABORT,/tmp,10M,1K"
PACKAGECONFIG_append_pn-qemu-system-native = " sdl"
CONF_VERSION = "1"

DL_DIR ?= "/home/user/data/build/yocto_common/downloads/"
SSTATE_DIR ?= "/home/user/data/build/yocto_common/sstate-cache"
# Supported values are i686 and x86_64
SDKMACHINE ?= "x86_64"


ACCEPT_FSL_EULA = "1"

Then I run building image 

user@user:~/data/build/imx-yocto-bsp/imx8qmmek-release$ bitbake core-image-minimal
Loading cache: 100% |#############################################################| Time: 0:00:00
Loaded 4067 entries from dependency cache.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION = "1.44.0"
BUILD_SYS = "x86_64-linux"
NATIVELSBSTRING = "ubuntu-18.04"
TARGET_SYS = "aarch64-poky-linux"
MACHINE = "imx8qmmek"
DISTRO = "fsl-imx-xwayland"
DISTRO_VERSION = "5.4-zeus"
TUNE_FEATURES = "aarch64"
TARGET_FPU = ""
meta
meta-poky = "imx-linux-zeus:0275e68b0576cdefc19718e4b1977044f9f43f48"
meta-oe
meta-multimedia
meta-python = "HEAD:aad5b3d070cd8c58828b0975cf861d8ebc90f460"
meta-freescale = "HEAD:0be39721cea6e04c589a419f4bb07fabd0da6704"
meta-freescale-3rdparty = "HEAD:aea3771baa77e74762358ceb673d407e36637e5f"
meta-freescale-distro = "HEAD:ca27d12e4964d1336e662bcc60184bbff526c857"
meta-bsp
meta-sdk
meta-ml = "HEAD:435f5e984856a943986491fddd061734a0b9eba5"
meta-browser = "HEAD:5f365ef0f842ba4651efe88787cf9c63bc8b6cb3"
meta-rust = "HEAD:5cda04c7c2158fc982502ca1e7893f71e4ca1729"
meta-gnome
meta-networking
meta-filesystems = "HEAD:aad5b3d070cd8c58828b0975cf861d8ebc90f460"
meta-qt5 = "HEAD:432ad2aa6c3a13253fefc909faba368851d21fb1"

WARNING: /home/user/data/build/imx-yocto-bsp/sources/poky/meta/recipes-core/images/core-image-minimal.bb:do_build is tainted from a forced run
Initialising tasks: 100% |########################################################| Time: 0:00:02
Sstate summary: Wanted 19 Found 16 Missed 3 Current 884 (84% match, 99% complete)
NOTE: Executing Tasks
NOTE: Setscene tasks completed
ERROR: core-image-minimal-1.0-r0 do_image_wic: Execution of '/home/user/data/build/imx-yocto-bsp/imx8qmmek-release/tmp/work/imx8qmmek-poky-linux/core-image-minimal/1.0-r0/temp/run.do_image_wic.14693' failed with exit code 1:
INFO: Creating image(s)...

ERROR: A native program mkfs.ext4 required to build the image was not found (see details above).

Please make sure wic-tools have e2fsprogs-native in its DEPENDS, build it with 'bitbake wic-tools' and try again.


WARNING: exit code 1 from a shell command.

ERROR: Logfile of failure stored in: /home/user/data/build/imx-yocto-bsp/imx8qmmek-release/tmp/work/imx8qmmek-poky-linux/core-image-minimal/1.0-r0/temp/log.do_image_wic.14693
Log data follows:
| DEBUG: Executing python function set_image_size
| DEBUG: 62254.400000 = 47888 * 1.300000
| DEBUG: 66350.400000 = max(62254.400000, 8192)[62254.400000] + 4096
| DEBUG: 66351.000000 = int(66350.400000)
| DEBUG: 66351 = aligned(66351)
| DEBUG: returning 66351
| DEBUG: Python function set_image_size finished
| DEBUG: Executing python function extend_recipe_sysroot
| NOTE: Direct dependencies are ['virtual:native:/home/user/data/build/imx-yocto-bsp/sources/poky/meta/recipes-devtools/automake/automake_1.16.1.bb:do_populate_sysroot', '/home/user/data/build/imx-yocto-bsp/sources/poky/meta/recipes-core/glibc/glibc_2.30.bb:do_populate_sysroot', '/home/user/data/build/imx-yocto-bsp/sources/meta-imx/meta-bsp/recipes-bsp/imx-sc-firmware/imx-sc-firmware_1.2.10.1.bb:do_populate_sysroot', 'virtual:native:/home/user/data/build/imx-yocto-bsp/sources/poky/meta/recipes-devtools/dosfstools/dosfstools_4.1.bb:do_populate_sysroot', '/home/user/data/build/imx-yocto-bsp/sources/poky/meta/recipes-devtools/gcc/gcc-cross_9.2.bb:do_populate_sysroot', '/home/user/data/build/imx-yocto-bsp/sources/poky/meta/recipes-devtools/gcc/gcc-runtime_9.2.bb:do_populate_sysroot', 'virtual:native:/home/user/data/build/imx-yocto-bsp/sources/poky/meta/recipes-support/bmap-tools/bmap-tools_3.5.bb:do_populate_sysroot', 'virtual:native:/home/user/data/build/imx-yocto-bsp/sources/poky/meta/recipes-devtools/bison/bison_3.4.1.bb:do_populate_sysroot', '/home/user/data/build/imx-yocto-bsp/sources/meta-imx/meta-bsp/recipes-bsp/imx-seco/imx-seco_2.3.1.bb:do_populate_sysroot', '/home/user/data/build/imx-yocto-bsp/sources/poky/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb:do_populate_sysroot', 'virtual:native:/home/user/data/build/imx-yocto-bsp/sources/poky/meta/recipes-devtools/prelink/prelink_git.bb:do_populate_sysroot', '/home/user/data/build/imx-yocto-bsp/sources/poky/meta/recipes-devtools/apt/apt-native_1.2.31.bb:do_populate_sysroot', '/home/user/data/build/imx-yocto-bsp/sources/poky/meta/recipes-devtools/binutils/binutils-cross_2.32.bb:do_populate_sysroot', 'virtual:native:/home/user/data/build/imx-yocto-bsp/sources/poky/meta/recipes-devtools/dpkg/dpkg_1.19.7.bb:do_populate_sysroot', '/home/user/data/build/imx-yocto-bsp/sources/meta-imx/meta-bsp/recipes-kernel/linux/linux-imx_5.4.bb:do_populate_sysroot', '/home/user/data/build/imx-yocto-bsp/sources/poky/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb:do_populate_sysroot', '/home/user/data/build/imx-yocto-bsp/sources/poky/meta/recipes-devtools/libtool/libtool-cross_2.4.6.bb:do_populate_sysroot', 'virtual:native:/home/user/data/build/imx-yocto-bsp/sources/poky/meta/recipes-bsp/u-boot/u-boot-tools_2019.07.bb:do_populate_sysroot', 'virtual:native:/home/user/data/build/imx-yocto-bsp/sources/poky/meta/recipes-kernel/dtc/dtc_1.5.1.bb:do_populate_sysroot', 'virtual:native:/home/user/data/build/imx-yocto-bsp/sources/poky/meta/recipes-connectivity/openssl/openssl_1.1.1d.bb:do_populate_sysroot', 'virtual:native:/home/user/data/build/imx-yocto-bsp/sources/meta-imx/meta-bsp/recipes-devtools/python/python-pycrypto_2.6.1.bb:do_populate_sysroot', 'virtual:native:/home/user/data/build/imx-yocto-bsp/sources/poky/meta/recipes-devtools/flex/flex_2.6.0.bb:do_populate_sysroot', 'virtual:native:/home/user/data/build/imx-yocto-bsp/sources/poky/meta/recipes-devtools/fdisk/gptfdisk_1.0.4.bb:do_populate_sysroot', 'virtual:native:/home/user/data/build/imx-yocto-bsp/sources/poky/meta/recipes-core/zlib/zlib_1.2.11.bb:do_populate_sysroot', '/home/user/data/build/imx-yocto-bsp/sources/poky/meta/recipes-devtools/quilt/quilt-native_0.66.bb:do_populate_sysroot', 'virtual:native:/home/user/data/build/imx-yocto-bsp/sources/poky/meta/recipes-devtools/pkgconfig/pkgconfig_git.bb:do_populate_sysroot', 'virtual:native:/home/user/data/build/imx-yocto-bsp/sources/poky/meta/recipes-devtools/pseudo/pseudo_git.bb:do_populate_sysroot', '/home/user/data/build/imx-yocto-bsp/sources/meta-freescale/recipes-bsp/imx-atf/imx-atf_2.0.bb:do_populate_sysroot', '/home/user/data/build/imx-yocto-bsp/sources/poky/meta/recipes-devtools/libtool/libtool-native_2.4.6.bb:do_populate_sysroot', '/home/user/data/build/imx-yocto-bsp/sources/poky/meta/recipes-devtools/qemu/qemuwrapper-cross_1.0.bb:do_populate_sysroot', '/home/user/data/build/imx-yocto-bsp/sources/meta-imx/meta-bsp/recipes-bsp/firmware-imx/firmware-imx-8_8.6.bb:do_populate_sysroot', '/home/user/data/build/imx-yocto-bsp/sources/meta-freescale/recipes-security/optee-imx/optee-os_3.2.0.imx.bb:do_populate_sysroot', 'virtual:native:/home/user/data/build/imx-yocto-bsp/sources/poky/meta/recipes-extended/pigz/pigz_2.4.bb:do_populate_sysroot', 'virtual:native:/home/user/data/build/imx-yocto-bsp/sources/poky/meta/recipes-extended/parted/parted_3.2.bb:do_populate_sysroot', 'virtual:native:/home/user/data/build/imx-yocto-bsp/sources/poky/meta/recipes-devtools/autoconf/autoconf_2.69.bb:do_populate_sysroot', '/home/user/data/build/imx-yocto-bsp/sources/poky/meta/recipes-kernel/kmod/kmod-native_git.bb:do_populate_sysroot', '/home/user/data/build/imx-yocto-bsp/sources/poky/meta/recipes-devtools/python/python-native_2.7.16.bb:do_populate_sysroot', 'virtual:native:/home/user/data/build/imx-yocto-bsp/sources/poky/meta/recipes-devtools/gnu-config/gnu-config_git.bb:do_populate_sysroot', 'virtual:native:/home/user/data/build/imx-yocto-bsp/sources/poky/meta/recipes-support/lzop/lzop_1.04.bb:do_populate_sysroot', 'virtual:native:/home/user/data/build/imx-yocto-bsp/sources/poky/meta/recipes-core/update-rc.d/update-rc.d_0.8.bb:do_populate_sysroot', 'virtual:native:/home/user/data/build/imx-yocto-bsp/sources/poky/meta/recipes-devtools/makedevs/makedevs_1.0.1.bb:do_populate_sysroot', '/home/user/data/build/imx-yocto-bsp/sources/poky/meta/recipes-core/glibc/cross-localedef-native_2.30.bb:do_populate_sysroot', 'virtual:native:/home/user/data/build/imx-yocto-bsp/sources/poky/meta/recipes-devtools/opkg-utils/opkg-utils_0.4.1.bb:do_populate_sysroot', '/home/user/data/build/imx-yocto-bsp/sources/meta-imx/meta-bsp/recipes-bsp/u-boot/u-boot-imx_2019.04.bb:do_populate_sysroot', 'virtual:native:/home/user/data/build/imx-yocto-bsp/sources/poky/meta/recipes-devtools/swig/swig_3.0.12.bb:do_populate_sysroot', 'virtual:native:/home/user/data/build/imx-yocto-bsp/sources/poky/meta/recipes-extended/bc/bc_1.07.1.bb:do_populate_sysroot', '/home/user/data/build/imx-yocto-bsp/sources/poky/meta/recipes-core/glibc/ldconfig-native_2.12.1.bb:do_populate_sysroot', '/home/user/data/build/imx-yocto-bsp/sources/poky/meta/recipes-devtools/mklibs/mklibs-native_0.1.44.bb:do_populate_sysroot', 'virtual:native:/home/user/data/build/imx-yocto-bsp/sources/poky/meta/recipes-devtools/mtools/mtools_4.0.23.bb:do_populate_sysroot', '/home/user/data/build/imx-yocto-bsp/sources/meta-imx/meta-bsp/recipes-bsp/imx-mkimage/imx-boot_0.2.bb:do_populate_sysroot', 'virtual:native:/home/user/data/build/imx-yocto-bsp/sources/poky/meta/recipes-extended/pbzip2/pbzip2_1.1.13.bb:do_populate_sysroot']
| NOTE: Installed into sysroot: []
| NOTE: Skipping as already exists in sysroot: ['automake-native', 'glibc', 'imx-sc-firmware', 'dosfstools-native', 'gcc-cross-aarch64', 'gcc-runtime', 'bmap-tools-native', 'bison-native', 'imx-seco', 'kern-tools-native', 'prelink-native', 'apt-native', 'binutils-cross-aarch64', 'dpkg-native', 'linux-imx', 'depmodwrapper-cross', 'libtool-cross', 'u-boot-tools-native', 'dtc-native', 'openssl-native', 'python-pycrypto-native', 'flex-native', 'gptfdisk-native', 'zlib-native', 'quilt-native', 'pkgconfig-native', 'pseudo-native', 'imx-atf', 'libtool-native', 'qemuwrapper-cross', 'firmware-imx-8', 'optee-os', 'pigz-native', 'parted-native', 'autoconf-native', 'kmod-native', 'python-native', 'gnu-config-native', 'lzop-native', 'update-rc.d-native', 'makedevs-native', 'cross-localedef-native', 'opkg-utils-native', 'u-boot-imx', 'swig-native', 'bc-native', 'ldconfig-native', 'mklibs-native', 'mtools-native', 'imx-boot', 'pbzip2-native', 'texinfo-dummy-native', 'systemd-systemctl-native', 'linux-libc-headers', 'xz-native', 'mpfr-native', 'libmpc-native', 'gmp-native', 'libgcc', 'python3-setuptools-native', 'python3-native', 'python3-six-native', 'gettext-minimal-native', 'binutils-native', 'elfutils-native', 'db-native', 'curl-native', 'gettext-native', 'qemu-native', 'bzip2-native', 'perl-native', 'shadow-native', 'm4-native', 'popt-native', 'util-linux-native', 'ncurses-native', 'debianutils-native', 'readline-native', 'gtk-doc-native', 'sqlite3-native', 'expat-native', 'gdbm-native', 'lzo-native', 'libpcre-native', 'unzip-native', 'libffi-native', 'libtirpc-native', 'libnsl2-native', 'glib-2.0-native', 'libcap-ng-native', 'ninja-native', 'meson-native', 're2c-native']
| DEBUG: Python function extend_recipe_sysroot finished
| DEBUG: Executing shell function do_image_wic
| INFO: Creating image(s)...
|
| ERROR: A native program mkfs.ext4 required to build the image was not found (see details above).
|
| Please make sure wic-tools have e2fsprogs-native in its DEPENDS, build it with 'bitbake wic-tools' and try again.
|
|
| WARNING: exit code 1 from a shell command.
| ERROR: Execution of '/home/user/data/build/imx-yocto-bsp/imx8qmmek-release/tmp/work/imx8qmmek-poky-linux/core-image-minimal/1.0-r0/temp/run.do_image_wic.14693' failed with exit code 1:
| INFO: Creating image(s)...
|
| ERROR: A native program mkfs.ext4 required to build the image was not found (see details above).
|
| Please make sure wic-tools have e2fsprogs-native in its DEPENDS, build it with 'bitbake wic-tools' and try again.
|
|
| WARNING: exit code 1 from a shell command.
|
ERROR: Task (/home/user/data/build/imx-yocto-bsp/sources/poky/meta/recipes-core/images/core-image-minimal.bb:do_image_wic) failed with exit code '1'
NOTE: Tasks Summary: Attempted 2725 tasks of which 2665 didn't need to be rerun and 1 failed.

Summary: 1 task failed:
/home/user/data/build/imx-yocto-bsp/sources/poky/meta/recipes-core/images/core-image-minimal.bb:do_image_wic
Summary: There was 1 WARNING message shown.
Summary: There was 1 ERROR message shown, returning a non-zero exit code.
user@user:~/data/build/imx-yocto-bsp/imx8qmmek-release$

4 Replies

5,229 Views
gehariprasath
Contributor II

Hello

I am also facing this same error. In my local.conf, I have already added this change, but still I am facing this issue. What else is missing ?

IMAGE_FSTYPES = "ext4 wic.bz2"

0 Kudos

5,264 Views
maoi_by
Contributor II

Hi all,

I've simply added IMAGE_FSTYPES = "ext4 wic.bz2" into my local.conf file and the issue is over. I've got required wic image. But I didn't check how it works in hardware just did fdisk -lu <image_name>.wic

fdisk -lu imx-image-full-imx8qmmek-20200618133421.rootfs.wic
Disk imx-image-full-imx8qmmek-20200618133421.rootfs.wic: 4.3 GiB, 4653463552 bytes, 9088796 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x962076d9

Device Boot Start End Sectors Size Id Type
imx-image-full-imx8qmmek-20200618133421.rootfs.wic1 * 16384 186775 170392 83.2M c W95 FAT32 (LBA)
imx-image-full-imx8qmmek-20200618133421.rootfs.wic2 196608 9088795 8892188 4.2G 83 Linux

5,264 Views
gusarambula
NXP TechSupport
NXP TechSupport

Hello Andrey Mihadyuk,

May I ask why are you changing the SDKMACHINE and the PACKAGE_CLASSES types? It could be that the switch of the PACKAGE_CLASSES changed some dependencies as these were not set for the deb but only for rpm.

Have you tried adding e2fsprogs-native to the image? If it’s available perhaps it just have not been installed and that’s why is giving this error.

Regards,

5,264 Views
maoi_by
Contributor II

Hi,

Thank for your reply. I've changed SDKMACHINE because my host PC is 64-bit and the rootfs is ubuntu aarch64. PACKAGE_CLASSES is deb since I've used ubuntu rootfs.

No, I haven't. Could you tell me how to add e2fsprogs-native to the image? Actually e2fsprogs-native is in dependency list for wic-tools and I think it does not mandatory to add the package into image however some bugs may exist in the yocto. The e2fsprogs-native is a part of external tools and is required to build an image in my opinion.

0 Kudos