Re: building additional kenrel module in yocto, ERROR: no makefile found


Quentin Schulz
 

On August 18, 2021 5:45:28 PM GMT+02:00, Ivan Riabtsov <ivriabtsov@...> wrote:
Ok, thanks. "aptitude install openssl-dev" on host machine is solved this
So you actually need DEPENDS += "openssl-native" in your recipe.

Don't install package on your build machine to fix your Yocto recipes, add the native recipes to your DEPENDS instead. Otherwise anyone building your recipe will need to install openssl-dev and everyone will have a different version because of different update status or distros and things will break at one point.

Quentin

ср, 18 авг. 2021 г. в 18:38, Quentin Schulz <foss@...>:



On August 18, 2021 5:16:36 PM GMT+02:00, Ivan Riabtsov <ivriabtsov@...> wrote:
Thanks!
Can I ask one more question? My module is need for openssl, I added
DEPENDS = "openssl" in my recipe

$ cat meta-gobinet/recipes-gobinet/gobinet/gobinet_1.bb
SUMMARY = "gobinet module"
LICENSE = "CLOSED"
inherit module
DEPENDS = "openssl" !!!!!!!!!!!!!!!!!!!!!!!!!!!
SRC_URI = "file://gobinet.tar.xz;md5sum=5175806df4c088bd77a4e6b66d20f899"
#SRC_URI += " file://0001_gobinet_makefile.patch;md5sum=1261df573e1b91177954f6190a12c7b1"
S = "${WORKDIR}/gobinet"

but the error appears:

/home/ivr/work/yocto/build/tmp/work-shared/phyboard-segin-imx6ul-6/kernel-source/scripts/extract-cert.c:21:10:
fatal error: openssl/bio.h: No such file or directory
| 21 | #include <openssl/bio.h>
| | ^~~~~~~~~~~~~~~
I suspect this script is to be run on the host, so maybe openssl-native in DEPENDS?

Let us know,
Quentin

