Yocto - Add Custom Driver - linux

I need realtek-8192cu driver in my linux version.
The default driver shipped with kernel is not suitable for me.
I want to use a custom version of driver like https://github.com/desflynn/realtek-8192cu-concurrent-softAP.
How to create a recipe for that job.
Thanks,

one possibility is to use the bitbake recipe hello-mod_0.1.bb as starting point to build a recipe for external kernel modules. It can be found at openembedded-core/meta-skeleton/recipes-kernel/hello-mod/hello-mod_0.1.bb
The Reference to Incorporating Out-of-Tree Modules: https://www.yoctoproject.org/docs/2.3.2/mega-manual/mega-manual.html#incorporating-out-of-tree-modules

Related

An kdump tool issue with the customized kernel

when we are using the kdump tool, we need to install the according kernel-debug*.rpm at first.
My questions is , the linux I am using is compiled by myself with lots of modifications. When could I find the kernel-debug*.rpm related to my customized kernel version?
Thanks
Not certain if you are using Fedora, RHEL or CentOS to create your kernel. For Fedora, a custom kernel-debug*.rpm is built from your source with the instructions given here:
https://fedoraproject.org/wiki/Building_a_non-debugging_kernel#Building_a_non-debugging_kernel
using the make release target.

Differences between openembedded-core and poky

We want to build a embedded Linux device using Yocto which is SELinux Enabled.
I was looking at meta-selinux layer Dependencies.
Dependencies
This layer depends on the openembedded-core metadata and the
meta-python and meta-oe layers from the meta-openembedded repository.
When it is referring to 'openembedded-core' does it mean poky
git://git.yoctoproject.org/poky
or
https://github.com/openembedded/openembedded-core
What are the differences between poky and openembedded-core, i don't see bitbake in openembedded-core
OpenEmbedded/Yocto Project is a superset project, from this superset, a subset (poky) is created so people can get a taste of OE.
Poky distribution is made using components from OE, demo BSPs, helper scripts to easily setup build environment, QEMU emulator to test the image, and the bitbake task scheduler. This make poky a ready-to-cook subset of OpenEmbedded (OE) that helps users to understand the build system and to create their own Linux distribution possibly based on Poky distro.
Poky is a reference distribution of the Yocto Project. It contains the OpenEmbedded Build System (BitBake and OpenEmbedded Core) as well as a set of metadata to get you started building your own distro. See https://www.yoctoproject.org/software-item/poky/

Yocto recipe for Nodejs V8.3 or newer

I'm trying to add nodejs support for my yocto environment to be able to compile react native code.
I found a recipe here: https://layers.openembedded.org/layerindex/branch/master/layer/meta-nodejs/
maximum version offered in above link is 7.10.0, but react native needs 8.3 or newer. How to get recipe for Nodejs 8.3 or newer.
Current OpenEmbedded master already contains v10.16.0, whereas meta-nodejs should be considered deprecated. So depending on the exact release you are on give or take a little, but as you can see from the log, v8.4 is available since 2017-08-31.
You can use PREFERED_VERSION_nodejs="8.3" in your local.conf file

Is it possible to build native gdb for Linux-ARM on Linux-x86-64?

