Build error while copying kernel config to the source tree - raspberry-pi3

i am trying to compile the defconfig file bcm2711_defconfig, so i am trying to copy the bcm2711_defconfig file to the kernel source path, kernel-source/arch/arm/configs/
Please let me know how to overcome from the error. below is the recipe file content.
file name: linux-raspberrypi_4.14.bbappend
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
SRC_URI += "file://bcm2711_defconfig"
do_preconfigure_prepend(){
cp ${WORKDIR}/bcm2711_defconfig ${S}/arch/${ARCH}/configs/
}
KBUILD_DEFCONFIG_raspberrypi4 ?= "bcm2711_defconfig""
build error:
ERROR: linux-raspberrypi-1_4.14.68+gitAUTOINC+8c8666ff6c-r0 do_kernel_metadata: A KBUILD_DECONFIG '/bcm2711_defconfig' was specified, but not present in the source tree

do_kernel_metadata task is executed after do_unpack & before do_patch, so try to copy your defconfig at the end of do_unpack task as below,
do_unpack_append(){
cp ${WORKDIR}/bcm2711_defconfig ${S}/arch/${ARCH}/configs/
}

Related

Yocto Transaction Test, two recipes install the same file

I am adding a custom recipe to my image. It is bases on DBCPPP. This project is built using cmake. My issue only comes to light when I include a new layer meta-swupdate. It seems meta-swupdate alters the kernel in a way that conflicts with dbcppp. My full error is:
Error: Transaction test error:
file /usr/lib/libxml2.so.2.9.10 conflicts between attempted installs of dbcppp-1.0+gitr0+fa8ce17468-r0.cortexa7t2hf_neon and libxml2-2.9.10-r0.cortexa7t2hf_neon
To build and include dbcppp I added the recipe:
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
SRC_URI = "gitsm://github.com/xR3b0rn/dbcppp.git;protocol=https;branch=master"
PV = "1.0+gitr${SRCPV}"
SRCREV = "${AUTOREV}"
DEPENDS += " boost"
S = "${WORKDIR}/git"
inherit pkgconfig cmake
FILES_${PN} += "/usr/lib/xml2Conf.sh /usr/lib/lib*.so.*"
SOLIBS = ".so"
FILES_SOLIBSDEV = ""
INSANE_SKIP_${PN} += "dev-so"
I have read a few other questions and attempted two solutions by adding a do_install_append step.
Change folder permission level install -d 0755 ${D}/usr/lib
Remove the folder rm -rf ${D}/usr/lib
Neither solution worked. I need both libraries in my application and I unsure how to proceed.
Edit: After some further reading I found a suggestion to delete the tmp, cache, and sstate-chace folders. I did this but I receive the same error.
Edit: My local.conf has PACKAGE_CLASSES ?= 'package_rpm' defined. if I remove this I still get a do_rootfs error, but the error message is not helpful.
Edit: In my recipe for dbcppp I have attempted to remove the file in question. This gives me the same error. Makes no difference.
do_install_append() {
rm -rf /usr/lib/libxml2.so.2.9.10
}

do_patch: Function failed: patch_do_patch -- running bitbake

