How to add extra files into the image?


#1

Hi Sir,

I created a recipe and custom meta layer.
$yocto-layer create mylayer
then create test recipe.

I want to add extra file(rtl8192cufw.bin) to /lib/firmware/rtlwifi in the image.

yocto/meta-mylayer/recipes-example/example/test_0.1.bb

DESCRIPTION = "Simple Test bb file"
SECTION = "examples"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
PR = “r0”

SRC_URI = “file://rtl8192cufw.bin”

S = “${WORKDIR}”

do_install() {
install -d ${D}${libdir}/firmware/rtlwifi/
install -m 0755 rtl8192cufw.bin ${D}${libdir}/firmware/rtlwifi/
}

FILES_${PN} = “/firmware/rtlwifi/”

Add extra description /home/vince/Legato_16.07/yocto/meta-mylayer in build_bin/conf/bblayers.conf

vince@xxx:~/Legato_16.07/yocto/build_bin$bitbake test
vince@xxx:~/Legato_16.07/yocto/build_bin$ find -name rtl8192cufw*

./downloads/rtl8192cufw.bin.done
./tmp/work/armv7a-vfp-neon-poky-linux-gnueabi/test/0.1-r0/rtl8192cufw.bin
./tmp/work/armv7a-vfp-neon-poky-linux-gnueabi/test/0.1-r0/sysroot-destdir/usr/lib/firmware/rtlwifi/rtl8192cufw.bin
./tmp/work/armv7a-vfp-neon-poky-linux-gnueabi/test/0.1-r0/package/usr/lib/firmware/rtlwifi/rtl8192cufw.bin
./tmp/work/armv7a-vfp-neon-poky-linux-gnueabi/test/0.1-r0/image/usr/lib/firmware/rtlwifi/rtl8192cufw.bin
./tmp/sysroots/swi-mdm9x15/usr/lib/firmware/rtlwifi/rtl8192cufw.bin

I also added CORE_IMAGE_EXTRA_INSTALL += "test"
after that I make the BSP

vince@xxx:~/Legato_16.07/yocto$ make
Makefile:18: “Legato: build disabled since ‘/home/vince/Legato_16.07/yocto/legato/’ does not exist”
“meta-swi-extras/build.sh” -p poky/ -o meta-openembedded/ -l meta-swi -x “kernel/.git” -j 9 -t 9 -a “SDKPATH_PREFIX=” -M -a “MANGOH_WIFI_REPO=”/home/vince/Legato_16.07/yocto/mangOH/WiFi"" -m swi-mdm9x15 -a KBRANCH_DEFAULT_MDM9X15=standard/swi-mdm9x15-yocto-1.7-swi-le55 -a KMETA_DEFAULT_MDM9X15=meta-yocto-1.7-swi-le55 -q -b build_bin
Poky dir: /home/vince/Legato_16.07/yocto/poky
OE meta: /home/vince/Legato_16.07/yocto/meta-openembedded
SWI meta dir: /home/vince/Legato_16.07/yocto/meta-swi
Linux repo dir: /home/vince/Legato_16.07/yocto/kernel/.git
Number of make threads 9
Number of bitbake tasks 9
Extra options added - SDKPATH_PREFIX=
With mangOH
Extra options added - MANGOH_WIFI_REPO=/home/vince/Legato_16.07/yocto/mangOH/WiFi
SWI machine: swi-mdm9x15
Extra options added - KBRANCH_DEFAULT_MDM9X15=standard/swi-mdm9x15-yocto-1.7-swi-le55
Extra options added - KMETA_DEFAULT_MDM9X15=meta-yocto-1.7-swi-le55
Enable Qualcomm Proprietary bin
Build dir: /home/vince/Legato_16.07/yocto/build_bin

Shell environment set up for builds.

You can now run 'bitbake ’

Common targets are:
core-image-minimal
core-image-sato
meta-toolchain
adt-installer
meta-ide-support

You can also run generated qemu images with a command like ‘runqemu qemux86’

  • layer: meta-swi-mdm9xxx
  • layer: meta-swi-mdm9x15
  • layer: meta-swi
  • layer: meta-oe
  • layer: meta-networking
  • layer: meta-python
  • layer: meta-swi-bin
  • layer: meta-swi-extras
  • layer: meta-mangoh
    Updating LEGATO_BUILD to false
    Updating ROOTFS_VERSION to
    Updating SDKPATH_PREFIX to
    Updating MANGOH_WIFI_REPO to /home/vince/Legato_16.07/yocto/mangOH/WiFi
    Updating KBRANCH_DEFAULT_MDM9X15 to standard/swi-mdm9x15-yocto-1.7-swi-le55
    Updating KMETA_DEFAULT_MDM9X15 to meta-yocto-1.7-swi-le55
    Build image of minimal rootfs (for swi-mdm9x15).
    WARNING: Host distribution “Ubuntu-16.04” has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.
    Loading cache: 100% |##################################################################################################################| ETA: 00:00:00
    Loaded 2071 entries from dependency cache.
    Parsing recipes: 100% |################################################################################################################| Time: 00:00:01
    Parsing of 1600 .bb files complete (1595 cached, 5 parsed). 2072 targets, 200 skipped, 0 masked, 0 errors.
    NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION = "1.24.0"