$ find -name bio.h
./build/tmp/work/phyboard_segin_imx6ul_6-phytec-linux-gnueabi/make-mod-scripts/1.0-r0/recipe-sysroot-native/usr/include/openssl/bio.h
./build/tmp/work/phyboard_segin_imx6ul_6-phytec-linux-gnueabi/depmodwrapper-cross/1.0-r0/recipe-sysroot-native/usr/include/openssl/bio.h
./build/tmp/work/phyboard_segin_imx6ul_6-phytec-linux-gnueabi/linux-mainline/5.4.91-phy1-r0.0/recipe-sysroot-native/usr/include/openssl/bio.h
./build/tmp/work/phyboard_segin_imx6ul_6-phytec-linux-gnueabi/gobinet/1-r0/recipe-sysroot/usr/include/openssl/bio.h
./build/tmp/work/cortexa7t2hf-neon-vfpv4-phytec-linux-gnueabi/libxcrypt/4.4.15-r0/recipe-sysroot-native/usr/include/openssl/bio.h
./build/tmp/work/cortexa7t2hf-neon-vfpv4-phytec-linux-gnueabi/ncurses/6.2-r0/recipe-sysroot-native/usr/include/openssl/bio.h
./build/tmp/work/cortexa7t2hf-neon-vfpv4-phytec-linux-gnueabi/openssl/1.1.1i-r0/recipe-sysroot-native/usr/include/openssl/bio.h
./build/tmp/work/cortexa7t2hf-neon-vfpv4-phytec-linux-gnueabi/openssl/1.1.1i-r0/openssl-1.1.1i/include/openssl/bio.h
./build/tmp/work/cortexa7t2hf-neon-vfpv4-phytec-linux-gnueabi/openssl/1.1.1i-r0/openssl-1.1.1i/include/internal/bio.h
./build/tmp/work/cortexa7t2hf-neon-vfpv4-phytec-linux-gnueabi/openssl/1.1.1i-r0/packages-split/openssl-dev/usr/include/openssl/bio.h
./build/tmp/work/cortexa7t2hf-neon-vfpv4-phytec-linux-gnueabi/openssl/1.1.1i-r0/packages-split/openssl-src/usr/src/debug/openssl/1.1.1i-r0/openssl-1.1.1i/include/openssl/bio.h
./build/tmp/work/cortexa7t2hf-neon-vfpv4-phytec-linux-gnueabi/openssl/1.1.1i-r0/packages-split/openssl-src/usr/src/debug/openssl/1.1.1i-r0/openssl-1.1.1i/include/internal/bio.h
./build/tmp/work/cortexa7t2hf-neon-vfpv4-phytec-linux-gnueabi/openssl/1.1.1i-r0/image/usr/include/openssl/bio.h
./build/tmp/work/cortexa7t2hf-neon-vfpv4-phytec-linux-gnueabi/openssl/1.1.1i-r0/sysroot-destdir/usr/include/openssl/bio.h
./build/tmp/work/cortexa7t2hf-neon-vfpv4-phytec-linux-gnueabi/openssl/1.1.1i-r0/package/usr/include/openssl/bio.h
./build/tmp/work/cortexa7t2hf-neon-vfpv4-phytec-linux-gnueabi/openssl/1.1.1i-r0/package/usr/src/debug/openssl/1.1.1i-r0/openssl-1.1.1i/include/openssl/bio.h
./build/tmp/work/cortexa7t2hf-neon-vfpv4-phytec-linux-gnueabi/openssl/1.1.1i-r0/package/usr/src/debug/openssl/1.1.1i-r0/openssl-1.1.1i/include/internal/bio.h
./build/tmp/work/cortexa7t2hf-neon-vfpv4-phytec-linux-gnueabi/readline/8.0-r0/recipe-sysroot-native/usr/include/openssl/bio.h
./build/tmp/work/cortexa7t2hf-neon-vfpv4-phytec-linux-gnueabi/gcc-runtime/9.3.0-r0/recipe-sysroot-native/usr/include/openssl/bio.h
./build/tmp/work/cortexa7t2hf-neon-vfpv4-phytec-linux-gnueabi/glibc/2.31+gitAUTOINC+df31c7ca92-r0/recipe-sysroot-native/usr/include/openssl/bio.h
./build/tmp/work/cortexa7t2hf-neon-vfpv4-phytec-linux-gnueabi/bash-completion/2.10-r0/recipe-sysroot-native/usr/include/openssl/bio.h
./build/tmp/work/cortexa7t2hf-neon-vfpv4-phytec-linux-gnueabi/libtirpc/1.2.6-r0/recipe-sysroot-native/usr/include/openssl/bio.h
./build/tmp/work/cortexa7t2hf-neon-vfpv4-phytec-linux-gnueabi/zlib/1.2.11-r0/recipe-sysroot-native/usr/include/openssl/bio.h
./build/tmp/work/cortexa7t2hf-neon-vfpv4-phytec-linux-gnueabi/libffi/3.2.1-r0/recipe-sysroot-native/usr/include/openssl/bio.h
./build/tmp/work/cortexa7t2hf-neon-vfpv4-phytec-linux-gnueabi/libgcc/9.3.0-r0/recipe-sysroot-native/usr/include/openssl/bio.h
./build/tmp/work/cortexa7t2hf-neon-vfpv4-phytec-linux-gnueabi/libcap-ng/0.7.10-r0/recipe-sysroot-native/usr/include/openssl/bio.h
./build/tmp/work/cortexa7t2hf-neon-vfpv4-phytec-linux-gnueabi/linux-libc-headers/5.4-r0/recipe-sysroot-native/usr/include/openssl/bio.h
./build/tmp/work/cortexa7t2hf-neon-vfpv4-phytec-linux-gnueabi/linux-libc-headers/5.4-r0/linux-5.4/include/linux/bio.h
./build/tmp/work/cortexa7t2hf-neon-vfpv4-phytec-linux-gnueabi/opkg-utils/0.4.2-r0/recipe-sysroot-native/usr/include/openssl/bio.h
./build/tmp/sysroots-components/cortexa7t2hf-neon-vfpv4/openssl/usr/include/openssl/bio.h
./build/tmp/sysroots-components/x86_64/openssl-native/usr/include/openssl/bio.h
./build/tmp/work-shared/phyboard-segin-imx6ul-6/kernel-source/include/linux/bio.h

the file is found in many places, please tell me how to fix it?

ср, 18 авг. 2021 г. в 17:00, Quentin Schulz <foss@...>:

Hi Ivan,

On August 18, 2021 3:36:58 PM GMT+02:00, Ivan Riabtsov <ivriabtsov@...> wrote:
help please, I meet with a problem with assembling the kernel module,
created a new layer:

