Creating a Patch for an Open Embedded Build

Hi,

I’m trying to determine how to create a patch file that I can use as part of an OpenEmbedded build of our embedded Linux OS. My understanding is that this uses something called bbappend, but I’m not sure how this all works and how to get started on creating this patch.

So far we have built: U-boot, the embedded Linux kernel, and the device tree seperately after making changes to those parts. This has worked great during development, but now that we’ve built the system the way we need we want to build a single OS image that incorporates all of our individual changes.

The best information that I could find here on the Support Community forum is in the following post: Patch applying failed on linux kernel. I see the information supplied by the Toradex engineer, but it isn’t clear to me how to go about doing what I need to do.

Is there a document somewhere that describes how this is done in your git hub repository? I’m going to do a web search to try and locate the information I need myself, but I thought if someone had a link to the information that I could read that would be helpful.

Thank You

Hi

Have a look at the links in this answer.

Max

Hello max.tx,

Thanks for providing the links. I will check them out. I actually found a good document that I’ve been using to learn more about this process: Patching Kernel in OpenEmbedded. It’s slightly different from the setup we have, but still very helpful.

When following this document I ran into some confusion about the Linux Kernel. When I perform a device test in QT Creator that queries the kernel, the kernel version I see returned is:

Linux 4.1.39-svn150 arnv7I

When running bitbake the kernel version that I see is:

linux-toradex-4.1-2.0.x.2.7.2

I believe the reason for the difference comes from the fact that I originally obtained the source files for the OpenEmbedded (core) from the Toradex Git repository several months ago and used it to build an embedded Linux OS image.

Later I obtained the source files to build the embedded Linux kernel from the Toradex Git repository, and we have been using that to make changes to the device tree.

What I wanted to know is: Will the slight differences in version numbers matter when I go to create a patch for the OpenEmbedded (core) build? Will it make any difference?

Thank You.

Hi

I don’t think that you will see a difference, however one never knows.

By default the version information returned by ‘uname -r’ is created at build time. It looks like you are using subversion to version control your kernel and the revision is at 150, so svn150 is added to the kernel.

In the OE built kernel information from the recipe name and additional version information is injected into the kernel build.

On top of that ‘linux-toradex-4.1-2.0.x.2.7.2’ is the recipe version in bitbake.
I guess with ‘Linux 4.1.39-svn150 arnv7I’ vs. ‘linux-toradex-4.1-2.0.x.2.7.2’ you are comparing apples with oranges.

So I guess that ‘Linux 4.1.39-svn150 arnv7I’ is the output from uname -s -r -m.
On a current build of OE that would look like this

root@apalis-imx6:~# uname -s -r -m                                              
Linux 4.1.41-2.7.3+g82f0f4f armv7l                                              

Max

P.S. If you have ‘your’ kernel version controlled on a stable server then I would not create and apply patches to a kernel pulled from the Toradex git in the bitbake recipe.

I would rather change the SRC_URI which pulls from the Toradex git to one pulling the kernel from your version control system.

Thanks max.tx,

Thanks for the great information. It does help clarify things for me, and yes we are using a subversion server for our kernel which is why the “svn” information is there.

Everything that you’re saying makes sense to me accept for the following:

I would rather change the SRC_URI which pulls from the Toradex git to one pulling the kernel from your version control system.

What is the SRC_URI that you’re referring to? Is this just the latest kernel source files that exist in the Toradex Git repository?

Thank You

Hi

Have a look at the OE kernel recipe.

Max

Ah, Okay, I believe I see what you’re talking about now thanks to the link that you sent.

What you’re saying I should do is change the line:

SRC_URI = "git://git.toradex.com/linux-toradex.git;protocol=git;branch=${SRCBRANCH} \
           file://defconfig"

So that SRC_URI points to the deconfig file located on our source control server.

Is that correct?

I am not sure if SRC_URI can have multiple svn source files…

Typically the defconfig file is alongside the recipe (in a subdirectory).

I assume that you changed something in the kernel source tree.

So instead of pulling the kernel sources from git.toradex.com and add patches to get what you need I proposed to use the kernel sources directly from your SVN.

The used defconfig is taken from the OE metadata, so that file you would have to provide together with your bbappend.

So SRC_URI would be something like the following:

SRC_URI = "svn://<svn_url>;module=<path_in_repo>;rev=150;protocol=http \
        file://defconfig"

Max