All of lore.kernel.org
 help / color / mirror / Atom feed
From: ydroneaud@opteya.com (Yann Droneaud)
To: kernelnewbies@lists.kernelnewbies.org
Subject: building kernel modules for linux differnet version
Date: Tue, 11 Mar 2014 18:39:56 +0100	[thread overview]
Message-ID: <1394559596.3257.72.camel@localhost.localdomain> (raw)
In-Reply-To: <CAK25hWMFKYyQKrX4yRAGX2Jgf3ksKrm1sV3bThptzXaTQ3FZ-g@mail.gmail.com>

Le mardi 11 mars 2014 ? 22:42 +0530, Saket Sinha a ?crit :
> Please find my response inline
> 
> >>          I have a scenario where I need to build a driver for
> >> different kernel versions.
> >> I have kernel-headers of different version in /lib/modules/
> >> 2.6.32-xxxx
> >> 2.6.39-xxxx
> >>
> >> and currently I am booted into 2.6.32-xxxx(which I find out by uname -r)
> >>
> >
> > You don't need to boot on a specific kernel version to build external
> > module for it.
> >
> 
> I am aware of that. I just need the kernel header of that specific
> version instead.
> What I meant was that since I was using the expression "uname -r" in
> my makefile below-
>  "make  -C   /lib/modules/$(shell uname -r)/build  M=$(PWD)  modules"
> so I specified that.
> 
> >> Now in my driver makefile, I generate .ko of driver
> >> make  -C   /lib/modules/$(shell uname -r)/build  M=$(PWD)  modules
> >>
> >> but I notice that the driver .ko gets generated for 2.6.39-xxxx though
> >> I am booted into  2.6.32-xxxx. Can anyone help me figure out why this
> >> is happening?
> >>
> >
> > Could you check that /lib/modules/2.6.32-xxxx/build is not a symbolic
> > link to linux 2.6.39-xxxx sources ?
> 
> I am pasting the output for you to check
> 
> [root at Noi1-502156 ~]# cd /lib/modules
> [root at Noi1-502156 modules]# ls
> 2.6.32-220.4.2.el6.x86_64      2.6.39-300.17.1.el6uek.x86_64
> 2.6.32-358.6.2.el6.x86_64      2.6.39-400.24.1.el6uek.x86_64
> [root at Noi1-502156 modules]# ll
> total 16
> drwxr-xr-x. 8 root root 4096 Feb 28 14:41 2.6.32-220.4.2.el6.x86_64
> drwxr-xr-x. 7 root root 4096 Jul 15  2013 2.6.32-358.6.2.el6.x86_64
> drwxr-xr-x  8 root root 4096 Aug 12  2013 2.6.39-300.17.1.el6uek.x86_64
> drwxr-xr-x. 4 root root 4096 Jul 10  2013 2.6.39-400.24.1.el6uek.x86_64
> [root at Noi1-502156 modules]#
> 

Now try "ls -dFl  /lib/modules/2.6.3*/build"

And

grep '^\(\(VERSION\)\|\(PATCHLEVEL\)\|\(SUBLEVEL\)\|\(EXTRAVERSION\)\|
\(MAKEARGS\)\)' /lib/modules/*/build/Makefile

Check that matches the expected version.

-- 
Yann Droneaud
OPTEYA

  reply	other threads:[~2014-03-11 17:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-11 15:46 building kernel modules for linux differnet version Saket Sinha
2014-03-11 16:40 ` Yann Droneaud
2014-03-11 17:12   ` Saket Sinha
2014-03-11 17:39     ` Yann Droneaud [this message]
2014-03-11 18:13       ` Saket Sinha
2014-03-11 18:41         ` Laurent Navet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1394559596.3257.72.camel@localhost.localdomain \
    --to=ydroneaud@opteya.com \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.