BUILD_SYS = "x86_64-linux"
NATIVELSBSTRING = "Ubuntu-16.04"
TARGET_SYS = "arm-poky-linux-gnueabi"
MACHINE = "swi-mdm9x15"
DISTRO = "poky-swi-ext"
DISTRO_VERSION = "1.7.3"
TUNE_FEATURES = "arm armv7a vfp neon"
TARGET_FPU = "vfp-neon"
meta
meta-yocto
meta-yocto-bsp = "(nobranch):c282df8993828bd7b1d50cfcf637a477eaf481a1"
meta-mangoh = "(nobranch):b58ad3c6a4e4d0f2d563e8af86c46f96f8ba3bb6"
meta-python
meta-networking
meta-oe = "(nobranch):70beecb2716bca1b9dfbc7d6a264233e1f05e82b"
meta-swi
meta-swi-mdm9xxx
meta-swi-mdm9x15 = "master:0f1bf8d6d24d7389168eafead6c2f2bede345d18"
meta-swi-extras
meta-swi-bin = "master:6f65f78f6e8a1801ae7cd424191f3513457e4bbe"
meta-mylayer = “:”

NOTE: Preparing runqueue
WARNING: /home/vince/Legato_16.07/yocto/poky/meta/recipes-kernel/linux/linux-yocto_3.14.bb.do_compile is tainted from a forced run
WARNING: /home/vince/Legato_16.07/yocto/poky/meta/recipes-kernel/linux/linux-yocto_3.14.bb.do_build is tainted from a forced run
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
ERROR: Unable to install packages. Command ‘/home/vince/Legato_16.07/yocto/build_bin/tmp/sysroots/x86_64-linux/usr/bin/opkg-cl -f /home/vince/Legato_16.07/yocto/build_bin/tmp/work/swi_mdm9x15-poky-linux-gnueabi/mdm9x15-image-minimal/1.0-r0.0/opkg.conf -o /home/vince/Legato_16.07/yocto/build_bin/tmp/work/swi_mdm9x15-poky-linux-gnueabi/mdm9x15-image-minimal/1.0-r0.0/rootfs --force_postinstall --prefer-arch-to-version install linkmon i2cgpioctl sierra-timeservices kernel-module-xt-cgroup kernel-module-xt-conntrack qmi packagegroup-swi-image-target sierra-m2m-init libaudioalsa1 modem-shutdown diag kernel-module-xt-mark kernel-modules csd-server kernel-module-xt-connmark audio-ftm libacdbloader1 cxm-apps test kernel-devicetree audcaltests sierra-initscripts time-services sierra libacdbmapper1 lttng-modules data diag-reboot-app i2c-tools run-postinsts sierra-init-tiwifi qmi-framework ti-compat-wireless libaudcal1 packagegroup-core-boot lttng-ust mbim kernel-module-iptable-mangle loc-api’ returned 255:

  • opkg_install_cmd: Cannot install package test.

ERROR: Function failed: do_rootfs
ERROR: Logfile of failure stored in: /home/vince/Legato_16.07/yocto/build_bin/tmp/work/swi_mdm9x15-poky-linux-gnueabi/mdm9x15-image-minimal/1.0-r0.0/temp/log.do_rootfs.25518
ERROR: Task 9 (/home/vince/Legato_16.07/yocto/meta-swi/meta-swi-mdm9x15/recipes-core/images/mdm9x15-image-minimal.bb, do_rootfs) failed with exit code '1’
NOTE: Tasks Summary: Attempted 2466 tasks of which 2460 didn’t need to be rerun and 1 failed.
No currently running tasks (2466 of 2470)

Summary: 1 task failed:
/home/vince/Legato_16.07/yocto/meta-swi/meta-swi-mdm9x15/recipes-core/images/mdm9x15-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.
Makefile:137: recipe for target ‘image_bin’ failed
make: *** [image_bin] Error 1

How to add the extra files into the image?
Thank you very much.

Best Regards,
Vince