I am using yocto build a linux image that integrates some layers of wlan and a specific wifi chip, but seems like patching of one of the files is failing (details below)
Steps that I did:
Created a working directory
initialized a repo for kernel 4.14.98 via:
repo init -u https://source.codeaurora.org/external/imx/imx-manifest -b imx-linux-sumo -m imx-4.14.98-2.3.3.xml
sync the repo via repo sync
created a tmp folder outside of the current working dir, and download the specific code for wifi via
repo init -u git://codeaurora.org/quic/le/le/manifest.git -b release -m CHSS.LNX_FSLS.1.0-01200-QCAAUTOHOSTHZ.xml –repo-url=git://codeaurora.org/tools/repo.git –repo-branch=caf-stable
repo the sync
copy the meta-qti-connectivity and wlan-opensource folders into the source folder of the working directory
Download the files for a specific wifi chip and copy over meta-qticonnectivity-prop and wlanproprietary into the source folder of the working directory
So now we have added additional 4 directories into the source folder of the working directory
Set up the build environment
Run bitbake core-image-minimal
and I see the following error:
ERROR: wpa-supplicant-git-r0 do_patch: Command Error: 'quilt --quiltrc <working_directory>/linux_image/build/tmp/work/imx8qxpmek-poky-linux/wpa-supplicant/git-r0/recipe-sysroot-native/etc/quiltrc push' exited with 0 Output:
Applying patch 0009-Sync-with-mac80211-next.git-include-uapi-linux-nl802.patch
patching file src/drivers/nl80211_copy.h
...
15 out of 20 hunks FAILED -- rejects in file src/drivers/nl80211_copy.h
Patch 0009-Sync-with-mac80211-next.git-include-uapi-linux-nl802.patch does not apply (enforce with -f)
ERROR: wpa-supplicant-git-r0 do_patch: Function failed: patch_do_patch
I'm new to yocto, and from the looks of it, it seems the patch 0009-Sync-with-mac80211-next.git-include-uapi-linux-nl802.patch didn't apply, but does that mean the issue is with the patch file or the way it's referenced.
This patch file resides in the meta-fsl-bsp-release layer under wpa-supplicant sub directory, which I DID NOT add manually. This sub-directory has a .bbappend file that refers to these patch files via SRC_URI variable, but it doesn't contain any .bb file.
One of the meta layers that I added has wpa-supplicant sub-directory as well but it only has .bb file and no .bbappend.
I'm confused as to how are these two subdirectories different or could they conflict in anyway? Also, shouldn't the subdirectory have both the .bbappend & a corresponding .bb file?
The SRC_URI variable is used to locate the applicable patch files and do_patch isn't needed in the respective .bb file of wpa-supplicant, right?
the respective bb file wpa-supplicant has the following:
SRC_URI = "file://wlan-opensource/wpa_supplicant_8/"
SRC_URI += "file://hostapdconf \
file://supplicantconf \
shouldn't patch files be defined with .patch at the end?
Also, I see in the yocto documentation that the path defined in file:// is relative to the FILESPATH variable, which in the bb file is defined to be "${BSPDIR}/sources:" - not certain of BSPDIR itself but I think it's referring to <top_dir>/sources, but does that mean hostapdconf is supposed to be at <top_dir>/sources? I don't see it there but in other sub directory
To me it looks like you have added a .bbappend for the wpa-supplicant recipe in a version that does not match the recipe. Likely the .bbappend is from one of the meta layers you copied into your source tree manually (meta-qti-connectivity or wlan-opensource).
I'm new to yocto, and from the looks of it, it seems the patch
0009-Sync-with-mac80211-next.git-include-uapi-linux-nl802.patch didn't
apply, but does that mean the issue is with the patch file or the way
it's referenced?
Likely the patch is targetet at a different version of the source file.
The SRC_URI variable is used to locate the applicable patch files and
do_patch isn't needed in the respective .bb file of wpa-supplicant,
right?
Right, if you don't see it explicitly ly in the .bb. The default do_patch task will be used.
the respective bb file wpa-supplicant has the following:
SRC_URI = "file://wlan-opensource/wpa_supplicant_8/" SRC_URI +=
"file://hostapdconf
file://supplicantconf \ shouldn't patch files be defined
with .patch at the end?
The .patch file is probably referenced by name in a .bbappend if you dont see it in the .bb file.

Yocto kernel module path

