My image builds nicely with kernel 4.13 (set in local.conf) and all of my recipes.
When I try to add the iptables recipe (v1.6) to my image, the do_rootfs task fails with the following error:
ERROR: image-dev-0.7-r0 do_rootfs: Error executing a python function in exec_python_func() autogenerated:
The stack trace of python calls that resulted in this exception/failure was:
File: 'exec_python_func() autogenerated', lineno: 2, function: <module>
0001:
*** 0002:license_create_manifest(d)
0003:
File: '/home/yocto/sources/poky/meta/classes/license.bbclass', lineno: 48, function: license_create_manifest
0044: pkg_dic = {}
0045: for pkg in sorted(image_list_installed_packages(d)):
0046: pkg_info = os.path.join(d.getVar('PKGDATA_DIR'),
0047: 'runtime-reverse', pkg)
*** 0048: pkg_name = os.path.basename(os.readlink(pkg_info))
0049:
0050: pkg_dic[pkg_name] = oe.packagedata.read_pkgdatafile(pkg_info)
0051: if not "LICENSE" in pkg_dic[pkg_name].keys():
0052: pkg_lic_name = "LICENSE_" + pkg_name
Exception: FileNotFoundError: [Errno 2] No such file or directory: '/media/yocto/build/tmp/pkgdata/machine/runtime-reverse/kernel-4.14.1-fslc+ga4f7f0ac8250'
ERROR: image-dev-0.7-r0 do_rootfs: Function failed: license_create_manifest
ERROR: Logfile of failure stored in: /media/yocto/build/tmp/work/machine-linux-gnueabi/image-dev/0.7-r0/temp/log.do_rootfs.49245
ERROR: Task (/home/yocto/sources/meta-mymeta/recipes-images/images/image-dev.bb:do_rootfs) failed with exit code '1'
When looking at the error and the logs, iptables wants to install the neccessary kernel-modules (good) but at version 4.14-fslc (bad). I don't even have an 4.14 kernel in my layers.
When I manually add the kernel-module-recipes to my image, the exact same thing happens.
So the question is: Why does my Yocto with 4.13 kernel builds and wants to install 4.14 kernel modules?
Thus the next question: How can I tell Yocto to build and install 4.13 kernel modules?
Update 1:
After further digging:
Lets take module kernel-module-x-tables as an example. According to the error-log, it is build and used for 4.14. However, looking in the buildlog-files, kernel-module-x-tables is also build in 4.13, but this version is not used even through its not used.
Update 2:
I've updated our poky to the newest rocko release and upgraded the kernel to 4.19.13, image works fine without iptables.
The error remains, but slightly changed.
It again tries to install the 4.14 kernel-modules for some iptables modules, but now 4.14.24-stable. I found this kernel version in another meta-layer that we need.
However, it should install the 4.19.13 module, which is also build by yocto according to the build-log.
We really need a kernel above 4.16 due to other constraints. So unfortunately we cant just use 4.14.24.