$ ll ~/work/yocto/sources/meta-gobinet
total 28K
drwxr-xr-x 5 ivr ivr 4.0K Aug 18 11:27 .
drwxr-xr-x 12 ivr ivr 4.0K Aug 18 11:26 ..
drwxr-xr-x 2 ivr ivr 4.0K Aug 18 11:26 conf
-rw-r--r-- 1 ivr ivr 1.1K Aug 18 11:26 COPYING.MIT
-rw-r--r-- 1 ivr ivr 801 Aug 18 11:26 README
drwxr-xr-x 3 ivr ivr 4.0K Aug 18 11:26 recipes-example
drwxr-xr-x 3 ivr ivr 4.0K Aug 18 11:28 recipes-gobinet

and i was create recipe:

$ cat ~/work/yocto/sources/meta-gobinet/recipes-gobinet/gobinet/gobinet_1.bb
SUMMARY = "gobinet module"
LICENSE = "CLOSED"
inherit module
SRC_URI = "file://gobinet.tar.xz;md5sum=13b5f20214a3925eb4be3b831b62612f"
#SRC_URI += " file://0001_gobinet_makefile.patch;md5sum=1261df573e1b91177954f6190a12c7b1"

and i put gobinet.tar.xz in:

$ ll ~/work/yocto/sources/meta-gobinet/recipes-gobinet/gobinet/gobinet/
total 44K
drwxr-xr-x 2 ivr ivr 4.0K Aug 18 15:28 .
drwxr-xr-x 3 ivr ivr 4.0K Aug 18 15:31 ..
-rw-r--r-- 1 ivr ivr 30K Aug 18 15:31 gobinet.tar.xz

content of gobinet.tar.xz is:

tar -xf gobinet.tar.xz
ivr@home-machine:~/work/yocto/sources/meta-gobinet/recipes-gobinet/gobinet/gobinet
$ ll gobinet
total 244K
drwxr-xr-x 2 ivr ivr 4.0K Aug 17 21:32 .
drwxr-xr-x 3 ivr ivr 4.0K Aug 18 15:39 ..
-rw-r--r-- 1 ivr ivr 3.1K Aug 17 21:32 GobiNetworkManager.h
-rw-r--r-- 1 ivr ivr 36K Aug 17 21:32 GobiUSBNet.c
-rw-r--r-- 1 ivr ivr 131 Aug 17 21:32 Kconfig
-rw-r--r-- 1 ivr ivr 324 Aug 17 21:32 kernel-deploy-guide
-rw-r--r-- 1 ivr ivr 326 Aug 17 21:32 Makefile
-rwxr-xr-x 1 ivr ivr 127 Aug 17 21:32 Makefile.kernel
-rw-r--r-- 1 ivr ivr 36K Aug 17 21:32 QMI.c
-rw-r--r-- 1 ivr ivr 97K Aug 17 21:32 QMIDevice.c
-rw-r--r-- 1 ivr ivr 9.8K Aug 17 21:32 QMIDevice.h
-rw-r--r-- 1 ivr ivr 8.7K Aug 17 21:32 QMI.h
-rw-r--r-- 1 ivr ivr 2.9K Aug 17 21:32 Readme.txt
-rw-r--r-- 1 ivr ivr 13K Aug 17 21:32 Structs.h

but i have error:

ERROR: gobinet-1-r0 do_compile: oe_runmake failed
ERROR: gobinet-1-r0 do_compile: Execution of
'/home/ivr/work/yocto/build/tmp/work/phyboard_segin_imx6ul_6-phytec-linux-gnueabi/gobinet/1-r0/temp/run.do_compile.1734076'
failed with exit code 1:
make: *** No targets specified and no makefile found. Stop.
WARNING: exit code 1 from a shell command.

ERROR: Logfile of failure stored in:
/home/ivr/work/yocto/build/tmp/work/phyboard_segin_imx6ul_6-phytec-linux-gnueabi/gobinet/1-r0/temp/log.do_compile.1734076

that there is no Makefile but Makefile is present. tell me what is the
problem? Please
Because do_compile runs from ${S} which by default is set to ${WORKDIR}/${PN}-${PV} (might be BPN instead of PN but does not matter). Basically it expects to be run from ${WORKDIR}/gobinet-1/.

However the content of the tar.xz is extracted directly within ${WORKDIR}. So it's looking for a Makefile in ${WORKDIR}/gobinet-1/ but it's in ${WORKDIR}.

Two possible ways to do it:
1. Set S to ${WORKDIR}
2. Put all your files in a directory named gobinet-1 and make a tarball of that directory.

Cheers,
Quentin

Join yocto@lists.yoctoproject.org to automatically receive all group messages.