I need to access the target path to kernel modules in a recipe, is there a variable with such information?
I mean, where can i get "/lib/modules/4.1.23-fslc+g3617c73" since this path may change because of configuration?
The destination directory is as follows.
Look into bbclass file kernel.bbclass in poky/meta/classes/ function kernel_do_install
It is passed as a make option
oe_runmake DEPMOD=echo MODLIB=${D}${nonarch_base_libdir}/module/${KERNEL_VERSION} INSTALL_FW_PATH=${D}${nonarch_base_libdir}/firmware modules_install
I hope below info will help you,
the kernel modules path is `
tmp-glibc/work/beaglebone-linux-gnueabi/linux-ti/3.12.30-phy10-r0.0/image/lib/modules/3.12.30-AM335x-PD15.3.0`
if you add your code in your linux kernel and compile as modules(.ko) by default it will add in above mentioned path.
If you want to copy your module(.ko) manually to the lib/modules path copy your.ko file to sources/meta-youlayer/recipes-kernel/linux and create linux-ti_%.bbappend file ad below line
FILESEXTRAPATHS_prepend := "${THISDIR}:"
SRC_URI +="file://your.ko"
do_install_append(){
install -m 0777 ${S}/your.ko ${D}/lib/modules/version
}
I did not try this yet. hope it will work.

extconf.rb how to define the sources files to use

I have a little projet of a ruby extension which was organized like this :
./
Rakefile
ext/
mymodule/
extconf.rb
mymodule.rb
mymodule.cpp
source1.h
source1.cpp
source2.h
source2.cpp
Everything worked but I needed to put some of the source files in a directory (I create/modify/test all those source files in a git repos in order to just have to update this directory when my C++ code is tested). So the new organization looks like this :
./
Rakefile
ext/
mymodule/
extconf.rb
mymodule.rb
mymodule.cpp
somesourcesfiles/
source1.h
source1.cpp
source2.h
source2.cpp
My problem now is how to specify to extconf.rb where to find the source files (extconf.rb use source files in current directory by default).
I have tested this in the extconf.rb whitout success:
myfiles = %w{somesourcefiles/source1 somesourcefiles/source2 mymodule}
$srcs = myfiles.map{|i| i + ".cpp"}
I have had an error message saying that the linker couldn't find some ".o" files so I added this:
myfiles = %w{somesourcefiles/source1 somesourcefiles/source2 mymodule}
$srcs = myfiles.map{|i| i + ".cpp"}
$objs = myfiles.map{|i| i + ".o"}
But this didn't work.
See mkmf ignores files in sub-folders when it compiles the C extension
$INCFLAGS << " -I$(srcdir)/somesourcesfiles"
$VPATH << "$(srcdir)/somesourcesfiles"

Configuration files and log files installation with automake

Let's say I have a project like that:
(dev dir)
- README
- INSTALL
/ src
- blah.cpp
- blah.hpp
/ conf
- blah_one.xml
- blah_two.xml
I made out a configure.ac and Makefile.am to install binaries under (/usr/local)/bin . configure.ac is something like:
AC_INIT([blah], [0.1])
AC_PREREQ([2.67])
AM_INIT_AUTOMAKE([1.11])
AC_CONFIG_SRCDIR([src/blah.cpp])
AC_PROG_CXX
AC_LANG([C++])
AC_HEADER_STDC
AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([src/Makefile])
AC_OUTPUT
... Makefile is something like
SUBDIRS = src
...and src/Makefile.am is something like
bin_PROGRAMS = blah
blah_SOURCES = blah.cpp blah.hpp
It all works, and "make install" correctly install the binary under (/usr/local)/bin.
Now:
I want extend these to make the command "make install" (after configure, build and whatsoever) to install configuration files blah_one.xml and blah_two.xml under /etc/blah, and to "prepare" a log directory under /var/log/blah/
What is the correct way to do it?
Well, I'd do this:
blahconfdir=$(sysconfdir)/blah
blahconf_DATA = blah_one.xml blah_two.xml
blahlogdir = $(localstatedir)/log/blah
then when you configure:
./configure --sysconfdir=/etc --localstatedir=/var
Without knowing details of your "prepare" step, it's hard to know what needs to happen, and how to get it to happen.

Resources