Creating a receipe to copy the library files

Hi,
I’m building a receipe for wp7608 for copying the library file to rootfs,
This is my file structure

meta-mylayer/
├── conf
│ └── layer.conf
└── meta-myreceipe
└── myreceipe
├── files
│ ├── libpicoipp.so → libpicoipp.so.1.0.1
│ ├── libpicoipp.so.1 → libpicoipp.so.1.0.1
│ ├── libpicoipp.so.1.0.1
│ ├── libps5000a.so → libps5000a.so.2.0.0
│ ├── libps5000a.so.2 → libps5000a.so.2.0.0
│ └── libps5000a.so.2.0.0
└── myreceipe.bb

and this is the content of myreceipe.bb:
SUMMARY = “COPYlibFILES”

LICENSE = “CLOSED”

SRC_URI += “file://libpicoipp.so.1.0.1”
SRC_URI += “file://libps5000a.so.2.0.0”

do_install() {
install -d ${D}${libdir}/
install -m 755 libpicoipp.so.1.0.1 ${D}${libdir}/
install -m 755 libpicoipp.so ${D}${libdir}/
install -m 755 libpicoipp.so.1 ${D}${libdir}/
install -m 755 libps5000a.so.2.0.0 ${D}${libdir}/
install -m 755 libps5000a.so.2 ${D}${libdir}/
install -m 755 libps5000a.so ${D}${libdir}/
}
FILES_${PN} += “${libdir}/libpicoipp.so.1.0.1”
FILES_${PN} += “${libdir}/llibpicoipp.so”
FILES_${PN} += “${libdir}/libpicoipp.so.1”
FILES_${PN} += “${libdir}/libps5000a.so.2.0.0”
FILES_${PN} += “${libdir}/libps5000a.so.2”
FILES_${PN} += “${libdir}/libps5000a.so”

I have added a line in yocto/build_bin/conf/bblayers.conf : /home/sloki-linux1/Documents/yocto/meta-mylayer (Path the layer created by me)
and finally
IMAGE_INSTALL_append = “myreceipe”

Error message :
ERROR: Nothing RPROVIDES ‘packagegroup-swi-image-targetmyreceipe’ (but /home/sloki-linux1/Documents/yocto/meta-swi/meta-swi-mdm9x28/recipes-core/images/mdm9x28-image-minimal.bb RDEPENDS on or otherwise requires it)
NOTE: Runtime target ‘packagegroup-swi-image-targetmyreceipe’ is unbuildable, removing…
Missing or unbuildable dependency chain was: [‘packagegroup-swi-image-targetmyreceipe’]
ERROR: Required build target ‘mdm9x28-image-minimal’ has no buildable providers.
Missing or unbuildable dependency chain was: [‘mdm9x28-image-minimal’, ‘packagegroup-swi-image-targetmyreceipe’]

is there anything i’m missing?

Here is an example on how you can add your recipe.
[WP76xx] Example on putting own files and building helloworld application into yocto image.docx (20.9 KB)

Hi ,
i tried the above solution, but im getting this error even after placing the file in files folder im getting this error.

