On 3/22/24 00:20, Cpp Code via discuss wrote:
> Hi,
> 
> Now with kernel modules residing inside linux repository, I am unable
> to figure out how to build them so they would match my kernel.

I don't think it is generally possible.  You should use the version
that is provided with your kernel.

If you want to make changes in the module, you need to get sources of your
current running kernel, make changes in the openvswitch module provided in
it and re-build that kernel or just a module from it.

Kernel will normally refuse loading of the module that is built for
different (even minor) version, so you can't use the module from a
different set of sources.

> 
> I have both:
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> 
> and
> 
> https://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/jammy
> 
> repositories and Ubuntu:
> 
> $ uname -a
> Linux virtual-machine 6.5.0-25-generic #25~22.04.1-Ubuntu SMP
> PREEMPT_DYNAMIC Tue Feb 20 16:09:15 UTC 2 x86_64 x86_64 x86_64
> GNU/Linux
> 
> What is the correct way to build openvswitch kernel module?

So, in this case you should be able to make changes in the code in the
ubuntu repo and re-build it.  This module should be loadable into your
current kernel as long as the version of the running kernel matches
exactly the version in the git repo.

If you can't find the exact commit in the ubuntu repo that corresponds
to 6.5.0-25-generic build, then you'll need to get source rpm, make
changes in it and re-build the RPM.

An easier way might be to just build and install a new kernel altogether
from an upstream repo.

Best regards, Ilya Maximets.
_______________________________________________
discuss mailing list
disc...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-discuss

Reply via email to