Custom recipe to copy .so files

Hi,

I’m trying to add the library libnode.so from my custom recipe but I get the following error:

    Log data follows:
    | DEBUG: Executing python function extend_recipe_sysroot
    | NOTE: Direct dependencies are ['/home/joao/projetos/mT100_imx7_2.8/build/../layers/openembedded-core/meta/recipes-devtools/quilt/quilt-native_0.65.bb:do_populate_sysroot', '/home/joao/projetos/mT100_imx7_2.8/build/../layers/openembedded-core/meta/recipes-devtools/gcc/gcc-runtime_7.3.bb:do_populate_sysroot', '/home/joao/projetos/mT100_imx7_2.8/build/../layers/openembedded-core/meta/recipes-devtools/gcc/gcc-cross_7.3.bb:do_populate_sysroot', '/home/joao/projetos/mT100_imx7_2.8/build/../layers/openembedded-core/meta/recipes-core/glibc/glibc_2.26.bb:do_populate_sysroot', 'virtual:native:/home/joao/projetos/mT100_imx7_2.8/build/../layers/openembedded-core/meta/recipes-devtools/pseudo/pseudo_1.8.2.bb:do_populate_sysroot']
    | NOTE: Installed into sysroot: []
    | NOTE: Skipping as already exists in sysroot: ['quilt-native', 'gcc-runtime', 'gcc-cross-arm', 'glibc', 'pseudo-native', 'linux-libc-headers', 'libgcc', 'xz-native', 'binutils-cross-arm', 'libtool-native', 'zlib-native', 'texinfo-dummy-native', 'libmpc-native', 'autoconf-native', 'gmp-native', 'mpfr-native', 'gnu-config-native', 'automake-native', 'gettext-minimal-native', 'bison-native', 'flex-native', 'm4-native']
    | DEBUG: Python function extend_recipe_sysroot finished
    | DEBUG: Executing shell function do_install
    | install: cannot create regular file '/home/joao/projetos/mT100_imx7_2.8/build/tmp-glibc/work/armv7at2hf-neon-angstrom-linux-gnueabi/library-test/1.0-r0/image/usr/lib/libnode.so': No such file or directory
    | WARNING: exit code 1 from a shell command.
    | ERROR: Function failed: do_install (log file is located at /home/joao/projetos/mT100_imx7_2.8/build/tmp-glibc/work/armv7at2hf-neon-angstrom-linux-gnueabi/library-test/1.0-r0/temp/log.do_install.18845)
    ERROR: Task (/home/joao/projetos/mT100_imx7_2.8/build/../myTapp-OS/oe_core/meta-mytapp/recipes-mytapp/recipes-core/library-test.bb:do_install) failed with exit code '1'
    NOTE: Tasks Summary: Attempted 5221 tasks of which 5218 didn't need to be rerun and 1 failed.
    NOTE: Writing buildhistory
    
    Summary: 1 task failed:

My recipe library_test.bb:

    SUMMARY = "Test"
    DESCRIPTION = ""
    LICENSE = "CLOSED"
    PR = "r0"
    
    SRC_URI = "file://files.tar.gz"
    
    SOLIBS = ".so"
    FILES_SOLIBSDEV = ""
    
    do_install() {
    	install -m 0644 ${WORKDIR}/files/libnode.so ${D}${libdir}/libnode.so
    }
    
    FILES_${PN} += "${libdir}/libnode.so"

The content of files.tar.gz:

            .
            ├── files
            │   └── libnode.so

The main cause should be:

install: cannot create regular file '/home/joao/projetos/mT100_imx7_2.8/build/tmp-glibc/work/armv7at2hf-neon-angstrom-linux-gnueabi/library-test/1.0-r0/image/usr/lib/libnode.so': No such file or directory

I followed a lot of examples but it doesn’t work. Am i missing anything?

Hi

You need to create the target directory in the do_install task.

do_install() {
    install -d ${D}${libdir}
    install -m 0644 ${WORKDIR}/files/libnode.so ${D}${libdir}/libnode.so
}

Maybe there are other things too. You might want to read this.
If the build succeeds but you get QA warnings you might want to suppress the warning by setting the INSANE_SKIP_${PN} variable depending on the warning, e.g ‘INSANE_SKIP_${PN} = “dev-so ldflags”’.

Max

It worked! Thanks

Perfect. You are welcome. Thanks for the feedback.