Error log:
myreceipe-1.0-r0 do_install: Function failed: do_install (log file is located at /home/sloki-linux1/Documents/yocto/build_bin/tmp/work/armv7a-neon-poky-linux-gnueabi/myreceipe/1.0-r0/temp/log.do_install.2424)
ERROR: Logfile of failure stored in: /home/sloki-linux1/Documents/yocto/build_bin/tmp/work/armv7a-neon-poky-linux-gnueabi/myreceipe/1.0-r0/temp/log.do_install.2424
Log data follows:
| DEBUG: Executing python function extend_recipe_sysroot
| NOTE: Direct dependencies are [’/home/sloki-linux1/Documents/yocto/poky/meta/recipes-devtools/quilt/quilt-native_0.65.bb:do_populate_sysroot’, ‘virtual:native:/home/sloki-linux1/Documents/yocto/poky/meta/recipes-devtools/pseudo/pseudo_git.bb:do_populate_sysroot’, ‘/home/sloki-linux1/Documents/yocto/poky/meta/recipes-core/glibc/glibc_2.27.bb:do_populate_sysroot’, ‘/home/sloki-linux1/Documents/yocto/poky/meta/recipes-devtools/gcc/gcc-cross_7.3.bb:do_populate_sysroot’, ‘/home/sloki-linux1/Documents/yocto/poky/meta/recipes-devtools/gcc/gcc-runtime_7.3.bb:do_populate_sysroot’]
| NOTE: Installed into sysroot:
| NOTE: Skipping as already exists in sysroot: [‘quilt-native’, ‘pseudo-native’, ‘glibc’, ‘gcc-cross-arm’, ‘gcc-runtime’, ‘linux-libc-headers’, ‘zlib-native’, ‘gnu-config-native’, ‘xz-native’, ‘autoconf-native’, ‘libtool-native’, ‘binutils-cross-arm’, ‘automake-native’, ‘mpfr-native’, ‘flex-native’, ‘gmp-native’, ‘texinfo-dummy-native’, ‘libmpc-native’, ‘libgcc’, ‘gettext-minimal-native’, ‘m4-native’, ‘bison-native’]
| DEBUG: Python function extend_recipe_sysroot finished
| DEBUG: Executing shell function do_install
| install: cannot stat ‘libpicoipp.so.1.0.1’: No such file or directory
| WARNING: /home/sloki-linux1/Documents/yocto/build_bin/tmp/work/armv7a-neon-poky-linux-gnueabi/myreceipe/1.0-r0/temp/run.do_install.2424:1 exit 1 from ‘install -m 755 libpicoipp.so.1.0.1 /home/sloki-linux1/Documents/yocto/build_bin/tmp/work/armv7a-neon-poky-linux-gnueabi/myreceipe/1.0-r0/image/usr/lib/’
| ERROR: Function failed: do_install (log file is located at /home/sloki-linux1/Documents/yocto/build_bin/tmp/work/armv7a-neon-poky-linux-gnueabi/myreceipe/1.0-r0/temp/log.do_install.2424)
ERROR: Task (/home/sloki-linux1/Documents/yocto/meta-swi/common/recipes-multimedia/meta-mylayer/myreceipe.bb:do_install) failed with exit code ‘1’
NOTE: Tasks Summary: Attempted 3231 tasks of which 3227 didn’t need to be rerun and 1 failed.

Any possible solutions?

did you really follow the document?
I don’t see problem to add jacktest in WP76 R16 yocto source.

I follwed all the things mentioned in document,

pwd
/home/sloki-linux1/Documents/yocto/meta-swi/common/recipes-multimedia
.
├── jacktest
│ ├── files
│ │ ├── example.patch
│ │ └── helloworld.c
│ ├── jacktest_0.1.bb
│ └── jacktest_0.1.bb~
├── libopencore-amr
│ └── libopencore-amr_0.1.3.bb
├── libvo-amrwbenc
│ └── libvo-amrwbenc_0.1.3.bb
└── meta-mylayer
├── files
│ ├── libpicoipp.so → libpicoipp.so.1.0.1
│ ├── libpicoipp.so.1 → libpicoipp.so.1.0.1
│ ├── libpicoipp.so.1.0.1
│ ├── libps5000a.so → libps5000a.so.2.0.0
│ ├── libps5000a.so.2 → libps5000a.so.2.0.0
│ └── libps5000a.so.2.0.0
└── myreceipe.bb

content of myreceipe.bb:

SUMMARY = “COPYlibFILES”

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

SRC_URI += “file://libpicoipp.so.1.0.1”
SRC_URI += “file://libps5000a.so.2.0.0”

do_install() {
install -d ${D}${libdir}
install -m 755 libpicoipp.so.1.0.1 ${D}${libdir}
install -m 755 libps5000a.so.2.0.0 ${D}${libdir}
install -m 0755 /home/sloki-linux1/Desktop/files ${D}${libdir}

}

FILES_${PN} += “${libdir}/libpicoipp.so.1.0.1”
FILES_${PN} += “${libdir}/libps5000a.so.2.0.0”
INSANE_SKIP_${PN} = “ldflags”

and also added
In yocto/meta-swi/meta-swi-mdm9x28/recipes-core/images/mdm9x28-image.inc
IMAGE_INSTALL_append = " myreceipe"