I'm trying to build a native ARM GDB for an ARM board to use. Since it lacks a lot of the tools GDB needs for compilation, I'm trying to build it on my x86 machine.
./configure --host=arm-linux-gnueabi --target=arm-linux-gnueabi && make
However, half way through the build process, it complains that "termcap library" is missing. I think it means it couldn't find an ARM version of the library for it to use. So, is there a possible workaround, or should I not bother with this approach and think of another way?
You should be able to do this for your "ARM board". You need to compile GDB library dependencies (e.g. the termcap library) and install them where the cross compiler can find them before you can build GDB. Without a more specific description about the cross compilation toolchain and board it's hard to give more specific advice that will be helpful to you.
I cross build GDB for several Linux targets for my ELLCC cross development tool project (http://ellcc.org). You do need a few libraries built for the target to do a build. In addition to the standard C library, I used libedit, zlib, expat, and ncurses.

Setting up a cross-compilation environment for a specific target platform

I'd like to set up a cross-compilation environment on a Ubuntu 9.10 box. From the documents I've read so far (these ones, for example) this involves compiling the toolchain of the target platforms.
My question is: how do you determine the required version of each of the packages in the toolchain for a specific target platform? Is there any rule of thumb I can follow?
This is a list found in one of the websites linked above:
binutils-2.16.1.tar.bz2
linux-2.6.20.1.tar.bz2
glibc-2.5.tar.bz2
glibc-linuxthreads-2.5.tar.bz2
gcc-core-4.2.0.tar.bz2
gcc-g++-4.2.0.tar.bz2
But suppose I want to generate executables for standard Ubuntu 8.04 and CentOS 5.3 boxes. What are the necessary packages?
My primary need is to avoid errors like "/usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found" in the customers' machines but in the future I want to deal with different architectures as well.
It is generally a good idea to build a cross-toolchain that uses the same version of libc (and other libraries) found on the target system. This is especially important in the case of libraries that use versioned symbols or you could wind up with errors like "/usr/lib/libstdc++.so.6: version 'GLIBCXX_3.4.11' not found".
Same Architecture
For generating executables for standard Ubuntu 8.04 and CentOS 5.3 systems, you could install the distributions in virtual machines and do the necessary compilation from within the virtual machine to guarantee the resulting binaries are compatible with the library versions from each distribution.
Another option would be to setup chroot build environments instead of virtual machines for the target distributions.
You could also build toolchains targeted at different environments (different library versions) and build under your Ubuntu 9.10 environment without using virtual machines or chroot environments. I have used Dan Kegel's crosstool for creating such cross-toolchains.
Different Architecture
As I noted in my answer to a another cross-compiler question, I used Dan Kegel's crosstool for creating my arm cross-toolchain.
It appears it may be slightly out of date, but there is a matrix of build results for various architectures to help determine a suitable combination of gcc, glibc, binutils, and linux kernel headers.
Required Package Versions
In my experience, there really isn't a rule of thumb. Not all combinations of gcc, binutils, glibc, and linux headers will build successfully. Even if the build completes, some level of testing is necessary to validate the build's success. This is sometimes done by compiling the Linux kernel with your new cross-toolchain. Depending on the target system and architecture, some patching of the source may be necessary to produce a successful build.
Since you are setting up this cross-compilation environment on Ubuntu 9.10, you might want to look into the dpkg-cross package.
Compiling for other Linux distributions is easiest by installing them in virtual machines (apt-get install kvm) and then doing the compilation from within. You can also script them to do it automatically. Building a cross-compiler and providing the exact same versions of all libraries and such, as the other Linux distro does, is nearly impossible.
My question is: how do you determine
the required version of each of the
packages in the toolchain for a
specific target platform?
...
binutils-2.16.1.tar.bz2
gcc-core-4.2.0.tar.bz2
gcc-g++-4.2.0.tar.bz2
Generally pick the latest stable: these only affect your local toolchain, not runtime.
linux-2.6.20.1.tar.bz2
You don't need this. (For targeting embedded platforms you might use it.)
glibc-2.5.tar.bz2
glibc-linuxthreads-2.5.tar.bz2
You don't need these. I.e. you should not download them or build them; you should link against the versions from the oldest distro you want to support.
Is there any
rule of thumb I can follow?
But suppose I want to generate
executables for standard Ubuntu 8.04
and CentOS 5.3 boxes. What are the
necessary packages?
You survey the distros you want to target, find the lowest common denominator versions of
of libc, libstdc++, pthreads, and any other shared library you will link with, then copy these libs and corresponding headers from the box that has these LCD versions to your toolchain.
[edit] I should clarify, you really want to get all the dependent libs from a single system. Picking and choosing the LCD of each file version from different distributions is a recipe for a quick trip to dependency hell.
Depending on your target platforms, have you considered using Optware?
I'm currently working on getting Mono and Moonlight built for my Palm Pre using the cross-compilation toolchain (and the Optware makefiles handle the majority of dependencies already).

Resources