Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Fedora User (http://www.linux-archive.org/fedora-user/)
-   -   Building Custom Modules (http://www.linux-archive.org/fedora-user/26593-building-custom-modules.html)

Felix Miata 01-02-2008 04:41 AM

Building Custom Modules
 
On 2008/01/01 22:35 (GMT-0600) Matt Domsch apparently typed:

> On Tue, Jan 01, 2008 at 11:13:57PM -0500, Felix Miata wrote:
>> A note on
>> http://fedoraproject.org/wiki/Docs/CustomKernel#head-5658f6db74cec105eb1e6d5481444c2d621e8636
>> indicates it isn't complete. Can someone complete it, or tell me what's
>> missing enough that I can build a few F8 modules?

> What's there is sufficient for personal development purposes. It
> doesn't address how to get your modules included in the upstream
> kernel.org kernels, so they can be added to Fedora as well.

> There are other mechanisms, such as DKMS (yum install dkms) which also
> can be used for building kernel modules. The Makefile becomes even
> simpler, just the single line:

> obj-m := foo.o

> and DKMS takes care of the rest.

I must be dense. There's a Makefile already in the source dir that includes
the desired module name, but dkms wants a -v parameter, and man dkms gives me
no idea what a module-version is in this context of a module build. :-(
--
"In the beginning was the Word, and the Word was
with God, and the Word was God." John 1:1 NIV

Team OS/2 ** Reg. Linux User #211409

Felix Miata *** http://mrmazda.no-ip.com/

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list

Matt Domsch 01-02-2008 03:55 PM

Building Custom Modules
 
On Wed, Jan 02, 2008 at 12:41:05AM -0500, Felix Miata wrote:
> On 2008/01/01 22:35 (GMT-0600) Matt Domsch apparently typed:
>
> > On Tue, Jan 01, 2008 at 11:13:57PM -0500, Felix Miata wrote:
> >> A note on
> >> http://fedoraproject.org/wiki/Docs/CustomKernel#head-5658f6db74cec105eb1e6d5481444c2d621e8636
> >> indicates it isn't complete. Can someone complete it, or tell me what's
> >> missing enough that I can build a few F8 modules?
>
> > What's there is sufficient for personal development purposes. It
> > doesn't address how to get your modules included in the upstream
> > kernel.org kernels, so they can be added to Fedora as well.
>
> > There are other mechanisms, such as DKMS (yum install dkms) which also
> > can be used for building kernel modules. The Makefile becomes even
> > simpler, just the single line:
>
> > obj-m := foo.o
>
> > and DKMS takes care of the rest.
>
> I must be dense. There's a Makefile already in the source dir that includes
> the desired module name, but dkms wants a -v parameter, and man dkms gives me
> no idea what a module-version is in this context of a module build. :-(


(yes, as Craig noted, I'm one of the authors, and maintainer for
DMKS).

DKMS makes a few assumptions.
1) the source code needs to be in a directory
/usr/src/<modulename>-<moduleversion>. So, /usr/src/foo-1.0 for
module foo version 1.0. The version field generally matches what's in
the MODULE_VERSION() tag of the source code.

2) in that directory, there needs to be a brief dkms.conf file that
looks like:

PACKAGE_NAME="foo"
PACKAGE_VERSION="1.0"
BUILT_MODULE_NAME[0]="foo"
DEST_MODULE_LOCATION[0]="/kernel/drivers/net"

(it can get fancier, but that's enough for most modules).

Then you execute:

# dkms add -m foo -v 1.0
# dkms build -m foo -v 1.0
# dkms install -m foo -v 1.0

This builds and installs module foo version 1.0 into your currently
running kernel's /lib/modules/ tree. If you need to build for a
different kernel than the currently running kernel (or architecture):

# dkms build -m foo -v 1.0 -k $kernelver -a $arch
# dkms install -m foo -v 1.0 -k $kernelver -a $arch

Thanks,
Matt

--
Matt Domsch
Linux Technology Strategist, Dell Office of the CTO
linux.dell.com & www.dell.com/linux

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list


All times are GMT. The time now is 01:26 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.