im i missing anything?

I think you should delete your “myreceipe” folder, compile the image to have jacktest

Once it is ok, step by step to move your library to jacktest folder

yes, i was working on it and when i ran it independently im getting this error

Error:
install: missing destination file operand after ‘/home/sloki-linux1/Documents/yocto/build_bin/tmp/work/armv7a-neon-poky-linux-gnueabi/jacktest/0.1-r0/image/usr/bin’

what does this below line refers to?
install -m 0755 /home/owner/Desktop/your_file ${D}${bindir}

you can replace “/home/owner/Desktop/your_file” with your file

For example, you have a file in Desktop called “123.txt”, then you replace it with install -m 0755 /home/owner/Desktop/123.txt ${D}${bindir}

after you build the image and load to module, the 123.txt will appear in /usr/bin folder

oh okay, I tried this line by replacing the 123.txt with .so file folder and changed the bindir to libdir, then it is giving error
ERROR: jacktest-0.1-r0 do_package: QA Issue: File ‘/usr/lib/libps5000a.so.2.0.0’ from jacktest was already stripped, this will prevent future debugging! [already-stripped]
ERROR: jacktest-0.1-r0 do_package: Fatal QA errors found, failing task.
ERROR: jacktest-0.1-r0 do_package: Function failed: do_package
ERROR: Logfile of failure stored in: /home/sloki-linux1/Documents/yocto/build_bin/tmp/work/armv7a-neon-poky-linux-gnueabi/jacktest/0.1-r0/temp/log.do_package.11304
ERROR: Task (/home/sloki-linux1/Documents/yocto/meta-swi/common/recipes-multimedia/jacktest/jacktest_0.1.bb:do_package) failed with exit code ‘1’

why don’t you put it in /usr/bin

still same error
ERROR: jacktest-0.1-r0 do_package: QA Issue: File ‘/usr/bin/libps5000a.so.2.0.0’ from jacktest was already stripped, this will prevent future debugging! [already-stripped]
ERROR: jacktest-0.1-r0 do_package: Fatal QA errors found, failing task.
ERROR: jacktest-0.1-r0 do_package: Function failed: do_package
ERROR: Logfile of failure stored in: /home/sloki-linux1/Documents/yocto/build_bin/tmp/work/armv7a-neon-poky-linux-gnueabi/jacktest/0.1-r0/temp/log.do_package.12635
ERROR: Task (/home/sloki-linux1/Documents/yocto/meta-swi/common/recipes-multimedia/jacktest/jacktest_0.1.bb:do_package) failed with exit code ‘1’

I just tried this, and I can compile:


#
# This file was derived from the 'Hello World!' example recipe in the
# Yocto Project Development Manual.
#

SUMMARY = "Simple helloworld application"
SECTION = "examples"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

SRC_URI = "file://helloworld.c"

S = "${WORKDIR}"


FILES_${PN} += "${base_libdir}/*"


do_compile() {
	     ${CC} helloworld.c -o helloworld
}

do_install() {
	     install -d ${D}${bindir}
	     install -m 0755 helloworld ${D}${bindir}
 install -d ${D}${base_libdir}
	install -m 0755 /home/owner/Desktop/ext4.txt ${D}${base_libdir}
}


INSANE_SKIP_${PN} = "ldflags"

Yes, this alone when compiled is working when added with a library file (.so) it is giving the errors as above

I have also tried to put txt file like this, no problem is found…


install -d ${D}${base_libdir}
install -m 0755 /home/owner/Desktop/ext4.txt ${D}${base_libdir}

Is this only happening to filename xxx.so only?

FYI, after loading this yocto image, I can see:

root@swi-mdm9x28-wp:~# find / -name ext4.txt
/lib/ext4.txt

yes, for dynamic library(filename.so),
it is giving this error

no problem is found for the following:

install -m 0755 /home/owner/Desktop/vgpreload_memcheck-arm-linux.so ${D}${base_libdir}

is that you put these files to /lib more than once?

“is that you put these files to /lib more than once?”

May be that could be the issue, im working on it

suggest you only putting one .so for testing just like my case

I had previously tried with only one, again i will try this

No idea then as i cannot see your issue here